repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
looly/hutool | hutool-db/src/main/java/cn/hutool/db/StatementUtil.java | StatementUtil.prepareStatementForBatch | public static PreparedStatement prepareStatementForBatch(Connection conn, String sql, Object[]... paramsBatch) throws SQLException {
"""
创建批量操作的{@link PreparedStatement}
@param conn 数据库连接
@param sql SQL语句,使用"?"做为占位符
@param paramsBatch "?"对应参数批次列表
@return {@link PreparedStatement}
@throws SQLException SQL异常
... | java | public static PreparedStatement prepareStatementForBatch(Connection conn, String sql, Object[]... paramsBatch) throws SQLException {
return prepareStatementForBatch(conn, sql, new ArrayIter<Object[]>(paramsBatch));
} | [
"public",
"static",
"PreparedStatement",
"prepareStatementForBatch",
"(",
"Connection",
"conn",
",",
"String",
"sql",
",",
"Object",
"[",
"]",
"...",
"paramsBatch",
")",
"throws",
"SQLException",
"{",
"return",
"prepareStatementForBatch",
"(",
"conn",
",",
"sql",
... | 创建批量操作的{@link PreparedStatement}
@param conn 数据库连接
@param sql SQL语句,使用"?"做为占位符
@param paramsBatch "?"对应参数批次列表
@return {@link PreparedStatement}
@throws SQLException SQL异常
@since 4.1.13 | [
"创建批量操作的",
"{",
"@link",
"PreparedStatement",
"}"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/StatementUtil.java#L163-L165 |
mesosphere/mesos-http-adapter | src/main/java/com/mesosphere/mesos/http-adapter/MesosToSchedulerDriverAdapter.java | MesosToSchedulerDriverAdapter.startInternal | @VisibleForTesting
protected Mesos startInternal() {
"""
Broken out into a separate function to allow testing with custom `Mesos` implementations.
"""
String version = System.getenv("MESOS_API_VERSION");
if (version == null) {
version = "V0";
}
LOGGER.info("Usin... | java | @VisibleForTesting
protected Mesos startInternal() {
String version = System.getenv("MESOS_API_VERSION");
if (version == null) {
version = "V0";
}
LOGGER.info("Using Mesos API version: {}", version);
if (version.equals("V0")) {
if (credential == null... | [
"@",
"VisibleForTesting",
"protected",
"Mesos",
"startInternal",
"(",
")",
"{",
"String",
"version",
"=",
"System",
".",
"getenv",
"(",
"\"MESOS_API_VERSION\"",
")",
";",
"if",
"(",
"version",
"==",
"null",
")",
"{",
"version",
"=",
"\"V0\"",
";",
"}",
"LO... | Broken out into a separate function to allow testing with custom `Mesos` implementations. | [
"Broken",
"out",
"into",
"a",
"separate",
"function",
"to",
"allow",
"testing",
"with",
"custom",
"Mesos",
"implementations",
"."
] | train | https://github.com/mesosphere/mesos-http-adapter/blob/5965d467c86ce7a1092bda5624dd2da9b0776334/src/main/java/com/mesosphere/mesos/http-adapter/MesosToSchedulerDriverAdapter.java#L314-L338 |
Graylog2/graylog2-server | graylog2-server/src/main/java/org/graylog2/lookup/adapters/dnslookup/DnsClient.java | DnsClient.parseReverseLookupDomain | public static void parseReverseLookupDomain(PtrDnsAnswer.Builder dnsAnswerBuilder, String hostname) {
"""
Extract the domain name (without subdomain). The Guava {@link InternetDomainName} implementation
provides a method to correctly handle this (and handles special cases for TLDs with multiple
names. eg. for lb... | java | public static void parseReverseLookupDomain(PtrDnsAnswer.Builder dnsAnswerBuilder, String hostname) {
dnsAnswerBuilder.fullDomain(hostname);
final InternetDomainName internetDomainName = InternetDomainName.from(hostname);
if (internetDomainName.hasPublicSuffix()) {
// Use Guava to... | [
"public",
"static",
"void",
"parseReverseLookupDomain",
"(",
"PtrDnsAnswer",
".",
"Builder",
"dnsAnswerBuilder",
",",
"String",
"hostname",
")",
"{",
"dnsAnswerBuilder",
".",
"fullDomain",
"(",
"hostname",
")",
";",
"final",
"InternetDomainName",
"internetDomainName",
... | Extract the domain name (without subdomain). The Guava {@link InternetDomainName} implementation
provides a method to correctly handle this (and handles special cases for TLDs with multiple
names. eg. for lb01.store.amazon.co.uk, only amazon.co.uk would be extracted).
It uses https://publicsuffix.org behind the scenes.... | [
"Extract",
"the",
"domain",
"name",
"(",
"without",
"subdomain",
")",
".",
"The",
"Guava",
"{"
] | train | https://github.com/Graylog2/graylog2-server/blob/50b565dcead6e0a372236d5c2f8530dc5726fa9b/graylog2-server/src/main/java/org/graylog2/lookup/adapters/dnslookup/DnsClient.java#L282-L305 |
zanata/openprops | orig/Properties.java | Properties.enumerateStringProperties | private synchronized void enumerateStringProperties(Hashtable<String, String> h) {
"""
Enumerates all key/value pairs in the specified hashtable
and omits the property if the key or value is not a string.
@param h the hashtable
"""
if (defaults != null) {
defaults.enumerateStringPropertie... | java | private synchronized void enumerateStringProperties(Hashtable<String, String> h) {
if (defaults != null) {
defaults.enumerateStringProperties(h);
}
for (Enumeration e = keys() ; e.hasMoreElements() ;) {
Object k = e.nextElement();
Object v = get(k);
... | [
"private",
"synchronized",
"void",
"enumerateStringProperties",
"(",
"Hashtable",
"<",
"String",
",",
"String",
">",
"h",
")",
"{",
"if",
"(",
"defaults",
"!=",
"null",
")",
"{",
"defaults",
".",
"enumerateStringProperties",
"(",
"h",
")",
";",
"}",
"for",
... | Enumerates all key/value pairs in the specified hashtable
and omits the property if the key or value is not a string.
@param h the hashtable | [
"Enumerates",
"all",
"key",
"/",
"value",
"pairs",
"in",
"the",
"specified",
"hashtable",
"and",
"omits",
"the",
"property",
"if",
"the",
"key",
"or",
"value",
"is",
"not",
"a",
"string",
"."
] | train | https://github.com/zanata/openprops/blob/46510e610a765e4a91b302fc0d6a2123ed589603/orig/Properties.java#L1087-L1098 |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/datastore/map/impl/MapDatastoreProvider.java | MapDatastoreProvider.writeLock | public void writeLock(EntityKey key, int timeout) {
"""
Acquires a write lock on a specific key.
@param key The key to lock
@param timeout in milliseconds; -1 means wait indefinitely, 0 means no wait.
"""
ReadWriteLock lock = getLock( key );
Lock writeLock = lock.writeLock();
acquireLock( key, timeout,... | java | public void writeLock(EntityKey key, int timeout) {
ReadWriteLock lock = getLock( key );
Lock writeLock = lock.writeLock();
acquireLock( key, timeout, writeLock );
} | [
"public",
"void",
"writeLock",
"(",
"EntityKey",
"key",
",",
"int",
"timeout",
")",
"{",
"ReadWriteLock",
"lock",
"=",
"getLock",
"(",
"key",
")",
";",
"Lock",
"writeLock",
"=",
"lock",
".",
"writeLock",
"(",
")",
";",
"acquireLock",
"(",
"key",
",",
"... | Acquires a write lock on a specific key.
@param key The key to lock
@param timeout in milliseconds; -1 means wait indefinitely, 0 means no wait. | [
"Acquires",
"a",
"write",
"lock",
"on",
"a",
"specific",
"key",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/datastore/map/impl/MapDatastoreProvider.java#L94-L98 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLReadServiceContext.java | SSLReadServiceContext.handleAsyncComplete | private void handleAsyncComplete(boolean forceQueue, TCPReadCompletedCallback inCallback) {
"""
This method handles calling the complete method of the callback as required by an async
read. Appropriate action is taken based on the setting of the forceQueue parameter.
If it is true, the complete callback is calle... | java | private void handleAsyncComplete(boolean forceQueue, TCPReadCompletedCallback inCallback) {
boolean fireHere = true;
if (forceQueue) {
// Complete must be returned on a separate thread.
// Reuse queuedWork object (performance), but reset the error parameters.
queuedWo... | [
"private",
"void",
"handleAsyncComplete",
"(",
"boolean",
"forceQueue",
",",
"TCPReadCompletedCallback",
"inCallback",
")",
"{",
"boolean",
"fireHere",
"=",
"true",
";",
"if",
"(",
"forceQueue",
")",
"{",
"// Complete must be returned on a separate thread.",
"// Reuse que... | This method handles calling the complete method of the callback as required by an async
read. Appropriate action is taken based on the setting of the forceQueue parameter.
If it is true, the complete callback is called on a separate thread. Otherwise it is
called right here.
@param forceQueue
@param inCallback | [
"This",
"method",
"handles",
"calling",
"the",
"complete",
"method",
"of",
"the",
"callback",
"as",
"required",
"by",
"an",
"async",
"read",
".",
"Appropriate",
"action",
"is",
"taken",
"based",
"on",
"the",
"setting",
"of",
"the",
"forceQueue",
"parameter",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLReadServiceContext.java#L576-L600 |
ravendb/ravendb-jvm-client | src/main/java/net/ravendb/client/documents/subscriptions/DocumentSubscriptions.java | DocumentSubscriptions.getSubscriptions | public List<SubscriptionState> getSubscriptions(int start, int take, String database) {
"""
It downloads a list of all existing subscriptions in a database.
@param start Range start
@param take Maximum number of items that will be retrieved
@param database Database to use
@return List of subscriptions state
... | java | public List<SubscriptionState> getSubscriptions(int start, int take, String database) {
RequestExecutor requestExecutor = _store.getRequestExecutor(ObjectUtils.firstNonNull(database, _store.getDatabase()));
GetSubscriptionsCommand command = new GetSubscriptionsCommand(start, take);
requestExecu... | [
"public",
"List",
"<",
"SubscriptionState",
">",
"getSubscriptions",
"(",
"int",
"start",
",",
"int",
"take",
",",
"String",
"database",
")",
"{",
"RequestExecutor",
"requestExecutor",
"=",
"_store",
".",
"getRequestExecutor",
"(",
"ObjectUtils",
".",
"firstNonNul... | It downloads a list of all existing subscriptions in a database.
@param start Range start
@param take Maximum number of items that will be retrieved
@param database Database to use
@return List of subscriptions state | [
"It",
"downloads",
"a",
"list",
"of",
"all",
"existing",
"subscriptions",
"in",
"a",
"database",
"."
] | train | https://github.com/ravendb/ravendb-jvm-client/blob/5a45727de507b541d1571e79ddd97c7d88bee787/src/main/java/net/ravendb/client/documents/subscriptions/DocumentSubscriptions.java#L355-L362 |
OpenLiberty/open-liberty | dev/com.ibm.ws.couchdb/src/com/ibm/ws/couchdb/internal/CouchDbService.java | CouchDbService.set | @Trivial
private void set(Class<?> builderCls, Object builder, String propName, Object value)
throws IntrospectionException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
"""
Configure a couchdb option.
@param builder
class org.ektorp.http.StdHttpClient$Builder
@... | java | @Trivial
private void set(Class<?> builderCls, Object builder, String propName, Object value)
throws IntrospectionException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
try {
Class<?> cls = COUCHDB_CLIENT_OPTIONS_TYPES.get(propName);
... | [
"@",
"Trivial",
"private",
"void",
"set",
"(",
"Class",
"<",
"?",
">",
"builderCls",
",",
"Object",
"builder",
",",
"String",
"propName",
",",
"Object",
"value",
")",
"throws",
"IntrospectionException",
",",
"IllegalArgumentException",
",",
"IllegalAccessException... | Configure a couchdb option.
@param builder
class org.ektorp.http.StdHttpClient$Builder
@param builder
instance org.ektorp.http.StdHttpClient$Builder
@param propName
name of the config property
@param value
value of the config property. | [
"Configure",
"a",
"couchdb",
"option",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.couchdb/src/com/ibm/ws/couchdb/internal/CouchDbService.java#L229-L262 |
konvergeio/cofoja | src/main/java/com/google/java/contract/core/runtime/ContractRuntime.java | ContractRuntime.magicCast | @SuppressWarnings("unchecked")
public static <T> T magicCast(Object obj, T dummy) {
"""
Magically casts the first argument to the type of the second
argument.
<p>This method is part of the old value type inference trick. It
is called at run time to cast the old value variable (first
argument) to the type o... | java | @SuppressWarnings("unchecked")
public static <T> T magicCast(Object obj, T dummy) {
return (T) obj;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"magicCast",
"(",
"Object",
"obj",
",",
"T",
"dummy",
")",
"{",
"return",
"(",
"T",
")",
"obj",
";",
"}"
] | Magically casts the first argument to the type of the second
argument.
<p>This method is part of the old value type inference trick. It
is called at run time to cast the old value variable (first
argument) to the type of an unevaluated version of the old value
expression (second argument). The "unevaluation" is achiev... | [
"Magically",
"casts",
"the",
"first",
"argument",
"to",
"the",
"type",
"of",
"the",
"second",
"argument",
"."
] | train | https://github.com/konvergeio/cofoja/blob/6ded58fa05eb5bf85f16353c8dd4c70bee59121a/src/main/java/com/google/java/contract/core/runtime/ContractRuntime.java#L57-L60 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.ovhAccount_ovhAccountId_PUT | public void ovhAccount_ovhAccountId_PUT(String ovhAccountId, OvhOvhAccount body) throws IOException {
"""
Alter this object properties
REST: PUT /me/ovhAccount/{ovhAccountId}
@param body [required] New object properties
@param ovhAccountId [required]
"""
String qPath = "/me/ovhAccount/{ovhAccountId}";
... | java | public void ovhAccount_ovhAccountId_PUT(String ovhAccountId, OvhOvhAccount body) throws IOException {
String qPath = "/me/ovhAccount/{ovhAccountId}";
StringBuilder sb = path(qPath, ovhAccountId);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"ovhAccount_ovhAccountId_PUT",
"(",
"String",
"ovhAccountId",
",",
"OvhOvhAccount",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/ovhAccount/{ovhAccountId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
... | Alter this object properties
REST: PUT /me/ovhAccount/{ovhAccountId}
@param body [required] New object properties
@param ovhAccountId [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L3392-L3396 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/referral/ExtendedAnswerProvider.java | ExtendedAnswerProvider.addJsonArrayToKitEvent | private void addJsonArrayToKitEvent(KitEvent kitEvent, JSONArray jsonArray, String keyPathPrepend) throws JSONException {
"""
<p>
Converts the given JsonArray to key-value pairs and update the {@link KitEvent}
</p>
@param kitEvent {@link KitEvent} to update with key-value pairs from the JsonArray
@para... | java | private void addJsonArrayToKitEvent(KitEvent kitEvent, JSONArray jsonArray, String keyPathPrepend) throws JSONException {
for (int i = 0; i < jsonArray.length(); i++) {
addBranchAttributes(kitEvent, keyPathPrepend, CTRL_PARAM_NOTATION + Integer.toString(i), jsonArray.getString(i));
}
} | [
"private",
"void",
"addJsonArrayToKitEvent",
"(",
"KitEvent",
"kitEvent",
",",
"JSONArray",
"jsonArray",
",",
"String",
"keyPathPrepend",
")",
"throws",
"JSONException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"jsonArray",
".",
"length",
"(",
"... | <p>
Converts the given JsonArray to key-value pairs and update the {@link KitEvent}
</p>
@param kitEvent {@link KitEvent} to update with key-value pairs from the JsonArray
@param jsonArray {@link JSONArray} to add to the {@link KitEvent}
@param keyPathPrepend {@link String} with value to prepend to the keys... | [
"<p",
">",
"Converts",
"the",
"given",
"JsonArray",
"to",
"key",
"-",
"value",
"pairs",
"and",
"update",
"the",
"{",
"@link",
"KitEvent",
"}",
"<",
"/",
"p",
">"
] | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/ExtendedAnswerProvider.java#L91-L95 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionRendererModel.java | MapTileCollisionRendererModel.createFunctionDraw | public static ImageBuffer createFunctionDraw(CollisionFormula collision, int tw, int th) {
"""
Create the function draw to buffer.
@param collision The collision reference.
@param tw The tile width.
@param th The tile height.
@return The created collision representation buffer.
"""
final ImageBu... | java | public static ImageBuffer createFunctionDraw(CollisionFormula collision, int tw, int th)
{
final ImageBuffer buffer = Graphics.createImageBuffer(tw, th, ColorRgba.TRANSPARENT);
final Graphic g = buffer.createGraphic();
g.setColor(ColorRgba.PURPLE);
createFunctionDraw(g, collis... | [
"public",
"static",
"ImageBuffer",
"createFunctionDraw",
"(",
"CollisionFormula",
"collision",
",",
"int",
"tw",
",",
"int",
"th",
")",
"{",
"final",
"ImageBuffer",
"buffer",
"=",
"Graphics",
".",
"createImageBuffer",
"(",
"tw",
",",
"th",
",",
"ColorRgba",
".... | Create the function draw to buffer.
@param collision The collision reference.
@param tw The tile width.
@param th The tile height.
@return The created collision representation buffer. | [
"Create",
"the",
"function",
"draw",
"to",
"buffer",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionRendererModel.java#L48-L58 |
btaz/data-util | src/main/java/com/btaz/util/collections/Sets.java | Sets.isSuperset | public static <T> boolean isSuperset(Set<T> setA, Set<T> setB) {
"""
This method returns true if set A is a superset of set B
i.e. it answers the question if A contains all items from B
@param setA set A
@param setB set B
@param <T> type
@return {@code boolean} true if A is a superset of B
"""
ret... | java | public static <T> boolean isSuperset(Set<T> setA, Set<T> setB) {
return setA.containsAll(setB);
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"isSuperset",
"(",
"Set",
"<",
"T",
">",
"setA",
",",
"Set",
"<",
"T",
">",
"setB",
")",
"{",
"return",
"setA",
".",
"containsAll",
"(",
"setB",
")",
";",
"}"
] | This method returns true if set A is a superset of set B
i.e. it answers the question if A contains all items from B
@param setA set A
@param setB set B
@param <T> type
@return {@code boolean} true if A is a superset of B | [
"This",
"method",
"returns",
"true",
"if",
"set",
"A",
"is",
"a",
"superset",
"of",
"set",
"B",
"i",
".",
"e",
".",
"it",
"answers",
"the",
"question",
"if",
"A",
"contains",
"all",
"items",
"from",
"B"
] | train | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/collections/Sets.java#L139-L141 |
highsource/maven-jaxb2-plugin | plugin-core/src/main/java/org/jvnet/jaxb2/maven2/RawXJC2Mojo.java | RawXJC2Mojo.createCatalogResolver | protected CatalogResolver createCatalogResolver() throws MojoExecutionException {
"""
Creates an instance of catalog resolver.
@return Instance of the catalog resolver.
@throws MojoExecutionException
If catalog resolver cannot be instantiated.
"""
final CatalogManager catalogManager = new CatalogManage... | java | protected CatalogResolver createCatalogResolver() throws MojoExecutionException {
final CatalogManager catalogManager = new CatalogManager();
catalogManager.setIgnoreMissingProperties(true);
catalogManager.setUseStaticCatalog(false);
// TODO Logging
if (getLog().isDebugEnabled()) {
catalogManager.set... | [
"protected",
"CatalogResolver",
"createCatalogResolver",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"final",
"CatalogManager",
"catalogManager",
"=",
"new",
"CatalogManager",
"(",
")",
";",
"catalogManager",
".",
"setIgnoreMissingProperties",
"(",
"true",
")",
"... | Creates an instance of catalog resolver.
@return Instance of the catalog resolver.
@throws MojoExecutionException
If catalog resolver cannot be instantiated. | [
"Creates",
"an",
"instance",
"of",
"catalog",
"resolver",
"."
] | train | https://github.com/highsource/maven-jaxb2-plugin/blob/a4d3955be5a8c2a5f6137c0f436798c95ef95176/plugin-core/src/main/java/org/jvnet/jaxb2/maven2/RawXJC2Mojo.java#L891-L905 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DocumentLine.java | DocumentLine.setBeginnings | public void setBeginnings(int i, float v) {
"""
indexed setter for beginnings - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array
"""
if (DocumentLine_Type.featOkTst && ((DocumentLine_Type)jcasType).casFeat_beginnings == null)
jcasType.jcas... | java | public void setBeginnings(int i, float v) {
if (DocumentLine_Type.featOkTst && ((DocumentLine_Type)jcasType).casFeat_beginnings == null)
jcasType.jcas.throwFeatMissing("beginnings", "ch.epfl.bbp.uima.types.DocumentLine");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((DocumentLine_... | [
"public",
"void",
"setBeginnings",
"(",
"int",
"i",
",",
"float",
"v",
")",
"{",
"if",
"(",
"DocumentLine_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"DocumentLine_Type",
")",
"jcasType",
")",
".",
"casFeat_beginnings",
"==",
"null",
")",
"jcasType",
".",
"jc... | indexed setter for beginnings - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"beginnings",
"-",
"sets",
"an",
"indexed",
"value",
"-"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DocumentLine.java#L160-L164 |
xiancloud/xian | xian-zookeeper/xian-curator/xian-curator-client/src/main/java/org/apache/curator/SessionFailRetryLoop.java | SessionFailRetryLoop.callWithRetry | public static<T> T callWithRetry(CuratorZookeeperClient client, Mode mode, Callable<T> proc) throws Exception {
"""
Convenience utility: creates a "session fail" retry loop calling the given proc
@param client Zookeeper
@param mode how to handle session failures
@param proc procedure to call with retry
... | java | public static<T> T callWithRetry(CuratorZookeeperClient client, Mode mode, Callable<T> proc) throws Exception
{
T result = null;
SessionFailRetryLoop retryLoop = client.newSessionFailRetryLoop(mode);
retryLoop.start();
try
{
while ( r... | [
"public",
"static",
"<",
"T",
">",
"T",
"callWithRetry",
"(",
"CuratorZookeeperClient",
"client",
",",
"Mode",
"mode",
",",
"Callable",
"<",
"T",
">",
"proc",
")",
"throws",
"Exception",
"{",
"T",
"result",
"=",
"null",
";",
"SessionFailRetryLoop",
"retryLoo... | Convenience utility: creates a "session fail" retry loop calling the given proc
@param client Zookeeper
@param mode how to handle session failures
@param proc procedure to call with retry
@param <T> return type
@return procedure result
@throws Exception any non-retriable errors | [
"Convenience",
"utility",
":",
"creates",
"a",
"session",
"fail",
"retry",
"loop",
"calling",
"the",
"given",
"proc"
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-zookeeper/xian-curator/xian-curator-client/src/main/java/org/apache/curator/SessionFailRetryLoop.java#L148-L173 |
apache/flink | flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/PatternStream.java | PatternStream.flatSelect | public <R> SingleOutputStreamOperator<R> flatSelect(final PatternFlatSelectFunction<T, R> patternFlatSelectFunction) {
"""
Applies a flat select function to the detected pattern sequence. For each pattern sequence
the provided {@link PatternFlatSelectFunction} is called. The pattern flat select function
can prod... | java | public <R> SingleOutputStreamOperator<R> flatSelect(final PatternFlatSelectFunction<T, R> patternFlatSelectFunction) {
// we have to extract the output type from the provided pattern selection function manually
// because the TypeExtractor cannot do that if the method is wrapped in a MapFunction
final TypeInform... | [
"public",
"<",
"R",
">",
"SingleOutputStreamOperator",
"<",
"R",
">",
"flatSelect",
"(",
"final",
"PatternFlatSelectFunction",
"<",
"T",
",",
"R",
">",
"patternFlatSelectFunction",
")",
"{",
"// we have to extract the output type from the provided pattern selection function m... | Applies a flat select function to the detected pattern sequence. For each pattern sequence
the provided {@link PatternFlatSelectFunction} is called. The pattern flat select function
can produce an arbitrary number of resulting elements.
@param patternFlatSelectFunction The pattern flat select function which is called ... | [
"Applies",
"a",
"flat",
"select",
"function",
"to",
"the",
"detected",
"pattern",
"sequence",
".",
"For",
"each",
"pattern",
"sequence",
"the",
"provided",
"{",
"@link",
"PatternFlatSelectFunction",
"}",
"is",
"called",
".",
"The",
"pattern",
"flat",
"select",
... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/PatternStream.java#L329-L344 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/CloudTasksClient.java | CloudTasksClient.renewLease | public final Task renewLease(String name, Timestamp scheduleTime, Duration leaseDuration) {
"""
Renew the current lease of a pull task.
<p>The worker can use this method to extend the lease by a new duration, starting from now. The
new task lease will be returned in the task's
[schedule_time][google.cloud.tas... | java | public final Task renewLease(String name, Timestamp scheduleTime, Duration leaseDuration) {
RenewLeaseRequest request =
RenewLeaseRequest.newBuilder()
.setName(name)
.setScheduleTime(scheduleTime)
.setLeaseDuration(leaseDuration)
.build();
return renewLea... | [
"public",
"final",
"Task",
"renewLease",
"(",
"String",
"name",
",",
"Timestamp",
"scheduleTime",
",",
"Duration",
"leaseDuration",
")",
"{",
"RenewLeaseRequest",
"request",
"=",
"RenewLeaseRequest",
".",
"newBuilder",
"(",
")",
".",
"setName",
"(",
"name",
")",... | Renew the current lease of a pull task.
<p>The worker can use this method to extend the lease by a new duration, starting from now. The
new task lease will be returned in the task's
[schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time].
<p>Sample code:
<pre><code>
try (CloudTasksClient cloudTasksClient = Cl... | [
"Renew",
"the",
"current",
"lease",
"of",
"a",
"pull",
"task",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/CloudTasksClient.java#L2402-L2411 |
Sciss/abc4j | abc/src/main/java/abc/ui/swing/ScoreTemplate.java | ScoreTemplate.setTextSize | public void setTextSize(byte field, float size, SizeUnit unit) {
"""
Sets the font size of a field
@param field
one of {@link ScoreElements} constants
@param size
text size in percent of {@link #getDefaultTextSize()} if
{@link #getTextSize(byte)} is
{@link SizeUnit#PERCENT}, else in pt
@param unit
{@link... | java | public void setTextSize(byte field, float size, SizeUnit unit) {
FieldInfos fi = getFieldInfos(field);
fi.m_fontSize = size;
fi.m_fontSizeUnit = unit;
notifyListeners();
} | [
"public",
"void",
"setTextSize",
"(",
"byte",
"field",
",",
"float",
"size",
",",
"SizeUnit",
"unit",
")",
"{",
"FieldInfos",
"fi",
"=",
"getFieldInfos",
"(",
"field",
")",
";",
"fi",
".",
"m_fontSize",
"=",
"size",
";",
"fi",
".",
"m_fontSizeUnit",
"=",... | Sets the font size of a field
@param field
one of {@link ScoreElements} constants
@param size
text size in percent of {@link #getDefaultTextSize()} if
{@link #getTextSize(byte)} is
{@link SizeUnit#PERCENT}, else in pt
@param unit
{@link SizeUnit#PERCENT} or {@link SizeUnit#PT} | [
"Sets",
"the",
"font",
"size",
"of",
"a",
"field"
] | train | https://github.com/Sciss/abc4j/blob/117b405642c84a7bfca4e3e13668838258b90ca7/abc/src/main/java/abc/ui/swing/ScoreTemplate.java#L932-L937 |
davidmoten/geo | geo/src/main/java/com/github/davidmoten/geo/Base32.java | Base32.encodeBase32 | public static String encodeBase32(long i, int length) {
"""
Returns the base 32 encoding of the given length from a {@link Long}
geohash.
@param i
the geohash
@param length
the length of the returned hash
@return the string geohash
"""
char[] buf = new char[65];
int charPos = 64;
... | java | public static String encodeBase32(long i, int length) {
char[] buf = new char[65];
int charPos = 64;
boolean negative = (i < 0);
if (!negative)
i = -i;
while (i <= -32) {
buf[charPos--] = characters[(int) (-(i % 32))];
i /= 32;
}
... | [
"public",
"static",
"String",
"encodeBase32",
"(",
"long",
"i",
",",
"int",
"length",
")",
"{",
"char",
"[",
"]",
"buf",
"=",
"new",
"char",
"[",
"65",
"]",
";",
"int",
"charPos",
"=",
"64",
";",
"boolean",
"negative",
"=",
"(",
"i",
"<",
"0",
")... | Returns the base 32 encoding of the given length from a {@link Long}
geohash.
@param i
the geohash
@param length
the length of the returned hash
@return the string geohash | [
"Returns",
"the",
"base",
"32",
"encoding",
"of",
"the",
"given",
"length",
"from",
"a",
"{",
"@link",
"Long",
"}",
"geohash",
"."
] | train | https://github.com/davidmoten/geo/blob/e90d2f406133cd9b60d54a3e6bdb7423d7fcce37/geo/src/main/java/com/github/davidmoten/geo/Base32.java#L48-L65 |
jvirtanen/config-extras | src/main/java/org/jvirtanen/config/Configs.java | Configs.getInetAddress | public static InetAddress getInetAddress(Config config, String path) {
"""
Get an IP address. The configuration value can either be a hostname or
a literal IP address.
@param config a configuration object
@param path the path expression
@return an IP address
@throws ConfigException.Missing if the value is a... | java | public static InetAddress getInetAddress(Config config, String path) {
try {
return InetAddress.getByName(config.getString(path));
} catch (UnknownHostException e) {
throw badValue(e, config, path);
}
} | [
"public",
"static",
"InetAddress",
"getInetAddress",
"(",
"Config",
"config",
",",
"String",
"path",
")",
"{",
"try",
"{",
"return",
"InetAddress",
".",
"getByName",
"(",
"config",
".",
"getString",
"(",
"path",
")",
")",
";",
"}",
"catch",
"(",
"UnknownHo... | Get an IP address. The configuration value can either be a hostname or
a literal IP address.
@param config a configuration object
@param path the path expression
@return an IP address
@throws ConfigException.Missing if the value is absent or null
@throws ConfigException.WrongType if the value is not convertible to
a s... | [
"Get",
"an",
"IP",
"address",
".",
"The",
"configuration",
"value",
"can",
"either",
"be",
"a",
"hostname",
"or",
"a",
"literal",
"IP",
"address",
"."
] | train | https://github.com/jvirtanen/config-extras/blob/eba3cff680c302fe07625dc8046f0bd4a56b9fc3/src/main/java/org/jvirtanen/config/Configs.java#L32-L38 |
exoplatform/jcr | exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/util/TextUtil.java | TextUtil.relativizePath | public static String relativizePath(String path, boolean withIndex) {
"""
Creates relative path from string.
@param path path
@param withIndex indicates whether we should keep the index or not
@return relative path
"""
if (path.startsWith("/"))
path = path.substring(1);
if (!with... | java | public static String relativizePath(String path, boolean withIndex)
{
if (path.startsWith("/"))
path = path.substring(1);
if (!withIndex && path.endsWith("]"))
{
int index = path.lastIndexOf('[');
return index == -1 ? path : path.substring(0, index);
}
... | [
"public",
"static",
"String",
"relativizePath",
"(",
"String",
"path",
",",
"boolean",
"withIndex",
")",
"{",
"if",
"(",
"path",
".",
"startsWith",
"(",
"\"/\"",
")",
")",
"path",
"=",
"path",
".",
"substring",
"(",
"1",
")",
";",
"if",
"(",
"!",
"wi... | Creates relative path from string.
@param path path
@param withIndex indicates whether we should keep the index or not
@return relative path | [
"Creates",
"relative",
"path",
"from",
"string",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/util/TextUtil.java#L166-L177 |
redkale/redkale | src/org/redkale/boot/ClassFilter.java | ClassFilter.accept | @SuppressWarnings("unchecked")
public boolean accept(AnyValue property, Class clazz, boolean autoscan) {
"""
判断class是否有效
@param property AnyValue
@param clazz Class
@param autoscan boolean
@return boolean
"""
if (this.refused || !Modifier.isPublic(clazz.getModifiers())) return false;
... | java | @SuppressWarnings("unchecked")
public boolean accept(AnyValue property, Class clazz, boolean autoscan) {
if (this.refused || !Modifier.isPublic(clazz.getModifiers())) return false;
if (annotationClass != null && clazz.getAnnotation(annotationClass) == null) return false;
boolean rs = sup... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"boolean",
"accept",
"(",
"AnyValue",
"property",
",",
"Class",
"clazz",
",",
"boolean",
"autoscan",
")",
"{",
"if",
"(",
"this",
".",
"refused",
"||",
"!",
"Modifier",
".",
"isPublic",
"(",
"cl... | 判断class是否有效
@param property AnyValue
@param clazz Class
@param autoscan boolean
@return boolean | [
"判断class是否有效"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/boot/ClassFilter.java#L277-L288 |
morimekta/utils | io-util/src/main/java/net/morimekta/util/io/BinaryReader.java | BinaryReader.readUInt16 | public int readUInt16() throws IOException {
"""
Read an unsigned short from the input stream.
@return The number read.
@throws IOException If no number to read.
"""
int b1 = in.read();
if (b1 < 0) {
return 0;
}
int b2 = in.read();
if (b2 < 0) {
... | java | public int readUInt16() throws IOException {
int b1 = in.read();
if (b1 < 0) {
return 0;
}
int b2 = in.read();
if (b2 < 0) {
throw new IOException("Missing byte 2 to read uint16");
}
return unshift2bytes(b1, b2);
} | [
"public",
"int",
"readUInt16",
"(",
")",
"throws",
"IOException",
"{",
"int",
"b1",
"=",
"in",
".",
"read",
"(",
")",
";",
"if",
"(",
"b1",
"<",
"0",
")",
"{",
"return",
"0",
";",
"}",
"int",
"b2",
"=",
"in",
".",
"read",
"(",
")",
";",
"if",... | Read an unsigned short from the input stream.
@return The number read.
@throws IOException If no number to read. | [
"Read",
"an",
"unsigned",
"short",
"from",
"the",
"input",
"stream",
"."
] | train | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/io-util/src/main/java/net/morimekta/util/io/BinaryReader.java#L297-L307 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/SNE.java | SNE.computeGradient | protected void computeGradient(AffinityMatrix pij, double[][] qij, double qij_isum, double[][] sol, double[] meta) {
"""
Compute the gradients.
@param pij Desired affinity matrix
@param qij Projected affinity matrix
@param qij_isum Normalization factor
@param sol Current solution coordinates
@param meta Poi... | java | protected void computeGradient(AffinityMatrix pij, double[][] qij, double qij_isum, double[][] sol, double[] meta) {
final int dim3 = dim * 3;
int size = pij.size();
for(int i = 0, off = 0; i < size; i++, off += dim3) {
final double[] sol_i = sol[i], qij_i = qij[i];
Arrays.fill(meta, off, off + ... | [
"protected",
"void",
"computeGradient",
"(",
"AffinityMatrix",
"pij",
",",
"double",
"[",
"]",
"[",
"]",
"qij",
",",
"double",
"qij_isum",
",",
"double",
"[",
"]",
"[",
"]",
"sol",
",",
"double",
"[",
"]",
"meta",
")",
"{",
"final",
"int",
"dim3",
"=... | Compute the gradients.
@param pij Desired affinity matrix
@param qij Projected affinity matrix
@param qij_isum Normalization factor
@param sol Current solution coordinates
@param meta Point metadata | [
"Compute",
"the",
"gradients",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/SNE.java#L295-L315 |
google/Accessibility-Test-Framework-for-Android | src/main/java/com/googlecode/eyesfree/utils/AccessibilityNodeInfoUtils.java | AccessibilityNodeInfoUtils.isTopLevelScrollItem | public static boolean isTopLevelScrollItem(Context context, AccessibilityNodeInfoCompat node) {
"""
Determines whether a node is a top-level item in a scrollable container.
@param node The node to test.
@return {@code true} if {@code node} is a top-level item in a scrollable
container.
"""
if (nod... | java | public static boolean isTopLevelScrollItem(Context context, AccessibilityNodeInfoCompat node) {
if (node == null) {
return false;
}
AccessibilityNodeInfoCompat parent = null;
try {
parent = node.getParent();
if (parent == null) {
// N... | [
"public",
"static",
"boolean",
"isTopLevelScrollItem",
"(",
"Context",
"context",
",",
"AccessibilityNodeInfoCompat",
"node",
")",
"{",
"if",
"(",
"node",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"AccessibilityNodeInfoCompat",
"parent",
"=",
"null",
... | Determines whether a node is a top-level item in a scrollable container.
@param node The node to test.
@return {@code true} if {@code node} is a top-level item in a scrollable
container. | [
"Determines",
"whether",
"a",
"node",
"is",
"a",
"top",
"-",
"level",
"item",
"in",
"a",
"scrollable",
"container",
"."
] | train | https://github.com/google/Accessibility-Test-Framework-for-Android/blob/a6117fe0059c82dd764fa628d3817d724570f69e/src/main/java/com/googlecode/eyesfree/utils/AccessibilityNodeInfoUtils.java#L513-L547 |
banq/jdonframework | src/main/java/com/jdon/container/pico/JdonInstantiatingComponentAdapter.java | JdonInstantiatingComponentAdapter.newInstance | protected Object newInstance(Constructor constructor, Object[] parameters) throws InstantiationException, IllegalAccessException,
InvocationTargetException {
"""
Instantiate an object with given parameters and respect the accessible
flag.
@param constructor
the constructor to use
@param parameters
the p... | java | protected Object newInstance(Constructor constructor, Object[] parameters) throws InstantiationException, IllegalAccessException,
InvocationTargetException {
if (allowNonPublicClasses) {
constructor.setAccessible(true);
}
return constructor.newInstance(parameters);
} | [
"protected",
"Object",
"newInstance",
"(",
"Constructor",
"constructor",
",",
"Object",
"[",
"]",
"parameters",
")",
"throws",
"InstantiationException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"if",
"(",
"allowNonPublicClasses",
")",
"{",
... | Instantiate an object with given parameters and respect the accessible
flag.
@param constructor
the constructor to use
@param parameters
the parameters for the constructor
@return the new object.
@throws InstantiationException
@throws IllegalAccessException
@throws InvocationTargetException | [
"Instantiate",
"an",
"object",
"with",
"given",
"parameters",
"and",
"respect",
"the",
"accessible",
"flag",
"."
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/container/pico/JdonInstantiatingComponentAdapter.java#L212-L218 |
thymeleaf/thymeleaf-spring | thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/view/ThymeleafViewResolver.java | ThymeleafViewResolver.setStaticVariables | public void setStaticVariables(final Map<String, ?> variables) {
"""
<p>
Sets a set of static variables, which will be available at the context
every time a view resolved by this ViewResolver is processed.
</p>
<p>
This method <b>does not overwrite</b> the existing static variables, it
simply adds the ones s... | java | public void setStaticVariables(final Map<String, ?> variables) {
if (variables != null) {
for (final Map.Entry<String, ?> entry : variables.entrySet()) {
addStaticVariable(entry.getKey(), entry.getValue());
}
}
} | [
"public",
"void",
"setStaticVariables",
"(",
"final",
"Map",
"<",
"String",
",",
"?",
">",
"variables",
")",
"{",
"if",
"(",
"variables",
"!=",
"null",
")",
"{",
"for",
"(",
"final",
"Map",
".",
"Entry",
"<",
"String",
",",
"?",
">",
"entry",
":",
... | <p>
Sets a set of static variables, which will be available at the context
every time a view resolved by this ViewResolver is processed.
</p>
<p>
This method <b>does not overwrite</b> the existing static variables, it
simply adds the ones specify to any variables already registered.
</p>
<p>
These static variables are ... | [
"<p",
">",
"Sets",
"a",
"set",
"of",
"static",
"variables",
"which",
"will",
"be",
"available",
"at",
"the",
"context",
"every",
"time",
"a",
"view",
"resolved",
"by",
"this",
"ViewResolver",
"is",
"processed",
".",
"<",
"/",
"p",
">",
"<p",
">",
"This... | train | https://github.com/thymeleaf/thymeleaf-spring/blob/9aa15a19017a0938e57646e3deefb8a90ab78dcb/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/view/ThymeleafViewResolver.java#L241-L247 |
sirthias/parboiled | parboiled-core/src/main/java/org/parboiled/support/ParseTreeUtils.java | ParseTreeUtils.findNodeByLabel | public static <V> Node<V> findNodeByLabel(Node<V> parent, String labelPrefix) {
"""
Returns the first node underneath the given parent for which matches the given label prefix.
If parents is null or empty or no node is found the method returns null.
@param parent the parent node
@param labelPrefix the la... | java | public static <V> Node<V> findNodeByLabel(Node<V> parent, String labelPrefix) {
return findNode(parent, new LabelPrefixPredicate<V>(labelPrefix));
} | [
"public",
"static",
"<",
"V",
">",
"Node",
"<",
"V",
">",
"findNodeByLabel",
"(",
"Node",
"<",
"V",
">",
"parent",
",",
"String",
"labelPrefix",
")",
"{",
"return",
"findNode",
"(",
"parent",
",",
"new",
"LabelPrefixPredicate",
"<",
"V",
">",
"(",
"lab... | Returns the first node underneath the given parent for which matches the given label prefix.
If parents is null or empty or no node is found the method returns null.
@param parent the parent node
@param labelPrefix the label prefix to look for
@return the Node if found or null if not found | [
"Returns",
"the",
"first",
"node",
"underneath",
"the",
"given",
"parent",
"for",
"which",
"matches",
"the",
"given",
"label",
"prefix",
".",
"If",
"parents",
"is",
"null",
"or",
"empty",
"or",
"no",
"node",
"is",
"found",
"the",
"method",
"returns",
"null... | train | https://github.com/sirthias/parboiled/blob/84f3ed43e3e171b4c6ab5e6ca6297d264a9d686a/parboiled-core/src/main/java/org/parboiled/support/ParseTreeUtils.java#L182-L184 |
apptik/jus | demo-android/src/main/java/io/apptik/jus/demoapp/adapter/RecyclerAdapter.java | RecyclerAdapter.onBindViewHolder | @Override
public void onBindViewHolder(ViewHolder viewHolder, final int position) {
"""
Replace the contents of a view (invoked by the layout manager)
"""
if (jarr == null) return;
Log.d(TAG, "Element " + position + " set.");
// Get element from your dataset at this position and replace the contents of ... | java | @Override
public void onBindViewHolder(ViewHolder viewHolder, final int position) {
if (jarr == null) return;
Log.d(TAG, "Element " + position + " set.");
// Get element from your dataset at this position and replace the contents of the view
// with that element
Log.d("jus", jarr.get(position).asJsonObject()... | [
"@",
"Override",
"public",
"void",
"onBindViewHolder",
"(",
"ViewHolder",
"viewHolder",
",",
"final",
"int",
"position",
")",
"{",
"if",
"(",
"jarr",
"==",
"null",
")",
"return",
";",
"Log",
".",
"d",
"(",
"TAG",
",",
"\"Element \"",
"+",
"position",
"+"... | Replace the contents of a view (invoked by the layout manager) | [
"Replace",
"the",
"contents",
"of",
"a",
"view",
"(",
"invoked",
"by",
"the",
"layout",
"manager",
")"
] | train | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/demo-android/src/main/java/io/apptik/jus/demoapp/adapter/RecyclerAdapter.java#L131-L148 |
erlang/otp | lib/jinterface/java_src/com/ericsson/otp/erlang/OtpLocalNode.java | OtpLocalNode.createRef | public synchronized OtpErlangRef createRef() {
"""
Create an Erlang {@link OtpErlangRef reference}. Erlang references are
based upon some node specific information; this method creates a
reference using the information in this node. Each call to this method
produces a unique reference.
@return an Erlang refe... | java | public synchronized OtpErlangRef createRef() {
final OtpErlangRef r = new OtpErlangRef(node, refId, creation);
// increment ref ids (3 ints: 18 + 32 + 32 bits)
refId[0]++;
if (refId[0] > 0x3ffff) {
refId[0] = 0;
refId[1]++;
if (refId[1] == 0) {
... | [
"public",
"synchronized",
"OtpErlangRef",
"createRef",
"(",
")",
"{",
"final",
"OtpErlangRef",
"r",
"=",
"new",
"OtpErlangRef",
"(",
"node",
",",
"refId",
",",
"creation",
")",
";",
"// increment ref ids (3 ints: 18 + 32 + 32 bits)",
"refId",
"[",
"0",
"]",
"++",
... | Create an Erlang {@link OtpErlangRef reference}. Erlang references are
based upon some node specific information; this method creates a
reference using the information in this node. Each call to this method
produces a unique reference.
@return an Erlang reference. | [
"Create",
"an",
"Erlang",
"{",
"@link",
"OtpErlangRef",
"reference",
"}",
".",
"Erlang",
"references",
"are",
"based",
"upon",
"some",
"node",
"specific",
"information",
";",
"this",
"method",
"creates",
"a",
"reference",
"using",
"the",
"information",
"in",
"... | train | https://github.com/erlang/otp/blob/ac6084fd83240355f72e94adbf303e57832d1fab/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpLocalNode.java#L160-L175 |
m-m-m/util | xml/src/main/java/net/sf/mmm/util/xml/base/jaxb/XmlBeanMapper.java | XmlBeanMapper.saveXml | public void saveXml(T jaxbBean, OutputStream outputStream) {
"""
This method saves the given {@code jaxbBean} as XML to the given {@code outputStream}. <br>
<b>ATTENTION:</b><br>
The caller of this method has to {@link OutputStream#close() close} the {@code outputStream}.
@param jaxbBean is the JAXB-bean to s... | java | public void saveXml(T jaxbBean, OutputStream outputStream) {
try {
validate(jaxbBean);
getOrCreateMarshaller().marshal(jaxbBean, outputStream);
} catch (MarshalException e) {
throw new XmlInvalidException(e, jaxbBean);
} catch (JAXBException e) {
throw new IllegalStateException(e);
... | [
"public",
"void",
"saveXml",
"(",
"T",
"jaxbBean",
",",
"OutputStream",
"outputStream",
")",
"{",
"try",
"{",
"validate",
"(",
"jaxbBean",
")",
";",
"getOrCreateMarshaller",
"(",
")",
".",
"marshal",
"(",
"jaxbBean",
",",
"outputStream",
")",
";",
"}",
"ca... | This method saves the given {@code jaxbBean} as XML to the given {@code outputStream}. <br>
<b>ATTENTION:</b><br>
The caller of this method has to {@link OutputStream#close() close} the {@code outputStream}.
@param jaxbBean is the JAXB-bean to save as XML.
@param outputStream is the {@link OutputStream} where to write... | [
"This",
"method",
"saves",
"the",
"given",
"{",
"@code",
"jaxbBean",
"}",
"as",
"XML",
"to",
"the",
"given",
"{",
"@code",
"outputStream",
"}",
".",
"<br",
">",
"<b",
">",
"ATTENTION",
":",
"<",
"/",
"b",
">",
"<br",
">",
"The",
"caller",
"of",
"th... | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/xml/src/main/java/net/sf/mmm/util/xml/base/jaxb/XmlBeanMapper.java#L330-L340 |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/util/Convert.java | Convert.toInputSource | public static InputSource toInputSource(Source s, TransformerFactory fac) {
"""
Creates a SAX InputSource from a TraX Source.
<p>May use an XSLT identity transformation if SAXSource cannot
convert it directly.</p>
@param s the source to convert
@param fac the TransformerFactory to use, will use the defaul
... | java | public static InputSource toInputSource(Source s, TransformerFactory fac) {
try {
InputSource is = SAXSource.sourceToInputSource(s);
if (is == null) {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
StreamResult r = new StreamResult(bos);
... | [
"public",
"static",
"InputSource",
"toInputSource",
"(",
"Source",
"s",
",",
"TransformerFactory",
"fac",
")",
"{",
"try",
"{",
"InputSource",
"is",
"=",
"SAXSource",
".",
"sourceToInputSource",
"(",
"s",
")",
";",
"if",
"(",
"is",
"==",
"null",
")",
"{",
... | Creates a SAX InputSource from a TraX Source.
<p>May use an XSLT identity transformation if SAXSource cannot
convert it directly.</p>
@param s the source to convert
@param fac the TransformerFactory to use, will use the defaul
factory if the value is null. | [
"Creates",
"a",
"SAX",
"InputSource",
"from",
"a",
"TraX",
"Source",
"."
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/util/Convert.java#L68-L89 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2017_08_31/src/main/java/com/microsoft/azure/management/containerservice/v2017_08_31/implementation/ManagedClustersInner.java | ManagedClustersInner.getAccessProfilesAsync | public Observable<ManagedClusterAccessProfileInner> getAccessProfilesAsync(String resourceGroupName, String resourceName, String roleName) {
"""
Gets access profile of a managed cluster.
Gets the accessProfile for the specified role name of the managed cluster with a specified resource group and name.
@param r... | java | public Observable<ManagedClusterAccessProfileInner> getAccessProfilesAsync(String resourceGroupName, String resourceName, String roleName) {
return getAccessProfilesWithServiceResponseAsync(resourceGroupName, resourceName, roleName).map(new Func1<ServiceResponse<ManagedClusterAccessProfileInner>, ManagedCluster... | [
"public",
"Observable",
"<",
"ManagedClusterAccessProfileInner",
">",
"getAccessProfilesAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"String",
"roleName",
")",
"{",
"return",
"getAccessProfilesWithServiceResponseAsync",
"(",
"resourceGroupNa... | Gets access profile of a managed cluster.
Gets the accessProfile for the specified role name of the managed cluster with a specified resource group and name.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the managed cluster resource.
@param roleName The name of the role for m... | [
"Gets",
"access",
"profile",
"of",
"a",
"managed",
"cluster",
".",
"Gets",
"the",
"accessProfile",
"for",
"the",
"specified",
"role",
"name",
"of",
"the",
"managed",
"cluster",
"with",
"a",
"specified",
"resource",
"group",
"and",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2017_08_31/src/main/java/com/microsoft/azure/management/containerservice/v2017_08_31/implementation/ManagedClustersInner.java#L476-L483 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DomainsInner.java | DomainsInner.updateOwnershipIdentifier | public DomainOwnershipIdentifierInner updateOwnershipIdentifier(String resourceGroupName, String domainName, String name, DomainOwnershipIdentifierInner domainOwnershipIdentifier) {
"""
Creates an ownership identifier for a domain or updates identifier details for an existing identifer.
Creates an ownership ident... | java | public DomainOwnershipIdentifierInner updateOwnershipIdentifier(String resourceGroupName, String domainName, String name, DomainOwnershipIdentifierInner domainOwnershipIdentifier) {
return updateOwnershipIdentifierWithServiceResponseAsync(resourceGroupName, domainName, name, domainOwnershipIdentifier).toBlockin... | [
"public",
"DomainOwnershipIdentifierInner",
"updateOwnershipIdentifier",
"(",
"String",
"resourceGroupName",
",",
"String",
"domainName",
",",
"String",
"name",
",",
"DomainOwnershipIdentifierInner",
"domainOwnershipIdentifier",
")",
"{",
"return",
"updateOwnershipIdentifierWithS... | Creates an ownership identifier for a domain or updates identifier details for an existing identifer.
Creates an ownership identifier for a domain or updates identifier details for an existing identifer.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param domainName Name of domain... | [
"Creates",
"an",
"ownership",
"identifier",
"for",
"a",
"domain",
"or",
"updates",
"identifier",
"details",
"for",
"an",
"existing",
"identifer",
".",
"Creates",
"an",
"ownership",
"identifier",
"for",
"a",
"domain",
"or",
"updates",
"identifier",
"details",
"fo... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DomainsInner.java#L1723-L1725 |
sebastiangraf/perfidix | src/main/java/org/perfidix/ouput/TabularSummaryOutput.java | TabularSummaryOutput.generateMeterResult | private NiceTable generateMeterResult(final String columnDesc, final AbstractMeter meter, final AbstractResult result, final NiceTable input) {
"""
Generating the results for a given table.
@param columnDesc the description for the row
@param meter the corresponding {@link AbstractMeter} instance
@param ... | java | private NiceTable generateMeterResult(final String columnDesc, final AbstractMeter meter, final AbstractResult result, final NiceTable input) {
input.addRow(new String[]{columnDesc, meter.getUnit(), AbstractOutput.format(result.sum(meter)), AbstractOutput.format(result.min(meter)), AbstractOutput.format(result.... | [
"private",
"NiceTable",
"generateMeterResult",
"(",
"final",
"String",
"columnDesc",
",",
"final",
"AbstractMeter",
"meter",
",",
"final",
"AbstractResult",
"result",
",",
"final",
"NiceTable",
"input",
")",
"{",
"input",
".",
"addRow",
"(",
"new",
"String",
"["... | Generating the results for a given table.
@param columnDesc the description for the row
@param meter the corresponding {@link AbstractMeter} instance
@param result the corresponding {@link AbstractResult} instance
@param input the {@link NiceTable} to be print to
@return the modified {@link NiceTable} in... | [
"Generating",
"the",
"results",
"for",
"a",
"given",
"table",
"."
] | train | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/ouput/TabularSummaryOutput.java#L132-L135 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java | ComputeNodesImpl.getRemoteLoginSettings | public ComputeNodeGetRemoteLoginSettingsResult getRemoteLoginSettings(String poolId, String nodeId) {
"""
Gets the settings required for remote login to a compute node.
Before you can remotely login to a node using the remote login settings, you must create a user account on the node. This API can be invoked only... | java | public ComputeNodeGetRemoteLoginSettingsResult getRemoteLoginSettings(String poolId, String nodeId) {
return getRemoteLoginSettingsWithServiceResponseAsync(poolId, nodeId).toBlocking().single().body();
} | [
"public",
"ComputeNodeGetRemoteLoginSettingsResult",
"getRemoteLoginSettings",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
")",
"{",
"return",
"getRemoteLoginSettingsWithServiceResponseAsync",
"(",
"poolId",
",",
"nodeId",
")",
".",
"toBlocking",
"(",
")",
".",
"s... | Gets the settings required for remote login to a compute node.
Before you can remotely login to a node using the remote login settings, you must create a user account on the node. This API can be invoked only on pools created with the virtual machine configuration property. For pools created with a cloud service config... | [
"Gets",
"the",
"settings",
"required",
"for",
"remote",
"login",
"to",
"a",
"compute",
"node",
".",
"Before",
"you",
"can",
"remotely",
"login",
"to",
"a",
"node",
"using",
"the",
"remote",
"login",
"settings",
"you",
"must",
"create",
"a",
"user",
"accoun... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java#L1929-L1931 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/web/JavaScriptUtils.java | JavaScriptUtils.getHtmlCookieString | public String getHtmlCookieString(String name, String value, Map<String, String> cookieProperties) {
"""
Creates and returns a JavaScript line for setting a cookie with the specified name, value, and cookie properties. Note: The
name, value, and properties will be HTML-encoded.
"""
return createHtmlCo... | java | public String getHtmlCookieString(String name, String value, Map<String, String> cookieProperties) {
return createHtmlCookieString(name, value, cookieProperties, true);
} | [
"public",
"String",
"getHtmlCookieString",
"(",
"String",
"name",
",",
"String",
"value",
",",
"Map",
"<",
"String",
",",
"String",
">",
"cookieProperties",
")",
"{",
"return",
"createHtmlCookieString",
"(",
"name",
",",
"value",
",",
"cookieProperties",
",",
... | Creates and returns a JavaScript line for setting a cookie with the specified name, value, and cookie properties. Note: The
name, value, and properties will be HTML-encoded. | [
"Creates",
"and",
"returns",
"a",
"JavaScript",
"line",
"for",
"setting",
"a",
"cookie",
"with",
"the",
"specified",
"name",
"value",
"and",
"cookie",
"properties",
".",
"Note",
":",
"The",
"name",
"value",
"and",
"properties",
"will",
"be",
"HTML",
"-",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/web/JavaScriptUtils.java#L83-L85 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java | CommerceOrderPersistenceImpl.findByUserId | @Override
public List<CommerceOrder> findByUserId(long userId, int start, int end) {
"""
Returns a range of all the commerce orders where userId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, t... | java | @Override
public List<CommerceOrder> findByUserId(long userId, int start, int end) {
return findByUserId(userId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceOrder",
">",
"findByUserId",
"(",
"long",
"userId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByUserId",
"(",
"userId",
",",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce orders where userId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Set... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"orders",
"where",
"userId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java#L2032-L2035 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGHyperSphere.java | SVGHyperSphere.drawManhattan | public static Element drawManhattan(SVGPlot svgp, Projection2D proj, NumberVector mid, double radius) {
"""
Wireframe "manhattan" hypersphere
@param svgp SVG Plot
@param proj Visualization projection
@param mid mean vector
@param radius radius
@return path element
"""
final double[] v_mid = mid.toAr... | java | public static Element drawManhattan(SVGPlot svgp, Projection2D proj, NumberVector mid, double radius) {
final double[] v_mid = mid.toArray(); // a copy
final long[] dims = proj.getVisibleDimensions2D();
SVGPath path = new SVGPath();
for(int dim = BitsUtil.nextSetBit(dims, 0); dim >= 0; dim = BitsUtil.n... | [
"public",
"static",
"Element",
"drawManhattan",
"(",
"SVGPlot",
"svgp",
",",
"Projection2D",
"proj",
",",
"NumberVector",
"mid",
",",
"double",
"radius",
")",
"{",
"final",
"double",
"[",
"]",
"v_mid",
"=",
"mid",
".",
"toArray",
"(",
")",
";",
"// a copy"... | Wireframe "manhattan" hypersphere
@param svgp SVG Plot
@param proj Visualization projection
@param mid mean vector
@param radius radius
@return path element | [
"Wireframe",
"manhattan",
"hypersphere"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGHyperSphere.java#L63-L91 |
redkale/redkale | src/org/redkale/net/http/HttpRequest.java | HttpRequest.getCookie | public String getCookie(String name, String dfvalue) {
"""
获取Cookie值, 没有返回默认值
@param name cookie名
@param dfvalue 默认cookie值
@return cookie值
"""
for (HttpCookie c : getCookies()) {
if (name.equals(c.getName())) return c.getValue();
}
return dfvalue;
} | java | public String getCookie(String name, String dfvalue) {
for (HttpCookie c : getCookies()) {
if (name.equals(c.getName())) return c.getValue();
}
return dfvalue;
} | [
"public",
"String",
"getCookie",
"(",
"String",
"name",
",",
"String",
"dfvalue",
")",
"{",
"for",
"(",
"HttpCookie",
"c",
":",
"getCookies",
"(",
")",
")",
"{",
"if",
"(",
"name",
".",
"equals",
"(",
"c",
".",
"getName",
"(",
")",
")",
")",
"retur... | 获取Cookie值, 没有返回默认值
@param name cookie名
@param dfvalue 默认cookie值
@return cookie值 | [
"获取Cookie值,",
"没有返回默认值"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/net/http/HttpRequest.java#L530-L535 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/EmulatedFields.java | EmulatedFields.get | public double get(String name, double defaultValue) throws IllegalArgumentException {
"""
Finds and returns the double value of a given field named {@code name}
in the receiver. If the field has not been assigned any value yet, the
default value {@code defaultValue} is returned instead.
@param name
the name ... | java | public double get(String name, double defaultValue) throws IllegalArgumentException {
ObjectSlot slot = findMandatorySlot(name, double.class);
return slot.defaulted ? defaultValue : ((Double) slot.fieldValue).doubleValue();
} | [
"public",
"double",
"get",
"(",
"String",
"name",
",",
"double",
"defaultValue",
")",
"throws",
"IllegalArgumentException",
"{",
"ObjectSlot",
"slot",
"=",
"findMandatorySlot",
"(",
"name",
",",
"double",
".",
"class",
")",
";",
"return",
"slot",
".",
"default... | Finds and returns the double value of a given field named {@code name}
in the receiver. If the field has not been assigned any value yet, the
default value {@code defaultValue} is returned instead.
@param name
the name of the field to find.
@param defaultValue
return value in case the field has not been assigned to ye... | [
"Finds",
"and",
"returns",
"the",
"double",
"value",
"of",
"a",
"given",
"field",
"named",
"{",
"@code",
"name",
"}",
"in",
"the",
"receiver",
".",
"If",
"the",
"field",
"has",
"not",
"been",
"assigned",
"any",
"value",
"yet",
"the",
"default",
"value",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/EmulatedFields.java#L248-L251 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java | JavacParser.classDeclaration | protected JCClassDecl classDeclaration(JCModifiers mods, Comment dc) {
"""
ClassDeclaration = CLASS Ident TypeParametersOpt [EXTENDS Type]
[IMPLEMENTS TypeList] ClassBody
@param mods The modifiers starting the class declaration
@param dc The documentation comment for the class, or null.
"""
... | java | protected JCClassDecl classDeclaration(JCModifiers mods, Comment dc) {
int pos = token.pos;
accept(CLASS);
Name name = ident();
List<JCTypeParameter> typarams = typeParametersOpt();
JCExpression extending = null;
if (token.kind == EXTENDS) {
nextToken();
... | [
"protected",
"JCClassDecl",
"classDeclaration",
"(",
"JCModifiers",
"mods",
",",
"Comment",
"dc",
")",
"{",
"int",
"pos",
"=",
"token",
".",
"pos",
";",
"accept",
"(",
"CLASS",
")",
";",
"Name",
"name",
"=",
"ident",
"(",
")",
";",
"List",
"<",
"JCType... | ClassDeclaration = CLASS Ident TypeParametersOpt [EXTENDS Type]
[IMPLEMENTS TypeList] ClassBody
@param mods The modifiers starting the class declaration
@param dc The documentation comment for the class, or null. | [
"ClassDeclaration",
"=",
"CLASS",
"Ident",
"TypeParametersOpt",
"[",
"EXTENDS",
"Type",
"]",
"[",
"IMPLEMENTS",
"TypeList",
"]",
"ClassBody"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java#L3381-L3403 |
j256/simplejmx | src/main/java/com/j256/simplejmx/client/JmxClient.java | JmxClient.invokeOperation | public Object invokeOperation(String domain, String beanName, String operName, Object... params) throws Exception {
"""
Invoke a JMX method as an array of objects.
@return The value returned by the method or null if none.
"""
return invokeOperation(ObjectNameUtil.makeObjectName(domain, beanName), operName... | java | public Object invokeOperation(String domain, String beanName, String operName, Object... params) throws Exception {
return invokeOperation(ObjectNameUtil.makeObjectName(domain, beanName), operName, params);
} | [
"public",
"Object",
"invokeOperation",
"(",
"String",
"domain",
",",
"String",
"beanName",
",",
"String",
"operName",
",",
"Object",
"...",
"params",
")",
"throws",
"Exception",
"{",
"return",
"invokeOperation",
"(",
"ObjectNameUtil",
".",
"makeObjectName",
"(",
... | Invoke a JMX method as an array of objects.
@return The value returned by the method or null if none. | [
"Invoke",
"a",
"JMX",
"method",
"as",
"an",
"array",
"of",
"objects",
"."
] | train | https://github.com/j256/simplejmx/blob/1a04f52512dfa0a711ba0cc7023c604dbc82a352/src/main/java/com/j256/simplejmx/client/JmxClient.java#L449-L451 |
phax/ph-web | ph-servlet/src/main/java/com/helger/servlet/response/UnifiedResponse.java | UnifiedResponse.setContentAndCharset | @Nonnull
public final UnifiedResponse setContentAndCharset (@Nonnull final String sContent, @Nonnull final Charset aCharset) {
"""
Utility method to set content and charset at once.
@param sContent
The response content string. May not be <code>null</code>.
@param aCharset
The charset to use. May not be <co... | java | @Nonnull
public final UnifiedResponse setContentAndCharset (@Nonnull final String sContent, @Nonnull final Charset aCharset)
{
ValueEnforcer.notNull (sContent, "Content");
setCharset (aCharset);
setContent (sContent.getBytes (aCharset));
return this;
} | [
"@",
"Nonnull",
"public",
"final",
"UnifiedResponse",
"setContentAndCharset",
"(",
"@",
"Nonnull",
"final",
"String",
"sContent",
",",
"@",
"Nonnull",
"final",
"Charset",
"aCharset",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"sContent",
",",
"\"Content\"",
... | Utility method to set content and charset at once.
@param sContent
The response content string. May not be <code>null</code>.
@param aCharset
The charset to use. May not be <code>null</code>.
@return this | [
"Utility",
"method",
"to",
"set",
"content",
"and",
"charset",
"at",
"once",
"."
] | train | https://github.com/phax/ph-web/blob/d445fd25184605b62682c93c9782409acf0ae813/ph-servlet/src/main/java/com/helger/servlet/response/UnifiedResponse.java#L415-L422 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/ServiceUtils.java | ServiceUtils.convertRequestToUrl | @Deprecated
public static URL convertRequestToUrl(Request<?> request, boolean removeLeadingSlashInResourcePath) {
"""
Converts the specified request object into a URL, containing all the
specified parameters, the specified request endpoint, etc.
@param request
The request to convert into a URL.
@param re... | java | @Deprecated
public static URL convertRequestToUrl(Request<?> request, boolean removeLeadingSlashInResourcePath) {
return convertRequestToUrl(request, removeLeadingSlashInResourcePath, true);
} | [
"@",
"Deprecated",
"public",
"static",
"URL",
"convertRequestToUrl",
"(",
"Request",
"<",
"?",
">",
"request",
",",
"boolean",
"removeLeadingSlashInResourcePath",
")",
"{",
"return",
"convertRequestToUrl",
"(",
"request",
",",
"removeLeadingSlashInResourcePath",
",",
... | Converts the specified request object into a URL, containing all the
specified parameters, the specified request endpoint, etc.
@param request
The request to convert into a URL.
@param removeLeadingSlashInResourcePath
Whether the leading slash in resource-path should be removed
before appending to the endpoint.
@retur... | [
"Converts",
"the",
"specified",
"request",
"object",
"into",
"a",
"URL",
"containing",
"all",
"the",
"specified",
"parameters",
"the",
"specified",
"request",
"endpoint",
"etc",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/ServiceUtils.java#L166-L169 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java | ShapeGenerator.addScrollGapPath | private void addScrollGapPath(int x, int y, int w, int h, boolean isAtLeft) {
"""
Adds a hemispherical section to the current path. This is used to create
the gap in a scroll bar button or cap into which the scroll bar thumb
will fit.
@param x the X coordinate of the upper-left corner of the button
or... | java | private void addScrollGapPath(int x, int y, int w, int h, boolean isAtLeft) {
final double hHalf = h / 2.0;
final double wFull = isAtLeft ? w : 0;
final double wHalfOff = isAtLeft ? w - hHalf : hHalf;
path.quadTo(x + wHalfOff, y + h, x + wHalfOff, y + hHalf);
path.quadTo(x... | [
"private",
"void",
"addScrollGapPath",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"w",
",",
"int",
"h",
",",
"boolean",
"isAtLeft",
")",
"{",
"final",
"double",
"hHalf",
"=",
"h",
"/",
"2.0",
";",
"final",
"double",
"wFull",
"=",
"isAtLeft",
"?",
... | Adds a hemispherical section to the current path. This is used to create
the gap in a scroll bar button or cap into which the scroll bar thumb
will fit.
@param x the X coordinate of the upper-left corner of the button
or cap
@param y the Y coordinate of the upper-left corner of the button
or cap
@param w... | [
"Adds",
"a",
"hemispherical",
"section",
"to",
"the",
"current",
"path",
".",
"This",
"is",
"used",
"to",
"create",
"the",
"gap",
"in",
"a",
"scroll",
"bar",
"button",
"or",
"cap",
"into",
"which",
"the",
"scroll",
"bar",
"thumb",
"will",
"fit",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java#L730-L737 |
soabase/soabase | soabase-core/src/main/java/io/soabase/core/listening/ListenerContainer.java | ListenerContainer.forEach | public void forEach(final Function<T, Void> function) {
"""
Utility - apply the given function to each listener. The function receives
the listener as an argument.
@param function function to call for each listener
"""
for ( final ListenerEntry<T> entry : listeners.values() )
{
... | java | public void forEach(final Function<T, Void> function)
{
for ( final ListenerEntry<T> entry : listeners.values() )
{
entry.executor.execute
(
new Runnable()
{
@Override
public void run()
... | [
"public",
"void",
"forEach",
"(",
"final",
"Function",
"<",
"T",
",",
"Void",
">",
"function",
")",
"{",
"for",
"(",
"final",
"ListenerEntry",
"<",
"T",
">",
"entry",
":",
"listeners",
".",
"values",
"(",
")",
")",
"{",
"entry",
".",
"executor",
".",... | Utility - apply the given function to each listener. The function receives
the listener as an argument.
@param function function to call for each listener | [
"Utility",
"-",
"apply",
"the",
"given",
"function",
"to",
"each",
"listener",
".",
"The",
"function",
"receives",
"the",
"listener",
"as",
"an",
"argument",
"."
] | train | https://github.com/soabase/soabase/blob/4c27b090c09d3b2901cace91c3021505b187276d/soabase-core/src/main/java/io/soabase/core/listening/ListenerContainer.java#L58-L81 |
hal/core | gui/src/main/java/org/jboss/as/console/client/tools/ModelBrowser.java | ModelBrowser.onRemoveChildResource | public void onRemoveChildResource(final ModelNode address, final ModelNode selection) {
"""
Checks permissions and removes a child resource
@param address
@param selection
"""
final ModelNode fqAddress = AddressUtils.toFqAddress(address, selection.asString());
_loadMetaData(fqAddress, new Re... | java | public void onRemoveChildResource(final ModelNode address, final ModelNode selection) {
final ModelNode fqAddress = AddressUtils.toFqAddress(address, selection.asString());
_loadMetaData(fqAddress, new ResourceData(true), new Outcome<ResourceData>() {
@Override
p... | [
"public",
"void",
"onRemoveChildResource",
"(",
"final",
"ModelNode",
"address",
",",
"final",
"ModelNode",
"selection",
")",
"{",
"final",
"ModelNode",
"fqAddress",
"=",
"AddressUtils",
".",
"toFqAddress",
"(",
"address",
",",
"selection",
".",
"asString",
"(",
... | Checks permissions and removes a child resource
@param address
@param selection | [
"Checks",
"permissions",
"and",
"removes",
"a",
"child",
"resource"
] | train | https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/jboss/as/console/client/tools/ModelBrowser.java#L447-L468 |
evernote/android-state | library/src/main/java/com/evernote/android/state/StateSaver.java | StateSaver.saveInstanceState | @NonNull
public static <T extends View> Parcelable saveInstanceState(@NonNull T target, @Nullable Parcelable state) {
"""
Save the state of the given view and the other state inside of the returned {@link Parcelable}.
@param target The view containing fields annotated with {@link State}.
@param state The ... | java | @NonNull
public static <T extends View> Parcelable saveInstanceState(@NonNull T target, @Nullable Parcelable state) {
return IMPL.saveInstanceState(target, state);
} | [
"@",
"NonNull",
"public",
"static",
"<",
"T",
"extends",
"View",
">",
"Parcelable",
"saveInstanceState",
"(",
"@",
"NonNull",
"T",
"target",
",",
"@",
"Nullable",
"Parcelable",
"state",
")",
"{",
"return",
"IMPL",
".",
"saveInstanceState",
"(",
"target",
","... | Save the state of the given view and the other state inside of the returned {@link Parcelable}.
@param target The view containing fields annotated with {@link State}.
@param state The super state of the parent class of the view. Usually it isn't {@code null}.
@return A parcelable containing the view's state and its s... | [
"Save",
"the",
"state",
"of",
"the",
"given",
"view",
"and",
"the",
"other",
"state",
"inside",
"of",
"the",
"returned",
"{",
"@link",
"Parcelable",
"}",
"."
] | train | https://github.com/evernote/android-state/blob/6d56c0c5709f330324ec23d39c3f70c9d59bf6d3/library/src/main/java/com/evernote/android/state/StateSaver.java#L62-L65 |
Jasig/spring-portlet-contrib | spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/filter/GenericPortletFilterBean.java | GenericPortletFilterBean.doCommonFilter | protected void doCommonFilter(PortletRequest request, PortletResponse response, FilterChain chain) throws IOException, PortletException {
"""
Can be implemented by subclasses to provide filter handling common to all request types. Default
implementation just uses {@link org.jasig.springframework.web.portlet.filte... | java | protected void doCommonFilter(PortletRequest request, PortletResponse response, FilterChain chain) throws IOException, PortletException {
PortletFilterUtils.doFilter(request, response, chain);
} | [
"protected",
"void",
"doCommonFilter",
"(",
"PortletRequest",
"request",
",",
"PortletResponse",
"response",
",",
"FilterChain",
"chain",
")",
"throws",
"IOException",
",",
"PortletException",
"{",
"PortletFilterUtils",
".",
"doFilter",
"(",
"request",
",",
"response"... | Can be implemented by subclasses to provide filter handling common to all request types. Default
implementation just uses {@link org.jasig.springframework.web.portlet.filter.PortletFilterUtils#doFilter(PortletRequest, PortletResponse, FilterChain)}
@param request a {@link javax.portlet.PortletRequest} object.
@param r... | [
"Can",
"be",
"implemented",
"by",
"subclasses",
"to",
"provide",
"filter",
"handling",
"common",
"to",
"all",
"request",
"types",
".",
"Default",
"implementation",
"just",
"uses",
"{",
"@link",
"org",
".",
"jasig",
".",
"springframework",
".",
"web",
".",
"p... | train | https://github.com/Jasig/spring-portlet-contrib/blob/719240fa268ddc69900ce9775d9cad3b9c543c6b/spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/filter/GenericPortletFilterBean.java#L357-L359 |
negusoft/holoaccent | HoloAccent/src/com/negusoft/holoaccent/util/BitmapUtils.java | BitmapUtils.applyColor | public static Bitmap applyColor(Bitmap bitmap, int accentColor) {
"""
Creates a copy of the bitmap by replacing the color of every pixel
by accentColor while keeping the alpha value.
@param bitmap The original bitmap.
@param accentColor The color to apply to every pixel.
@return A copy of the given bitmap with... | java | public static Bitmap applyColor(Bitmap bitmap, int accentColor) {
int r = Color.red(accentColor);
int g = Color.green(accentColor);
int b = Color.blue(accentColor);
int width = bitmap.getWidth();
int height = bitmap.getHeight();
int[] pixels = new int[width * height];
bitmap.getPixels(pixels, 0, width,... | [
"public",
"static",
"Bitmap",
"applyColor",
"(",
"Bitmap",
"bitmap",
",",
"int",
"accentColor",
")",
"{",
"int",
"r",
"=",
"Color",
".",
"red",
"(",
"accentColor",
")",
";",
"int",
"g",
"=",
"Color",
".",
"green",
"(",
"accentColor",
")",
";",
"int",
... | Creates a copy of the bitmap by replacing the color of every pixel
by accentColor while keeping the alpha value.
@param bitmap The original bitmap.
@param accentColor The color to apply to every pixel.
@return A copy of the given bitmap with the accent color applied. | [
"Creates",
"a",
"copy",
"of",
"the",
"bitmap",
"by",
"replacing",
"the",
"color",
"of",
"every",
"pixel",
"by",
"accentColor",
"while",
"keeping",
"the",
"alpha",
"value",
"."
] | train | https://github.com/negusoft/holoaccent/blob/7121a02dde94834e770cb81174d0bdc596323324/HoloAccent/src/com/negusoft/holoaccent/util/BitmapUtils.java#L53-L69 |
cache2k/cache2k | cache2k-core/src/main/java/org/cache2k/impl/xmlConfiguration/CacheConfigurationProviderImpl.java | CacheConfigurationProviderImpl.handleBean | private boolean handleBean(
final ConfigurationContext ctx,
final Class<?> _type,
final Object cfg,
final ParsedConfiguration _parsedCfg) {
"""
Create the bean, apply configuration to it and set it.
@return true, if applied, false if not a property
"""
String _containerName = _parsedCfg.... | java | private boolean handleBean(
final ConfigurationContext ctx,
final Class<?> _type,
final Object cfg,
final ParsedConfiguration _parsedCfg) {
String _containerName = _parsedCfg.getContainer();
BeanPropertyMutator m = provideMutator(cfg.getClass());
Class<?> _targetType = m.getType(_containerNa... | [
"private",
"boolean",
"handleBean",
"(",
"final",
"ConfigurationContext",
"ctx",
",",
"final",
"Class",
"<",
"?",
">",
"_type",
",",
"final",
"Object",
"cfg",
",",
"final",
"ParsedConfiguration",
"_parsedCfg",
")",
"{",
"String",
"_containerName",
"=",
"_parsedC... | Create the bean, apply configuration to it and set it.
@return true, if applied, false if not a property | [
"Create",
"the",
"bean",
"apply",
"configuration",
"to",
"it",
"and",
"set",
"it",
"."
] | train | https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-core/src/main/java/org/cache2k/impl/xmlConfiguration/CacheConfigurationProviderImpl.java#L318-L335 |
apache/incubator-druid | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java | ApproximateHistogram.foldFast | public ApproximateHistogram foldFast(ApproximateHistogram h, float[] mergedPositions, long[] mergedBins) {
"""
@param h histogram to be merged into the current histogram
@param mergedPositions temporary buffer of size greater or equal to {@link #size}
@param mergedBins temporary buffer of size... | java | public ApproximateHistogram foldFast(ApproximateHistogram h, float[] mergedPositions, long[] mergedBins)
{
if (size == 0) {
return copy(h);
} else {
return foldRule(h, mergedPositions, mergedBins);
}
} | [
"public",
"ApproximateHistogram",
"foldFast",
"(",
"ApproximateHistogram",
"h",
",",
"float",
"[",
"]",
"mergedPositions",
",",
"long",
"[",
"]",
"mergedBins",
")",
"{",
"if",
"(",
"size",
"==",
"0",
")",
"{",
"return",
"copy",
"(",
"h",
")",
";",
"}",
... | @param h histogram to be merged into the current histogram
@param mergedPositions temporary buffer of size greater or equal to {@link #size}
@param mergedBins temporary buffer of size greater or equal to {@link #size}
@return returns this histogram with h folded into it | [
"@param",
"h",
"histogram",
"to",
"be",
"merged",
"into",
"the",
"current",
"histogram",
"@param",
"mergedPositions",
"temporary",
"buffer",
"of",
"size",
"greater",
"or",
"equal",
"to",
"{",
"@link",
"#size",
"}",
"@param",
"mergedBins",
"temporary",
"buffer",
... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java#L499-L506 |
elibom/jogger | src/main/java/com/elibom/jogger/middleware/router/RouterMiddleware.java | RouterMiddleware.addRoute | public void addRoute(HttpMethod httpMethod, String path, Object controller, String methodName) throws NoSuchMethodException {
"""
Creates a {@link Route} object from the received arguments and adds it to the list of routes.
@param httpMethod the HTTP method to which this route is going to respond.
@param path ... | java | public void addRoute(HttpMethod httpMethod, String path, Object controller, String methodName) throws NoSuchMethodException {
Preconditions.notNull(controller, "no controller provided");
Method method = controller.getClass().getMethod(methodName, Request.class, Response.class);
addRoute(httpMethod, path, controll... | [
"public",
"void",
"addRoute",
"(",
"HttpMethod",
"httpMethod",
",",
"String",
"path",
",",
"Object",
"controller",
",",
"String",
"methodName",
")",
"throws",
"NoSuchMethodException",
"{",
"Preconditions",
".",
"notNull",
"(",
"controller",
",",
"\"no controller pro... | Creates a {@link Route} object from the received arguments and adds it to the list of routes.
@param httpMethod the HTTP method to which this route is going to respond.
@param path the path to which this route is going to respond.
@param controller the object that will be invoked when this route matches.
@param method... | [
"Creates",
"a",
"{",
"@link",
"Route",
"}",
"object",
"from",
"the",
"received",
"arguments",
"and",
"adds",
"it",
"to",
"the",
"list",
"of",
"routes",
"."
] | train | https://github.com/elibom/jogger/blob/d5892ff45e76328d444a68b5a38c26e7bdd0692b/src/main/java/com/elibom/jogger/middleware/router/RouterMiddleware.java#L180-L184 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/impl/JcrBinary.java | JcrBinary.isNt | private static boolean isNt(Resource resource, String nodeTypeName) {
"""
Checks if the given resource is a node with the given node type name
@param resource Resource
@param nodeTypeName Node type name
@return true if resource is of the given node type
"""
if (resource != null) {
return StringUti... | java | private static boolean isNt(Resource resource, String nodeTypeName) {
if (resource != null) {
return StringUtils.equals(resource.getResourceType(), nodeTypeName);
}
return false;
} | [
"private",
"static",
"boolean",
"isNt",
"(",
"Resource",
"resource",
",",
"String",
"nodeTypeName",
")",
"{",
"if",
"(",
"resource",
"!=",
"null",
")",
"{",
"return",
"StringUtils",
".",
"equals",
"(",
"resource",
".",
"getResourceType",
"(",
")",
",",
"no... | Checks if the given resource is a node with the given node type name
@param resource Resource
@param nodeTypeName Node type name
@return true if resource is of the given node type | [
"Checks",
"if",
"the",
"given",
"resource",
"is",
"a",
"node",
"with",
"the",
"given",
"node",
"type",
"name"
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/impl/JcrBinary.java#L86-L91 |
xiancloud/xian | xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderLatch.java | LeaderLatch.await | public boolean await(long timeout, TimeUnit unit) throws InterruptedException {
"""
<p>Causes the current thread to wait until this instance acquires leadership
unless the thread is {@linkplain Thread#interrupt interrupted},
the specified waiting time elapses or the instance is {@linkplain #close() closed}.</p>
... | java | public boolean await(long timeout, TimeUnit unit) throws InterruptedException
{
long waitNanos = TimeUnit.NANOSECONDS.convert(timeout, unit);
synchronized(this)
{
while ( (waitNanos > 0) && (state.get() == State.STARTED) && !hasLeadership.get() )
{
lo... | [
"public",
"boolean",
"await",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
"{",
"long",
"waitNanos",
"=",
"TimeUnit",
".",
"NANOSECONDS",
".",
"convert",
"(",
"timeout",
",",
"unit",
")",
";",
"synchronized",
"(",
"... | <p>Causes the current thread to wait until this instance acquires leadership
unless the thread is {@linkplain Thread#interrupt interrupted},
the specified waiting time elapses or the instance is {@linkplain #close() closed}.</p>
<p></p>
<p>If this instance already is the leader then this method returns immediately
with... | [
"<p",
">",
"Causes",
"the",
"current",
"thread",
"to",
"wait",
"until",
"this",
"instance",
"acquires",
"leadership",
"unless",
"the",
"thread",
"is",
"{",
"@linkplain",
"Thread#interrupt",
"interrupted",
"}",
"the",
"specified",
"waiting",
"time",
"elapses",
"o... | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderLatch.java#L376-L391 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/journal/Journaler.java | Journaler.parseParameters | private void parseParameters(Map<String, String> parameters)
throws ModuleInitializationException {
"""
Check the parameters for required values and for acceptable values. At
this point, the only parameter we care about is "mode".
"""
logger.info("Parameters: " + parameters);
Stri... | java | private void parseParameters(Map<String, String> parameters)
throws ModuleInitializationException {
logger.info("Parameters: " + parameters);
String mode = parameters.get(PARAMETER_JOURNAL_MODE);
if (mode == null) {
inRecoveryMode = false;
} else if (mode.equals(... | [
"private",
"void",
"parseParameters",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"throws",
"ModuleInitializationException",
"{",
"logger",
".",
"info",
"(",
"\"Parameters: \"",
"+",
"parameters",
")",
";",
"String",
"mode",
"=",
"parameter... | Check the parameters for required values and for acceptable values. At
this point, the only parameter we care about is "mode". | [
"Check",
"the",
"parameters",
"for",
"required",
"values",
"and",
"for",
"acceptable",
"values",
".",
"At",
"this",
"point",
"the",
"only",
"parameter",
"we",
"care",
"about",
"is",
"mode",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/Journaler.java#L120-L137 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/installed/DefaultInstalledExtension.java | DefaultInstalledExtension.setNamespaceProperty | public void setNamespaceProperty(String key, Object value, String namespace) {
"""
Sets the value of the specified extension property on the given namespace.
@param key the extension property to set
@param value the property value
@param namespace the namespace to associate the property with, {@code null} for... | java | public void setNamespaceProperty(String key, Object value, String namespace)
{
try {
this.propertiesLock.lock();
Map<String, Object> namespaceProperties = getNamespaceProperties(namespace);
if (namespaceProperties != null) {
namespaceProperties.put(key, v... | [
"public",
"void",
"setNamespaceProperty",
"(",
"String",
"key",
",",
"Object",
"value",
",",
"String",
"namespace",
")",
"{",
"try",
"{",
"this",
".",
"propertiesLock",
".",
"lock",
"(",
")",
";",
"Map",
"<",
"String",
",",
"Object",
">",
"namespacePropert... | Sets the value of the specified extension property on the given namespace.
@param key the extension property to set
@param value the property value
@param namespace the namespace to associate the property with, {@code null} for the root namespace
@since 7.0M2 | [
"Sets",
"the",
"value",
"of",
"the",
"specified",
"extension",
"property",
"on",
"the",
"given",
"namespace",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/repository/internal/installed/DefaultInstalledExtension.java#L504-L516 |
cdk/cdk | tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomTetrahedralLigandPlacer3D.java | AtomTetrahedralLigandPlacer3D.makeStereocenter | public int makeStereocenter(Point3d atomA, IBond ax, Point3d atomB, Point3d atomC, Point3d[] branchPoints) {
"""
set Atoms in respect to stereoinformation.
take placed neighbours to stereocenter
create a x b
if right handed system (spatproduct >0)
if unplaced is not up (relative to stereocenter)
n=b x a
D... | java | public int makeStereocenter(Point3d atomA, IBond ax, Point3d atomB, Point3d atomC, Point3d[] branchPoints) {
Vector3d b = new Vector3d((atomB.x - atomA.x), (atomB.y - atomA.y), (atomB.z - atomA.z));
Vector3d c = new Vector3d((atomC.x - atomA.x), (atomC.y - atomA.y), (atomC.z - atomA.z));
Vector... | [
"public",
"int",
"makeStereocenter",
"(",
"Point3d",
"atomA",
",",
"IBond",
"ax",
",",
"Point3d",
"atomB",
",",
"Point3d",
"atomC",
",",
"Point3d",
"[",
"]",
"branchPoints",
")",
"{",
"Vector3d",
"b",
"=",
"new",
"Vector3d",
"(",
"(",
"atomB",
".",
"x",
... | set Atoms in respect to stereoinformation.
take placed neighbours to stereocenter
create a x b
if right handed system (spatproduct >0)
if unplaced is not up (relative to stereocenter)
n=b x a
Determine angle between n and possible ligand place points
if angle smaller than 90 degrees take this branch point
@param a... | [
"set",
"Atoms",
"in",
"respect",
"to",
"stereoinformation",
".",
"take",
"placed",
"neighbours",
"to",
"stereocenter",
"create",
"a",
"x",
"b",
"if",
"right",
"handed",
"system",
"(",
"spatproduct",
">",
";",
"0",
")",
"if",
"unplaced",
"is",
"not",
"up"... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomTetrahedralLigandPlacer3D.java#L740-L764 |
alkacon/opencms-core | src-modules/org/opencms/workplace/list/CmsListMetadata.java | CmsListMetadata.addColumn | public void addColumn(CmsListColumnDefinition listColumn, int position) {
"""
Adds a new column definition at the given position.<p>
By default a column is printable if it is the first column in the list,
or if it is sorteable.<p>
If you want to override this behaviour, use the
{@link CmsListColumnDefiniti... | java | public void addColumn(CmsListColumnDefinition listColumn, int position) {
setListIdForColumn(listColumn);
if (m_columns.elementList().isEmpty()) {
listColumn.setPrintable(true);
} else {
listColumn.setPrintable(listColumn.isSorteable());
}
if ((listColumn... | [
"public",
"void",
"addColumn",
"(",
"CmsListColumnDefinition",
"listColumn",
",",
"int",
"position",
")",
"{",
"setListIdForColumn",
"(",
"listColumn",
")",
";",
"if",
"(",
"m_columns",
".",
"elementList",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"listC... | Adds a new column definition at the given position.<p>
By default a column is printable if it is the first column in the list,
or if it is sorteable.<p>
If you want to override this behaviour, use the
{@link CmsListColumnDefinition#setPrintable(boolean)}
method after calling this one.
@param listColumn the column de... | [
"Adds",
"a",
"new",
"column",
"definition",
"at",
"the",
"given",
"position",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/list/CmsListMetadata.java#L152-L164 |
JodaOrg/joda-time | src/main/java/org/joda/time/field/DividedDateTimeField.java | DividedDateTimeField.addWrapField | public long addWrapField(long instant, int amount) {
"""
Add to the scaled component of the specified time instant,
wrapping around within that component if necessary.
@param instant the time instant in millis to update.
@param amount the amount of scaled units to add (can be negative).
@return the updated... | java | public long addWrapField(long instant, int amount) {
return set(instant, FieldUtils.getWrappedValue(get(instant), amount, iMin, iMax));
} | [
"public",
"long",
"addWrapField",
"(",
"long",
"instant",
",",
"int",
"amount",
")",
"{",
"return",
"set",
"(",
"instant",
",",
"FieldUtils",
".",
"getWrappedValue",
"(",
"get",
"(",
"instant",
")",
",",
"amount",
",",
"iMin",
",",
"iMax",
")",
")",
";... | Add to the scaled component of the specified time instant,
wrapping around within that component if necessary.
@param instant the time instant in millis to update.
@param amount the amount of scaled units to add (can be negative).
@return the updated time instant. | [
"Add",
"to",
"the",
"scaled",
"component",
"of",
"the",
"specified",
"time",
"instant",
"wrapping",
"around",
"within",
"that",
"component",
"if",
"necessary",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/DividedDateTimeField.java#L181-L183 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/IntegralImageOps.java | IntegralImageOps.convolveSparse | public static long convolveSparse(GrayS64 integral , IntegralKernel kernel , int x , int y ) {
"""
Convolves a kernel around a single point in the integral image.
@param integral Input integral image. Not modified.
@param kernel Convolution kernel.
@param x Pixel the convolution is performed at.
@param y Pix... | java | public static long convolveSparse(GrayS64 integral , IntegralKernel kernel , int x , int y )
{
return ImplIntegralImageOps.convolveSparse(integral,kernel,x,y);
} | [
"public",
"static",
"long",
"convolveSparse",
"(",
"GrayS64",
"integral",
",",
"IntegralKernel",
"kernel",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"return",
"ImplIntegralImageOps",
".",
"convolveSparse",
"(",
"integral",
",",
"kernel",
",",
"x",
",",
"y"... | Convolves a kernel around a single point in the integral image.
@param integral Input integral image. Not modified.
@param kernel Convolution kernel.
@param x Pixel the convolution is performed at.
@param y Pixel the convolution is performed at.
@return Value of the convolution | [
"Convolves",
"a",
"kernel",
"around",
"a",
"single",
"point",
"in",
"the",
"integral",
"image",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/IntegralImageOps.java#L354-L357 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Input.java | Input.considerDoubleClick | public void considerDoubleClick(int button, int x, int y) {
"""
Notification that the mouse has been pressed and hence we
should consider what we're doing with double clicking
@param button The button pressed/released
@param x The location of the mouse
@param y The location of the mouse
"""
if (double... | java | public void considerDoubleClick(int button, int x, int y) {
if (doubleClickTimeout == 0) {
clickX = x;
clickY = y;
clickButton = button;
doubleClickTimeout = System.currentTimeMillis() + doubleClickDelay;
fireMouseClicked(button, x, y, 1);
} else {
if (clickButton == button) {
if ((Sy... | [
"public",
"void",
"considerDoubleClick",
"(",
"int",
"button",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"if",
"(",
"doubleClickTimeout",
"==",
"0",
")",
"{",
"clickX",
"=",
"x",
";",
"clickY",
"=",
"y",
";",
"clickButton",
"=",
"button",
";",
"dou... | Notification that the mouse has been pressed and hence we
should consider what we're doing with double clicking
@param button The button pressed/released
@param x The location of the mouse
@param y The location of the mouse | [
"Notification",
"that",
"the",
"mouse",
"has",
"been",
"pressed",
"and",
"hence",
"we",
"should",
"consider",
"what",
"we",
"re",
"doing",
"with",
"double",
"clicking"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Input.java#L1107-L1122 |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java | AptUtils.getElementValueClassName | public static Name getElementValueClassName(AnnotationMirror anno, CharSequence name, boolean useDefaults) {
"""
Get the Name of the class that is referenced by attribute 'name'.
This is a convenience method for the most common use-case.
Like getElementValue(anno, name, ClassType.class).getQualifiedName(), but
... | java | public static Name getElementValueClassName(AnnotationMirror anno, CharSequence name, boolean useDefaults) {
Type.ClassType ct = getElementValue(anno, name, Type.ClassType.class, useDefaults);
// TODO: Is it a problem that this returns the type parameters too? Should I cut them off?
return ct.... | [
"public",
"static",
"Name",
"getElementValueClassName",
"(",
"AnnotationMirror",
"anno",
",",
"CharSequence",
"name",
",",
"boolean",
"useDefaults",
")",
"{",
"Type",
".",
"ClassType",
"ct",
"=",
"getElementValue",
"(",
"anno",
",",
"name",
",",
"Type",
".",
"... | Get the Name of the class that is referenced by attribute 'name'.
This is a convenience method for the most common use-case.
Like getElementValue(anno, name, ClassType.class).getQualifiedName(), but
this method ensures consistent use of the qualified name. | [
"Get",
"the",
"Name",
"of",
"the",
"class",
"that",
"is",
"referenced",
"by",
"attribute",
"name",
".",
"This",
"is",
"a",
"convenience",
"method",
"for",
"the",
"most",
"common",
"use",
"-",
"case",
".",
"Like",
"getElementValue",
"(",
"anno",
"name",
"... | train | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/apt/AptUtils.java#L297-L301 |
apache/incubator-gobblin | gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/reporter/FileFailureEventReporter.java | FileFailureEventReporter.setupOutputStream | private void setupOutputStream() {
"""
Set up the {@link OutputStream} to the {@link #failureLogFile} only once
"""
synchronized (failureLogFile) {
// Setup is done by some thread
if (hasSetupOutputStream) {
return;
}
try {
boolean append = false;
if (fs.exi... | java | private void setupOutputStream() {
synchronized (failureLogFile) {
// Setup is done by some thread
if (hasSetupOutputStream) {
return;
}
try {
boolean append = false;
if (fs.exists(failureLogFile)) {
log.info("Failure log file %s already exists, appending t... | [
"private",
"void",
"setupOutputStream",
"(",
")",
"{",
"synchronized",
"(",
"failureLogFile",
")",
"{",
"// Setup is done by some thread",
"if",
"(",
"hasSetupOutputStream",
")",
"{",
"return",
";",
"}",
"try",
"{",
"boolean",
"append",
"=",
"false",
";",
"if",
... | Set up the {@link OutputStream} to the {@link #failureLogFile} only once | [
"Set",
"up",
"the",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/reporter/FileFailureEventReporter.java#L72-L93 |
apache/incubator-gobblin | gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/orc/HiveOrcSerDeManager.java | HiveOrcSerDeManager.isORC | private static boolean isORC(Path file, FileSystem fs)
throws IOException {
"""
Determine if a file is ORC format.
Steal ideas & code from presto/OrcReader under Apache License 2.0.
"""
try {
FSDataInputStream inputStream = fs.open(file);
long size = fs.getFileStatus(file).getLen();
... | java | private static boolean isORC(Path file, FileSystem fs)
throws IOException {
try {
FSDataInputStream inputStream = fs.open(file);
long size = fs.getFileStatus(file).getLen();
byte[] buffer = new byte[Math.toIntExact(Math.min(size, EXPECTED_FOOTER_SIZE))];
if (size < buffer.length) {
... | [
"private",
"static",
"boolean",
"isORC",
"(",
"Path",
"file",
",",
"FileSystem",
"fs",
")",
"throws",
"IOException",
"{",
"try",
"{",
"FSDataInputStream",
"inputStream",
"=",
"fs",
".",
"open",
"(",
"file",
")",
";",
"long",
"size",
"=",
"fs",
".",
"getF... | Determine if a file is ORC format.
Steal ideas & code from presto/OrcReader under Apache License 2.0. | [
"Determine",
"if",
"a",
"file",
"is",
"ORC",
"format",
".",
"Steal",
"ideas",
"&",
"code",
"from",
"presto",
"/",
"OrcReader",
"under",
"Apache",
"License",
"2",
".",
"0",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/orc/HiveOrcSerDeManager.java#L203-L238 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/MapModel.java | MapModel.getGeometryFactory | public GeometryFactory getGeometryFactory() {
"""
Return a factory for geometries that is suited perfectly for geometries within this model. The SRID and precision
will for the factory will be correct.
@return geometry factory
"""
if (null == geometryFactory) {
if (0 == srid) {
throw new IllegalAr... | java | public GeometryFactory getGeometryFactory() {
if (null == geometryFactory) {
if (0 == srid) {
throw new IllegalArgumentException("srid needs to be set on MapModel to obtain GeometryFactory");
}
geometryFactory = new GeometryFactory(srid, -1); // @todo precision is not yet implemented
}
return geometr... | [
"public",
"GeometryFactory",
"getGeometryFactory",
"(",
")",
"{",
"if",
"(",
"null",
"==",
"geometryFactory",
")",
"{",
"if",
"(",
"0",
"==",
"srid",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"srid needs to be set on MapModel to obtain GeometryFacto... | Return a factory for geometries that is suited perfectly for geometries within this model. The SRID and precision
will for the factory will be correct.
@return geometry factory | [
"Return",
"a",
"factory",
"for",
"geometries",
"that",
"is",
"suited",
"perfectly",
"for",
"geometries",
"within",
"this",
"model",
".",
"The",
"SRID",
"and",
"precision",
"will",
"for",
"the",
"factory",
"will",
"be",
"correct",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/MapModel.java#L1035-L1043 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/CommitsApi.java | CommitsApi.getCommit | public Commit getCommit(Object projectIdOrPath, String sha) throws GitLabApiException {
"""
Get a specific commit identified by the commit hash or name of a branch or tag.
<pre><code>GitLab Endpoint: GET /projects/:id/repository/commits/:sha</code></pre>
@param projectIdOrPath the project in the form of an I... | java | public Commit getCommit(Object projectIdOrPath, String sha) throws GitLabApiException {
Response response = get(Response.Status.OK, getDefaultPerPageParam(), "projects", getProjectIdOrPath(projectIdOrPath), "repository", "commits", urlEncode(sha));
return (response.readEntity(Commit.class));
} | [
"public",
"Commit",
"getCommit",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"sha",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"getDefaultPerPageParam",
"(",
")",
",",
"\"p... | Get a specific commit identified by the commit hash or name of a branch or tag.
<pre><code>GitLab Endpoint: GET /projects/:id/repository/commits/:sha</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param sha a commit hash or name of a branch or tag
@re... | [
"Get",
"a",
"specific",
"commit",
"identified",
"by",
"the",
"commit",
"hash",
"or",
"name",
"of",
"a",
"branch",
"or",
"tag",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/CommitsApi.java#L264-L267 |
threerings/narya | core/src/main/java/com/threerings/presents/dobj/DObject.java | DObject.requestElementUpdate | protected void requestElementUpdate (
String name, int index, Object value, Object oldValue, Transport transport) {
"""
Called by derived instances when an element updater method was called.
"""
// dispatch an attribute changed event
postEvent(new ElementUpdatedEvent(_oid, name, value, ... | java | protected void requestElementUpdate (
String name, int index, Object value, Object oldValue, Transport transport)
{
// dispatch an attribute changed event
postEvent(new ElementUpdatedEvent(_oid, name, value, index).
setOldValue(oldValue).setTransport(transport));
} | [
"protected",
"void",
"requestElementUpdate",
"(",
"String",
"name",
",",
"int",
"index",
",",
"Object",
"value",
",",
"Object",
"oldValue",
",",
"Transport",
"transport",
")",
"{",
"// dispatch an attribute changed event",
"postEvent",
"(",
"new",
"ElementUpdatedEvent... | Called by derived instances when an element updater method was called. | [
"Called",
"by",
"derived",
"instances",
"when",
"an",
"element",
"updater",
"method",
"was",
"called",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L840-L846 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.createHash | public static String createHash(final InputStream inputStream, final String algorithm) {
"""
Creates a HEX encoded hash from a stream.
@param inputStream
Stream to create a hash for - Cannot be <code>null</code>.
@param algorithm
Hash algorithm like "MD5" or "SHA" - Cannot be <code>null</code>.
@return HE... | java | public static String createHash(final InputStream inputStream, final String algorithm) {
checkNotNull("inputStream", inputStream);
checkNotNull("algorithm", algorithm);
try {
final MessageDigest messageDigest = MessageDigest.getInstance(algorithm);
try (final Buffere... | [
"public",
"static",
"String",
"createHash",
"(",
"final",
"InputStream",
"inputStream",
",",
"final",
"String",
"algorithm",
")",
"{",
"checkNotNull",
"(",
"\"inputStream\"",
",",
"inputStream",
")",
";",
"checkNotNull",
"(",
"\"algorithm\"",
",",
"algorithm",
")"... | Creates a HEX encoded hash from a stream.
@param inputStream
Stream to create a hash for - Cannot be <code>null</code>.
@param algorithm
Hash algorithm like "MD5" or "SHA" - Cannot be <code>null</code>.
@return HEX encoded hash. | [
"Creates",
"a",
"HEX",
"encoded",
"hash",
"from",
"a",
"stream",
"."
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L346-L362 |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java | UtilImageIO.loadPGM | public static BufferedImage loadPGM( String fileName , BufferedImage storage ) throws IOException {
"""
Loads a PGM image from a file.
@param fileName Location of PGM image
@param storage (Optional) Storage for output image. Must be the width and height of the image being read.
Better performance of type Buf... | java | public static BufferedImage loadPGM( String fileName , BufferedImage storage ) throws IOException {
return loadPGM(new FileInputStream(fileName), storage);
} | [
"public",
"static",
"BufferedImage",
"loadPGM",
"(",
"String",
"fileName",
",",
"BufferedImage",
"storage",
")",
"throws",
"IOException",
"{",
"return",
"loadPGM",
"(",
"new",
"FileInputStream",
"(",
"fileName",
")",
",",
"storage",
")",
";",
"}"
] | Loads a PGM image from a file.
@param fileName Location of PGM image
@param storage (Optional) Storage for output image. Must be the width and height of the image being read.
Better performance of type BufferedImage.TYPE_BYTE_GRAY. If null or width/height incorrect a new image
will be declared.
@return The image
@th... | [
"Loads",
"a",
"PGM",
"image",
"from",
"a",
"file",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java#L217-L219 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsSessionImpl.java | JmsSessionImpl.instantiateProducer | JmsMsgProducer instantiateProducer(Destination jmsDestination) throws JMSException {
"""
This method is overriden by subclasses in order to instantiate an instance
of the MsgProducer class. This means that the QueueSession.createSender
method can delegate straight to Session.createProducer, and still get back
a... | java | JmsMsgProducer instantiateProducer(Destination jmsDestination) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "instantiateProducer", jmsDestination);
JmsMsgProducer messageProducer = new JmsMsgProducerImpl(jmsDestination, coreConn... | [
"JmsMsgProducer",
"instantiateProducer",
"(",
"Destination",
"jmsDestination",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"t... | This method is overriden by subclasses in order to instantiate an instance
of the MsgProducer class. This means that the QueueSession.createSender
method can delegate straight to Session.createProducer, and still get back
an instance of a QueueSender, rather than a vanilla MessageProducer.
Note, since this method is o... | [
"This",
"method",
"is",
"overriden",
"by",
"subclasses",
"in",
"order",
"to",
"instantiate",
"an",
"instance",
"of",
"the",
"MsgProducer",
"class",
".",
"This",
"means",
"that",
"the",
"QueueSession",
".",
"createSender",
"method",
"can",
"delegate",
"straight",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsSessionImpl.java#L1642-L1649 |
jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/print/PaperPrint.java | PaperPrint.printFooter | protected void printFooter(Graphics2D g2d, String footerText) {
"""
Print the page footer.
@param g2d The graphics environment.
@param footerText The text to print in the footer.
"""
FontMetrics fm = g2d.getFontMetrics();
int stringWidth = fm.stringWidth(footerText);
int textX = (page... | java | protected void printFooter(Graphics2D g2d, String footerText)
{
FontMetrics fm = g2d.getFontMetrics();
int stringWidth = fm.stringWidth(footerText);
int textX = (pageRect.width - stringWidth) / 2 + pageRect.x;
int textY = pageRect.y + pageRect.height - BORDER;
g2d.drawString(... | [
"protected",
"void",
"printFooter",
"(",
"Graphics2D",
"g2d",
",",
"String",
"footerText",
")",
"{",
"FontMetrics",
"fm",
"=",
"g2d",
".",
"getFontMetrics",
"(",
")",
";",
"int",
"stringWidth",
"=",
"fm",
".",
"stringWidth",
"(",
"footerText",
")",
";",
"i... | Print the page footer.
@param g2d The graphics environment.
@param footerText The text to print in the footer. | [
"Print",
"the",
"page",
"footer",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/print/PaperPrint.java#L146-L153 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.getGregorianEpochDay | private static long getGregorianEpochDay(int prolepticYear, int monthOfYear, int dayOfMonth) {
"""
Return Gregorian epoch day from Hijrah year, month, and day.
@param prolepticYear the year to represent, caller calculated
@param monthOfYear the month-of-year to represent, caller calculated
@param dayOfMonth... | java | private static long getGregorianEpochDay(int prolepticYear, int monthOfYear, int dayOfMonth) {
long day = yearToGregorianEpochDay(prolepticYear);
day += getMonthDays(monthOfYear - 1, prolepticYear);
day += dayOfMonth;
return day;
} | [
"private",
"static",
"long",
"getGregorianEpochDay",
"(",
"int",
"prolepticYear",
",",
"int",
"monthOfYear",
",",
"int",
"dayOfMonth",
")",
"{",
"long",
"day",
"=",
"yearToGregorianEpochDay",
"(",
"prolepticYear",
")",
";",
"day",
"+=",
"getMonthDays",
"(",
"mon... | Return Gregorian epoch day from Hijrah year, month, and day.
@param prolepticYear the year to represent, caller calculated
@param monthOfYear the month-of-year to represent, caller calculated
@param dayOfMonth the day-of-month to represent, caller calculated
@return a julian day | [
"Return",
"Gregorian",
"epoch",
"day",
"from",
"Hijrah",
"year",
"month",
"and",
"day",
"."
] | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L851-L856 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/tree/TreeInfo.java | TreeInfo.finalizerPos | public static int finalizerPos(JCTree tree, PosKind posKind) {
"""
The position of the finalizer of given try/synchronized statement.
"""
if (tree.hasTag(TRY)) {
JCTry t = (JCTry) tree;
Assert.checkNonNull(t.finalizer);
return posKind.toPos(t.finalizer);
} el... | java | public static int finalizerPos(JCTree tree, PosKind posKind) {
if (tree.hasTag(TRY)) {
JCTry t = (JCTry) tree;
Assert.checkNonNull(t.finalizer);
return posKind.toPos(t.finalizer);
} else if (tree.hasTag(SYNCHRONIZED)) {
return endPos(((JCSynchronized) tree... | [
"public",
"static",
"int",
"finalizerPos",
"(",
"JCTree",
"tree",
",",
"PosKind",
"posKind",
")",
"{",
"if",
"(",
"tree",
".",
"hasTag",
"(",
"TRY",
")",
")",
"{",
"JCTry",
"t",
"=",
"(",
"JCTry",
")",
"tree",
";",
"Assert",
".",
"checkNonNull",
"(",... | The position of the finalizer of given try/synchronized statement. | [
"The",
"position",
"of",
"the",
"finalizer",
"of",
"given",
"try",
"/",
"synchronized",
"statement",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java#L625-L635 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/FilterListSlowStr.java | FilterListSlowStr.findInList | private boolean findInList(String[] address, int index, FilterCellSlowStr cell, int endIndex) {
"""
Determine, recursively, if an address is in the address tree.
@param address
address to look for as a string array.
The 0th index of the array is the rightmost substring of
the string and so on. Each substring... | java | private boolean findInList(String[] address, int index, FilterCellSlowStr cell, int endIndex) {
if (cell.getWildcardCell() != null) {
// a wildcard, match found
return true;
}
// no wildcard so far, see if there is a still a path
FilterCellSlowStr nextCell = cell... | [
"private",
"boolean",
"findInList",
"(",
"String",
"[",
"]",
"address",
",",
"int",
"index",
",",
"FilterCellSlowStr",
"cell",
",",
"int",
"endIndex",
")",
"{",
"if",
"(",
"cell",
".",
"getWildcardCell",
"(",
")",
"!=",
"null",
")",
"{",
"// a wildcard, ma... | Determine, recursively, if an address is in the address tree.
@param address
address to look for as a string array.
The 0th index of the array is the rightmost substring of
the string and so on. Each substring is the chars between
two periods (".") in a URL address.
@param index
the next index in the address array to ... | [
"Determine",
"recursively",
"if",
"an",
"address",
"is",
"in",
"the",
"address",
"tree",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/FilterListSlowStr.java#L191-L210 |
VoltDB/voltdb | src/frontend/org/voltdb/RestoreAgent.java | RestoreAgent.sendLocalRestoreInformation | private void sendLocalRestoreInformation(Long max, Set<SnapshotInfo> snapshots) {
"""
Send the information about the local snapshot files to the other hosts to
generate restore plan.
@param max
The maximum txnId of the last txn across all initiators in the
local command log.
@param snapshots
The informatio... | java | private void sendLocalRestoreInformation(Long max, Set<SnapshotInfo> snapshots) {
String jsonData = serializeRestoreInformation(max, snapshots);
String zkNode = VoltZK.restore + "/" + m_hostId;
try {
m_zk.create(zkNode, jsonData.getBytes(StandardCharsets.UTF_8),
... | [
"private",
"void",
"sendLocalRestoreInformation",
"(",
"Long",
"max",
",",
"Set",
"<",
"SnapshotInfo",
">",
"snapshots",
")",
"{",
"String",
"jsonData",
"=",
"serializeRestoreInformation",
"(",
"max",
",",
"snapshots",
")",
";",
"String",
"zkNode",
"=",
"VoltZK"... | Send the information about the local snapshot files to the other hosts to
generate restore plan.
@param max
The maximum txnId of the last txn across all initiators in the
local command log.
@param snapshots
The information of the local snapshot files. | [
"Send",
"the",
"information",
"about",
"the",
"local",
"snapshot",
"files",
"to",
"the",
"other",
"hosts",
"to",
"generate",
"restore",
"plan",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/RestoreAgent.java#L987-L997 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/breadcrumbs/BreadcrumbsRenderer.java | BreadcrumbsRenderer.encodeBegin | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
"""
This methods generates the HTML code of the current b:breadcrumbs. <code>encodeBegin</code> generates the
start of the component. After the, the JSF framework calls <code>encodeChildren()</code> to generate th... | java | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
if (!component.isRendered()) {
return;
}
Breadcrumbs breadcrumbs = (Breadcrumbs) component;
ResponseWriter rw = context.getResponseWriter();
String clientId = breadcrumbs.getClientId();
rw.startElement("... | [
"@",
"Override",
"public",
"void",
"encodeBegin",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"component",
".",
"isRendered",
"(",
")",
")",
"{",
"return",
";",
"}",
"Breadcrumbs",
"brea... | This methods generates the HTML code of the current b:breadcrumbs. <code>encodeBegin</code> generates the
start of the component. After the, the JSF framework calls <code>encodeChildren()</code> to generate the HTML
code between the beginning and the end of the component. For instance, in the case of a panel component ... | [
"This",
"methods",
"generates",
"the",
"HTML",
"code",
"of",
"the",
"current",
"b",
":",
"breadcrumbs",
".",
"<code",
">",
"encodeBegin<",
"/",
"code",
">",
"generates",
"the",
"start",
"of",
"the",
"component",
".",
"After",
"the",
"the",
"JSF",
"framewor... | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/breadcrumbs/BreadcrumbsRenderer.java#L45-L78 |
headius/invokebinder | src/main/java/com/headius/invokebinder/SmartBinder.java | SmartBinder.filterReturn | public SmartBinder filterReturn(MethodHandle filter) {
"""
Use the given filter function to transform the return value at this
point in the binder. The filter will be inserted into the handle, and
return values will pass through it before continuing.
The filter's argument must match the expected return value ... | java | public SmartBinder filterReturn(MethodHandle filter) {
return new SmartBinder(this, signature().changeReturn(filter.type().returnType()), binder.filterReturn(filter));
} | [
"public",
"SmartBinder",
"filterReturn",
"(",
"MethodHandle",
"filter",
")",
"{",
"return",
"new",
"SmartBinder",
"(",
"this",
",",
"signature",
"(",
")",
".",
"changeReturn",
"(",
"filter",
".",
"type",
"(",
")",
".",
"returnType",
"(",
")",
")",
",",
"... | Use the given filter function to transform the return value at this
point in the binder. The filter will be inserted into the handle, and
return values will pass through it before continuing.
The filter's argument must match the expected return value downstream
from this point in the binder, and the return value must ... | [
"Use",
"the",
"given",
"filter",
"function",
"to",
"transform",
"the",
"return",
"value",
"at",
"this",
"point",
"in",
"the",
"binder",
".",
"The",
"filter",
"will",
"be",
"inserted",
"into",
"the",
"handle",
"and",
"return",
"values",
"will",
"pass",
"thr... | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L945-L947 |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.getHitObjects | protected void getHitObjects (DirtyItemList list, int x, int y) {
"""
Adds to the supplied dirty item list, all of the object tiles that are hit by the specified
point (meaning the point is contained within their bounds and intersects a non-transparent
pixel in the actual object image.
"""
for (Scene... | java | protected void getHitObjects (DirtyItemList list, int x, int y)
{
for (SceneObject scobj : _vizobjs) {
Rectangle pbounds = scobj.bounds;
if (!pbounds.contains(x, y)) {
continue;
}
// see if we should skip it
if (skipHitObject(scobj... | [
"protected",
"void",
"getHitObjects",
"(",
"DirtyItemList",
"list",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"for",
"(",
"SceneObject",
"scobj",
":",
"_vizobjs",
")",
"{",
"Rectangle",
"pbounds",
"=",
"scobj",
".",
"bounds",
";",
"if",
"(",
"!",
"pb... | Adds to the supplied dirty item list, all of the object tiles that are hit by the specified
point (meaning the point is contained within their bounds and intersects a non-transparent
pixel in the actual object image. | [
"Adds",
"to",
"the",
"supplied",
"dirty",
"item",
"list",
"all",
"of",
"the",
"object",
"tiles",
"that",
"are",
"hit",
"by",
"the",
"specified",
"point",
"(",
"meaning",
"the",
"point",
"is",
"contained",
"within",
"their",
"bounds",
"and",
"intersects",
"... | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L1155-L1176 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java | FileSystemView.checkNotAncestor | private void checkNotAncestor(File source, Directory destParent, FileSystemView destView)
throws IOException {
"""
Checks that source is not an ancestor of dest, throwing an exception if it is.
"""
// if dest is not in the same file system, it couldn't be in source's subdirectories
if (!isSameFil... | java | private void checkNotAncestor(File source, Directory destParent, FileSystemView destView)
throws IOException {
// if dest is not in the same file system, it couldn't be in source's subdirectories
if (!isSameFileSystem(destView)) {
return;
}
Directory current = destParent;
while (true) {... | [
"private",
"void",
"checkNotAncestor",
"(",
"File",
"source",
",",
"Directory",
"destParent",
",",
"FileSystemView",
"destView",
")",
"throws",
"IOException",
"{",
"// if dest is not in the same file system, it couldn't be in source's subdirectories",
"if",
"(",
"!",
"isSameF... | Checks that source is not an ancestor of dest, throwing an exception if it is. | [
"Checks",
"that",
"source",
"is",
"not",
"an",
"ancestor",
"of",
"dest",
"throwing",
"an",
"exception",
"if",
"it",
"is",
"."
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L640-L660 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/SeleniumSpec.java | SeleniumSpec.elementSelect | @When("^I select '(.+?)' on the element on index '(\\d+?)'$")
public void elementSelect(String option, Integer index) {
"""
Choose an @{code option} from a select webelement found previously
@param option
@param index
"""
Select sel = null;
sel = new Select(commonspec.getPreviousWebElem... | java | @When("^I select '(.+?)' on the element on index '(\\d+?)'$")
public void elementSelect(String option, Integer index) {
Select sel = null;
sel = new Select(commonspec.getPreviousWebElements().getPreviousWebElements().get(index));
sel.selectByVisibleText(option);
} | [
"@",
"When",
"(",
"\"^I select '(.+?)' on the element on index '(\\\\d+?)'$\"",
")",
"public",
"void",
"elementSelect",
"(",
"String",
"option",
",",
"Integer",
"index",
")",
"{",
"Select",
"sel",
"=",
"null",
";",
"sel",
"=",
"new",
"Select",
"(",
"commonspec",
... | Choose an @{code option} from a select webelement found previously
@param option
@param index | [
"Choose",
"an",
"@",
"{",
"code",
"option",
"}",
"from",
"a",
"select",
"webelement",
"found",
"previously"
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/SeleniumSpec.java#L354-L360 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.constructPseudoDurableDestName | public String constructPseudoDurableDestName(String meUUID, String durableName) {
"""
Creates the pseudo destination name string for remote durable
subscriptions.
The case when the the DME is remote to this ME.
@param meUUID the durable home ME uuid
@param subName the durable sub name
@return a string of th... | java | public String constructPseudoDurableDestName(String meUUID, String durableName)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "constructPseudoDurableDestName", new Object[] { meUUID, durableName });
String returnString = meUUID + "##" + durableName;
... | [
"public",
"String",
"constructPseudoDurableDestName",
"(",
"String",
"meUUID",
",",
"String",
"durableName",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"... | Creates the pseudo destination name string for remote durable
subscriptions.
The case when the the DME is remote to this ME.
@param meUUID the durable home ME uuid
@param subName the durable sub name
@return a string of the form "localME##subName" | [
"Creates",
"the",
"pseudo",
"destination",
"name",
"string",
"for",
"remote",
"durable",
"subscriptions",
".",
"The",
"case",
"when",
"the",
"the",
"DME",
"is",
"remote",
"to",
"this",
"ME",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L3384-L3392 |
Impetus/Kundera | src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDbDBClientProperties.java | CouchDbDBClientProperties.populateClientProperties | public void populateClientProperties(Client client, Map<String, Object> properties) {
"""
Populate client properties.
@param client
the client
@param properties
the properties
"""
this.couchDBClient = (CouchDBClient) client;
if (properties != null)
{
for (String key :... | java | public void populateClientProperties(Client client, Map<String, Object> properties)
{
this.couchDBClient = (CouchDBClient) client;
if (properties != null)
{
for (String key : properties.keySet())
{
Object value = properties.get(key);
i... | [
"public",
"void",
"populateClientProperties",
"(",
"Client",
"client",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"this",
".",
"couchDBClient",
"=",
"(",
"CouchDBClient",
")",
"client",
";",
"if",
"(",
"properties",
"!=",
"null",
... | Populate client properties.
@param client
the client
@param properties
the properties | [
"Populate",
"client",
"properties",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDbDBClientProperties.java#L49-L68 |
morimekta/utils | io-util/src/main/java/net/morimekta/util/io/IOUtils.java | IOUtils.skipUntil | public static boolean skipUntil(Reader in, String separator) throws IOException {
"""
Skip all bytes in stream until (and including) given separator is found.
@param in Input stream to read from.
@param separator Separator bytes to skip until.
@return True iff the separator was encountered.
@throws IOExcepti... | java | public static boolean skipUntil(Reader in, String separator) throws IOException {
if (separator == null) {
throw new NullPointerException("Null separator given");
}
final int len = separator.length();
if(len > 0) {
if(len == 1) { return skipUntil(in, separator.cha... | [
"public",
"static",
"boolean",
"skipUntil",
"(",
"Reader",
"in",
",",
"String",
"separator",
")",
"throws",
"IOException",
"{",
"if",
"(",
"separator",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Null separator given\"",
")",
";",
"... | Skip all bytes in stream until (and including) given separator is found.
@param in Input stream to read from.
@param separator Separator bytes to skip until.
@return True iff the separator was encountered.
@throws IOException if unable to read from stream. | [
"Skip",
"all",
"bytes",
"in",
"stream",
"until",
"(",
"and",
"including",
")",
"given",
"separator",
"is",
"found",
"."
] | train | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/io-util/src/main/java/net/morimekta/util/io/IOUtils.java#L81-L91 |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPBase.java | MPBase.getStandardHeaders | private static Collection<Header> getStandardHeaders() {
"""
Returns standard headers for all the requests
@return a collection with headers objects
"""
Collection<Header> colHeaders = new Vector<Header>();
colHeaders.add(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
... | java | private static Collection<Header> getStandardHeaders() {
Collection<Header> colHeaders = new Vector<Header>();
colHeaders.add(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
colHeaders.add(new BasicHeader(HTTP.USER_AGENT, "MercadoPago Java SDK/1.0.10"));
colHeaders.add(new Basic... | [
"private",
"static",
"Collection",
"<",
"Header",
">",
"getStandardHeaders",
"(",
")",
"{",
"Collection",
"<",
"Header",
">",
"colHeaders",
"=",
"new",
"Vector",
"<",
"Header",
">",
"(",
")",
";",
"colHeaders",
".",
"add",
"(",
"new",
"BasicHeader",
"(",
... | Returns standard headers for all the requests
@return a collection with headers objects | [
"Returns",
"standard",
"headers",
"for",
"all",
"the",
"requests"
] | train | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPBase.java#L435-L441 |
Hygieia/Hygieia | collectors/scm/github/src/main/java/com/capitalone/dashboard/collector/DefaultGitHubClient.java | DefaultGitHubClient.getComments | public List<Comment> getComments(String commentsUrl, GitHubRepo repo) throws RestClientException {
"""
Get comments from the given comment url
@param commentsUrl
@param repo
@return
@throws RestClientException
"""
List<Comment> comments = new ArrayList<>();
// decrypt password
Str... | java | public List<Comment> getComments(String commentsUrl, GitHubRepo repo) throws RestClientException {
List<Comment> comments = new ArrayList<>();
// decrypt password
String decryptedPassword = decryptString(repo.getPassword(), settings.getKey());
String personalAccessToken = (String) rep... | [
"public",
"List",
"<",
"Comment",
">",
"getComments",
"(",
"String",
"commentsUrl",
",",
"GitHubRepo",
"repo",
")",
"throws",
"RestClientException",
"{",
"List",
"<",
"Comment",
">",
"comments",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"// decrypt passwor... | Get comments from the given comment url
@param commentsUrl
@param repo
@return
@throws RestClientException | [
"Get",
"comments",
"from",
"the",
"given",
"comment",
"url"
] | train | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/scm/github/src/main/java/com/capitalone/dashboard/collector/DefaultGitHubClient.java#L381-L421 |
mgormley/prim | src/main/java_generated/edu/jhu/prim/map/IntDoubleHashMap.java | IntDoubleHashMap.contains | private boolean contains(final int key, final int index) {
"""
Check if the tables contain an element associated with specified key
at specified index.
@param key key to check
@param index index to check
@return true if an element is associated with key at index
"""
return (key != 0 || states[index... | java | private boolean contains(final int key, final int index) {
return (key != 0 || states[index] == FULL) && keys[index] == key;
} | [
"private",
"boolean",
"contains",
"(",
"final",
"int",
"key",
",",
"final",
"int",
"index",
")",
"{",
"return",
"(",
"key",
"!=",
"0",
"||",
"states",
"[",
"index",
"]",
"==",
"FULL",
")",
"&&",
"keys",
"[",
"index",
"]",
"==",
"key",
";",
"}"
] | Check if the tables contain an element associated with specified key
at specified index.
@param key key to check
@param index index to check
@return true if an element is associated with key at index | [
"Check",
"if",
"the",
"tables",
"contain",
"an",
"element",
"associated",
"with",
"specified",
"key",
"at",
"specified",
"index",
"."
] | train | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java_generated/edu/jhu/prim/map/IntDoubleHashMap.java#L423-L425 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java | BugInstance.addSourceLine | @Nonnull
public BugInstance addSourceLine(MethodDescriptor methodDescriptor, Location location) {
"""
Add source line annotation for given Location in a method.
@param methodDescriptor
the method
@param location
the Location in the method
@return this BugInstance
"""
try {
IAnaly... | java | @Nonnull
public BugInstance addSourceLine(MethodDescriptor methodDescriptor, Location location) {
try {
IAnalysisCache analysisCache = Global.getAnalysisCache();
ClassContext classContext = analysisCache.getClassAnalysis(ClassContext.class, methodDescriptor.getClassDescriptor());
... | [
"@",
"Nonnull",
"public",
"BugInstance",
"addSourceLine",
"(",
"MethodDescriptor",
"methodDescriptor",
",",
"Location",
"location",
")",
"{",
"try",
"{",
"IAnalysisCache",
"analysisCache",
"=",
"Global",
".",
"getAnalysisCache",
"(",
")",
";",
"ClassContext",
"class... | Add source line annotation for given Location in a method.
@param methodDescriptor
the method
@param location
the Location in the method
@return this BugInstance | [
"Add",
"source",
"line",
"annotation",
"for",
"given",
"Location",
"in",
"a",
"method",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1723-L1734 |
bazaarvoice/emodb | event/src/main/java/com/bazaarvoice/emodb/event/dedup/DedupQueue.java | DedupQueue.peekOrPoll | private boolean peekOrPoll(@Nullable Duration claimTtl, EventSink rawSink) {
"""
Implements peek() or poll() based on whether claimTtl is null or non-null.
"""
// If dedup activity is disabled then we're in the process of falling back to regular non-dedup'd channels.
// Don't do anything that m... | java | private boolean peekOrPoll(@Nullable Duration claimTtl, EventSink rawSink) {
// If dedup activity is disabled then we're in the process of falling back to regular non-dedup'd channels.
// Don't do anything that might move events around--we're likely racing a call to moveToRawChannel().
if (!_ded... | [
"private",
"boolean",
"peekOrPoll",
"(",
"@",
"Nullable",
"Duration",
"claimTtl",
",",
"EventSink",
"rawSink",
")",
"{",
"// If dedup activity is disabled then we're in the process of falling back to regular non-dedup'd channels.",
"// Don't do anything that might move events around--we'... | Implements peek() or poll() based on whether claimTtl is null or non-null. | [
"Implements",
"peek",
"()",
"or",
"poll",
"()",
"based",
"on",
"whether",
"claimTtl",
"is",
"null",
"or",
"non",
"-",
"null",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/event/src/main/java/com/bazaarvoice/emodb/event/dedup/DedupQueue.java#L153-L210 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewayConnectionsInner.java | VirtualNetworkGatewayConnectionsInner.resetSharedKeyAsync | public Observable<ConnectionResetSharedKeyInner> resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) {
"""
The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway con... | java | public Observable<ConnectionResetSharedKeyInner> resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, int keyLength) {
return resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).map(new Func1<ServiceResponse<ConnectionRes... | [
"public",
"Observable",
"<",
"ConnectionResetSharedKeyInner",
">",
"resetSharedKeyAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayConnectionName",
",",
"int",
"keyLength",
")",
"{",
"return",
"resetSharedKeyWithServiceResponseAsync",
"(",
"res... | The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayConn... | [
"The",
"VirtualNetworkGatewayConnectionResetSharedKey",
"operation",
"resets",
"the",
"virtual",
"network",
"gateway",
"connection",
"shared",
"key",
"for",
"passed",
"virtual",
"network",
"gateway",
"connection",
"in",
"the",
"specified",
"resource",
"group",
"through",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewayConnectionsInner.java#L1250-L1257 |
jsonld-java/jsonld-java | core/src/main/java/com/github/jsonldjava/core/RDFDataset.java | RDFDataset.addQuad | public void addQuad(final String s, final String p, final String value, final String datatype,
final String language, String graph) {
"""
Adds a triple to the specified graph of this dataset
@param s
the subject for the triple
@param p
the predicate for the triple
@param value
the value of the ... | java | public void addQuad(final String s, final String p, final String value, final String datatype,
final String language, String graph) {
if (graph == null) {
graph = "@default";
}
if (!containsKey(graph)) {
put(graph, new ArrayList<Quad>());
}
((A... | [
"public",
"void",
"addQuad",
"(",
"final",
"String",
"s",
",",
"final",
"String",
"p",
",",
"final",
"String",
"value",
",",
"final",
"String",
"datatype",
",",
"final",
"String",
"language",
",",
"String",
"graph",
")",
"{",
"if",
"(",
"graph",
"==",
... | Adds a triple to the specified graph of this dataset
@param s
the subject for the triple
@param p
the predicate for the triple
@param value
the value of the literal object for the triple
@param datatype
the datatype of the literal object for the triple (null values
will default to xsd:string)
@param graph
the graph to... | [
"Adds",
"a",
"triple",
"to",
"the",
"specified",
"graph",
"of",
"this",
"dataset"
] | train | https://github.com/jsonld-java/jsonld-java/blob/efeef6ee96029a0011649633457035fa6be42da1/core/src/main/java/com/github/jsonldjava/core/RDFDataset.java#L495-L504 |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java | AbstractValidate.isNull | public <T> void isNull(final T object, final String message, final Object... values) {
"""
<p>Validate that the specified argument is {@code null}; otherwise throwing an exception with the specified message.
<pre>Validate.isNull(myObject, "The object must be null");</pre>
@param <T>
the object type
@param ob... | java | public <T> void isNull(final T object, final String message, final Object... values) {
if (object != null) {
fail(String.format(message, values));
}
} | [
"public",
"<",
"T",
">",
"void",
"isNull",
"(",
"final",
"T",
"object",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"values",
")",
"{",
"if",
"(",
"object",
"!=",
"null",
")",
"{",
"fail",
"(",
"String",
".",
"format",
"(",
"m... | <p>Validate that the specified argument is {@code null}; otherwise throwing an exception with the specified message.
<pre>Validate.isNull(myObject, "The object must be null");</pre>
@param <T>
the object type
@param object
the object to check
@param message
the {@link String#format(String, Object...)} exception messag... | [
"<p",
">",
"Validate",
"that",
"the",
"specified",
"argument",
"is",
"{",
"@code",
"null",
"}",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
"the",
"specified",
"message",
".",
"<pre",
">",
"Validate",
".",
"isNull",
"(",
"myObject",
"The",
"ob... | train | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java#L270-L274 |
forge/core | ui/impl/src/main/java/org/jboss/forge/addon/ui/impl/controller/WizardCommandControllerImpl.java | WizardCommandControllerImpl.refreshFlow | private synchronized void refreshFlow() {
"""
Refreshes the current flow so it's possible to eagerly fetch all the steps
"""
try
{
initialize();
}
catch (Exception e)
{
throw new IllegalStateException("Error while initializing wizard", e);
}
int curre... | java | private synchronized void refreshFlow()
{
try
{
initialize();
}
catch (Exception e)
{
throw new IllegalStateException("Error while initializing wizard", e);
}
int currentFlowPointer = this.flowPointer;
try
{
this.flowPointer = 0;
... | [
"private",
"synchronized",
"void",
"refreshFlow",
"(",
")",
"{",
"try",
"{",
"initialize",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Error while initializing wizard\"",
",",
"e",
")",
";",
... | Refreshes the current flow so it's possible to eagerly fetch all the steps | [
"Refreshes",
"the",
"current",
"flow",
"so",
"it",
"s",
"possible",
"to",
"eagerly",
"fetch",
"all",
"the",
"steps"
] | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/ui/impl/src/main/java/org/jboss/forge/addon/ui/impl/controller/WizardCommandControllerImpl.java#L92-L123 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsPreferences.java | CmsPreferences.buildSelectProject | public String buildSelectProject(String htmlAttributes) {
"""
Builds the html for the project select box of the start settings.<p>
@param htmlAttributes optional html attributes for the &lgt;select> tag
@return the html for the project select box
"""
SelectOptions selectOptions = getProjectSele... | java | public String buildSelectProject(String htmlAttributes) {
SelectOptions selectOptions = getProjectSelectOptions();
return buildSelect(htmlAttributes, selectOptions);
} | [
"public",
"String",
"buildSelectProject",
"(",
"String",
"htmlAttributes",
")",
"{",
"SelectOptions",
"selectOptions",
"=",
"getProjectSelectOptions",
"(",
")",
";",
"return",
"buildSelect",
"(",
"htmlAttributes",
",",
"selectOptions",
")",
";",
"}"
] | Builds the html for the project select box of the start settings.<p>
@param htmlAttributes optional html attributes for the &lgt;select> tag
@return the html for the project select box | [
"Builds",
"the",
"html",
"for",
"the",
"project",
"select",
"box",
"of",
"the",
"start",
"settings",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsPreferences.java#L797-L802 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/text/FieldPosition.java | FieldPosition.matchesField | private boolean matchesField(Format.Field attribute, int field) {
"""
Return true if the receiver wants a <code>Format.Field</code> value and
<code>attribute</code> is equal to it, or true if the receiver
represents an inteter constant and <code>field</code> equals it.
"""
if (this.attribute != null)... | java | private boolean matchesField(Format.Field attribute, int field) {
if (this.attribute != null) {
return this.attribute.equals(attribute);
}
return (field == this.field);
} | [
"private",
"boolean",
"matchesField",
"(",
"Format",
".",
"Field",
"attribute",
",",
"int",
"field",
")",
"{",
"if",
"(",
"this",
".",
"attribute",
"!=",
"null",
")",
"{",
"return",
"this",
".",
"attribute",
".",
"equals",
"(",
"attribute",
")",
";",
"... | Return true if the receiver wants a <code>Format.Field</code> value and
<code>attribute</code> is equal to it, or true if the receiver
represents an inteter constant and <code>field</code> equals it. | [
"Return",
"true",
"if",
"the",
"receiver",
"wants",
"a",
"<code",
">",
"Format",
".",
"Field<",
"/",
"code",
">",
"value",
"and",
"<code",
">",
"attribute<",
"/",
"code",
">",
"is",
"equal",
"to",
"it",
"or",
"true",
"if",
"the",
"receiver",
"represent... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/text/FieldPosition.java#L264-L269 |
MenoData/Time4J | base/src/main/java/net/time4j/range/TimestampInterval.java | TimestampInterval.streamPartitioned | public Stream<TimestampInterval> streamPartitioned(DayPartitionRule rule) {
"""
/*[deutsch]
<p>Erzeugt einen {@code Stream}, der jeden Tag dieses Intervalls entsprechend der angegebenen Regel
in einzelne Tagesabschnitte zerlegt. </p>
<p>Falls ein Tag dieses Intervalls nicht von Mitternacht zu Mitternacht reic... | java | public Stream<TimestampInterval> streamPartitioned(DayPartitionRule rule) {
TimestampInterval interval = this.toCanonical();
PlainTimestamp start = interval.getStartAsTimestamp();
PlainTimestamp end = interval.getEndAsTimestamp();
if ((start == null) || (end == null)) {
thr... | [
"public",
"Stream",
"<",
"TimestampInterval",
">",
"streamPartitioned",
"(",
"DayPartitionRule",
"rule",
")",
"{",
"TimestampInterval",
"interval",
"=",
"this",
".",
"toCanonical",
"(",
")",
";",
"PlainTimestamp",
"start",
"=",
"interval",
".",
"getStartAsTimestamp"... | /*[deutsch]
<p>Erzeugt einen {@code Stream}, der jeden Tag dieses Intervalls entsprechend der angegebenen Regel
in einzelne Tagesabschnitte zerlegt. </p>
<p>Falls ein Tag dieses Intervalls nicht von Mitternacht zu Mitternacht reicht (betrifft nur Start und Ende),
dann wird für einen solchen Tag eine gemeinsame Sc... | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Erzeugt",
"einen",
"{",
"@code",
"Stream",
"}",
"der",
"jeden",
"Tag",
"dieses",
"Intervalls",
"entsprechend",
"der",
"angegebenen",
"Regel",
"in",
"einzelne",
"Tagesabschnitte",
"zerlegt",
".",
"<",
"/",
"p",
">"... | train | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/range/TimestampInterval.java#L823-L856 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/dom3/DOM3TreeWalker.java | DOM3TreeWalker.serializeComment | protected void serializeComment(Comment node) throws SAXException {
"""
Serializes a Comment Node.
@param node The Comment Node to serialize
"""
// comments=true
if ((fFeatures & COMMENTS) != 0) {
String data = node.getData();
// well-formed=true
if ((fFe... | java | protected void serializeComment(Comment node) throws SAXException {
// comments=true
if ((fFeatures & COMMENTS) != 0) {
String data = node.getData();
// well-formed=true
if ((fFeatures & WELLFORMED) != 0) {
isCommentWellFormed(data);
}
... | [
"protected",
"void",
"serializeComment",
"(",
"Comment",
"node",
")",
"throws",
"SAXException",
"{",
"// comments=true",
"if",
"(",
"(",
"fFeatures",
"&",
"COMMENTS",
")",
"!=",
"0",
")",
"{",
"String",
"data",
"=",
"node",
".",
"getData",
"(",
")",
";",
... | Serializes a Comment Node.
@param node The Comment Node to serialize | [
"Serializes",
"a",
"Comment",
"Node",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/dom3/DOM3TreeWalker.java#L570-L590 |
pinterest/secor | src/main/java/com/pinterest/secor/common/FileRegistry.java | FileRegistry.getOrCreateWriter | public FileWriter getOrCreateWriter(LogFilePath path, CompressionCodec codec)
throws Exception {
"""
Retrieve a writer for a given path or create a new one if it does not exist.
@param path The path to retrieve writer for.
@param codec Optional compression codec.
@return Writer for a given path.
@t... | java | public FileWriter getOrCreateWriter(LogFilePath path, CompressionCodec codec)
throws Exception {
FileWriter writer = mWriters.get(path);
if (writer == null) {
// Just in case.
FileUtil.delete(path.getLogFilePath());
FileUtil.delete(path.getLogFileCrcPath()... | [
"public",
"FileWriter",
"getOrCreateWriter",
"(",
"LogFilePath",
"path",
",",
"CompressionCodec",
"codec",
")",
"throws",
"Exception",
"{",
"FileWriter",
"writer",
"=",
"mWriters",
".",
"get",
"(",
"path",
")",
";",
"if",
"(",
"writer",
"==",
"null",
")",
"{... | Retrieve a writer for a given path or create a new one if it does not exist.
@param path The path to retrieve writer for.
@param codec Optional compression codec.
@return Writer for a given path.
@throws Exception on error | [
"Retrieve",
"a",
"writer",
"for",
"a",
"given",
"path",
"or",
"create",
"a",
"new",
"one",
"if",
"it",
"does",
"not",
"exist",
"."
] | train | https://github.com/pinterest/secor/blob/4099ff061db392f11044e57dedf46c1617895278/src/main/java/com/pinterest/secor/common/FileRegistry.java#L118-L146 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.