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 |
|---|---|---|---|---|---|---|---|---|---|---|
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.sortGrantsByStartTime | private void sortGrantsByStartTime(List<ResourceGrant> grants) {
"""
Sort grants on granted time in descending order
@param grants the list of grants to sort
"""
Collections.sort(grants, new Comparator<ResourceGrant>() {
@Override
public int compare(ResourceGrant g1, ResourceGrant g2) {
... | java | private void sortGrantsByStartTime(List<ResourceGrant> grants) {
Collections.sort(grants, new Comparator<ResourceGrant>() {
@Override
public int compare(ResourceGrant g1, ResourceGrant g2) {
if (g1.grantedTime < g2.grantedTime) {
return 1;
}
if (g1.grantedTime > g2.gran... | [
"private",
"void",
"sortGrantsByStartTime",
"(",
"List",
"<",
"ResourceGrant",
">",
"grants",
")",
"{",
"Collections",
".",
"sort",
"(",
"grants",
",",
"new",
"Comparator",
"<",
"ResourceGrant",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"int",
"compare"... | Sort grants on granted time in descending order
@param grants the list of grants to sort | [
"Sort",
"grants",
"on",
"granted",
"time",
"in",
"descending",
"order"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L1253-L1266 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/Driver.java | Driver.makeConnection | private static Connection makeConnection(String url, Properties props) throws SQLException {
"""
Create a connection from URL and properties. Always does the connection work in the current
thread without enforcing a timeout, regardless of any timeout specified in the properties.
@param url the original URL
@p... | java | private static Connection makeConnection(String url, Properties props) throws SQLException {
return new PgConnection(hostSpecs(props), user(props), database(props), props, url);
} | [
"private",
"static",
"Connection",
"makeConnection",
"(",
"String",
"url",
",",
"Properties",
"props",
")",
"throws",
"SQLException",
"{",
"return",
"new",
"PgConnection",
"(",
"hostSpecs",
"(",
"props",
")",
",",
"user",
"(",
"props",
")",
",",
"database",
... | Create a connection from URL and properties. Always does the connection work in the current
thread without enforcing a timeout, regardless of any timeout specified in the properties.
@param url the original URL
@param props the parsed/defaulted connection properties
@return a new connection
@throws SQLException if the... | [
"Create",
"a",
"connection",
"from",
"URL",
"and",
"properties",
".",
"Always",
"does",
"the",
"connection",
"work",
"in",
"the",
"current",
"thread",
"without",
"enforcing",
"a",
"timeout",
"regardless",
"of",
"any",
"timeout",
"specified",
"in",
"the",
"prop... | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/Driver.java#L457-L459 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/Marshaller.java | Marshaller.marshalWithExplodedStrategy | private void marshalWithExplodedStrategy(EmbeddedMetadata embeddedMetadata, Object target) {
"""
Marshals an embedded field represented by the given metadata.
@param embeddedMetadata
the metadata of the embedded field
@param target
the target object to which the embedded object belongs
"""
try {
... | java | private void marshalWithExplodedStrategy(EmbeddedMetadata embeddedMetadata, Object target) {
try {
Object embeddedObject = initializeEmbedded(embeddedMetadata, target);
for (PropertyMetadata propertyMetadata : embeddedMetadata.getPropertyMetadataCollection()) {
marshalField(propertyMetadata, emb... | [
"private",
"void",
"marshalWithExplodedStrategy",
"(",
"EmbeddedMetadata",
"embeddedMetadata",
",",
"Object",
"target",
")",
"{",
"try",
"{",
"Object",
"embeddedObject",
"=",
"initializeEmbedded",
"(",
"embeddedMetadata",
",",
"target",
")",
";",
"for",
"(",
"Proper... | Marshals an embedded field represented by the given metadata.
@param embeddedMetadata
the metadata of the embedded field
@param target
the target object to which the embedded object belongs | [
"Marshals",
"an",
"embedded",
"field",
"represented",
"by",
"the",
"given",
"metadata",
"."
] | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/Marshaller.java#L497-L509 |
restfb/restfb | src/main/java/com/restfb/BaseFacebookClient.java | BaseFacebookClient.urlEncodedValueForParameterName | protected String urlEncodedValueForParameterName(String name, String value) {
"""
Gets the URL-encoded version of the given {@code value} for the parameter named {@code name}.
<p>
Includes special-case handling for access token parameters where we check if the token is already URL-encoded - if
so, we don't enco... | java | protected String urlEncodedValueForParameterName(String name, String value) {
// Special handling for access_token -
// '%7C' is the pipe character and will be present in any access_token
// parameter that's already URL-encoded. If we see this combination, don't
// URL-encode. Otherwise, URL-encode as n... | [
"protected",
"String",
"urlEncodedValueForParameterName",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"// Special handling for access_token -",
"// '%7C' is the pipe character and will be present in any access_token",
"// parameter that's already URL-encoded. If we see this co... | Gets the URL-encoded version of the given {@code value} for the parameter named {@code name}.
<p>
Includes special-case handling for access token parameters where we check if the token is already URL-encoded - if
so, we don't encode again. All other parameter types are always URL-encoded.
@param name
The name of the p... | [
"Gets",
"the",
"URL",
"-",
"encoded",
"version",
"of",
"the",
"given",
"{",
"@code",
"value",
"}",
"for",
"the",
"parameter",
"named",
"{",
"@code",
"name",
"}",
".",
"<p",
">",
"Includes",
"special",
"-",
"case",
"handling",
"for",
"access",
"token",
... | train | https://github.com/restfb/restfb/blob/fb77ba5486d1339e7deb81b9830670fa209b1047/src/main/java/com/restfb/BaseFacebookClient.java#L106-L112 |
synchronoss/cpo-api | cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java | CassandraCpoAdapter.processSelectGroup | protected <T> T processSelectGroup(T obj, String groupName, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException {
"""
Retrieves the Object from the datasource.
@param obj This is an object that has been defined within th... | java | protected <T> T processSelectGroup(T obj, String groupName, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException {
Session session = null;
T result = null;
try {
session = getReadSession();
result = processSelectGroup(... | [
"protected",
"<",
"T",
">",
"T",
"processSelectGroup",
"(",
"T",
"obj",
",",
"String",
"groupName",
",",
"Collection",
"<",
"CpoWhere",
">",
"wheres",
",",
"Collection",
"<",
"CpoOrderBy",
">",
"orderBy",
",",
"Collection",
"<",
"CpoNativeFunction",
">",
"na... | Retrieves the Object from the datasource.
@param obj This is an object that has been defined within the metadata of the datasource. If the class is not
defined an exception will be thrown. The input object is used to specify the search criteria.
@param groupName The name which identifies which RE... | [
"Retrieves",
"the",
"Object",
"from",
"the",
"datasource",
"."
] | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java#L2185-L2197 |
mozilla/rhino | src/org/mozilla/javascript/WrapFactory.java | WrapFactory.wrapNewObject | public Scriptable wrapNewObject(Context cx, Scriptable scope, Object obj) {
"""
Wrap an object newly created by a constructor call.
@param cx the current Context for this thread
@param scope the scope of the executing script
@param obj the object to be wrapped
@return the wrapped value.
"""
if (obj... | java | public Scriptable wrapNewObject(Context cx, Scriptable scope, Object obj)
{
if (obj instanceof Scriptable) {
return (Scriptable)obj;
}
Class<?> cls = obj.getClass();
if (cls.isArray()) {
return NativeJavaArray.wrap(scope, obj);
}
return wrapAsJ... | [
"public",
"Scriptable",
"wrapNewObject",
"(",
"Context",
"cx",
",",
"Scriptable",
"scope",
",",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"instanceof",
"Scriptable",
")",
"{",
"return",
"(",
"Scriptable",
")",
"obj",
";",
"}",
"Class",
"<",
"?",
">",
... | Wrap an object newly created by a constructor call.
@param cx the current Context for this thread
@param scope the scope of the executing script
@param obj the object to be wrapped
@return the wrapped value. | [
"Wrap",
"an",
"object",
"newly",
"created",
"by",
"a",
"constructor",
"call",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/WrapFactory.java#L87-L97 |
snazy/ohc | ohc-benchmark/src/main/java/org/caffinitas/ohc/benchmark/distribution/GroupedOptions.java | GroupedOptions.select | public static <G extends GroupedOptions> G select(String[] params, G... groupings) {
"""
option group that is happy() after this is done, that also accepted all the parameters
"""
for (String param : params)
{
boolean accepted = false;
for (GroupedOptions grouping : grou... | java | public static <G extends GroupedOptions> G select(String[] params, G... groupings)
{
for (String param : params)
{
boolean accepted = false;
for (GroupedOptions grouping : groupings)
accepted |= grouping.accept(param);
if (!accepted)
... | [
"public",
"static",
"<",
"G",
"extends",
"GroupedOptions",
">",
"G",
"select",
"(",
"String",
"[",
"]",
"params",
",",
"G",
"...",
"groupings",
")",
"{",
"for",
"(",
"String",
"param",
":",
"params",
")",
"{",
"boolean",
"accepted",
"=",
"false",
";",
... | option group that is happy() after this is done, that also accepted all the parameters | [
"option",
"group",
"that",
"is",
"happy",
"()",
"after",
"this",
"is",
"done",
"that",
"also",
"accepted",
"all",
"the",
"parameters"
] | train | https://github.com/snazy/ohc/blob/af47142711993a3eaaf3b496332c27e2b43454e4/ohc-benchmark/src/main/java/org/caffinitas/ohc/benchmark/distribution/GroupedOptions.java#L59-L73 |
VoltDB/voltdb | third_party/java/src/org/HdrHistogram_voltpatches/IntCountsHistogram.java | IntCountsHistogram.decodeFromCompressedByteBuffer | public static IntCountsHistogram decodeFromCompressedByteBuffer(final ByteBuffer buffer,
final long minBarForHighestTrackableValue) throws DataFormatException {
"""
Construct a new histogram by decoding it from a compressed form in a ByteBuffer.
@param... | java | public static IntCountsHistogram decodeFromCompressedByteBuffer(final ByteBuffer buffer,
final long minBarForHighestTrackableValue) throws DataFormatException {
return decodeFromCompressedByteBuffer(buffer, IntCountsHistogram.class, minBarForHighestT... | [
"public",
"static",
"IntCountsHistogram",
"decodeFromCompressedByteBuffer",
"(",
"final",
"ByteBuffer",
"buffer",
",",
"final",
"long",
"minBarForHighestTrackableValue",
")",
"throws",
"DataFormatException",
"{",
"return",
"decodeFromCompressedByteBuffer",
"(",
"buffer",
",",... | Construct a new histogram by decoding it from a compressed form in a ByteBuffer.
@param buffer The buffer to decode from
@param minBarForHighestTrackableValue Force highestTrackableValue to be set at least this high
@return The newly constructed histogram
@throws DataFormatException on error parsing/decompressing the b... | [
"Construct",
"a",
"new",
"histogram",
"by",
"decoding",
"it",
"from",
"a",
"compressed",
"form",
"in",
"a",
"ByteBuffer",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/HdrHistogram_voltpatches/IntCountsHistogram.java#L232-L235 |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/resolution/BindingInstaller.java | BindingInstaller.installBindings | public void installBindings(DependencyExplorerOutput output) {
"""
Installs all of the implicit bindings as described {@link BindingInstaller above}.
@param output {@link DependencyExplorerOutput} with information about the unresolved bindings
for the current ginjector.
"""
positions.position(output);
... | java | public void installBindings(DependencyExplorerOutput output) {
positions.position(output);
// Install each implicit binding in the correct position
for (Map.Entry<Key<?>, Binding> entry : output.getImplicitBindings()) {
installBinding(output.getGraph(), entry.getKey(), entry.getValue());
}
... | [
"public",
"void",
"installBindings",
"(",
"DependencyExplorerOutput",
"output",
")",
"{",
"positions",
".",
"position",
"(",
"output",
")",
";",
"// Install each implicit binding in the correct position",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Key",
"<",
"?",
">",
... | Installs all of the implicit bindings as described {@link BindingInstaller above}.
@param output {@link DependencyExplorerOutput} with information about the unresolved bindings
for the current ginjector. | [
"Installs",
"all",
"of",
"the",
"implicit",
"bindings",
"as",
"described",
"{",
"@link",
"BindingInstaller",
"above",
"}",
"."
] | train | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/resolution/BindingInstaller.java#L73-L84 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java | SeleniumHelper.doInContext | public <R> R doInContext(SearchContext context, Supplier<R> action) {
"""
Perform action/supplier in context.
@param context context to perfom action in.
@param action action to perform.
@param <R> type of action result.
@return action result.
"""
R result;
if (context == null) {
... | java | public <R> R doInContext(SearchContext context, Supplier<R> action) {
R result;
if (context == null) {
result = action.get();
} else {
// store current context (without triggering exception if it was stale)
SearchContext currentSearchContext = currentContext;
... | [
"public",
"<",
"R",
">",
"R",
"doInContext",
"(",
"SearchContext",
"context",
",",
"Supplier",
"<",
"R",
">",
"action",
")",
"{",
"R",
"result",
";",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"result",
"=",
"action",
".",
"get",
"(",
")",
";",
... | Perform action/supplier in context.
@param context context to perfom action in.
@param action action to perform.
@param <R> type of action result.
@return action result. | [
"Perform",
"action",
"/",
"supplier",
"in",
"context",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java#L770-L789 |
wcm-io/wcm-io-tooling | commons/content-package-builder/src/main/java/io/wcm/tooling/commons/contentpackagebuilder/ContentPackage.java | ContentPackage.addFile | public void addFile(String path, InputStream inputStream, String contentType) throws IOException {
"""
Adds a binary file with explicit mime type.
@param path Full content path and file name of file
@param inputStream Input stream with binary data
@param contentType Mime type, optionally with ";charset=XYZ" ext... | java | public void addFile(String path, InputStream inputStream, String contentType) throws IOException {
String fullPath = buildJcrPathForZip(path);
writeBinaryFile(fullPath, inputStream);
if (StringUtils.isNotEmpty(contentType)) {
String mimeType = StringUtils.substringBefore(contentType, CONTENT_TYPE_CHA... | [
"public",
"void",
"addFile",
"(",
"String",
"path",
",",
"InputStream",
"inputStream",
",",
"String",
"contentType",
")",
"throws",
"IOException",
"{",
"String",
"fullPath",
"=",
"buildJcrPathForZip",
"(",
"path",
")",
";",
"writeBinaryFile",
"(",
"fullPath",
",... | Adds a binary file with explicit mime type.
@param path Full content path and file name of file
@param inputStream Input stream with binary data
@param contentType Mime type, optionally with ";charset=XYZ" extension
@throws IOException I/O exception | [
"Adds",
"a",
"binary",
"file",
"with",
"explicit",
"mime",
"type",
"."
] | train | https://github.com/wcm-io/wcm-io-tooling/blob/1abcd01dd3ad4cc248f03b431f929573d84fa9b4/commons/content-package-builder/src/main/java/io/wcm/tooling/commons/contentpackagebuilder/ContentPackage.java#L188-L200 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.audit.source/src/com/ibm/ws/security/audit/source/AuditServiceImpl.java | AuditServiceImpl.map2GenericData | private GenericData map2GenericData(GenericData gdo, Map<String, Object> map) {
"""
Given a Map, add the corresponding audit data to the given GenericData object.
@param gdo - GenericData object
@param map - Java Map object
"""
for (Entry<String, Object> entry : map.entrySet()) {
if (en... | java | private GenericData map2GenericData(GenericData gdo, Map<String, Object> map) {
for (Entry<String, Object> entry : map.entrySet()) {
if (entry.getValue() == null) {
if (entry.getKey().equals(AuditEvent.TARGET_APPNAME)) {
gdo.addPair(entry.getKey(), AuditUtils.getJ... | [
"private",
"GenericData",
"map2GenericData",
"(",
"GenericData",
"gdo",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"for",
"(",
"Entry",
"<",
"String",
",",
"Object",
">",
"entry",
":",
"map",
".",
"entrySet",
"(",
")",
")",
"{",
... | Given a Map, add the corresponding audit data to the given GenericData object.
@param gdo - GenericData object
@param map - Java Map object | [
"Given",
"a",
"Map",
"add",
"the",
"corresponding",
"audit",
"data",
"to",
"the",
"given",
"GenericData",
"object",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.audit.source/src/com/ibm/ws/security/audit/source/AuditServiceImpl.java#L416-L430 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsADEManager.java | CmsADEManager.setShowEditorHelp | public void setShowEditorHelp(CmsObject cms, boolean showHelp) throws CmsException {
"""
Sets the show editor help flag.<p>
@param cms the cms context
@param showHelp the show help flag
@throws CmsException if writing the user info fails
"""
CmsUser user = cms.getRequestContext().getCurrentUser()... | java | public void setShowEditorHelp(CmsObject cms, boolean showHelp) throws CmsException {
CmsUser user = cms.getRequestContext().getCurrentUser();
user.setAdditionalInfo(ADDINFO_ADE_SHOW_EDITOR_HELP, String.valueOf(showHelp));
cms.writeUser(user);
} | [
"public",
"void",
"setShowEditorHelp",
"(",
"CmsObject",
"cms",
",",
"boolean",
"showHelp",
")",
"throws",
"CmsException",
"{",
"CmsUser",
"user",
"=",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"getCurrentUser",
"(",
")",
";",
"user",
".",
"setAdditional... | Sets the show editor help flag.<p>
@param cms the cms context
@param showHelp the show help flag
@throws CmsException if writing the user info fails | [
"Sets",
"the",
"show",
"editor",
"help",
"flag",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsADEManager.java#L1270-L1275 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_config_diff.java | ns_config_diff.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
ns_config_diff_responses result = (ns_config_diff_responses) service.ge... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
ns_config_diff_responses result = (ns_config_diff_responses) service.get_payload_formatter().string_to_resource(ns_config_diff_responses.class, response);
if(result.errorcode != 0)
{
if (result.er... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"ns_config_diff_responses",
"result",
"=",
"(",
"ns_config_diff_responses",
")",
"service",
".",
"get_payload_... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_config_diff.java#L227-L244 |
cloudant/java-cloudant | cloudant-client/src/main/java/com/cloudant/client/api/Database.java | Database.deleteIndex | public void deleteIndex(String indexName, String designDocId, String type) {
"""
Delete an index with the specified name and type in the given design document.
@param indexName name of the index
@param designDocId ID of the design doc (the _design prefix will be added if not present)
@param type type... | java | public void deleteIndex(String indexName, String designDocId, String type) {
assertNotEmpty(indexName, "indexName");
assertNotEmpty(designDocId, "designDocId");
assertNotNull(type, "type");
if (!designDocId.startsWith("_design")) {
designDocId = "_design/" + designDocId;
... | [
"public",
"void",
"deleteIndex",
"(",
"String",
"indexName",
",",
"String",
"designDocId",
",",
"String",
"type",
")",
"{",
"assertNotEmpty",
"(",
"indexName",
",",
"\"indexName\"",
")",
";",
"assertNotEmpty",
"(",
"designDocId",
",",
"\"designDocId\"",
")",
";"... | Delete an index with the specified name and type in the given design document.
@param indexName name of the index
@param designDocId ID of the design doc (the _design prefix will be added if not present)
@param type type of the index, valid values or "text" or "json" | [
"Delete",
"an",
"index",
"with",
"the",
"specified",
"name",
"and",
"type",
"in",
"the",
"given",
"design",
"document",
"."
] | train | https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/api/Database.java#L604-L621 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationsInner.java | ReplicationsInner.listAsync | public Observable<Page<ReplicationInner>> listAsync(final String resourceGroupName, final String registryName) {
"""
Lists all the replications for the specified container registry.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of ... | java | public Observable<Page<ReplicationInner>> listAsync(final String resourceGroupName, final String registryName) {
return listWithServiceResponseAsync(resourceGroupName, registryName)
.map(new Func1<ServiceResponse<Page<ReplicationInner>>, Page<ReplicationInner>>() {
@Override
... | [
"public",
"Observable",
"<",
"Page",
"<",
"ReplicationInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"registryName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",... | Lists all the replications for the specified container registry.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to t... | [
"Lists",
"all",
"the",
"replications",
"for",
"the",
"specified",
"container",
"registry",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationsInner.java#L953-L961 |
auth0/Lock.Android | lib/src/main/java/com/auth0/android/lock/views/ViewUtils.java | ViewUtils.tintWidget | static void tintWidget(@NonNull ProgressBar progressBar, @ColorInt int color) {
"""
Tints the progress bar drawable to the given color. Only for devices running Lollipop or greater.
@param progressBar the view to tint
@param color the color to use
"""
if (Build.VERSION.SDK_INT >= Build.VERSIO... | java | static void tintWidget(@NonNull ProgressBar progressBar, @ColorInt int color) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
ColorStateList tint = ColorStateList.valueOf(color);
progressBar.setIndeterminateTintList(tint);
}
} | [
"static",
"void",
"tintWidget",
"(",
"@",
"NonNull",
"ProgressBar",
"progressBar",
",",
"@",
"ColorInt",
"int",
"color",
")",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">=",
"Build",
".",
"VERSION_CODES",
".",
"LOLLIPOP",
")",
"{",
"ColorSta... | Tints the progress bar drawable to the given color. Only for devices running Lollipop or greater.
@param progressBar the view to tint
@param color the color to use | [
"Tints",
"the",
"progress",
"bar",
"drawable",
"to",
"the",
"given",
"color",
".",
"Only",
"for",
"devices",
"running",
"Lollipop",
"or",
"greater",
"."
] | train | https://github.com/auth0/Lock.Android/blob/8eb2a979048d2eb6cf0ec631e82e6c3fe6e7d220/lib/src/main/java/com/auth0/android/lock/views/ViewUtils.java#L166-L171 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/parameters/Parameters.java | Parameters.getBooleanList | public List<Boolean> getBooleanList(final String param) {
"""
Gets a parameter whose value is a (possibly empty) list of booleans.
"""
return getList(param, new StrictStringToBoolean(),
new AlwaysValid<Boolean>(), "boolean");
} | java | public List<Boolean> getBooleanList(final String param) {
return getList(param, new StrictStringToBoolean(),
new AlwaysValid<Boolean>(), "boolean");
} | [
"public",
"List",
"<",
"Boolean",
">",
"getBooleanList",
"(",
"final",
"String",
"param",
")",
"{",
"return",
"getList",
"(",
"param",
",",
"new",
"StrictStringToBoolean",
"(",
")",
",",
"new",
"AlwaysValid",
"<",
"Boolean",
">",
"(",
")",
",",
"\"boolean\... | Gets a parameter whose value is a (possibly empty) list of booleans. | [
"Gets",
"a",
"parameter",
"whose",
"value",
"is",
"a",
"(",
"possibly",
"empty",
")",
"list",
"of",
"booleans",
"."
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/parameters/Parameters.java#L628-L631 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.appendUtf8Lines | public static <T> File appendUtf8Lines(Collection<T> list, String path) throws IORuntimeException {
"""
将列表写入文件,追加模式
@param <T> 集合元素类型
@param list 列表
@param path 文件路径
@return 目标文件
@throws IORuntimeException IO异常
@since 3.1.2
"""
return appendLines(list, path, CharsetUtil.CHARSET_UTF_8);
} | java | public static <T> File appendUtf8Lines(Collection<T> list, String path) throws IORuntimeException {
return appendLines(list, path, CharsetUtil.CHARSET_UTF_8);
} | [
"public",
"static",
"<",
"T",
">",
"File",
"appendUtf8Lines",
"(",
"Collection",
"<",
"T",
">",
"list",
",",
"String",
"path",
")",
"throws",
"IORuntimeException",
"{",
"return",
"appendLines",
"(",
"list",
",",
"path",
",",
"CharsetUtil",
".",
"CHARSET_UTF_... | 将列表写入文件,追加模式
@param <T> 集合元素类型
@param list 列表
@param path 文件路径
@return 目标文件
@throws IORuntimeException IO异常
@since 3.1.2 | [
"将列表写入文件,追加模式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2953-L2955 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java | PackageSummaryBuilder.buildContent | public void buildContent(XMLNode node, Content contentTree) {
"""
Build the content for the package doc.
@param node the XML element that specifies which components to document
@param contentTree the content tree to which the package contents
will be added
"""
Content packageContentTree = packageW... | java | public void buildContent(XMLNode node, Content contentTree) {
Content packageContentTree = packageWriter.getContentHeader();
buildChildren(node, packageContentTree);
contentTree.addContent(packageContentTree);
} | [
"public",
"void",
"buildContent",
"(",
"XMLNode",
"node",
",",
"Content",
"contentTree",
")",
"{",
"Content",
"packageContentTree",
"=",
"packageWriter",
".",
"getContentHeader",
"(",
")",
";",
"buildChildren",
"(",
"node",
",",
"packageContentTree",
")",
";",
"... | Build the content for the package doc.
@param node the XML element that specifies which components to document
@param contentTree the content tree to which the package contents
will be added | [
"Build",
"the",
"content",
"for",
"the",
"package",
"doc",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java#L138-L142 |
aws/aws-sdk-java | aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/CreateCoreDefinitionRequest.java | CreateCoreDefinitionRequest.withTags | public CreateCoreDefinitionRequest withTags(java.util.Map<String, String> tags) {
"""
Tag(s) to add to the new resource
@param tags
Tag(s) to add to the new resource
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
return this;
... | java | public CreateCoreDefinitionRequest withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"CreateCoreDefinitionRequest",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | Tag(s) to add to the new resource
@param tags
Tag(s) to add to the new resource
@return Returns a reference to this object so that method calls can be chained together. | [
"Tag",
"(",
"s",
")",
"to",
"add",
"to",
"the",
"new",
"resource"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/CreateCoreDefinitionRequest.java#L169-L172 |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java | TupleGenerator.completeSatisfied | private boolean completeSatisfied( TestCaseDef testCase, VarTupleSet tuples, List<VarDef> vars) {
"""
Using selections from the given set of tuples, completes binding for all remaining variables.
Returns true if all variables have been bound.
"""
List<VarDef> varsRemaining = getVarsRemaining( vars, testCa... | java | private boolean completeSatisfied( TestCaseDef testCase, VarTupleSet tuples, List<VarDef> vars)
{
List<VarDef> varsRemaining = getVarsRemaining( vars, testCase);
VarDef varApplicable;
boolean complete;
// Any variables remaining unbound?
if( varsRemaining.isEmpty())
{
// No, this t... | [
"private",
"boolean",
"completeSatisfied",
"(",
"TestCaseDef",
"testCase",
",",
"VarTupleSet",
"tuples",
",",
"List",
"<",
"VarDef",
">",
"vars",
")",
"{",
"List",
"<",
"VarDef",
">",
"varsRemaining",
"=",
"getVarsRemaining",
"(",
"vars",
",",
"testCase",
")",... | Using selections from the given set of tuples, completes binding for all remaining variables.
Returns true if all variables have been bound. | [
"Using",
"selections",
"from",
"the",
"given",
"set",
"of",
"tuples",
"completes",
"binding",
"for",
"all",
"remaining",
"variables",
".",
"Returns",
"true",
"if",
"all",
"variables",
"have",
"been",
"bound",
"."
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java#L431-L476 |
OpenTSDB/opentsdb | src/tools/UidManager.java | UidManager.extactLookupName | private static int extactLookupName(final HBaseClient client,
final byte[] table,
final short idwidth,
final String kind,
final String name) {
"""
Looks up a name ... | java | private static int extactLookupName(final HBaseClient client,
final byte[] table,
final short idwidth,
final String kind,
final String name) {
final UniqueId uid = ... | [
"private",
"static",
"int",
"extactLookupName",
"(",
"final",
"HBaseClient",
"client",
",",
"final",
"byte",
"[",
"]",
"table",
",",
"final",
"short",
"idwidth",
",",
"final",
"String",
"kind",
",",
"final",
"String",
"name",
")",
"{",
"final",
"UniqueId",
... | Looks up a name for a given kind, and prints it if found.
@param client The HBase client to use.
@param idwidth Number of bytes on which the UIDs should be.
@param kind The 'kind' of the ID (must not be {@code null}).
@param name The name to look for.
@return 0 if the name for this kind was found, 1 otherwise. | [
"Looks",
"up",
"a",
"name",
"for",
"a",
"given",
"kind",
"and",
"prints",
"it",
"if",
"found",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/UidManager.java#L958-L972 |
ops4j/org.ops4j.base | ops4j-base-io/src/main/java/org/ops4j/io/StreamUtils.java | StreamUtils.copyReaderToStream | public static void copyReaderToStream( Reader in, OutputStream out, String encoding, boolean close )
throws IOException {
"""
Copies the content of the Reader to the provided OutputStream using the provided encoding.
@param in The character data to convert.
@param out The OutputStream to sen... | java | public static void copyReaderToStream( Reader in, OutputStream out, String encoding, boolean close )
throws IOException
{
OutputStreamWriter writer = new OutputStreamWriter( out, encoding );
copyReaderToWriter( in, writer, close );
} | [
"public",
"static",
"void",
"copyReaderToStream",
"(",
"Reader",
"in",
",",
"OutputStream",
"out",
",",
"String",
"encoding",
",",
"boolean",
"close",
")",
"throws",
"IOException",
"{",
"OutputStreamWriter",
"writer",
"=",
"new",
"OutputStreamWriter",
"(",
"out",
... | Copies the content of the Reader to the provided OutputStream using the provided encoding.
@param in The character data to convert.
@param out The OutputStream to send the data to.
@param encoding The character encoding that should be used for the byte stream.
@param close true if the Reader and OutputSt... | [
"Copies",
"the",
"content",
"of",
"the",
"Reader",
"to",
"the",
"provided",
"OutputStream",
"using",
"the",
"provided",
"encoding",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/StreamUtils.java#L299-L304 |
alipay/sofa-rpc | extension-impl/extension-common/src/main/java/com/alipay/sofa/rpc/config/UserThreadPoolManager.java | UserThreadPoolManager.registerUserThread | public static synchronized void registerUserThread(String service, UserThreadPool userThreadPool) {
"""
给某个服务分配到独立的线程池
@param service 服务唯一名
@param userThreadPool 自定义线程池
"""
if (userThreadMap == null) {
userThreadMap = new ConcurrentHashMap<String, UserThreadPool>();
}
... | java | public static synchronized void registerUserThread(String service, UserThreadPool userThreadPool) {
if (userThreadMap == null) {
userThreadMap = new ConcurrentHashMap<String, UserThreadPool>();
}
userThreadMap.put(service, userThreadPool);
} | [
"public",
"static",
"synchronized",
"void",
"registerUserThread",
"(",
"String",
"service",
",",
"UserThreadPool",
"userThreadPool",
")",
"{",
"if",
"(",
"userThreadMap",
"==",
"null",
")",
"{",
"userThreadMap",
"=",
"new",
"ConcurrentHashMap",
"<",
"String",
",",... | 给某个服务分配到独立的线程池
@param service 服务唯一名
@param userThreadPool 自定义线程池 | [
"给某个服务分配到独立的线程池"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/extension-common/src/main/java/com/alipay/sofa/rpc/config/UserThreadPoolManager.java#L51-L56 |
revapi/revapi | revapi-java-spi/src/main/java/org/revapi/java/spi/CheckBase.java | CheckBase.isBothPrivate | public boolean isBothPrivate(@Nullable JavaModelElement a, @Nullable JavaModelElement b) {
"""
Checks whether both provided elements are (package) private. If one of them is null, the fact cannot be
determined and therefore this method would return false.
@param a first element
@param b second element
@retur... | java | public boolean isBothPrivate(@Nullable JavaModelElement a, @Nullable JavaModelElement b) {
if (a == null || b == null) {
return false;
}
return !isAccessible(a) && !isAccessible(b);
} | [
"public",
"boolean",
"isBothPrivate",
"(",
"@",
"Nullable",
"JavaModelElement",
"a",
",",
"@",
"Nullable",
"JavaModelElement",
"b",
")",
"{",
"if",
"(",
"a",
"==",
"null",
"||",
"b",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"!",
"... | Checks whether both provided elements are (package) private. If one of them is null, the fact cannot be
determined and therefore this method would return false.
@param a first element
@param b second element
@return true if both elements are not null and are private or package private | [
"Checks",
"whether",
"both",
"provided",
"elements",
"are",
"(",
"package",
")",
"private",
".",
"If",
"one",
"of",
"them",
"is",
"null",
"the",
"fact",
"cannot",
"be",
"determined",
"and",
"therefore",
"this",
"method",
"would",
"return",
"false",
"."
] | train | https://github.com/revapi/revapi/blob/e070b136d977441ab96fdce067a13e7e0423295b/revapi-java-spi/src/main/java/org/revapi/java/spi/CheckBase.java#L67-L73 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/CmsDomUtil.java | CmsDomUtil.getCurrentStyleInt | public static int getCurrentStyleInt(Element element, Style style) {
"""
Returns the computed style of the given element as number.<p>
@param element the element
@param style the CSS property
@return the currently computed style
"""
String currentStyle = getCurrentStyle(element, style);
... | java | public static int getCurrentStyleInt(Element element, Style style) {
String currentStyle = getCurrentStyle(element, style);
return CmsClientStringUtil.parseInt(currentStyle);
} | [
"public",
"static",
"int",
"getCurrentStyleInt",
"(",
"Element",
"element",
",",
"Style",
"style",
")",
"{",
"String",
"currentStyle",
"=",
"getCurrentStyle",
"(",
"element",
",",
"style",
")",
";",
"return",
"CmsClientStringUtil",
".",
"parseInt",
"(",
"current... | Returns the computed style of the given element as number.<p>
@param element the element
@param style the CSS property
@return the currently computed style | [
"Returns",
"the",
"computed",
"style",
"of",
"the",
"given",
"element",
"as",
"number",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsDomUtil.java#L1232-L1236 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/Xml.java | Xml.getChild | public Xml getChild(String name) {
"""
Get a child node from its name.
@param name The child name (must not be <code>null</code>).
@return The child node reference.
@throws LionEngineException If no node is found at this child name.
"""
Check.notNull(name);
final NodeList list = root.getC... | java | public Xml getChild(String name)
{
Check.notNull(name);
final NodeList list = root.getChildNodes();
for (int i = 0; i < list.getLength(); i++)
{
final Node node = list.item(i);
if (node instanceof Element && node.getNodeName().equals(name))
{
... | [
"public",
"Xml",
"getChild",
"(",
"String",
"name",
")",
"{",
"Check",
".",
"notNull",
"(",
"name",
")",
";",
"final",
"NodeList",
"list",
"=",
"root",
".",
"getChildNodes",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"list",
... | Get a child node from its name.
@param name The child name (must not be <code>null</code>).
@return The child node reference.
@throws LionEngineException If no node is found at this child name. | [
"Get",
"a",
"child",
"node",
"from",
"its",
"name",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/Xml.java#L370-L384 |
datasalt/pangool | core/src/main/java/com/datasalt/pangool/solr/BatchWriter.java | BatchWriter.throwIf | private void throwIf() throws IOException, SolrServerException {
"""
Throw a legal exception if a previous batch write had an exception. The previous state is cleared. Uses
{@link #batchWriteException} for the state from the last exception.
This will loose individual exceptions if the exceptions happen rapidly... | java | private void throwIf() throws IOException, SolrServerException {
final Exception last = batchWriteException;
batchWriteException = null;
if(last == null) {
return;
}
if(last instanceof SolrServerException) {
throw (SolrServerException) last;
}
if(last instanceof IOException) {
throw (IOExceptio... | [
"private",
"void",
"throwIf",
"(",
")",
"throws",
"IOException",
",",
"SolrServerException",
"{",
"final",
"Exception",
"last",
"=",
"batchWriteException",
";",
"batchWriteException",
"=",
"null",
";",
"if",
"(",
"last",
"==",
"null",
")",
"{",
"return",
";",
... | Throw a legal exception if a previous batch write had an exception. The previous state is cleared. Uses
{@link #batchWriteException} for the state from the last exception.
This will loose individual exceptions if the exceptions happen rapidly.
@throws IOException
@throws SolrServerException | [
"Throw",
"a",
"legal",
"exception",
"if",
"a",
"previous",
"batch",
"write",
"had",
"an",
"exception",
".",
"The",
"previous",
"state",
"is",
"cleared",
".",
"Uses",
"{",
"@link",
"#batchWriteException",
"}",
"for",
"the",
"state",
"from",
"the",
"last",
"... | train | https://github.com/datasalt/pangool/blob/bfd312dd78cba03febaf7988ae96a3d4bc585408/core/src/main/java/com/datasalt/pangool/solr/BatchWriter.java#L197-L212 |
phax/ph-commons | ph-dao/src/main/java/com/helger/dao/wal/AbstractMapBasedWALDAO.java | AbstractMapBasedWALDAO.internalCreateItem | @MustBeLocked (ELockType.WRITE)
@Nonnull
protected final IMPLTYPE internalCreateItem (@Nonnull final IMPLTYPE aNewItem, final boolean bInvokeCallbacks) {
"""
Add an item including invoking the callback. Must only be invoked inside a
write-lock.
@param aNewItem
The item to be added. May not be <code>null</... | java | @MustBeLocked (ELockType.WRITE)
@Nonnull
protected final IMPLTYPE internalCreateItem (@Nonnull final IMPLTYPE aNewItem, final boolean bInvokeCallbacks)
{
// Add to map
_addItem (aNewItem, EDAOActionType.CREATE);
// Trigger save changes
super.markAsChanged (aNewItem, EDAOActionType.CREATE);
i... | [
"@",
"MustBeLocked",
"(",
"ELockType",
".",
"WRITE",
")",
"@",
"Nonnull",
"protected",
"final",
"IMPLTYPE",
"internalCreateItem",
"(",
"@",
"Nonnull",
"final",
"IMPLTYPE",
"aNewItem",
",",
"final",
"boolean",
"bInvokeCallbacks",
")",
"{",
"// Add to map",
"_addIte... | Add an item including invoking the callback. Must only be invoked inside a
write-lock.
@param aNewItem
The item to be added. May not be <code>null</code>.
@param bInvokeCallbacks
<code>true</code> to invoke callbacks, <code>false</code> to not do
so.
@return The passed parameter as-is. Never <code>null</code>.
@throws... | [
"Add",
"an",
"item",
"including",
"invoking",
"the",
"callback",
".",
"Must",
"only",
"be",
"invoked",
"inside",
"a",
"write",
"-",
"lock",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-dao/src/main/java/com/helger/dao/wal/AbstractMapBasedWALDAO.java#L315-L331 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/passivator/EJBObjectInfo.java | EJBObjectInfo.addFieldInfo | void addFieldInfo(String className, List<FieldInfo> fieldInfoList) {
"""
Adds the className and fieldInfoList to the ivFieldInfoMap.
@param className
@param fieldInfoList
"""
if (ivFieldInfoMap == null) {
ivFieldInfoMap = new HashMap<String, List<FieldInfo>>();
}
ivField... | java | void addFieldInfo(String className, List<FieldInfo> fieldInfoList) {
if (ivFieldInfoMap == null) {
ivFieldInfoMap = new HashMap<String, List<FieldInfo>>();
}
ivFieldInfoMap.put(className, fieldInfoList);
} | [
"void",
"addFieldInfo",
"(",
"String",
"className",
",",
"List",
"<",
"FieldInfo",
">",
"fieldInfoList",
")",
"{",
"if",
"(",
"ivFieldInfoMap",
"==",
"null",
")",
"{",
"ivFieldInfoMap",
"=",
"new",
"HashMap",
"<",
"String",
",",
"List",
"<",
"FieldInfo",
"... | Adds the className and fieldInfoList to the ivFieldInfoMap.
@param className
@param fieldInfoList | [
"Adds",
"the",
"className",
"and",
"fieldInfoList",
"to",
"the",
"ivFieldInfoMap",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/passivator/EJBObjectInfo.java#L76-L81 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java | JmsDestinationImpl.isDifferent | private boolean isDifferent(String key, Object value) {
"""
Compare the specified value with that in the properties Map
This utility method is used from the set* methods to determine
if the value is being changed and hence the cache needs to be
cleared.
@param key The name of the property in the Map
@param ... | java | private boolean isDifferent(String key, Object value) {
// Get the value from the properties Map for the specified key
Object currentVal = properties.get(key);
if (currentVal == null) {
// If the currentVal is null, then test value against null
return value != null;
... | [
"private",
"boolean",
"isDifferent",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"// Get the value from the properties Map for the specified key",
"Object",
"currentVal",
"=",
"properties",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"currentVal",
"==",... | Compare the specified value with that in the properties Map
This utility method is used from the set* methods to determine
if the value is being changed and hence the cache needs to be
cleared.
@param key The name of the property in the Map
@param value The value to be tested for equality
@return true if the values ar... | [
"Compare",
"the",
"specified",
"value",
"with",
"that",
"in",
"the",
"properties",
"Map",
"This",
"utility",
"method",
"is",
"used",
"from",
"the",
"set",
"*",
"methods",
"to",
"determine",
"if",
"the",
"value",
"is",
"being",
"changed",
"and",
"hence",
"t... | 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/JmsDestinationImpl.java#L1489-L1500 |
jbundle/jbundle | base/model/src/main/java/org/jbundle/base/model/Utility.java | Utility.convertObjectToString | public static String convertObjectToString(Object objData, Class<?> classData, Object objDefault) {
"""
Convert this object to an unfomatted string (ie., toString).
@param properties The map object to get the property from.
@param strKey The key of the property.
@param classData The target class to convert the ... | java | public static String convertObjectToString(Object objData, Class<?> classData, Object objDefault)
{
try {
objData = Converter.convertObjectToDatatype(objData, classData, objDefault);
} catch (Exception ex) {
objData = null;
}
if (objData == null)
r... | [
"public",
"static",
"String",
"convertObjectToString",
"(",
"Object",
"objData",
",",
"Class",
"<",
"?",
">",
"classData",
",",
"Object",
"objDefault",
")",
"{",
"try",
"{",
"objData",
"=",
"Converter",
".",
"convertObjectToDatatype",
"(",
"objData",
",",
"cla... | Convert this object to an unfomatted string (ie., toString).
@param properties The map object to get the property from.
@param strKey The key of the property.
@param classData The target class to convert the property to.
@param objDefault The default value.
@return The data in the correct class. | [
"Convert",
"this",
"object",
"to",
"an",
"unfomatted",
"string",
"(",
"ie",
".",
"toString",
")",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/model/src/main/java/org/jbundle/base/model/Utility.java#L526-L536 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java | BoxApiFile.getCreateUploadSessionRequest | public BoxRequestsFile.CreateUploadSession getCreateUploadSessionRequest(InputStream is, String fileName, long fileSize, String folderId) {
"""
Gets a request that creates an upload session for uploading a new file
@param is InputStream for the file to be uplaoded
@param fileName the file name for the file to be... | java | public BoxRequestsFile.CreateUploadSession getCreateUploadSessionRequest(InputStream is, String fileName, long fileSize, String folderId) {
return new BoxRequestsFile.CreateUploadSession(is, fileName, fileSize, folderId, getUploadSessionForNewFileUrl(), mSession);
} | [
"public",
"BoxRequestsFile",
".",
"CreateUploadSession",
"getCreateUploadSessionRequest",
"(",
"InputStream",
"is",
",",
"String",
"fileName",
",",
"long",
"fileSize",
",",
"String",
"folderId",
")",
"{",
"return",
"new",
"BoxRequestsFile",
".",
"CreateUploadSession",
... | Gets a request that creates an upload session for uploading a new file
@param is InputStream for the file to be uplaoded
@param fileName the file name for the file to be created/uploaded
@param fileSize the inputStream size (or the origin file size)
@param folderId the folder ID where this file will be uploaded
@return... | [
"Gets",
"a",
"request",
"that",
"creates",
"an",
"upload",
"session",
"for",
"uploading",
"a",
"new",
"file"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFile.java#L592-L594 |
UrielCh/ovh-java-sdk | ovh-java-sdk-msServices/src/main/java/net/minidev/ovh/api/ApiOvhMsServices.java | ApiOvhMsServices.serviceName_account_userPrincipalName_exchange_PUT | public void serviceName_account_userPrincipalName_exchange_PUT(String serviceName, String userPrincipalName, OvhExchangeInformation body) throws IOException {
"""
Alter this object properties
REST: PUT /msServices/{serviceName}/account/{userPrincipalName}/exchange
@param body [required] New object properties
... | java | public void serviceName_account_userPrincipalName_exchange_PUT(String serviceName, String userPrincipalName, OvhExchangeInformation body) throws IOException {
String qPath = "/msServices/{serviceName}/account/{userPrincipalName}/exchange";
StringBuilder sb = path(qPath, serviceName, userPrincipalName);
exec(qPath... | [
"public",
"void",
"serviceName_account_userPrincipalName_exchange_PUT",
"(",
"String",
"serviceName",
",",
"String",
"userPrincipalName",
",",
"OvhExchangeInformation",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/msServices/{serviceName}/account/{user... | Alter this object properties
REST: PUT /msServices/{serviceName}/account/{userPrincipalName}/exchange
@param body [required] New object properties
@param serviceName [required] The internal name of your Active Directory organization
@param userPrincipalName [required] User Principal Name
API beta | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-msServices/src/main/java/net/minidev/ovh/api/ApiOvhMsServices.java#L403-L407 |
eclipse/xtext-core | org.eclipse.xtext/src/org/eclipse/xtext/scoping/Scopes.java | Scopes.scopedElementsFor | public static Iterable<IEObjectDescription> scopedElementsFor(Iterable<? extends EObject> elements) {
"""
transforms an {@link Iterable} of {@link EObject}s into an {@link Iterable} of {@link IEObjectDescription}s computing
the {@link EAttribute} 'name' to compute the {@link IEObjectDescription}'s name. If not ex... | java | public static Iterable<IEObjectDescription> scopedElementsFor(Iterable<? extends EObject> elements) {
return scopedElementsFor(elements, QualifiedName.wrapper(SimpleAttributeResolver.NAME_RESOLVER));
} | [
"public",
"static",
"Iterable",
"<",
"IEObjectDescription",
">",
"scopedElementsFor",
"(",
"Iterable",
"<",
"?",
"extends",
"EObject",
">",
"elements",
")",
"{",
"return",
"scopedElementsFor",
"(",
"elements",
",",
"QualifiedName",
".",
"wrapper",
"(",
"SimpleAttr... | transforms an {@link Iterable} of {@link EObject}s into an {@link Iterable} of {@link IEObjectDescription}s computing
the {@link EAttribute} 'name' to compute the {@link IEObjectDescription}'s name. If not existent the object is
filtered out. | [
"transforms",
"an",
"{"
] | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext/src/org/eclipse/xtext/scoping/Scopes.java#L78-L80 |
alkacon/opencms-core | src/org/opencms/acacia/shared/CmsEntityAttribute.java | CmsEntityAttribute.createEntityAttribute | public static CmsEntityAttribute createEntityAttribute(String name, List<CmsEntity> values) {
"""
Creates a entity type attribute.<p>
@param name the attribute name
@param values the attribute values
@return the newly created attribute
"""
CmsEntityAttribute result = new CmsEntityAttribute();... | java | public static CmsEntityAttribute createEntityAttribute(String name, List<CmsEntity> values) {
CmsEntityAttribute result = new CmsEntityAttribute();
result.m_name = name;
result.m_entityValues = Collections.unmodifiableList(values);
return result;
} | [
"public",
"static",
"CmsEntityAttribute",
"createEntityAttribute",
"(",
"String",
"name",
",",
"List",
"<",
"CmsEntity",
">",
"values",
")",
"{",
"CmsEntityAttribute",
"result",
"=",
"new",
"CmsEntityAttribute",
"(",
")",
";",
"result",
".",
"m_name",
"=",
"name... | Creates a entity type attribute.<p>
@param name the attribute name
@param values the attribute values
@return the newly created attribute | [
"Creates",
"a",
"entity",
"type",
"attribute",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/acacia/shared/CmsEntityAttribute.java#L67-L73 |
irmen/Pyrolite | java/src/main/java/net/razorvine/pickle/PickleUtils.java | PickleUtils.bytes_to_uint | public static long bytes_to_uint(byte[] bytes, int offset) {
"""
Convert 4 little endian bytes into an unsigned int (as a long)
"""
if(bytes.length-offset<4)
throw new PickleException("too few bytes to convert to long");
long i = bytes[3+offset] & 0xff;
i <<= 8;
i |= bytes[2+offset] & 0xff;
... | java | public static long bytes_to_uint(byte[] bytes, int offset) {
if(bytes.length-offset<4)
throw new PickleException("too few bytes to convert to long");
long i = bytes[3+offset] & 0xff;
i <<= 8;
i |= bytes[2+offset] & 0xff;
i <<= 8;
i |= bytes[1+offset] & 0xff;
i <<= 8;
i |= bytes[0+offset] & 0... | [
"public",
"static",
"long",
"bytes_to_uint",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"bytes",
".",
"length",
"-",
"offset",
"<",
"4",
")",
"throw",
"new",
"PickleException",
"(",
"\"too few bytes to convert to long\"",
")",... | Convert 4 little endian bytes into an unsigned int (as a long) | [
"Convert",
"4",
"little",
"endian",
"bytes",
"into",
"an",
"unsigned",
"int",
"(",
"as",
"a",
"long",
")"
] | train | https://github.com/irmen/Pyrolite/blob/060bc3c9069cd31560b6da4f67280736fb2cdf63/java/src/main/java/net/razorvine/pickle/PickleUtils.java#L137-L148 |
jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/configfiles/SecretHandler.java | SecretHandler.createSafeSource | private static Source createSafeSource(XMLReader reader, InputSource source) {
"""
Converts a Source into a Source that is protected against XXE attacks.
@see jenkins.util.xml.XMLUtils#safeTransform
"""
try {
reader.setFeature("http://xml.org/sax/features/external-general-entities", false)... | java | private static Source createSafeSource(XMLReader reader, InputSource source) {
try {
reader.setFeature("http://xml.org/sax/features/external-general-entities", false);
} catch (SAXException ignored) {
/* Fallback entity resolver will be used */
}
try {
... | [
"private",
"static",
"Source",
"createSafeSource",
"(",
"XMLReader",
"reader",
",",
"InputSource",
"source",
")",
"{",
"try",
"{",
"reader",
".",
"setFeature",
"(",
"\"http://xml.org/sax/features/external-general-entities\"",
",",
"false",
")",
";",
"}",
"catch",
"(... | Converts a Source into a Source that is protected against XXE attacks.
@see jenkins.util.xml.XMLUtils#safeTransform | [
"Converts",
"a",
"Source",
"into",
"a",
"Source",
"that",
"is",
"protected",
"against",
"XXE",
"attacks",
"."
] | train | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/configfiles/SecretHandler.java#L138-L154 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java | HadoopUtils.renameRecursively | public static void renameRecursively(FileSystem fileSystem, Path from, Path to) throws IOException {
"""
This method is an additive implementation of the {@link FileSystem#rename(Path, Path)} method. It moves all the
files/directories under 'from' path to the 'to' path without overwriting existing directories in ... | java | public static void renameRecursively(FileSystem fileSystem, Path from, Path to) throws IOException {
log.info(String.format("Recursively renaming %s in %s to %s.", from, fileSystem.getUri(), to));
FileSystem throttledFS = getOptionallyThrottledFileSystem(fileSystem, 10000);
ExecutorService executorServic... | [
"public",
"static",
"void",
"renameRecursively",
"(",
"FileSystem",
"fileSystem",
",",
"Path",
"from",
",",
"Path",
"to",
")",
"throws",
"IOException",
"{",
"log",
".",
"info",
"(",
"String",
".",
"format",
"(",
"\"Recursively renaming %s in %s to %s.\"",
",",
"... | This method is an additive implementation of the {@link FileSystem#rename(Path, Path)} method. It moves all the
files/directories under 'from' path to the 'to' path without overwriting existing directories in the 'to' path.
<p>
The rename operation happens at the first non-existent sub-directory. If a directory at des... | [
"This",
"method",
"is",
"an",
"additive",
"implementation",
"of",
"the",
"{",
"@link",
"FileSystem#rename",
"(",
"Path",
"Path",
")",
"}",
"method",
".",
"It",
"moves",
"all",
"the",
"files",
"/",
"directories",
"under",
"from",
"path",
"to",
"the",
"to",
... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java#L505-L537 |
keenon/loglinear | src/main/java/com/github/keenon/loglinear/learning/AbstractBatchOptimizer.java | AbstractBatchOptimizer.addSparseConstraint | public void addSparseConstraint(int component, int index, double value) {
"""
This adds a constraint on the weight vector, that a certain component must be set to a sparse index=value
@param component the component to fix
@param index the index of the fixed sparse component
@param value the value to f... | java | public void addSparseConstraint(int component, int index, double value) {
constraints.add(new Constraint(component, index, value));
} | [
"public",
"void",
"addSparseConstraint",
"(",
"int",
"component",
",",
"int",
"index",
",",
"double",
"value",
")",
"{",
"constraints",
".",
"add",
"(",
"new",
"Constraint",
"(",
"component",
",",
"index",
",",
"value",
")",
")",
";",
"}"
] | This adds a constraint on the weight vector, that a certain component must be set to a sparse index=value
@param component the component to fix
@param index the index of the fixed sparse component
@param value the value to fix at | [
"This",
"adds",
"a",
"constraint",
"on",
"the",
"weight",
"vector",
"that",
"a",
"certain",
"component",
"must",
"be",
"set",
"to",
"a",
"sparse",
"index",
"=",
"value"
] | train | https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/learning/AbstractBatchOptimizer.java#L106-L108 |
alkacon/opencms-core | src/org/opencms/lock/CmsLockUtil.java | CmsLockUtil.ensureLock | public static CmsLockActionRecord ensureLock(CmsObject cms, CmsResource resource) throws CmsException {
"""
Static helper method to lock a resource.<p>
@param cms the CMS context to use
@param resource the resource to lock
@return the action that was taken
@throws CmsException if something goes wrong
"... | java | public static CmsLockActionRecord ensureLock(CmsObject cms, CmsResource resource) throws CmsException {
LockChange change = LockChange.unchanged;
List<CmsResource> blockingResources = cms.getBlockingLockedResources(resource);
if ((blockingResources != null) && !blockingResources.isEmpty()) {
... | [
"public",
"static",
"CmsLockActionRecord",
"ensureLock",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
")",
"throws",
"CmsException",
"{",
"LockChange",
"change",
"=",
"LockChange",
".",
"unchanged",
";",
"List",
"<",
"CmsResource",
">",
"blockingResource... | Static helper method to lock a resource.<p>
@param cms the CMS context to use
@param resource the resource to lock
@return the action that was taken
@throws CmsException if something goes wrong | [
"Static",
"helper",
"method",
"to",
"lock",
"a",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/lock/CmsLockUtil.java#L198-L220 |
hawkular/hawkular-agent | hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/JBossASClient.java | JBossASClient.createRequest | public static ModelNode createRequest(String operation, Address address, ModelNode extra) {
"""
Convienence method that builds a partial operation request node, with additional
node properties supplied by the given node.
@param operation the operation to be requested
@param address identifies the target resou... | java | public static ModelNode createRequest(String operation, Address address, ModelNode extra) {
final ModelNode request = (extra != null) ? extra.clone() : new ModelNode();
request.get(OPERATION).set(operation);
request.get(ADDRESS).set(address.getAddressNode());
return request;
} | [
"public",
"static",
"ModelNode",
"createRequest",
"(",
"String",
"operation",
",",
"Address",
"address",
",",
"ModelNode",
"extra",
")",
"{",
"final",
"ModelNode",
"request",
"=",
"(",
"extra",
"!=",
"null",
")",
"?",
"extra",
".",
"clone",
"(",
")",
":",
... | Convienence method that builds a partial operation request node, with additional
node properties supplied by the given node.
@param operation the operation to be requested
@param address identifies the target resource
@param extra provides additional properties to add to the returned request node.
@return the partial ... | [
"Convienence",
"method",
"that",
"builds",
"a",
"partial",
"operation",
"request",
"node",
"with",
"additional",
"node",
"properties",
"supplied",
"by",
"the",
"given",
"node",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/JBossASClient.java#L138-L143 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.registerBlockListener | public String registerBlockListener(BlockListener listener) throws InvalidArgumentException {
"""
Register a block listener.
@param listener function with single argument with type {@link BlockEvent}
@return The handle of the registered block listener.
@throws InvalidArgumentException if the channel is shutdo... | java | public String registerBlockListener(BlockListener listener) throws InvalidArgumentException {
if (shutdown) {
throw new InvalidArgumentException(format("Channel %s has been shutdown.", name));
}
if (null == listener) {
throw new InvalidArgumentException("Listener parame... | [
"public",
"String",
"registerBlockListener",
"(",
"BlockListener",
"listener",
")",
"throws",
"InvalidArgumentException",
"{",
"if",
"(",
"shutdown",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"format",
"(",
"\"Channel %s has been shutdown.\"",
",",
"nam... | Register a block listener.
@param listener function with single argument with type {@link BlockEvent}
@return The handle of the registered block listener.
@throws InvalidArgumentException if the channel is shutdown. | [
"Register",
"a",
"block",
"listener",
"."
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L5489-L5505 |
eclipse/xtext-extras | org.eclipse.xtext.common.types/src/org/eclipse/xtext/common/types/access/binary/asm/SignatureUtil.java | SignatureUtil.scanTypeVariableSignature | private static int scanTypeVariableSignature(String string, int start) {
"""
Scans the given string for a type variable signature starting at the given
index and returns the index of the last character.
<pre>
TypeVariableSignature:
<b>T</b> Identifier <b>;</b>
</pre>
@param string the signature string
@pa... | java | private static int scanTypeVariableSignature(String string, int start) {
// need a minimum 3 chars "Tx;"
if (start >= string.length() - 2) {
throw new IllegalArgumentException();
}
// must start in "T"
char c = string.charAt(start);
if (c != C_TYPE_VARIABLE) {
throw new IllegalArgumentException();
}... | [
"private",
"static",
"int",
"scanTypeVariableSignature",
"(",
"String",
"string",
",",
"int",
"start",
")",
"{",
"// need a minimum 3 chars \"Tx;\"",
"if",
"(",
"start",
">=",
"string",
".",
"length",
"(",
")",
"-",
"2",
")",
"{",
"throw",
"new",
"IllegalArgum... | Scans the given string for a type variable signature starting at the given
index and returns the index of the last character.
<pre>
TypeVariableSignature:
<b>T</b> Identifier <b>;</b>
</pre>
@param string the signature string
@param start the 0-based character index of the first character
@return the 0-based character... | [
"Scans",
"the",
"given",
"string",
"for",
"a",
"type",
"variable",
"signature",
"starting",
"at",
"the",
"given",
"index",
"and",
"returns",
"the",
"index",
"of",
"the",
"last",
"character",
".",
"<pre",
">",
"TypeVariableSignature",
":",
"<b",
">",
"T<",
... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.common.types/src/org/eclipse/xtext/common/types/access/binary/asm/SignatureUtil.java#L307-L324 |
defei/codelogger-utils | src/main/java/org/codelogger/utils/HttpUtils.java | HttpUtils.doPost | public static String doPost(final String action, final Map<String, String> parameters) {
"""
access given action with given parameters(<strong>default encoding by
"UTF-8"</strong>) by post request without retry when exception.
@param action action url to access
@param parameters parameters to post
@return re... | java | public static String doPost(final String action, final Map<String, String> parameters) {
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
for (Entry<String, String> nameValuePair : parameters.entrySet()) {
nvps.add(new BasicNameValuePair(nameValuePair.getKey(), nameValuePair.getValue()));
}... | [
"public",
"static",
"String",
"doPost",
"(",
"final",
"String",
"action",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"List",
"<",
"NameValuePair",
">",
"nvps",
"=",
"new",
"ArrayList",
"<",
"NameValuePair",
">",
"(",
... | access given action with given parameters(<strong>default encoding by
"UTF-8"</strong>) by post request without retry when exception.
@param action action url to access
@param parameters parameters to post
@return response content of target action url | [
"access",
"given",
"action",
"with",
"given",
"parameters",
"(",
"<strong",
">",
"default",
"encoding",
"by",
"UTF",
"-",
"8",
"<",
"/",
"strong",
">",
")",
"by",
"post",
"request",
"without",
"retry",
"when",
"exception",
"."
] | train | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/HttpUtils.java#L102-L118 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/ReturnValueIgnored.java | ReturnValueIgnored.javaTimeTypes | private static boolean javaTimeTypes(ExpressionTree tree, VisitorState state) {
"""
{@link java.time} types are immutable. The only methods we allow ignoring the return value on
are the {@code parse}-style APIs since folks often use it for validation.
"""
if (packageStartsWith("java.time").matches(tree, s... | java | private static boolean javaTimeTypes(ExpressionTree tree, VisitorState state) {
if (packageStartsWith("java.time").matches(tree, state)) {
return false;
}
Symbol symbol = ASTHelpers.getSymbol(tree);
if (symbol instanceof MethodSymbol) {
MethodSymbol methodSymbol = (MethodSymbol) symbol;
... | [
"private",
"static",
"boolean",
"javaTimeTypes",
"(",
"ExpressionTree",
"tree",
",",
"VisitorState",
"state",
")",
"{",
"if",
"(",
"packageStartsWith",
"(",
"\"java.time\"",
")",
".",
"matches",
"(",
"tree",
",",
"state",
")",
")",
"{",
"return",
"false",
";... | {@link java.time} types are immutable. The only methods we allow ignoring the return value on
are the {@code parse}-style APIs since folks often use it for validation. | [
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/ReturnValueIgnored.java#L105-L121 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/constraint/Constraints.java | Constraints.inRange | public PropertyConstraint inRange(String propertyName, Comparable min, Comparable max) {
"""
Apply a inclusive "range" constraint to a bean property.
@param propertyName the property with the range constraint.
@param min the low edge of the range
@param max the high edge of the range
@return The range constr... | java | public PropertyConstraint inRange(String propertyName, Comparable min, Comparable max) {
return value(propertyName, range(min, max));
} | [
"public",
"PropertyConstraint",
"inRange",
"(",
"String",
"propertyName",
",",
"Comparable",
"min",
",",
"Comparable",
"max",
")",
"{",
"return",
"value",
"(",
"propertyName",
",",
"range",
"(",
"min",
",",
"max",
")",
")",
";",
"}"
] | Apply a inclusive "range" constraint to a bean property.
@param propertyName the property with the range constraint.
@param min the low edge of the range
@param max the high edge of the range
@return The range constraint constraint | [
"Apply",
"a",
"inclusive",
"range",
"constraint",
"to",
"a",
"bean",
"property",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/constraint/Constraints.java#L898-L900 |
albfernandez/itext2 | src/main/java/com/lowagie/text/xml/XmlParser.java | XmlParser.go | public void go(DocListener document, InputSource is, String tagmap) {
"""
Parses a given file.
@param document The document that will listen to the parser
@param is The inputsource with the content
@param tagmap A user defined tagmap
"""
try {
parser.parse(is, new SAXmyHandler(document, ... | java | public void go(DocListener document, InputSource is, String tagmap) {
try {
parser.parse(is, new SAXmyHandler(document, new TagMap(tagmap)));
}
catch(SAXException se) {
throw new ExceptionConverter(se);
}
catch(IOException ioe) {
throw new Exce... | [
"public",
"void",
"go",
"(",
"DocListener",
"document",
",",
"InputSource",
"is",
",",
"String",
"tagmap",
")",
"{",
"try",
"{",
"parser",
".",
"parse",
"(",
"is",
",",
"new",
"SAXmyHandler",
"(",
"document",
",",
"new",
"TagMap",
"(",
"tagmap",
")",
"... | Parses a given file.
@param document The document that will listen to the parser
@param is The inputsource with the content
@param tagmap A user defined tagmap | [
"Parses",
"a",
"given",
"file",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/xml/XmlParser.java#L117-L127 |
awslabs/amazon-sqs-java-messaging-lib | src/main/java/com/amazon/sqs/javamessaging/SQSConnection.java | SQSConnection.createSession | @Override
public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException {
"""
Creates a <code>Session</code>
@param transacted
Only false is supported.
@param acknowledgeMode
Legal values are <code>Session.AUTO_ACKNOWLEDGE</code>,
<code>Session.CLIENT_ACKNOWLEDGE</code>,
<co... | java | @Override
public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException {
checkClosed();
actionOnConnectionTaken = true;
if (transacted || acknowledgeMode == Session.SESSION_TRANSACTED)
throw new JMSException("SQSSession does not support transacted");
... | [
"@",
"Override",
"public",
"Session",
"createSession",
"(",
"boolean",
"transacted",
",",
"int",
"acknowledgeMode",
")",
"throws",
"JMSException",
"{",
"checkClosed",
"(",
")",
";",
"actionOnConnectionTaken",
"=",
"true",
";",
"if",
"(",
"transacted",
"||",
"ack... | Creates a <code>Session</code>
@param transacted
Only false is supported.
@param acknowledgeMode
Legal values are <code>Session.AUTO_ACKNOWLEDGE</code>,
<code>Session.CLIENT_ACKNOWLEDGE</code>,
<code>Session.DUPS_OK_ACKNOWLEDGE</code>, and
<code>SQSSession.UNORDERED_ACKNOWLEDGE</code>
@return a new session.
@throws JM... | [
"Creates",
"a",
"<code",
">",
"Session<",
"/",
"code",
">"
] | train | https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/efa716d34d51ef1c5572790626cdb795419cb342/src/main/java/com/amazon/sqs/javamessaging/SQSConnection.java#L180-L212 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/pool/Pool.java | Pool.addConnection | private void addConnection() throws SQLException {
"""
Create new connection.
@throws SQLException if connection creation failed
"""
//create new connection
Protocol protocol = Utils.retrieveProxy(urlParser, globalInfo);
MariaDbConnection connection = new MariaDbConnection(protocol);
MariaD... | java | private void addConnection() throws SQLException {
//create new connection
Protocol protocol = Utils.retrieveProxy(urlParser, globalInfo);
MariaDbConnection connection = new MariaDbConnection(protocol);
MariaDbPooledConnection pooledConnection = createPoolConnection(connection);
if (options.static... | [
"private",
"void",
"addConnection",
"(",
")",
"throws",
"SQLException",
"{",
"//create new connection",
"Protocol",
"protocol",
"=",
"Utils",
".",
"retrieveProxy",
"(",
"urlParser",
",",
"globalInfo",
")",
";",
"MariaDbConnection",
"connection",
"=",
"new",
"MariaDb... | Create new connection.
@throws SQLException if connection creation failed | [
"Create",
"new",
"connection",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/pool/Pool.java#L215-L246 |
igniterealtime/Smack | smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/media/MediaNegotiator.java | MediaNegotiator.receiveSessionInfoAction | private IQ receiveSessionInfoAction(Jingle jingle, JingleDescription description) throws JingleException {
"""
A content info has been received. This is done for publishing the
list of payload types...
@param jingle
The input packet
@return a Jingle packet
@throws JingleException
"""
IQ response... | java | private IQ receiveSessionInfoAction(Jingle jingle, JingleDescription description) throws JingleException {
IQ response = null;
PayloadType oldBestCommonAudioPt = bestCommonAudioPt;
List<PayloadType> offeredPayloads;
boolean ptChange = false;
offeredPayloads = description.getAudi... | [
"private",
"IQ",
"receiveSessionInfoAction",
"(",
"Jingle",
"jingle",
",",
"JingleDescription",
"description",
")",
"throws",
"JingleException",
"{",
"IQ",
"response",
"=",
"null",
";",
"PayloadType",
"oldBestCommonAudioPt",
"=",
"bestCommonAudioPt",
";",
"List",
"<",... | A content info has been received. This is done for publishing the
list of payload types...
@param jingle
The input packet
@return a Jingle packet
@throws JingleException | [
"A",
"content",
"info",
"has",
"been",
"received",
".",
"This",
"is",
"done",
"for",
"publishing",
"the",
"list",
"of",
"payload",
"types",
"..."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/media/MediaNegotiator.java#L271-L300 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskClient.java | RegionDiskClient.insertRegionDisk | @BetaApi
public final Operation insertRegionDisk(String region, Disk diskResource) {
"""
Creates a persistent regional disk in the specified project using the data included in the
request.
<p>Sample code:
<pre><code>
try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
ProjectRegionName... | java | @BetaApi
public final Operation insertRegionDisk(String region, Disk diskResource) {
InsertRegionDiskHttpRequest request =
InsertRegionDiskHttpRequest.newBuilder()
.setRegion(region)
.setDiskResource(diskResource)
.build();
return insertRegionDisk(request);
} | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"insertRegionDisk",
"(",
"String",
"region",
",",
"Disk",
"diskResource",
")",
"{",
"InsertRegionDiskHttpRequest",
"request",
"=",
"InsertRegionDiskHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"setRegion",
"(",
"reg... | Creates a persistent regional disk in the specified project using the data included in the
request.
<p>Sample code:
<pre><code>
try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
Disk diskResource = Disk.newBuilder().build();... | [
"Creates",
"a",
"persistent",
"regional",
"disk",
"in",
"the",
"specified",
"project",
"using",
"the",
"data",
"included",
"in",
"the",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskClient.java#L520-L529 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/ZoneId.java | ZoneId.getDisplayName | public String getDisplayName(TextStyle style, Locale locale) {
"""
Gets the textual representation of the zone, such as 'British Time' or
'+02:00'.
<p>
This returns the textual name used to identify the time-zone ID,
suitable for presentation to the user.
The parameters control the style of the returned text ... | java | public String getDisplayName(TextStyle style, Locale locale) {
return new DateTimeFormatterBuilder().appendZoneText(style).toFormatter(locale).format(new DefaultInterfaceTemporalAccessor() {
@Override
public boolean isSupported(TemporalField field) {
return false;
... | [
"public",
"String",
"getDisplayName",
"(",
"TextStyle",
"style",
",",
"Locale",
"locale",
")",
"{",
"return",
"new",
"DateTimeFormatterBuilder",
"(",
")",
".",
"appendZoneText",
"(",
"style",
")",
".",
"toFormatter",
"(",
"locale",
")",
".",
"format",
"(",
"... | Gets the textual representation of the zone, such as 'British Time' or
'+02:00'.
<p>
This returns the textual name used to identify the time-zone ID,
suitable for presentation to the user.
The parameters control the style of the returned text and the locale.
<p>
If no textual mapping is found then the {@link #getId() f... | [
"Gets",
"the",
"textual",
"representation",
"of",
"the",
"zone",
"such",
"as",
"British",
"Time",
"or",
"+",
"02",
":",
"00",
".",
"<p",
">",
"This",
"returns",
"the",
"textual",
"name",
"used",
"to",
"identify",
"the",
"time",
"-",
"zone",
"ID",
"suit... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/ZoneId.java#L474-L493 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java | CommerceOrderPersistenceImpl.findByShippingAddressId | @Override
public List<CommerceOrder> findByShippingAddressId(long shippingAddressId,
int start, int end) {
"""
Returns a range of all the commerce orders where shippingAddressId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code... | java | @Override
public List<CommerceOrder> findByShippingAddressId(long shippingAddressId,
int start, int end) {
return findByShippingAddressId(shippingAddressId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceOrder",
">",
"findByShippingAddressId",
"(",
"long",
"shippingAddressId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByShippingAddressId",
"(",
"shippingAddressId",
",",
"start",
",",
"end",
... | Returns a range of all the commerce orders where shippingAddressId = ?.
<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 t... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"orders",
"where",
"shippingAddressId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java#L3053-L3057 |
aws/aws-sdk-java | aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/PutGatewayResponseResult.java | PutGatewayResponseResult.withResponseTemplates | public PutGatewayResponseResult withResponseTemplates(java.util.Map<String, String> responseTemplates) {
"""
<p>
Response templates of the <a>GatewayResponse</a> as a string-to-string map of key-value pairs.
</p>
@param responseTemplates
Response templates of the <a>GatewayResponse</a> as a string-to-string ... | java | public PutGatewayResponseResult withResponseTemplates(java.util.Map<String, String> responseTemplates) {
setResponseTemplates(responseTemplates);
return this;
} | [
"public",
"PutGatewayResponseResult",
"withResponseTemplates",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"responseTemplates",
")",
"{",
"setResponseTemplates",
"(",
"responseTemplates",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Response templates of the <a>GatewayResponse</a> as a string-to-string map of key-value pairs.
</p>
@param responseTemplates
Response templates of the <a>GatewayResponse</a> as a string-to-string map of key-value pairs.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Response",
"templates",
"of",
"the",
"<a",
">",
"GatewayResponse<",
"/",
"a",
">",
"as",
"a",
"string",
"-",
"to",
"-",
"string",
"map",
"of",
"key",
"-",
"value",
"pairs",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/PutGatewayResponseResult.java#L544-L547 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/PartitionRequestClient.java | PartitionRequestClient.sendTaskEvent | public void sendTaskEvent(ResultPartitionID partitionId, TaskEvent event, final RemoteInputChannel inputChannel) throws IOException {
"""
Sends a task event backwards to an intermediate result partition producer.
<p>
Backwards task events flow between readers and writers and therefore
will only work when both a... | java | public void sendTaskEvent(ResultPartitionID partitionId, TaskEvent event, final RemoteInputChannel inputChannel) throws IOException {
checkNotClosed();
tcpChannel.writeAndFlush(new TaskEventRequest(event, partitionId, inputChannel.getInputChannelId()))
.addListener(
new ChannelFutureListener() {
@... | [
"public",
"void",
"sendTaskEvent",
"(",
"ResultPartitionID",
"partitionId",
",",
"TaskEvent",
"event",
",",
"final",
"RemoteInputChannel",
"inputChannel",
")",
"throws",
"IOException",
"{",
"checkNotClosed",
"(",
")",
";",
"tcpChannel",
".",
"writeAndFlush",
"(",
"n... | Sends a task event backwards to an intermediate result partition producer.
<p>
Backwards task events flow between readers and writers and therefore
will only work when both are running at the same time, which is only
guaranteed to be the case when both the respective producer and
consumer task run pipelined. | [
"Sends",
"a",
"task",
"event",
"backwards",
"to",
"an",
"intermediate",
"result",
"partition",
"producer",
".",
"<p",
">",
"Backwards",
"task",
"events",
"flow",
"between",
"readers",
"and",
"writers",
"and",
"therefore",
"will",
"only",
"work",
"when",
"both"... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/PartitionRequestClient.java#L154-L171 |
apollographql/apollo-android | apollo-api/src/main/java/com/apollographql/apollo/api/internal/Utils.java | Utils.areDisjoint | public static <E> boolean areDisjoint(Set<E> setOne, Set<E> setTwo) {
"""
Checks if two {@link Set} are disjoint. Returns true if the sets don't have a single common element. Also returns
true if either of the sets is null.
@param setOne the first set
@param setTwo the second set
@param <E> the value type... | java | public static <E> boolean areDisjoint(Set<E> setOne, Set<E> setTwo) {
if (setOne == null || setTwo == null) {
return true;
}
Set<E> smallerSet = setOne;
Set<E> largerSet = setTwo;
if (setOne.size() > setTwo.size()) {
smallerSet = setTwo;
largerSet = setOne;
}
for (E el : sm... | [
"public",
"static",
"<",
"E",
">",
"boolean",
"areDisjoint",
"(",
"Set",
"<",
"E",
">",
"setOne",
",",
"Set",
"<",
"E",
">",
"setTwo",
")",
"{",
"if",
"(",
"setOne",
"==",
"null",
"||",
"setTwo",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}"... | Checks if two {@link Set} are disjoint. Returns true if the sets don't have a single common element. Also returns
true if either of the sets is null.
@param setOne the first set
@param setTwo the second set
@param <E> the value type contained within the sets
@return True if the sets don't have a single common eleme... | [
"Checks",
"if",
"two",
"{",
"@link",
"Set",
"}",
"are",
"disjoint",
".",
"Returns",
"true",
"if",
"the",
"sets",
"don",
"t",
"have",
"a",
"single",
"common",
"element",
".",
"Also",
"returns",
"true",
"if",
"either",
"of",
"the",
"sets",
"is",
"null",
... | train | https://github.com/apollographql/apollo-android/blob/a78869a76e17f77e42c7a88f0099914fe7ffa5b6/apollo-api/src/main/java/com/apollographql/apollo/api/internal/Utils.java#L41-L57 |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java | ClusterManager.handleDeadNode | private void handleDeadNode(String nodeName, Set<String> sessions) {
"""
All the sessions that had grants on this node should get notified
@param nodeName the name of the node that went dead
"""
LOG.info("Notify sessions: " + sessions + " about dead node " + nodeName);
for (String session : sessions) ... | java | private void handleDeadNode(String nodeName, Set<String> sessions) {
LOG.info("Notify sessions: " + sessions + " about dead node " + nodeName);
for (String session : sessions) {
sessionNotifier.notifyDeadNode(session, nodeName);
}
} | [
"private",
"void",
"handleDeadNode",
"(",
"String",
"nodeName",
",",
"Set",
"<",
"String",
">",
"sessions",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Notify sessions: \"",
"+",
"sessions",
"+",
"\" about dead node \"",
"+",
"nodeName",
")",
";",
"for",
"(",
"Str... | All the sessions that had grants on this node should get notified
@param nodeName the name of the node that went dead | [
"All",
"the",
"sessions",
"that",
"had",
"grants",
"on",
"this",
"node",
"should",
"get",
"notified"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/ClusterManager.java#L900-L905 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/ItemStream.java | ItemStream.addItemStream | public void addItemStream(final ItemStream itemStream, final Transaction transaction)
throws ProtocolException, OutOfCacheSpace, StreamIsFull, TransactionException, PersistenceException, SevereMessageStoreException {
"""
Add an {@link ItemStream} to an item stream under a transaction. An ItemSt... | java | public void addItemStream(final ItemStream itemStream, final Transaction transaction)
throws ProtocolException, OutOfCacheSpace, StreamIsFull, TransactionException, PersistenceException, SevereMessageStoreException
{
addItemStream(itemStream, NO_LOCK_ID, transaction);
} | [
"public",
"void",
"addItemStream",
"(",
"final",
"ItemStream",
"itemStream",
",",
"final",
"Transaction",
"transaction",
")",
"throws",
"ProtocolException",
",",
"OutOfCacheSpace",
",",
"StreamIsFull",
",",
"TransactionException",
",",
"PersistenceException",
",",
"Seve... | Add an {@link ItemStream} to an item stream under a transaction. An ItemStream
can only be added onto one stream at a time. .
<p>This method can be overridden by subclass implementors in order to
customize the behaviour of the stream. Any override should call the superclass
implementation to maintain correct behaviour.... | [
"Add",
"an",
"{",
"@link",
"ItemStream",
"}",
"to",
"an",
"item",
"stream",
"under",
"a",
"transaction",
".",
"An",
"ItemStream",
"can",
"only",
"be",
"added",
"onto",
"one",
"stream",
"at",
"a",
"time",
".",
".",
"<p",
">",
"This",
"method",
"can",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/ItemStream.java#L216-L220 |
Azure/azure-sdk-for-java | storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java | BlobContainersInner.createOrUpdateImmutabilityPolicy | public ImmutabilityPolicyInner createOrUpdateImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, int immutabilityPeriodSinceCreationInDays, String ifMatch) {
"""
Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this ope... | java | public ImmutabilityPolicyInner createOrUpdateImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, int immutabilityPeriodSinceCreationInDays, String ifMatch) {
return createOrUpdateImmutabilityPolicyWithServiceResponseAsync(resourceGroupName, accountName, containerName, immutabi... | [
"public",
"ImmutabilityPolicyInner",
"createOrUpdateImmutabilityPolicy",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"containerName",
",",
"int",
"immutabilityPeriodSinceCreationInDays",
",",
"String",
"ifMatch",
")",
"{",
"return",
"cre... | Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation.
@param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
@param accountName The name of the storage account within the specified res... | [
"Creates",
"or",
"updates",
"an",
"unlocked",
"immutability",
"policy",
".",
"ETag",
"in",
"If",
"-",
"Match",
"is",
"honored",
"if",
"given",
"but",
"not",
"required",
"for",
"this",
"operation",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java#L1096-L1098 |
OwlPlatform/java-owl-sensor | src/main/java/com/owlplatform/sensor/SensorIoHandler.java | SensorIoHandler.messageSent | @Override
public void messageSent(IoSession session, Object message) throws Exception {
"""
Demultiplexes the sent message and passes it to the appropriate method of the IOAdapter.
@see SensorIoAdapter#sensorSampleSent(IoSession, SampleMessage)
@see SensorIoAdapter#handshakeMessageSent(IoSession, HandshakeMessa... | java | @Override
public void messageSent(IoSession session, Object message) throws Exception {
log.debug("{} --> {}", message, session);
if (this.sensorIoAdapter == null) {
log.warn("No SensorIoAdapter defined. Ignoring message to {}: {}",
session, message);
return;
}
if (message instanceof HandshakeMessa... | [
"@",
"Override",
"public",
"void",
"messageSent",
"(",
"IoSession",
"session",
",",
"Object",
"message",
")",
"throws",
"Exception",
"{",
"log",
".",
"debug",
"(",
"\"{} --> {}\"",
",",
"message",
",",
"session",
")",
";",
"if",
"(",
"this",
".",
"sensorIo... | Demultiplexes the sent message and passes it to the appropriate method of the IOAdapter.
@see SensorIoAdapter#sensorSampleSent(IoSession, SampleMessage)
@see SensorIoAdapter#handshakeMessageSent(IoSession, HandshakeMessage) | [
"Demultiplexes",
"the",
"sent",
"message",
"and",
"passes",
"it",
"to",
"the",
"appropriate",
"method",
"of",
"the",
"IOAdapter",
"."
] | train | https://github.com/OwlPlatform/java-owl-sensor/blob/7d98e985f2fc150dd696ca5683ad9ef6514be92b/src/main/java/com/owlplatform/sensor/SensorIoHandler.java#L114-L138 |
phax/ph-css | ph-css/src/main/java/com/helger/css/writer/CSSWriter.java | CSSWriter.writeCSS | public void writeCSS (@Nonnull final ICSSWriteable aCSS, @Nonnull @WillClose final Writer aWriter) throws IOException {
"""
Write the CSS content to the passed writer. No specific charset is used.
@param aCSS
The CSS to write. May not be <code>null</code>.
@param aWriter
The write to write the text to. May n... | java | public void writeCSS (@Nonnull final ICSSWriteable aCSS, @Nonnull @WillClose final Writer aWriter) throws IOException
{
ValueEnforcer.notNull (aCSS, "CSS");
ValueEnforcer.notNull (aWriter, "Writer");
try
{
aWriter.write (aCSS.getAsCSSString (m_aSettings));
}
finally
{
StreamHe... | [
"public",
"void",
"writeCSS",
"(",
"@",
"Nonnull",
"final",
"ICSSWriteable",
"aCSS",
",",
"@",
"Nonnull",
"@",
"WillClose",
"final",
"Writer",
"aWriter",
")",
"throws",
"IOException",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aCSS",
",",
"\"CSS\"",
")",
";... | Write the CSS content to the passed writer. No specific charset is used.
@param aCSS
The CSS to write. May not be <code>null</code>.
@param aWriter
The write to write the text to. May not be <code>null</code>. Is
automatically closed after the writing!
@throws IOException
In case writing fails.
@throws IllegalStateExc... | [
"Write",
"the",
"CSS",
"content",
"to",
"the",
"passed",
"writer",
".",
"No",
"specific",
"charset",
"is",
"used",
"."
] | train | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/writer/CSSWriter.java#L395-L408 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterJoinManager.java | ClusterJoinManager.sendJoinRequest | public boolean sendJoinRequest(Address toAddress, boolean withCredentials) {
"""
Send join request to {@code toAddress}.
@param toAddress the currently known master address.
@param withCredentials use cluster credentials
@return {@code true} if join request was sent successfully, otherwise {@code false}... | java | public boolean sendJoinRequest(Address toAddress, boolean withCredentials) {
if (toAddress == null) {
toAddress = clusterService.getMasterAddress();
}
JoinRequestOp joinRequest = new JoinRequestOp(node.createJoinRequest(withCredentials));
return nodeEngine.getOperationService... | [
"public",
"boolean",
"sendJoinRequest",
"(",
"Address",
"toAddress",
",",
"boolean",
"withCredentials",
")",
"{",
"if",
"(",
"toAddress",
"==",
"null",
")",
"{",
"toAddress",
"=",
"clusterService",
".",
"getMasterAddress",
"(",
")",
";",
"}",
"JoinRequestOp",
... | Send join request to {@code toAddress}.
@param toAddress the currently known master address.
@param withCredentials use cluster credentials
@return {@code true} if join request was sent successfully, otherwise {@code false}. | [
"Send",
"join",
"request",
"to",
"{",
"@code",
"toAddress",
"}",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterJoinManager.java#L446-L452 |
ops4j/org.ops4j.pax.wicket | service/src/main/java/org/ops4j/pax/wicket/internal/injection/registry/OSGiServiceRegistryProxyTargetLocator.java | OSGiServiceRegistryProxyTargetLocator.fetchReferences | public ServiceReference<?>[] fetchReferences() {
"""
<p>fetchReferences.</p>
@return an array of {@link org.osgi.framework.ServiceReference} objects.
"""
try {
LOGGER.debug("Try to locate a suitable service for objectClass = "
+ serviceInterface + " and filter = " + f... | java | public ServiceReference<?>[] fetchReferences() {
try {
LOGGER.debug("Try to locate a suitable service for objectClass = "
+ serviceInterface + " and filter = " + filterString);
return bundleContext.getAllServiceReferences(serviceInterface, filterString);
} cat... | [
"public",
"ServiceReference",
"<",
"?",
">",
"[",
"]",
"fetchReferences",
"(",
")",
"{",
"try",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Try to locate a suitable service for objectClass = \"",
"+",
"serviceInterface",
"+",
"\" and filter = \"",
"+",
"filterString",
")",
... | <p>fetchReferences.</p>
@return an array of {@link org.osgi.framework.ServiceReference} objects. | [
"<p",
">",
"fetchReferences",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ops4j/org.ops4j.pax.wicket/blob/ef7cb4bdf918e9e61ec69789b9c690567616faa9/service/src/main/java/org/ops4j/pax/wicket/internal/injection/registry/OSGiServiceRegistryProxyTargetLocator.java#L101-L110 |
apereo/cas | core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java | WebUtils.getService | public static WebApplicationService getService(final List<ArgumentExtractor> argumentExtractors, final RequestContext context) {
"""
Gets the service.
@param argumentExtractors the argument extractors
@param context the context
@return the service
"""
val request = WebUtils.getHttpServl... | java | public static WebApplicationService getService(final List<ArgumentExtractor> argumentExtractors, final RequestContext context) {
val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(context);
return HttpRequestUtils.getService(argumentExtractors, request);
} | [
"public",
"static",
"WebApplicationService",
"getService",
"(",
"final",
"List",
"<",
"ArgumentExtractor",
">",
"argumentExtractors",
",",
"final",
"RequestContext",
"context",
")",
"{",
"val",
"request",
"=",
"WebUtils",
".",
"getHttpServletRequestFromExternalWebflowCont... | Gets the service.
@param argumentExtractors the argument extractors
@param context the context
@return the service | [
"Gets",
"the",
"service",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java#L137-L140 |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/DistributedLayoutManager.java | DistributedLayoutManager.updateNodeAttribute | private void updateNodeAttribute(
Element ilfNode,
String nodeId,
String attName,
String newVal,
String oldVal,
List<ILayoutProcessingAction> pendingActions)
throws PortalException {
"""
Handles checking for updates to a named attr... | java | private void updateNodeAttribute(
Element ilfNode,
String nodeId,
String attName,
String newVal,
String oldVal,
List<ILayoutProcessingAction> pendingActions)
throws PortalException {
if (newVal == null && oldVal != null
... | [
"private",
"void",
"updateNodeAttribute",
"(",
"Element",
"ilfNode",
",",
"String",
"nodeId",
",",
"String",
"attName",
",",
"String",
"newVal",
",",
"String",
"oldVal",
",",
"List",
"<",
"ILayoutProcessingAction",
">",
"pendingActions",
")",
"throws",
"PortalExce... | Handles checking for updates to a named attribute, verifying such change is allowed, and
generates an action object to make that change.
@param ilfNode the node in the viewed layout
@param nodeId the id of the ilfNode
@param attName the attribute to be checked
@param newVal the attribute's new value
@param oldVal the ... | [
"Handles",
"checking",
"for",
"updates",
"to",
"a",
"named",
"attribute",
"verifying",
"such",
"change",
"is",
"allowed",
"and",
"generates",
"an",
"action",
"object",
"to",
"make",
"that",
"change",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/DistributedLayoutManager.java#L659-L721 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/IntegrationAccountBatchConfigurationsInner.java | IntegrationAccountBatchConfigurationsInner.listAsync | public Observable<List<BatchConfigurationInner>> listAsync(String resourceGroupName, String integrationAccountName) {
"""
List the batch configurations for an integration account.
@param resourceGroupName The resource group name.
@param integrationAccountName The integration account name.
@throws IllegalArgum... | java | public Observable<List<BatchConfigurationInner>> listAsync(String resourceGroupName, String integrationAccountName) {
return listWithServiceResponseAsync(resourceGroupName, integrationAccountName).map(new Func1<ServiceResponse<List<BatchConfigurationInner>>, List<BatchConfigurationInner>>() {
@Overr... | [
"public",
"Observable",
"<",
"List",
"<",
"BatchConfigurationInner",
">",
">",
"listAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"integrationAccountName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"integrationAccountN... | List the batch configurations for an integration account.
@param resourceGroupName The resource group name.
@param integrationAccountName The integration account name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the List<BatchConfigurationInner> object | [
"List",
"the",
"batch",
"configurations",
"for",
"an",
"integration",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/IntegrationAccountBatchConfigurationsInner.java#L112-L119 |
mercadopago/dx-java | src/main/java/com/mercadopago/core/MPBase.java | MPBase.fillResourceWithResponseData | protected static <T extends MPBase> T fillResourceWithResponseData(T resource, MPApiResponse response) throws MPException {
"""
It fills all the attributes members of the Resource obj.
Used when a Get or a Put request is called
@param response Response of the request
@throws MPException
"""
... | java | protected static <T extends MPBase> T fillResourceWithResponseData(T resource, MPApiResponse response) throws MPException {
if (response.getJsonElementResponse() != null &&
response.getJsonElementResponse().isJsonObject()) {
JsonObject jsonObject = (JsonObject) response.getJsonElemen... | [
"protected",
"static",
"<",
"T",
"extends",
"MPBase",
">",
"T",
"fillResourceWithResponseData",
"(",
"T",
"resource",
",",
"MPApiResponse",
"response",
")",
"throws",
"MPException",
"{",
"if",
"(",
"response",
".",
"getJsonElementResponse",
"(",
")",
"!=",
"null... | It fills all the attributes members of the Resource obj.
Used when a Get or a Put request is called
@param response Response of the request
@throws MPException | [
"It",
"fills",
"all",
"the",
"attributes",
"members",
"of",
"the",
"Resource",
"obj",
".",
"Used",
"when",
"a",
"Get",
"or",
"a",
"Put",
"request",
"is",
"called"
] | train | https://github.com/mercadopago/dx-java/blob/9df65a6bfb4db0c1fddd7699a5b109643961b03f/src/main/java/com/mercadopago/core/MPBase.java#L349-L358 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java | DateTimeFormatterBuilder.appendFixedSignedDecimal | public DateTimeFormatterBuilder appendFixedSignedDecimal(
DateTimeFieldType fieldType, int numDigits) {
"""
Instructs the printer to emit a field value as a fixed-width decimal
number (smaller numbers will be left-padded with zeros), and the parser
to expect an signed decimal number with the same fix... | java | public DateTimeFormatterBuilder appendFixedSignedDecimal(
DateTimeFieldType fieldType, int numDigits) {
if (fieldType == null) {
throw new IllegalArgumentException("Field type must not be null");
}
if (numDigits <= 0) {
throw new IllegalArgumentException("Ille... | [
"public",
"DateTimeFormatterBuilder",
"appendFixedSignedDecimal",
"(",
"DateTimeFieldType",
"fieldType",
",",
"int",
"numDigits",
")",
"{",
"if",
"(",
"fieldType",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Field type must not be null\"",
... | Instructs the printer to emit a field value as a fixed-width decimal
number (smaller numbers will be left-padded with zeros), and the parser
to expect an signed decimal number with the same fixed width.
@param fieldType type of field to append
@param numDigits the exact number of digits to parse or print, except if
... | [
"Instructs",
"the",
"printer",
"to",
"emit",
"a",
"field",
"value",
"as",
"a",
"fixed",
"-",
"width",
"decimal",
"number",
"(",
"smaller",
"numbers",
"will",
"be",
"left",
"-",
"padded",
"with",
"zeros",
")",
"and",
"the",
"parser",
"to",
"expect",
"an",... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java#L515-L524 |
netty/netty | handler/src/main/java/io/netty/handler/ssl/SslContext.java | SslContext.newClientContext | @Deprecated
public static SslContext newClientContext(
File certChainFile, TrustManagerFactory trustManagerFactory) throws SSLException {
"""
Creates a new client-side {@link SslContext}.
@param certChainFile an X.509 certificate chain file in PEM format.
{@code null} to use the system default
... | java | @Deprecated
public static SslContext newClientContext(
File certChainFile, TrustManagerFactory trustManagerFactory) throws SSLException {
return newClientContext(null, certChainFile, trustManagerFactory);
} | [
"@",
"Deprecated",
"public",
"static",
"SslContext",
"newClientContext",
"(",
"File",
"certChainFile",
",",
"TrustManagerFactory",
"trustManagerFactory",
")",
"throws",
"SSLException",
"{",
"return",
"newClientContext",
"(",
"null",
",",
"certChainFile",
",",
"trustMana... | Creates a new client-side {@link SslContext}.
@param certChainFile an X.509 certificate chain file in PEM format.
{@code null} to use the system default
@param trustManagerFactory the {@link TrustManagerFactory} that provides the {@link TrustManager}s
that verifies the certificates sent from servers.
{@code null} to u... | [
"Creates",
"a",
"new",
"client",
"-",
"side",
"{",
"@link",
"SslContext",
"}",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslContext.java#L495-L499 |
mojohaus/jaxb2-maven-plugin | src/main/java/org/codehaus/mojo/jaxb2/shared/environment/logging/LoggingHandlerEnvironmentFacet.java | LoggingHandlerEnvironmentFacet.create | public static LoggingHandlerEnvironmentFacet create(final Log mavenLog,
final Class<? extends AbstractJaxbMojo> caller,
final String encoding) {
"""
Factory method creating a new LoggingHandlerEnvironmen... | java | public static LoggingHandlerEnvironmentFacet create(final Log mavenLog,
final Class<? extends AbstractJaxbMojo> caller,
final String encoding) {
// Check sanity
Validate.notNull(mavenLog, "ma... | [
"public",
"static",
"LoggingHandlerEnvironmentFacet",
"create",
"(",
"final",
"Log",
"mavenLog",
",",
"final",
"Class",
"<",
"?",
"extends",
"AbstractJaxbMojo",
">",
"caller",
",",
"final",
"String",
"encoding",
")",
"{",
"// Check sanity",
"Validate",
".",
"notNu... | Factory method creating a new LoggingHandlerEnvironmentFacet wrapping the supplied properties.
@param mavenLog The active Maven Log.
@param caller The AbstractJaxbMojo subclass which invoked this LoggingHandlerEnvironmentFacet factory method.
@param encoding The encoding used by the Maven Mojo subclass.
@return A fu... | [
"Factory",
"method",
"creating",
"a",
"new",
"LoggingHandlerEnvironmentFacet",
"wrapping",
"the",
"supplied",
"properties",
"."
] | train | https://github.com/mojohaus/jaxb2-maven-plugin/blob/e3c4e47943b15282e5a6e850bbfb1588d8452a0a/src/main/java/org/codehaus/mojo/jaxb2/shared/environment/logging/LoggingHandlerEnvironmentFacet.java#L142-L158 |
sitoolkit/sit-wt-all | sit-wt-runtime/src/main/java/io/sitoolkit/wt/domain/evidence/LogRecord.java | LogRecord.create | public static LogRecord create(SitLogger logger, LogLevelVo logLevel, TestStep testStep,
String messageKey, Object... params) {
"""
操作ログオブジェクトを作成します。
@param logger
ロガー
@param logLevel
ログレベル
@param testStep
テストステップ
@param messageKey
メッセージキー
@param params
メッセージパラメーター
@return 操作ログ
"""
... | java | public static LogRecord create(SitLogger logger, LogLevelVo logLevel, TestStep testStep,
String messageKey, Object... params) {
String msg = MessageManager.getMessage(messageKey, params);
switch (logLevel) {
case INFO:
logger.infoMsg(msg);
... | [
"public",
"static",
"LogRecord",
"create",
"(",
"SitLogger",
"logger",
",",
"LogLevelVo",
"logLevel",
",",
"TestStep",
"testStep",
",",
"String",
"messageKey",
",",
"Object",
"...",
"params",
")",
"{",
"String",
"msg",
"=",
"MessageManager",
".",
"getMessage",
... | 操作ログオブジェクトを作成します。
@param logger
ロガー
@param logLevel
ログレベル
@param testStep
テストステップ
@param messageKey
メッセージキー
@param params
メッセージパラメーター
@return 操作ログ | [
"操作ログオブジェクトを作成します。"
] | train | https://github.com/sitoolkit/sit-wt-all/blob/efabde27aa731a5602d2041e137721a22f4fd27a/sit-wt-runtime/src/main/java/io/sitoolkit/wt/domain/evidence/LogRecord.java#L151-L176 |
guardtime/ksi-java-sdk | ksi-service-client-apache-http/src/main/java/com/guardtime/ksi/service/client/http/apache/AbstractApacheHttpClient.java | AbstractApacheHttpClient.createProxyRoutePlanner | private DefaultProxyRoutePlanner createProxyRoutePlanner(HttpSettings settings, HttpAsyncClientBuilder httpClientBuilder) {
"""
Creates default proxy route planner.
@param settings
settings to use.
@param httpClientBuilder
http client builder.
@return Instance of {@link DefaultProxyRoutePlanner}.
"""
... | java | private DefaultProxyRoutePlanner createProxyRoutePlanner(HttpSettings settings, HttpAsyncClientBuilder httpClientBuilder) {
HttpHost proxy = new HttpHost(settings.getProxyUrl().getHost(), settings.getProxyUrl().getPort());
if (settings.getProxyUser() != null) {
CredentialsProvider credential... | [
"private",
"DefaultProxyRoutePlanner",
"createProxyRoutePlanner",
"(",
"HttpSettings",
"settings",
",",
"HttpAsyncClientBuilder",
"httpClientBuilder",
")",
"{",
"HttpHost",
"proxy",
"=",
"new",
"HttpHost",
"(",
"settings",
".",
"getProxyUrl",
"(",
")",
".",
"getHost",
... | Creates default proxy route planner.
@param settings
settings to use.
@param httpClientBuilder
http client builder.
@return Instance of {@link DefaultProxyRoutePlanner}. | [
"Creates",
"default",
"proxy",
"route",
"planner",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-service-client-apache-http/src/main/java/com/guardtime/ksi/service/client/http/apache/AbstractApacheHttpClient.java#L153-L164 |
citiususc/hipster | hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/ScalarOperation.java | ScalarOperation.doubleMultiplicationOp | public static ScalarOperation<Double> doubleMultiplicationOp() {
"""
Builds the scaling operation for Doubles, that is the multiplying
operation for the factor.
@return {@link ScalarOperation} for Double
"""
return new ScalarOperation<Double>(new ScalarFunction<Double>() {
@Override
public Double ... | java | public static ScalarOperation<Double> doubleMultiplicationOp() {
return new ScalarOperation<Double>(new ScalarFunction<Double>() {
@Override
public Double scale(Double a, double b) {
return a * b;
}
}, 1d);
} | [
"public",
"static",
"ScalarOperation",
"<",
"Double",
">",
"doubleMultiplicationOp",
"(",
")",
"{",
"return",
"new",
"ScalarOperation",
"<",
"Double",
">",
"(",
"new",
"ScalarFunction",
"<",
"Double",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Double",
... | Builds the scaling operation for Doubles, that is the multiplying
operation for the factor.
@return {@link ScalarOperation} for Double | [
"Builds",
"the",
"scaling",
"operation",
"for",
"Doubles",
"that",
"is",
"the",
"multiplying",
"operation",
"for",
"the",
"factor",
"."
] | train | https://github.com/citiususc/hipster/blob/9ab1236abb833a27641ae73ba9ca890d5c17598e/hipster-core/src/main/java/es/usc/citius/hipster/model/function/impl/ScalarOperation.java#L53-L62 |
dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.copyFromCopyRef | public /*@Nullable*/DbxEntry copyFromCopyRef(String copyRef, String toPath)
throws DbxException {
"""
Create a file or folder at {@code toPath} based on the given copy ref (created with
{@link #createCopyRef}).
"""
if (copyRef == null) throw new IllegalArgumentException("'copyRef' can't be nul... | java | public /*@Nullable*/DbxEntry copyFromCopyRef(String copyRef, String toPath)
throws DbxException
{
if (copyRef == null) throw new IllegalArgumentException("'copyRef' can't be null");
if (copyRef.length() == 0) throw new IllegalArgumentException("'copyRef' can't be empty");
DbxPathV1.c... | [
"public",
"/*@Nullable*/",
"DbxEntry",
"copyFromCopyRef",
"(",
"String",
"copyRef",
",",
"String",
"toPath",
")",
"throws",
"DbxException",
"{",
"if",
"(",
"copyRef",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"'copyRef' can't be null\"",
... | Create a file or folder at {@code toPath} based on the given copy ref (created with
{@link #createCopyRef}). | [
"Create",
"a",
"file",
"or",
"folder",
"at",
"{"
] | train | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L2097-L2122 |
EvidentSolutions/dalesbred | dalesbred/src/main/java/org/dalesbred/Database.java | Database.findMap | public @NotNull <K,V> Map<K, V> findMap(@NotNull Class<K> keyType,
@NotNull Class<V> valueType,
@NotNull @SQL String sql,
Object... args) {
"""
Executes a query that returns at least two values and creates a ma... | java | public @NotNull <K,V> Map<K, V> findMap(@NotNull Class<K> keyType,
@NotNull Class<V> valueType,
@NotNull @SQL String sql,
Object... args) {
return findMap(keyType, valueType, SqlQuery.query(sql, args));
... | [
"public",
"@",
"NotNull",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"findMap",
"(",
"@",
"NotNull",
"Class",
"<",
"K",
">",
"keyType",
",",
"@",
"NotNull",
"Class",
"<",
"V",
">",
"valueType",
",",
"@",
"NotNull",
"@",
"SQL",
"St... | Executes a query that returns at least two values and creates a map from the results,
using the first value as the key and rest of the values for instantiating {@code V}.
<p>If the keys of the result are not distinct, the result contains the last binding of given key. | [
"Executes",
"a",
"query",
"that",
"returns",
"at",
"least",
"two",
"values",
"and",
"creates",
"a",
"map",
"from",
"the",
"results",
"using",
"the",
"first",
"value",
"as",
"the",
"key",
"and",
"rest",
"of",
"the",
"values",
"for",
"instantiating",
"{",
... | train | https://github.com/EvidentSolutions/dalesbred/blob/713f5b6e152d97e1672ca68b9ff9c7c6c288ceb1/dalesbred/src/main/java/org/dalesbred/Database.java#L575-L580 |
cqframework/clinical_quality_language | Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/Cql2ElmVisitor.java | Cql2ElmVisitor.attemptDateRangeOptimization | private boolean attemptDateRangeOptimization(BinaryExpression during, Retrieve retrieve, String alias) {
"""
Test a <code>BinaryExpression</code> expression and determine if it is suitable to be refactored into the
<code>Retrieve</code> as a date range restriction. If so, adjust the <code>Retrieve</code>
accord... | java | private boolean attemptDateRangeOptimization(BinaryExpression during, Retrieve retrieve, String alias) {
if (retrieve.getDateProperty() != null || retrieve.getDateRange() != null) {
return false;
}
Expression left = during.getOperand().get(0);
Expression right = during.getOp... | [
"private",
"boolean",
"attemptDateRangeOptimization",
"(",
"BinaryExpression",
"during",
",",
"Retrieve",
"retrieve",
",",
"String",
"alias",
")",
"{",
"if",
"(",
"retrieve",
".",
"getDateProperty",
"(",
")",
"!=",
"null",
"||",
"retrieve",
".",
"getDateRange",
... | Test a <code>BinaryExpression</code> expression and determine if it is suitable to be refactored into the
<code>Retrieve</code> as a date range restriction. If so, adjust the <code>Retrieve</code>
accordingly and return <code>true</code>.
@param during the <code>BinaryExpression</code> expression to potentially ref... | [
"Test",
"a",
"<code",
">",
"BinaryExpression<",
"/",
"code",
">",
"expression",
"and",
"determine",
"if",
"it",
"is",
"suitable",
"to",
"be",
"refactored",
"into",
"the",
"<code",
">",
"Retrieve<",
"/",
"code",
">",
"as",
"a",
"date",
"range",
"restriction... | train | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/Cql2ElmVisitor.java#L3032-L3048 |
jbundle/jbundle | base/message/core/src/main/java/org/jbundle/base/message/core/trx/TrxMessageHeader.java | TrxMessageHeader.createReplyHeader | public TrxMessageHeader createReplyHeader() {
"""
Given this message header, set up a reply header.
Note: Swap the source and destimation, set the message to the reply message,
move the registry ID here.
@return The new reply header.
"""
Map<String,Object> mapInHeader = this.getMessageHeaderMap();
... | java | public TrxMessageHeader createReplyHeader()
{
Map<String,Object> mapInHeader = this.getMessageHeaderMap();
Map<String,Object> mapInInfo = this.getMessageInfoMap();
Map<String,Object> mapReplyHeader = new HashMap<String,Object>();
Map<String,Object> mapReplyInfo = new HashMap<String,O... | [
"public",
"TrxMessageHeader",
"createReplyHeader",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"mapInHeader",
"=",
"this",
".",
"getMessageHeaderMap",
"(",
")",
";",
"Map",
"<",
"String",
",",
"Object",
">",
"mapInInfo",
"=",
"this",
".",
"get... | Given this message header, set up a reply header.
Note: Swap the source and destimation, set the message to the reply message,
move the registry ID here.
@return The new reply header. | [
"Given",
"this",
"message",
"header",
"set",
"up",
"a",
"reply",
"header",
".",
"Note",
":",
"Swap",
"the",
"source",
"and",
"destimation",
"set",
"the",
"message",
"to",
"the",
"reply",
"message",
"move",
"the",
"registry",
"ID",
"here",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/message/core/src/main/java/org/jbundle/base/message/core/trx/TrxMessageHeader.java#L366-L392 |
alkacon/opencms-core | src/org/opencms/acacia/shared/CmsWidgetUtil.java | CmsWidgetUtil.generatePipeSeparatedConfigString | public static String generatePipeSeparatedConfigString(Map<String, String> options) {
"""
Generates a pipe separated option string from the map,
e.g., for {key1 -> value1, key2 -> null, key3 -> value3} the string "key1=value1|key2|key3=value3" will be generated.
@param options the map with the config options.
... | java | public static String generatePipeSeparatedConfigString(Map<String, String> options) {
StringBuffer result = new StringBuffer();
for (Entry<String, String> option : options.entrySet()) {
result.append('|');
result.append(option.getKey());
if (option.getValue() != null... | [
"public",
"static",
"String",
"generatePipeSeparatedConfigString",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"for",
"(",
"Entry",
"<",
"String",
",",
"String",
">"... | Generates a pipe separated option string from the map,
e.g., for {key1 -> value1, key2 -> null, key3 -> value3} the string "key1=value1|key2|key3=value3" will be generated.
@param options the map with the config options.
@return the options as pipe separated string. | [
"Generates",
"a",
"pipe",
"separated",
"option",
"string",
"from",
"the",
"map",
"e",
".",
"g",
".",
"for",
"{",
"key1",
"-",
">",
"value1",
"key2",
"-",
">",
"null",
"key3",
"-",
">",
"value3",
"}",
"the",
"string",
"key1",
"=",
"value1|key2|key3",
... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/acacia/shared/CmsWidgetUtil.java#L45-L56 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java | SearchIndex.createDocument | protected Document createDocument(NodeDataIndexing node, NamespaceMappings nsMappings,
IndexFormatVersion indexFormatVersion, boolean loadAllProperties, VolatileIndex volatileIndex) throws RepositoryException {
"""
Creates a lucene <code>Document</code> for a node state using the
namespace mappings <code>ns... | java | protected Document createDocument(NodeDataIndexing node, NamespaceMappings nsMappings,
IndexFormatVersion indexFormatVersion, boolean loadAllProperties, VolatileIndex volatileIndex) throws RepositoryException
{
NodeIndexer indexer =
new NodeIndexer(node, getContext().getItemStateManager(), nsMap... | [
"protected",
"Document",
"createDocument",
"(",
"NodeDataIndexing",
"node",
",",
"NamespaceMappings",
"nsMappings",
",",
"IndexFormatVersion",
"indexFormatVersion",
",",
"boolean",
"loadAllProperties",
",",
"VolatileIndex",
"volatileIndex",
")",
"throws",
"RepositoryException... | Creates a lucene <code>Document</code> for a node state using the
namespace mappings <code>nsMappings</code>.
@param node
the node state to index.
@param nsMappings
the namespace mappings of the search index.
@param indexFormatVersion
the index format version that should be used to index the
passed node state.
@param ... | [
"Creates",
"a",
"lucene",
"<code",
">",
"Document<",
"/",
"code",
">",
"for",
"a",
"node",
"state",
"using",
"the",
"namespace",
"mappings",
"<code",
">",
"nsMappings<",
"/",
"code",
">",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java#L1841-L1855 |
michel-kraemer/citeproc-java | citeproc-java/src/main/java/de/undercouch/citeproc/CSL.java | CSL.makeAdhocBibliography | public static Bibliography makeAdhocBibliography(String style, String outputFormat,
CSLItemData... items) throws IOException {
"""
Creates an ad hoc bibliography from the given citation items. Calling
this method is rather expensive as it initializes the CSL processor.
If you need to create bibliographies mul... | java | public static Bibliography makeAdhocBibliography(String style, String outputFormat,
CSLItemData... items) throws IOException {
ItemDataProvider provider = new ListItemDataProvider(items);
try (CSL csl = new CSL(provider, style)) {
csl.setOutputFormat(outputFormat);
String[] ids = new String[items.length];... | [
"public",
"static",
"Bibliography",
"makeAdhocBibliography",
"(",
"String",
"style",
",",
"String",
"outputFormat",
",",
"CSLItemData",
"...",
"items",
")",
"throws",
"IOException",
"{",
"ItemDataProvider",
"provider",
"=",
"new",
"ListItemDataProvider",
"(",
"items",... | Creates an ad hoc bibliography from the given citation items. Calling
this method is rather expensive as it initializes the CSL processor.
If you need to create bibliographies multiple times in your application
you should create the processor yourself and cache it if necessary.
@param style the citation style to use. M... | [
"Creates",
"an",
"ad",
"hoc",
"bibliography",
"from",
"the",
"given",
"citation",
"items",
".",
"Calling",
"this",
"method",
"is",
"rather",
"expensive",
"as",
"it",
"initializes",
"the",
"CSL",
"processor",
".",
"If",
"you",
"need",
"to",
"create",
"bibliog... | train | https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/CSL.java#L952-L966 |
houbb/log-integration | src/main/java/com/github/houbb/log/integration/adaptors/jdbc/PreparedStatementLogger.java | PreparedStatementLogger.newInstance | public static PreparedStatement newInstance(PreparedStatement stmt, Log statementLog, int queryStack) {
"""
/*
Creates a logging version of a PreparedStatement
@param stmt - the statement
@param sql - the sql statement
@return - the proxy
"""
InvocationHandler handler = new PreparedStatementLogger(s... | java | public static PreparedStatement newInstance(PreparedStatement stmt, Log statementLog, int queryStack) {
InvocationHandler handler = new PreparedStatementLogger(stmt, statementLog, queryStack);
ClassLoader cl = PreparedStatement.class.getClassLoader();
return (PreparedStatement) Proxy.newProxyInstance(cl, ne... | [
"public",
"static",
"PreparedStatement",
"newInstance",
"(",
"PreparedStatement",
"stmt",
",",
"Log",
"statementLog",
",",
"int",
"queryStack",
")",
"{",
"InvocationHandler",
"handler",
"=",
"new",
"PreparedStatementLogger",
"(",
"stmt",
",",
"statementLog",
",",
"q... | /*
Creates a logging version of a PreparedStatement
@param stmt - the statement
@param sql - the sql statement
@return - the proxy | [
"/",
"*",
"Creates",
"a",
"logging",
"version",
"of",
"a",
"PreparedStatement"
] | train | https://github.com/houbb/log-integration/blob/c5e979719aec12a02f7d22b24b04b6fbb1789ca5/src/main/java/com/github/houbb/log/integration/adaptors/jdbc/PreparedStatementLogger.java#L99-L103 |
aoindustries/aocode-public | src/main/java/com/aoindustries/io/NativeToUnixWriter.java | NativeToUnixWriter.getInstance | public static Writer getInstance(Writer out) {
"""
Gets an instance of the Writer that performs the conversion.
The implementation may be optimized for common platforms.
"""
// Already in Unix format, no conversion necessary
if(UNIX_EOL.equals(EOL)) return out;
// Use FindReplaceWriter
return new Find... | java | public static Writer getInstance(Writer out) {
// Already in Unix format, no conversion necessary
if(UNIX_EOL.equals(EOL)) return out;
// Use FindReplaceWriter
return new FindReplaceWriter(out, EOL, UNIX_EOL);
} | [
"public",
"static",
"Writer",
"getInstance",
"(",
"Writer",
"out",
")",
"{",
"// Already in Unix format, no conversion necessary",
"if",
"(",
"UNIX_EOL",
".",
"equals",
"(",
"EOL",
")",
")",
"return",
"out",
";",
"// Use FindReplaceWriter",
"return",
"new",
"FindRep... | Gets an instance of the Writer that performs the conversion.
The implementation may be optimized for common platforms. | [
"Gets",
"an",
"instance",
"of",
"the",
"Writer",
"that",
"performs",
"the",
"conversion",
".",
"The",
"implementation",
"may",
"be",
"optimized",
"for",
"common",
"platforms",
"."
] | train | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/io/NativeToUnixWriter.java#L54-L59 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/io/ColumnTypeDetector.java | ColumnTypeDetector.detectType | private ColumnType detectType(List<String> valuesList, ReadOptions options) {
"""
Returns a predicted ColumnType derived by analyzing the given list of undifferentiated strings read from a
column in the file and applying the given Locale and options
"""
CopyOnWriteArrayList<AbstractColumnParser<?>> p... | java | private ColumnType detectType(List<String> valuesList, ReadOptions options) {
CopyOnWriteArrayList<AbstractColumnParser<?>> parsers = new CopyOnWriteArrayList<>(getParserList(typeArray, options));
CopyOnWriteArrayList<ColumnType> typeCandidates = new CopyOnWriteArrayList<>(typeArray);
for (St... | [
"private",
"ColumnType",
"detectType",
"(",
"List",
"<",
"String",
">",
"valuesList",
",",
"ReadOptions",
"options",
")",
"{",
"CopyOnWriteArrayList",
"<",
"AbstractColumnParser",
"<",
"?",
">",
">",
"parsers",
"=",
"new",
"CopyOnWriteArrayList",
"<>",
"(",
"get... | Returns a predicted ColumnType derived by analyzing the given list of undifferentiated strings read from a
column in the file and applying the given Locale and options | [
"Returns",
"a",
"predicted",
"ColumnType",
"derived",
"by",
"analyzing",
"the",
"given",
"list",
"of",
"undifferentiated",
"strings",
"read",
"from",
"a",
"column",
"in",
"the",
"file",
"and",
"applying",
"the",
"given",
"Locale",
"and",
"options"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/io/ColumnTypeDetector.java#L161-L176 |
molgenis/molgenis | molgenis-navigator/src/main/java/org/molgenis/navigator/copy/service/RelationTransformer.java | RelationTransformer.transformMappedBys | static void transformMappedBys(EntityType entityType, Map<String, Attribute> newAttributes) {
"""
Changes the 'mappedBy' property of all {@link AttributeType#ONE_TO_MANY} attributes of an
{@link EntityType} to other, new Attributes. Does nothing for mappedBy attributes whose IDs are
not present in the supplied M... | java | static void transformMappedBys(EntityType entityType, Map<String, Attribute> newAttributes) {
if (newAttributes.isEmpty()) {
return;
}
stream(entityType.getAtomicAttributes())
.filter(Attribute::isMappedBy)
.forEach(attr -> transformMappedBy(attr, newAttributes));
} | [
"static",
"void",
"transformMappedBys",
"(",
"EntityType",
"entityType",
",",
"Map",
"<",
"String",
",",
"Attribute",
">",
"newAttributes",
")",
"{",
"if",
"(",
"newAttributes",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"stream",
"(",
"entity... | Changes the 'mappedBy' property of all {@link AttributeType#ONE_TO_MANY} attributes of an
{@link EntityType} to other, new Attributes. Does nothing for mappedBy attributes whose IDs are
not present in the supplied Map.
@param entityType the EntityType to update
@param newAttributes a Map of (old) Attribute IDs and new... | [
"Changes",
"the",
"mappedBy",
"property",
"of",
"all",
"{",
"@link",
"AttributeType#ONE_TO_MANY",
"}",
"attributes",
"of",
"an",
"{",
"@link",
"EntityType",
"}",
"to",
"other",
"new",
"Attributes",
".",
"Does",
"nothing",
"for",
"mappedBy",
"attributes",
"whose"... | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-navigator/src/main/java/org/molgenis/navigator/copy/service/RelationTransformer.java#L99-L107 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/TasksImpl.java | TasksImpl.listAsync | public Observable<Page<CloudTask>> listAsync(final String jobId, final TaskListOptions taskListOptions) {
"""
Lists all of the tasks that are associated with the specified job.
For multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task. Use the list subtasks API... | java | public Observable<Page<CloudTask>> listAsync(final String jobId, final TaskListOptions taskListOptions) {
return listWithServiceResponseAsync(jobId, taskListOptions)
.map(new Func1<ServiceResponseWithHeaders<Page<CloudTask>, TaskListHeaders>, Page<CloudTask>>() {
@Override
... | [
"public",
"Observable",
"<",
"Page",
"<",
"CloudTask",
">",
">",
"listAsync",
"(",
"final",
"String",
"jobId",
",",
"final",
"TaskListOptions",
"taskListOptions",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"jobId",
",",
"taskListOptions",
")",
".",
... | Lists all of the tasks that are associated with the specified job.
For multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task. Use the list subtasks API to retrieve information about subtasks.
@param jobId The ID of the job.
@param taskListOptions Additional paramete... | [
"Lists",
"all",
"of",
"the",
"tasks",
"that",
"are",
"associated",
"with",
"the",
"specified",
"job",
".",
"For",
"multi",
"-",
"instance",
"tasks",
"information",
"such",
"as",
"affinityId",
"executionInfo",
"and",
"nodeInfo",
"refer",
"to",
"the",
"primary",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/TasksImpl.java#L537-L545 |
google/gson | gson/src/main/java/com/google/gson/Gson.java | Gson.fromJson | public <T> T fromJson(Reader json, Class<T> classOfT) throws JsonSyntaxException, JsonIOException {
"""
This method deserializes the Json read from the specified reader into an object of the
specified class. It is not suitable to use if the specified class is a generic type since it
will not have the generic typ... | java | public <T> T fromJson(Reader json, Class<T> classOfT) throws JsonSyntaxException, JsonIOException {
JsonReader jsonReader = newJsonReader(json);
Object object = fromJson(jsonReader, classOfT);
assertFullConsumption(object, jsonReader);
return Primitives.wrap(classOfT).cast(object);
} | [
"public",
"<",
"T",
">",
"T",
"fromJson",
"(",
"Reader",
"json",
",",
"Class",
"<",
"T",
">",
"classOfT",
")",
"throws",
"JsonSyntaxException",
",",
"JsonIOException",
"{",
"JsonReader",
"jsonReader",
"=",
"newJsonReader",
"(",
"json",
")",
";",
"Object",
... | This method deserializes the Json read from the specified reader into an object of the
specified class. It is not suitable to use if the specified class is a generic type since it
will not have the generic type information because of the Type Erasure feature of Java.
Therefore, this method should not be used if the des... | [
"This",
"method",
"deserializes",
"the",
"Json",
"read",
"from",
"the",
"specified",
"reader",
"into",
"an",
"object",
"of",
"the",
"specified",
"class",
".",
"It",
"is",
"not",
"suitable",
"to",
"use",
"if",
"the",
"specified",
"class",
"is",
"a",
"generi... | train | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/Gson.java#L868-L873 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/event/UpdateOnCloseHandler.java | UpdateOnCloseHandler.addUpdateOnCloseHandler | public static UpdateOnCloseHandler addUpdateOnCloseHandler(Record record, Record recordToUpdate, boolean bRefreshAfterUpdate, boolean bUpdateOnClose, boolean bUpdateOnUpdate) {
"""
Add this listener to a record (only if it doesn't already exist)
@param record
@param recordToUpdate
@param bRefreshAfterUpdate
@p... | java | public static UpdateOnCloseHandler addUpdateOnCloseHandler(Record record, Record recordToUpdate, boolean bRefreshAfterUpdate, boolean bUpdateOnClose, boolean bUpdateOnUpdate)
{
UpdateOnCloseHandler listener = (UpdateOnCloseHandler)record.getListener(UpdateOnCloseHandler.class);
while (listener != nu... | [
"public",
"static",
"UpdateOnCloseHandler",
"addUpdateOnCloseHandler",
"(",
"Record",
"record",
",",
"Record",
"recordToUpdate",
",",
"boolean",
"bRefreshAfterUpdate",
",",
"boolean",
"bUpdateOnClose",
",",
"boolean",
"bUpdateOnUpdate",
")",
"{",
"UpdateOnCloseHandler",
"... | Add this listener to a record (only if it doesn't already exist)
@param record
@param recordToUpdate
@param bRefreshAfterUpdate
@param bUpdateOnClose
@param bUpdateOnUpdate
@return | [
"Add",
"this",
"listener",
"to",
"a",
"record",
"(",
"only",
"if",
"it",
"doesn",
"t",
"already",
"exist",
")"
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/UpdateOnCloseHandler.java#L221-L233 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/RedundentExprEliminator.java | RedundentExprEliminator.getElemFromExpression | protected ElemTemplateElement getElemFromExpression(Expression expr) {
"""
From an XPath expression component, get the ElemTemplateElement
owner.
@param expr Should be static expression with proper parentage.
@return Valid ElemTemplateElement, or throw a runtime exception
if it is not found.
"""
Expre... | java | protected ElemTemplateElement getElemFromExpression(Expression expr)
{
ExpressionNode parent = expr.exprGetParent();
while(null != parent)
{
if(parent instanceof ElemTemplateElement)
return (ElemTemplateElement)parent;
parent = parent.exprGetParent();
}
throw new RuntimeException(XSLMessag... | [
"protected",
"ElemTemplateElement",
"getElemFromExpression",
"(",
"Expression",
"expr",
")",
"{",
"ExpressionNode",
"parent",
"=",
"expr",
".",
"exprGetParent",
"(",
")",
";",
"while",
"(",
"null",
"!=",
"parent",
")",
"{",
"if",
"(",
"parent",
"instanceof",
"... | From an XPath expression component, get the ElemTemplateElement
owner.
@param expr Should be static expression with proper parentage.
@return Valid ElemTemplateElement, or throw a runtime exception
if it is not found. | [
"From",
"an",
"XPath",
"expression",
"component",
"get",
"the",
"ElemTemplateElement",
"owner",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/RedundentExprEliminator.java#L1036-L1047 |
vincentk/joptimizer | src/main/java/com/joptimizer/util/ColtUtils.java | ColtUtils.add | public static final DoubleMatrix2D add(DoubleMatrix2D A, DoubleMatrix2D B) {
"""
Returns C = A + B.
Useful in avoiding the need of the copy() in the colt api.
"""
if(A.rows()!=B.rows() || A.columns()!=B.columns()){
throw new IllegalArgumentException("wrong matrices dimensions");
}
DoubleMatrix2D ... | java | public static final DoubleMatrix2D add(DoubleMatrix2D A, DoubleMatrix2D B){
if(A.rows()!=B.rows() || A.columns()!=B.columns()){
throw new IllegalArgumentException("wrong matrices dimensions");
}
DoubleMatrix2D ret = DoubleFactory2D.dense.make(A.rows(), A.columns());
for(int i=0; i<ret.rows(); i++){
... | [
"public",
"static",
"final",
"DoubleMatrix2D",
"add",
"(",
"DoubleMatrix2D",
"A",
",",
"DoubleMatrix2D",
"B",
")",
"{",
"if",
"(",
"A",
".",
"rows",
"(",
")",
"!=",
"B",
".",
"rows",
"(",
")",
"||",
"A",
".",
"columns",
"(",
")",
"!=",
"B",
".",
... | Returns C = A + B.
Useful in avoiding the need of the copy() in the colt api. | [
"Returns",
"C",
"=",
"A",
"+",
"B",
".",
"Useful",
"in",
"avoiding",
"the",
"need",
"of",
"the",
"copy",
"()",
"in",
"the",
"colt",
"api",
"."
] | train | https://github.com/vincentk/joptimizer/blob/65064c1bb0b26c7261358021e4c93d06dd43564f/src/main/java/com/joptimizer/util/ColtUtils.java#L313-L325 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/info/ChainedProperty.java | ChainedProperty.tail | public ChainedProperty<?> tail() {
"""
Returns a new ChainedProperty which contains everything that follows
this ChainedProperty's prime property.
@throws IllegalStateException if chain count is zero
"""
if (getChainCount() == 0) {
throw new IllegalStateException();
}
... | java | public ChainedProperty<?> tail() {
if (getChainCount() == 0) {
throw new IllegalStateException();
}
if (getChainCount() == 1) {
if (!isOuterJoin(1)) {
return get(mChain[0]);
} else {
return get(mChain[0], null, new boole... | [
"public",
"ChainedProperty",
"<",
"?",
">",
"tail",
"(",
")",
"{",
"if",
"(",
"getChainCount",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
")",
";",
"}",
"if",
"(",
"getChainCount",
"(",
")",
"==",
"1",
")",
"{",
"i... | Returns a new ChainedProperty which contains everything that follows
this ChainedProperty's prime property.
@throws IllegalStateException if chain count is zero | [
"Returns",
"a",
"new",
"ChainedProperty",
"which",
"contains",
"everything",
"that",
"follows",
"this",
"ChainedProperty",
"s",
"prime",
"property",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/info/ChainedProperty.java#L440-L462 |
tvesalainen/util | util/src/main/java/org/vesalainen/nio/file/attribute/PosixHelp.java | PosixHelp.checkFileType | public static final void checkFileType(Path path, String perms) {
"""
Throws IllegalArgumentException if perms length != 10 or files type doesn't
match with permission.
@param path
@param perms
"""
if (perms.length() != 10)
{
throw new IllegalArgumentException(perms+" not perm... | java | public static final void checkFileType(Path path, String perms)
{
if (perms.length() != 10)
{
throw new IllegalArgumentException(perms+" not permission. E.g. -rwxr--r--");
}
switch (perms.charAt(0))
{
case '-':
if (!Files.isReg... | [
"public",
"static",
"final",
"void",
"checkFileType",
"(",
"Path",
"path",
",",
"String",
"perms",
")",
"{",
"if",
"(",
"perms",
".",
"length",
"(",
")",
"!=",
"10",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"perms",
"+",
"\" not permissio... | Throws IllegalArgumentException if perms length != 10 or files type doesn't
match with permission.
@param path
@param perms | [
"Throws",
"IllegalArgumentException",
"if",
"perms",
"length",
"!",
"=",
"10",
"or",
"files",
"type",
"doesn",
"t",
"match",
"with",
"permission",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/file/attribute/PosixHelp.java#L242-L271 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/DocRootTaglet.java | DocRootTaglet.getTagletOutput | public Content getTagletOutput(Element holder, DocTree tag, TagletWriter writer) {
"""
Given a <code>Doc</code> object, check if it holds any tags of
this type. If it does, return the string representing the output.
If it does not, return null.
@param holder
@param tag a tag representing the custom tag.
@par... | java | public Content getTagletOutput(Element holder, DocTree tag, TagletWriter writer) {
return writer.getDocRootOutput();
} | [
"public",
"Content",
"getTagletOutput",
"(",
"Element",
"holder",
",",
"DocTree",
"tag",
",",
"TagletWriter",
"writer",
")",
"{",
"return",
"writer",
".",
"getDocRootOutput",
"(",
")",
";",
"}"
] | Given a <code>Doc</code> object, check if it holds any tags of
this type. If it does, return the string representing the output.
If it does not, return null.
@param holder
@param tag a tag representing the custom tag.
@param writer a {@link TagletWriter} Taglet writer.
@return the string representation of this <code>T... | [
"Given",
"a",
"<code",
">",
"Doc<",
"/",
"code",
">",
"object",
"check",
"if",
"it",
"holds",
"any",
"tags",
"of",
"this",
"type",
".",
"If",
"it",
"does",
"return",
"the",
"string",
"representing",
"the",
"output",
".",
"If",
"it",
"does",
"not",
"r... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/DocRootTaglet.java#L68-L70 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/MPPUtility.java | MPPUtility.getTime | public static final Date getTime(byte[] data, int offset) {
"""
Reads a time value. The time is represented as tenths of a
minute since midnight.
@param data byte array of data
@param offset location of data as offset into the array
@return time value
"""
int time = getShort(data, offset) / 10;
... | java | public static final Date getTime(byte[] data, int offset)
{
int time = getShort(data, offset) / 10;
Calendar cal = DateHelper.popCalendar(EPOCH_DATE);
cal.set(Calendar.HOUR_OF_DAY, (time / 60));
cal.set(Calendar.MINUTE, (time % 60));
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.M... | [
"public",
"static",
"final",
"Date",
"getTime",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"{",
"int",
"time",
"=",
"getShort",
"(",
"data",
",",
"offset",
")",
"/",
"10",
";",
"Calendar",
"cal",
"=",
"DateHelper",
".",
"popCalendar",
... | Reads a time value. The time is represented as tenths of a
minute since midnight.
@param data byte array of data
@param offset location of data as offset into the array
@return time value | [
"Reads",
"a",
"time",
"value",
".",
"The",
"time",
"is",
"represented",
"as",
"tenths",
"of",
"a",
"minute",
"since",
"midnight",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L337-L347 |
lucee/Lucee | core/src/main/java/lucee/runtime/coder/Base64Coder.java | Base64Coder.encodeFromString | public static String encodeFromString(String plain, String charset) throws CoderException, UnsupportedEncodingException {
"""
encodes a String to Base64 String
@param plain String to encode
@return encoded String
@throws CoderException
@throws UnsupportedEncodingException
"""
return encode(plain.getByte... | java | public static String encodeFromString(String plain, String charset) throws CoderException, UnsupportedEncodingException {
return encode(plain.getBytes(charset));
} | [
"public",
"static",
"String",
"encodeFromString",
"(",
"String",
"plain",
",",
"String",
"charset",
")",
"throws",
"CoderException",
",",
"UnsupportedEncodingException",
"{",
"return",
"encode",
"(",
"plain",
".",
"getBytes",
"(",
"charset",
")",
")",
";",
"}"
] | encodes a String to Base64 String
@param plain String to encode
@return encoded String
@throws CoderException
@throws UnsupportedEncodingException | [
"encodes",
"a",
"String",
"to",
"Base64",
"String"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/coder/Base64Coder.java#L52-L54 |
integration-technology/amazon-mws-orders | src/main/java/com/amazonservices/mws/client/MwsUtl.java | MwsUtl.replaceAll | static String replaceAll(String s, Pattern p, String r) {
"""
Replace a pattern in a string.
<p>
Do not do recursive replacement. Return the original string if no changes
are required.
@param s
The string to search.
@param p
The pattern to search for.
@param r
The string to replace occurrences with.... | java | static String replaceAll(String s, Pattern p, String r) {
int n = s == null ? 0 : s.length();
if (n == 0) {
return s;
}
Matcher m = p.matcher(s);
if (!m.find()) {
return s;
}
StringBuilder buf = new StringBuilder(n + 12);
int k = 0;... | [
"static",
"String",
"replaceAll",
"(",
"String",
"s",
",",
"Pattern",
"p",
",",
"String",
"r",
")",
"{",
"int",
"n",
"=",
"s",
"==",
"null",
"?",
"0",
":",
"s",
".",
"length",
"(",
")",
";",
"if",
"(",
"n",
"==",
"0",
")",
"{",
"return",
"s",... | Replace a pattern in a string.
<p>
Do not do recursive replacement. Return the original string if no changes
are required.
@param s
The string to search.
@param p
The pattern to search for.
@param r
The string to replace occurrences with.
@return The new string. | [
"Replace",
"a",
"pattern",
"in",
"a",
"string",
".",
"<p",
">",
"Do",
"not",
"do",
"recursive",
"replacement",
".",
"Return",
"the",
"original",
"string",
"if",
"no",
"changes",
"are",
"required",
"."
] | train | https://github.com/integration-technology/amazon-mws-orders/blob/042e8cd5b10588a30150222bf9c91faf4f130b3c/src/main/java/com/amazonservices/mws/client/MwsUtl.java#L224-L244 |
mangstadt/biweekly | src/main/java/biweekly/component/VFreeBusy.java | VFreeBusy.addFreeBusy | public FreeBusy addFreeBusy(FreeBusyType type, Date start, Duration duration) {
"""
Adds a single time period for which the person is free or busy (for
example, "free" for 2 hours after 1pm). This method will look for an
existing property that has the given {@link FreeBusyType} and add the
time period to it, or... | java | public FreeBusy addFreeBusy(FreeBusyType type, Date start, Duration duration) {
FreeBusy found = findByFreeBusyType(type);
found.getValues().add(new Period(start, duration));
return found;
} | [
"public",
"FreeBusy",
"addFreeBusy",
"(",
"FreeBusyType",
"type",
",",
"Date",
"start",
",",
"Duration",
"duration",
")",
"{",
"FreeBusy",
"found",
"=",
"findByFreeBusyType",
"(",
"type",
")",
";",
"found",
".",
"getValues",
"(",
")",
".",
"add",
"(",
"new... | Adds a single time period for which the person is free or busy (for
example, "free" for 2 hours after 1pm). This method will look for an
existing property that has the given {@link FreeBusyType} and add the
time period to it, or create a new property is one cannot be found.
@param type the availability type (e.g. "free... | [
"Adds",
"a",
"single",
"time",
"period",
"for",
"which",
"the",
"person",
"is",
"free",
"or",
"busy",
"(",
"for",
"example",
"free",
"for",
"2",
"hours",
"after",
"1pm",
")",
".",
"This",
"method",
"will",
"look",
"for",
"an",
"existing",
"property",
"... | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VFreeBusy.java#L572-L576 |
infinispan/infinispan | commons/src/main/java/org/infinispan/commons/marshall/MarshallUtil.java | MarshallUtil.marshallCollection | public static <E> void marshallCollection(Collection<E> collection, ObjectOutput out, ElementWriter<E> writer) throws IOException {
"""
Marshall a {@link Collection}.
<p>
This method supports {@code null} {@code collection}.
@param collection {@link Collection} to marshal.
@param out {@link ObjectOutp... | java | public static <E> void marshallCollection(Collection<E> collection, ObjectOutput out, ElementWriter<E> writer) throws IOException {
final int size = collection == null ? NULL_VALUE : collection.size();
marshallSize(out, size);
if (size <= 0) {
return;
}
for (E e : collection) {
... | [
"public",
"static",
"<",
"E",
">",
"void",
"marshallCollection",
"(",
"Collection",
"<",
"E",
">",
"collection",
",",
"ObjectOutput",
"out",
",",
"ElementWriter",
"<",
"E",
">",
"writer",
")",
"throws",
"IOException",
"{",
"final",
"int",
"size",
"=",
"col... | Marshall a {@link Collection}.
<p>
This method supports {@code null} {@code collection}.
@param collection {@link Collection} to marshal.
@param out {@link ObjectOutput} to write.
@param writer {@link ElementWriter} that writes single element to the output.
@param <E> Collection's element type.
@thro... | [
"Marshall",
"a",
"{",
"@link",
"Collection",
"}",
".",
"<p",
">",
"This",
"method",
"supports",
"{",
"@code",
"null",
"}",
"{",
"@code",
"collection",
"}",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/marshall/MarshallUtil.java#L245-L254 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncGroupsInner.java | SyncGroupsInner.beginCreateOrUpdateAsync | public Observable<SyncGroupInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, String syncGroupName, SyncGroupInner parameters) {
"""
Creates or updates a sync group.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain ... | java | public Observable<SyncGroupInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, String syncGroupName, SyncGroupInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters).map(new Func1... | [
"public",
"Observable",
"<",
"SyncGroupInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"syncGroupName",
",",
"SyncGroupInner",
"parameters",
")",
"{",
"return",
"be... | Creates or updates a sync group.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database on which the sync group is hosted.
@pa... | [
"Creates",
"or",
"updates",
"a",
"sync",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncGroupsInner.java#L1338-L1345 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.