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 |
|---|---|---|---|---|---|---|---|---|---|---|
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java | AbstractValidate.validIndex | public <T extends CharSequence> T validIndex(final T chars, final int index) {
"""
<p>Validates that the index is within the bounds of the argument character sequence; otherwise throwing an exception.</p>
<pre>Validate.validIndex(myStr, 2);</pre>
<p>If the character sequence is {@code null}, then the message of ... | java | public <T extends CharSequence> T validIndex(final T chars, final int index) {
return validIndex(chars, index, DEFAULT_VALID_INDEX_CHAR_SEQUENCE_EX_MESSAGE, index);
} | [
"public",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"validIndex",
"(",
"final",
"T",
"chars",
",",
"final",
"int",
"index",
")",
"{",
"return",
"validIndex",
"(",
"chars",
",",
"index",
",",
"DEFAULT_VALID_INDEX_CHAR_SEQUENCE_EX_MESSAGE",
",",
"index",
")... | <p>Validates that the index is within the bounds of the argument character sequence; otherwise throwing an exception.</p>
<pre>Validate.validIndex(myStr, 2);</pre>
<p>If the character sequence is {@code null}, then the message of the exception is "The validated object is null".</p><p>If the index is invalid, ... | [
"<p",
">",
"Validates",
"that",
"the",
"index",
"is",
"within",
"the",
"bounds",
"of",
"the",
"argument",
"character",
"sequence",
";",
"otherwise",
"throwing",
"an",
"exception",
".",
"<",
"/",
"p",
">",
"<pre",
">",
"Validate",
".",
"validIndex",
"(",
... | train | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java#L1100-L1102 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/AbstrStrMatcher.java | AbstrStrMatcher.isEmpty | public boolean isEmpty(String... specialValueAsEmpty) {
"""
Checks if a delegate string is empty ("") or null or special value.
@param specialValueAsEmpty
@return
"""
if (Strings.isNullOrEmpty(delegate.get())) {
return true;
}
if (null == specialValueAsEmpty || specialValueAsEmpty.length < 1) {... | java | public boolean isEmpty(String... specialValueAsEmpty) {
if (Strings.isNullOrEmpty(delegate.get())) {
return true;
}
if (null == specialValueAsEmpty || specialValueAsEmpty.length < 1) {
return false;
}
if (Gather.from(Arrays.asList(checkNotNull(specialValueAsEmpty))).filter(new Decision<String>(){
... | [
"public",
"boolean",
"isEmpty",
"(",
"String",
"...",
"specialValueAsEmpty",
")",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"delegate",
".",
"get",
"(",
")",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"null",
"==",
"specialValueAsE... | Checks if a delegate string is empty ("") or null or special value.
@param specialValueAsEmpty
@return | [
"Checks",
"if",
"a",
"delegate",
"string",
"is",
"empty",
"(",
")",
"or",
"null",
"or",
"special",
"value",
"."
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/AbstrStrMatcher.java#L242-L260 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbConnection.java | MariaDbConnection.getWarnings | public SQLWarning getWarnings() throws SQLException {
"""
<p>Retrieves the first warning reported by calls on this <code>Connection</code> object. If
there is more than one warning, subsequent warnings will be chained to the first one and can be
retrieved by calling the method
<code>SQLWarning.getNextWarning</... | java | public SQLWarning getWarnings() throws SQLException {
if (warningsCleared || isClosed() || !protocol.hasWarnings()) {
return null;
}
SQLWarning last = null;
SQLWarning first = null;
try (Statement st = this.createStatement()) {
try (ResultSet rs = st.executeQuery("show warnings")) {
... | [
"public",
"SQLWarning",
"getWarnings",
"(",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"warningsCleared",
"||",
"isClosed",
"(",
")",
"||",
"!",
"protocol",
".",
"hasWarnings",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"SQLWarning",
"last",
"=",
... | <p>Retrieves the first warning reported by calls on this <code>Connection</code> object. If
there is more than one warning, subsequent warnings will be chained to the first one and can be
retrieved by calling the method
<code>SQLWarning.getNextWarning</code> on the warning that was retrieved previously.</p>
<p>This me... | [
"<p",
">",
"Retrieves",
"the",
"first",
"warning",
"reported",
"by",
"calls",
"on",
"this",
"<code",
">",
"Connection<",
"/",
"code",
">",
"object",
".",
"If",
"there",
"is",
"more",
"than",
"one",
"warning",
"subsequent",
"warnings",
"will",
"be",
"chaine... | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbConnection.java#L997-L1024 |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationAttachmentPersistenceImpl.java | CommerceNotificationAttachmentPersistenceImpl.findByUuid | @Override
public List<CommerceNotificationAttachment> findByUuid(String uuid,
int start, int end,
OrderByComparator<CommerceNotificationAttachment> orderByComparator) {
"""
Returns an ordered range of all the commerce notification attachments where uuid = ?.
<p>
Useful when paginating results. Returns... | java | @Override
public List<CommerceNotificationAttachment> findByUuid(String uuid,
int start, int end,
OrderByComparator<CommerceNotificationAttachment> orderByComparator) {
return findByUuid(uuid, start, end, orderByComparator, true);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceNotificationAttachment",
">",
"findByUuid",
"(",
"String",
"uuid",
",",
"int",
"start",
",",
"int",
"end",
",",
"OrderByComparator",
"<",
"CommerceNotificationAttachment",
">",
"orderByComparator",
")",
"{",
"return",... | Returns an ordered range of all the commerce notification attachments where uuid = ?.
<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 fir... | [
"Returns",
"an",
"ordered",
"range",
"of",
"all",
"the",
"commerce",
"notification",
"attachments",
"where",
"uuid",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationAttachmentPersistenceImpl.java#L164-L169 |
GeoLatte/geolatte-common-hibernate | src/main/java/org/geolatte/common/automapper/TableRef.java | TableRef.valueOf | public static TableRef valueOf(String[] components) {
"""
Creates an instance from an array of table ref components,
<p/>
<p>The components should be (in order): catalog (optional), schema (optional), table name. if the catalog or schema
component is an empty String, the catalog or schema will be set to <code>n... | java | public static TableRef valueOf(String[] components) {
if (components == null) {
throw new IllegalArgumentException("Null argument not allowed.");
}
switch (components.length) {
case 1:
return new TableRef(null, null, components[0]);
case 2:
... | [
"public",
"static",
"TableRef",
"valueOf",
"(",
"String",
"[",
"]",
"components",
")",
"{",
"if",
"(",
"components",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Null argument not allowed.\"",
")",
";",
"}",
"switch",
"(",
"compo... | Creates an instance from an array of table ref components,
<p/>
<p>The components should be (in order): catalog (optional), schema (optional), table name. if the catalog or schema
component is an empty String, the catalog or schema will be set to <code>null</code>.</p>
@param components the components of the reference... | [
"Creates",
"an",
"instance",
"from",
"an",
"array",
"of",
"table",
"ref",
"components",
"<p",
"/",
">",
"<p",
">",
"The",
"components",
"should",
"be",
"(",
"in",
"order",
")",
":",
"catalog",
"(",
"optional",
")",
"schema",
"(",
"optional",
")",
"tabl... | train | https://github.com/GeoLatte/geolatte-common-hibernate/blob/2e871c70e506df2485d91152fbd0955c94de1d39/src/main/java/org/geolatte/common/automapper/TableRef.java#L95-L109 |
apache/groovy | src/main/groovy/groovy/lang/MetaMethod.java | MetaMethod.doMethodInvoke | public Object doMethodInvoke(Object object, Object[] argumentArray) {
"""
Invokes the method this object represents. This method is not final but it should be overloaded very carefully and only by generated methods
there is no guarantee that it will be called
@param object The object the method is to be called... | java | public Object doMethodInvoke(Object object, Object[] argumentArray) {
argumentArray = coerceArgumentsToClasses(argumentArray);
try {
return invoke(object, argumentArray);
} catch (Exception e) {
throw processDoMethodInvokeException(e, object, argumentArray);
}
... | [
"public",
"Object",
"doMethodInvoke",
"(",
"Object",
"object",
",",
"Object",
"[",
"]",
"argumentArray",
")",
"{",
"argumentArray",
"=",
"coerceArgumentsToClasses",
"(",
"argumentArray",
")",
";",
"try",
"{",
"return",
"invoke",
"(",
"object",
",",
"argumentArra... | Invokes the method this object represents. This method is not final but it should be overloaded very carefully and only by generated methods
there is no guarantee that it will be called
@param object The object the method is to be called at.
@param argumentArray Arguments for the method invocation.
@return The return ... | [
"Invokes",
"the",
"method",
"this",
"object",
"represents",
".",
"This",
"method",
"is",
"not",
"final",
"but",
"it",
"should",
"be",
"overloaded",
"very",
"carefully",
"and",
"only",
"by",
"generated",
"methods",
"there",
"is",
"no",
"guarantee",
"that",
"i... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/MetaMethod.java#L320-L327 |
jmchilton/galaxy-bootstrap | src/main/java/com/github/jmchilton/galaxybootstrap/DownloadProperties.java | DownloadProperties.wgetGithub | public static DownloadProperties wgetGithub(final String branch, final File destination) {
"""
Builds a new DownloadProperties for downloading Galaxy from github using wget.
@param branch The branch to download (e.g. master, dev, release_15.03).
@param destination The destination directory to store Galaxy, null ... | java | public static DownloadProperties wgetGithub(final String branch, final File destination) {
return new DownloadProperties(new WgetGithubDownloader(branch), destination);
} | [
"public",
"static",
"DownloadProperties",
"wgetGithub",
"(",
"final",
"String",
"branch",
",",
"final",
"File",
"destination",
")",
"{",
"return",
"new",
"DownloadProperties",
"(",
"new",
"WgetGithubDownloader",
"(",
"branch",
")",
",",
"destination",
")",
";",
... | Builds a new DownloadProperties for downloading Galaxy from github using wget.
@param branch The branch to download (e.g. master, dev, release_15.03).
@param destination The destination directory to store Galaxy, null if a directory
should be chosen by default.
@return A DownloadProperties for downloading Galaxy from ... | [
"Builds",
"a",
"new",
"DownloadProperties",
"for",
"downloading",
"Galaxy",
"from",
"github",
"using",
"wget",
"."
] | train | https://github.com/jmchilton/galaxy-bootstrap/blob/4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649/src/main/java/com/github/jmchilton/galaxybootstrap/DownloadProperties.java#L293-L295 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.newUpdateOpenGraphObjectRequest | public static Request newUpdateOpenGraphObjectRequest(Session session, String id, String title, String imageUrl,
String url, String description, GraphObject objectProperties, Callback callback) {
"""
Creates a new Request configured to update a user owned Open Graph object.
@param session
the Sessi... | java | public static Request newUpdateOpenGraphObjectRequest(Session session, String id, String title, String imageUrl,
String url, String description, GraphObject objectProperties, Callback callback) {
OpenGraphObject openGraphObject = OpenGraphObject.Factory.createForPost(OpenGraphObject.class, null, tit... | [
"public",
"static",
"Request",
"newUpdateOpenGraphObjectRequest",
"(",
"Session",
"session",
",",
"String",
"id",
",",
"String",
"title",
",",
"String",
"imageUrl",
",",
"String",
"url",
",",
"String",
"description",
",",
"GraphObject",
"objectProperties",
",",
"C... | Creates a new Request configured to update a user owned Open Graph object.
@param session
the Session to use, or null; if non-null, the session must be in an opened state
@param id
the id of the Open Graph object
@param title
the title of the Open Graph object
@param imageUrl
the link to an image to be associated with... | [
"Creates",
"a",
"new",
"Request",
"configured",
"to",
"update",
"a",
"user",
"owned",
"Open",
"Graph",
"object",
"."
] | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L818-L826 |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java | CmsMessageBundleEditor.setFilters | void setFilters(Map<Object, Object> filters) {
"""
Sets the provided filters.
@param filters a map "column id -> filter".
"""
for (Object column : filters.keySet()) {
Object filterValue = filters.get(column);
if ((filterValue != null) && !filterValue.toString().isEmpty() && !m... | java | void setFilters(Map<Object, Object> filters) {
for (Object column : filters.keySet()) {
Object filterValue = filters.get(column);
if ((filterValue != null) && !filterValue.toString().isEmpty() && !m_table.isColumnCollapsed(column)) {
m_table.setFilterFieldValue(column, f... | [
"void",
"setFilters",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"filters",
")",
"{",
"for",
"(",
"Object",
"column",
":",
"filters",
".",
"keySet",
"(",
")",
")",
"{",
"Object",
"filterValue",
"=",
"filters",
".",
"get",
"(",
"column",
")",
";",... | Sets the provided filters.
@param filters a map "column id -> filter". | [
"Sets",
"the",
"provided",
"filters",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditor.java#L571-L579 |
aequologica/geppaequo | geppaequo-cmis/src/main/java/net/aequologica/neo/geppaequo/document/impl/ECMHelperImpl.java | ECMHelperImpl.createOrUpdateDocument | @Override
public void createOrUpdateDocument(final Path path, final Serioulizer.Stream stream) throws IOException {
"""
/*
@Override
public void createOrUpdateUTF8Document(final Path path, final String content) throws IOException {
sessionExistsPreCondition(); // throws illegalStateException if no session... | java | @Override
public void createOrUpdateDocument(final Path path, final Serioulizer.Stream stream) throws IOException {
sessionExistsPreCondition(); // throws illegalStateException if no session
log.debug("createOrUpdateDocument | path: {}, length: {}, mimetype: {}, stream: {}", path, stream.getLength... | [
"@",
"Override",
"public",
"void",
"createOrUpdateDocument",
"(",
"final",
"Path",
"path",
",",
"final",
"Serioulizer",
".",
"Stream",
"stream",
")",
"throws",
"IOException",
"{",
"sessionExistsPreCondition",
"(",
")",
";",
"// throws illegalStateException if no session... | /*
@Override
public void createOrUpdateUTF8Document(final Path path, final String content) throws IOException {
sessionExistsPreCondition(); // throws illegalStateException if no session
log.debug("createOrUpdateDocument | path: {}, content: {}", path, getMax80StringEndingWithEllipsisWhenNeeded(content));
try (final... | [
"/",
"*",
"@Override",
"public",
"void",
"createOrUpdateUTF8Document",
"(",
"final",
"Path",
"path",
"final",
"String",
"content",
")",
"throws",
"IOException",
"{"
] | train | https://github.com/aequologica/geppaequo/blob/b72e5f6356535fd045a931f8c544d4a8ea6e35a2/geppaequo-cmis/src/main/java/net/aequologica/neo/geppaequo/document/impl/ECMHelperImpl.java#L87-L135 |
google/truth | extensions/proto/src/main/java/com/google/common/truth/extensions/proto/MapWithProtoValuesSubject.java | MapWithProtoValuesSubject.withPartialScopeForValues | public MapWithProtoValuesFluentAssertion<M> withPartialScopeForValues(FieldScope fieldScope) {
"""
Limits the comparison of Protocol buffers to the defined {@link FieldScope}.
<p>This method is additive and has well-defined ordering semantics. If the invoking {@link
ProtoFluentAssertion} is already scoped to a... | java | public MapWithProtoValuesFluentAssertion<M> withPartialScopeForValues(FieldScope fieldScope) {
return usingConfig(config.withPartialScope(checkNotNull(fieldScope, "fieldScope")));
} | [
"public",
"MapWithProtoValuesFluentAssertion",
"<",
"M",
">",
"withPartialScopeForValues",
"(",
"FieldScope",
"fieldScope",
")",
"{",
"return",
"usingConfig",
"(",
"config",
".",
"withPartialScope",
"(",
"checkNotNull",
"(",
"fieldScope",
",",
"\"fieldScope\"",
")",
"... | Limits the comparison of Protocol buffers to the defined {@link FieldScope}.
<p>This method is additive and has well-defined ordering semantics. If the invoking {@link
ProtoFluentAssertion} is already scoped to a {@link FieldScope} {@code X}, and this method is
invoked with {@link FieldScope} {@code Y}, the resultant ... | [
"Limits",
"the",
"comparison",
"of",
"Protocol",
"buffers",
"to",
"the",
"defined",
"{",
"@link",
"FieldScope",
"}",
"."
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/MapWithProtoValuesSubject.java#L642-L644 |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java | GeometryIndexService.addChildren | public GeometryIndex addChildren(GeometryIndex index, GeometryIndexType type, int... values) {
"""
Given a certain geometry index, add more levels to it (This method will not change the underlying geometry !).
@param index
The index to start out from.
@param type
Add more levels to it, where the deepest leve... | java | public GeometryIndex addChildren(GeometryIndex index, GeometryIndexType type, int... values) {
if (index == null) {
return create(type, values);
}
if (getType(index) != GeometryIndexType.TYPE_GEOMETRY) {
throw new IllegalArgumentException("Can only add children to an index of type geometry.");
}
Geometr... | [
"public",
"GeometryIndex",
"addChildren",
"(",
"GeometryIndex",
"index",
",",
"GeometryIndexType",
"type",
",",
"int",
"...",
"values",
")",
"{",
"if",
"(",
"index",
"==",
"null",
")",
"{",
"return",
"create",
"(",
"type",
",",
"values",
")",
";",
"}",
"... | Given a certain geometry index, add more levels to it (This method will not change the underlying geometry !).
@param index
The index to start out from.
@param type
Add more levels to it, where the deepest level should be of this type.
@param values
A list of integer values that determine the indices on each level in ... | [
"Given",
"a",
"certain",
"geometry",
"index",
"add",
"more",
"levels",
"to",
"it",
"(",
"This",
"method",
"will",
"not",
"change",
"the",
"underlying",
"geometry",
"!",
")",
"."
] | train | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java#L71-L86 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/subnetwork/SubnetworkStorage.java | SubnetworkStorage.setSubnetwork | public void setSubnetwork(int nodeId, int subnetwork) {
"""
This method sets the subnetwork if of the specified nodeId. Default is 0 and means subnetwork
was too small to be useful to be stored.
"""
if (subnetwork > 127)
throw new IllegalArgumentException("Number of subnetworks is currentl... | java | public void setSubnetwork(int nodeId, int subnetwork) {
if (subnetwork > 127)
throw new IllegalArgumentException("Number of subnetworks is currently limited to 127 but requested " + subnetwork);
byte[] bytes = new byte[1];
bytes[0] = (byte) subnetwork;
da.setBytes(nodeId, by... | [
"public",
"void",
"setSubnetwork",
"(",
"int",
"nodeId",
",",
"int",
"subnetwork",
")",
"{",
"if",
"(",
"subnetwork",
">",
"127",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Number of subnetworks is currently limited to 127 but requested \"",
"+",
"subnetwo... | This method sets the subnetwork if of the specified nodeId. Default is 0 and means subnetwork
was too small to be useful to be stored. | [
"This",
"method",
"sets",
"the",
"subnetwork",
"if",
"of",
"the",
"specified",
"nodeId",
".",
"Default",
"is",
"0",
"and",
"means",
"subnetwork",
"was",
"too",
"small",
"to",
"be",
"useful",
"to",
"be",
"stored",
"."
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/subnetwork/SubnetworkStorage.java#L54-L61 |
alkacon/opencms-core | src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageHandler.java | CmsContainerpageHandler.openEditorForElement | public void openEditorForElement(final CmsContainerPageElementPanel element, boolean inline, boolean wasNew) {
"""
Opens the edit dialog for the specified element.<p>
@param element the element to edit
@param inline <code>true</code> to open the inline editor for the given element if available
@param wasNew <... | java | public void openEditorForElement(final CmsContainerPageElementPanel element, boolean inline, boolean wasNew) {
if (element.isNew()) {
//openEditorForElement will be called again asynchronously when the RPC for creating the element has finished
m_controller.createAndEditNewElement(elemen... | [
"public",
"void",
"openEditorForElement",
"(",
"final",
"CmsContainerPageElementPanel",
"element",
",",
"boolean",
"inline",
",",
"boolean",
"wasNew",
")",
"{",
"if",
"(",
"element",
".",
"isNew",
"(",
")",
")",
"{",
"//openEditorForElement will be called again asynch... | Opens the edit dialog for the specified element.<p>
@param element the element to edit
@param inline <code>true</code> to open the inline editor for the given element if available
@param wasNew <code>true</code> in case this is a newly created element not previously edited | [
"Opens",
"the",
"edit",
"dialog",
"for",
"the",
"specified",
"element",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageHandler.java#L765-L788 |
aspectran/aspectran | web/src/main/java/com/aspectran/web/support/http/HttpStatusSetter.java | HttpStatusSetter.setStatus | public static void setStatus(HttpStatus httpStatus, Translet translet) {
"""
Sets the status code.
@param httpStatus the http status code
@param translet the Translet instance
"""
translet.getResponseAdapter().setStatus(httpStatus.value());
} | java | public static void setStatus(HttpStatus httpStatus, Translet translet) {
translet.getResponseAdapter().setStatus(httpStatus.value());
} | [
"public",
"static",
"void",
"setStatus",
"(",
"HttpStatus",
"httpStatus",
",",
"Translet",
"translet",
")",
"{",
"translet",
".",
"getResponseAdapter",
"(",
")",
".",
"setStatus",
"(",
"httpStatus",
".",
"value",
"(",
")",
")",
";",
"}"
] | Sets the status code.
@param httpStatus the http status code
@param translet the Translet instance | [
"Sets",
"the",
"status",
"code",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/web/src/main/java/com/aspectran/web/support/http/HttpStatusSetter.java#L31-L33 |
SeaCloudsEU/SeaCloudsPlatform | sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/AgreementRestEntity.java | AgreementRestEntity.getAgreements | @GET
public List<IAgreement> getAgreements(
@QueryParam("consumerId") String consumerId,
@QueryParam("providerId") String providerId,
@QueryParam("templateId") String templateId,
@QueryParam("active") BooleanParam active) {
"""
Gets a the list of available agreem... | java | @GET
public List<IAgreement> getAgreements(
@QueryParam("consumerId") String consumerId,
@QueryParam("providerId") String providerId,
@QueryParam("templateId") String templateId,
@QueryParam("active") BooleanParam active) {
logger.debug("StartOf getAgreements ... | [
"@",
"GET",
"public",
"List",
"<",
"IAgreement",
">",
"getAgreements",
"(",
"@",
"QueryParam",
"(",
"\"consumerId\"",
")",
"String",
"consumerId",
",",
"@",
"QueryParam",
"(",
"\"providerId\"",
")",
"String",
"providerId",
",",
"@",
"QueryParam",
"(",
"\"templ... | Gets a the list of available agreements from where we can get metrics,
host information, etc.
<pre>
GET /agreements{?providerId,consumerId,active}
Request:
GET /agreements HTTP/1.1
Response:
HTTP/1.1 200 OK
Content-type: application/xml
{@code
<?xml version="1.0" encoding="UTF-8"?>
<collection href="/agreements">
<i... | [
"Gets",
"a",
"the",
"list",
"of",
"available",
"agreements",
"from",
"where",
"we",
"can",
"get",
"metrics",
"host",
"information",
"etc",
"."
] | train | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/AgreementRestEntity.java#L145-L157 |
jeremylong/DependencyCheck | utils/src/main/java/org/owasp/dependencycheck/utils/Checksum.java | Checksum.getSHA1Checksum | public static String getSHA1Checksum(String text) {
"""
Calculates the SHA1 checksum of the specified text.
@param text the text to generate the SHA1 checksum
@return the hex representation of the SHA1
"""
final byte[] data = stringToBytes(text);
return getChecksum(SHA1, data);
} | java | public static String getSHA1Checksum(String text) {
final byte[] data = stringToBytes(text);
return getChecksum(SHA1, data);
} | [
"public",
"static",
"String",
"getSHA1Checksum",
"(",
"String",
"text",
")",
"{",
"final",
"byte",
"[",
"]",
"data",
"=",
"stringToBytes",
"(",
"text",
")",
";",
"return",
"getChecksum",
"(",
"SHA1",
",",
"data",
")",
";",
"}"
] | Calculates the SHA1 checksum of the specified text.
@param text the text to generate the SHA1 checksum
@return the hex representation of the SHA1 | [
"Calculates",
"the",
"SHA1",
"checksum",
"of",
"the",
"specified",
"text",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/Checksum.java#L169-L172 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_tcp_frontend_frontendId_DELETE | public void serviceName_tcp_frontend_frontendId_DELETE(String serviceName, Long frontendId) throws IOException {
"""
Delete an TCP frontend
REST: DELETE /ipLoadbalancing/{serviceName}/tcp/frontend/{frontendId}
@param serviceName [required] The internal name of your IP load balancing
@param frontendId [require... | java | public void serviceName_tcp_frontend_frontendId_DELETE(String serviceName, Long frontendId) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/tcp/frontend/{frontendId}";
StringBuilder sb = path(qPath, serviceName, frontendId);
exec(qPath, "DELETE", sb.toString(), null);
} | [
"public",
"void",
"serviceName_tcp_frontend_frontendId_DELETE",
"(",
"String",
"serviceName",
",",
"Long",
"frontendId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/tcp/frontend/{frontendId}\"",
";",
"StringBuilder",
"sb",
"=",... | Delete an TCP frontend
REST: DELETE /ipLoadbalancing/{serviceName}/tcp/frontend/{frontendId}
@param serviceName [required] The internal name of your IP load balancing
@param frontendId [required] Id of your frontend | [
"Delete",
"an",
"TCP",
"frontend"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L1460-L1464 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_alerting_id_PUT | public void project_serviceName_alerting_id_PUT(String serviceName, String id, OvhAlerting body) throws IOException {
"""
Alter this object properties
REST: PUT /cloud/project/{serviceName}/alerting/{id}
@param body [required] New object properties
@param serviceName [required] The project id
@param id [requ... | java | public void project_serviceName_alerting_id_PUT(String serviceName, String id, OvhAlerting body) throws IOException {
String qPath = "/cloud/project/{serviceName}/alerting/{id}";
StringBuilder sb = path(qPath, serviceName, id);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"project_serviceName_alerting_id_PUT",
"(",
"String",
"serviceName",
",",
"String",
"id",
",",
"OvhAlerting",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/alerting/{id}\"",
";",
"StringBuilder",
"sb",... | Alter this object properties
REST: PUT /cloud/project/{serviceName}/alerting/{id}
@param body [required] New object properties
@param serviceName [required] The project id
@param id [required] Alerting unique UUID | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2225-L2229 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getAllFileInfo | public void getAllFileInfo(String[] ids, Callback<List<Asset>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on files API go <a href="https://wiki.guildwars2.com/wiki/API:2/files">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback... | java | public void getAllFileInfo(String[] ids, Callback<List<Asset>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getAllFileInfo(processIds(ids)).enqueue(callback);
} | [
"public",
"void",
"getAllFileInfo",
"(",
"String",
"[",
"]",
"ids",
",",
"Callback",
"<",
"List",
"<",
"Asset",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"ids"... | For more info on files API go <a href="https://wiki.guildwars2.com/wiki/API:2/files">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param ids list of file id
@param callback callback that is going t... | [
"For",
"more",
"info",
"on",
"files",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"files",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Give",
"user",
"the... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1361-L1364 |
apereo/cas | support/cas-server-support-validation/src/main/java/org/apereo/cas/web/AbstractServiceValidateController.java | AbstractServiceValidateController.initBinder | protected void initBinder(final HttpServletRequest request, final ServletRequestDataBinder binder) {
"""
Initialize the binder with the required fields.
@param request the request
@param binder the binder
"""
if (serviceValidateConfigurationContext.isRenewEnabled()) {
binder.setRequire... | java | protected void initBinder(final HttpServletRequest request, final ServletRequestDataBinder binder) {
if (serviceValidateConfigurationContext.isRenewEnabled()) {
binder.setRequiredFields(CasProtocolConstants.PARAMETER_RENEW);
}
} | [
"protected",
"void",
"initBinder",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"ServletRequestDataBinder",
"binder",
")",
"{",
"if",
"(",
"serviceValidateConfigurationContext",
".",
"isRenewEnabled",
"(",
")",
")",
"{",
"binder",
".",
"setRequiredFiel... | Initialize the binder with the required fields.
@param request the request
@param binder the binder | [
"Initialize",
"the",
"binder",
"with",
"the",
"required",
"fields",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-validation/src/main/java/org/apereo/cas/web/AbstractServiceValidateController.java#L109-L113 |
rototor/pdfbox-graphics2d | src/main/java/de/rototor/pdfbox/graphics2d/PdfBoxGraphics2DFontTextDrawer.java | PdfBoxGraphics2DFontTextDrawer.mapFont | @SuppressWarnings("WeakerAccess")
protected PDFont mapFont(final Font font, final IFontTextDrawerEnv env) throws IOException, FontFormatException {
"""
Try to map the java.awt.Font to a PDFont.
@param font
the java.awt.Font for which a mapping should be found
@param env
environment of the font mapper
@retu... | java | @SuppressWarnings("WeakerAccess")
protected PDFont mapFont(final Font font, final IFontTextDrawerEnv env) throws IOException, FontFormatException {
/*
* If we have any font registering's, we must perform them now
*/
for (final FontEntry fontEntry : fontFiles) {
if (fontEntry.overrideName == null) {
Fo... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"protected",
"PDFont",
"mapFont",
"(",
"final",
"Font",
"font",
",",
"final",
"IFontTextDrawerEnv",
"env",
")",
"throws",
"IOException",
",",
"FontFormatException",
"{",
"/*\n\t\t * If we have any font registering's, ... | Try to map the java.awt.Font to a PDFont.
@param font
the java.awt.Font for which a mapping should be found
@param env
environment of the font mapper
@return the PDFont or null if none can be found. | [
"Try",
"to",
"map",
"the",
"java",
".",
"awt",
".",
"Font",
"to",
"a",
"PDFont",
"."
] | train | https://github.com/rototor/pdfbox-graphics2d/blob/86d53942cf2c137edca59d45766927c077f49230/src/main/java/de/rototor/pdfbox/graphics2d/PdfBoxGraphics2DFontTextDrawer.java#L408-L439 |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/transform/Transformation.java | Transformation.addOutputProperty | public void addOutputProperty(String name, String value) {
"""
Add a named output property.
@param name name of the property - must not be null
@param value value of the property - must not be null
"""
if (name == null) {
throw new IllegalArgumentException("name must not be null");
... | java | public void addOutputProperty(String name, String value) {
if (name == null) {
throw new IllegalArgumentException("name must not be null");
}
if (value == null) {
throw new IllegalArgumentException("value must not be null");
}
output.setProperty(name, valu... | [
"public",
"void",
"addOutputProperty",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"name must not be null\"",
")",
";",
"}",
"if",
"(",
"value",
"==",
... | Add a named output property.
@param name name of the property - must not be null
@param value value of the property - must not be null | [
"Add",
"a",
"named",
"output",
"property",
"."
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/transform/Transformation.java#L84-L92 |
hawkular/hawkular-apm | api/src/main/java/org/hawkular/apm/api/utils/NodeUtil.java | NodeUtil.findNodes | @SuppressWarnings("unchecked")
public static <T extends Node> void findNodes(List<Node> nodes, Class<T> cls, List<T> results) {
"""
This method recursively scans a node hierarchy to locate instances of a particular
type.
@param nodes The nodes to scan
@param cls The class of the node to be returned
@para... | java | @SuppressWarnings("unchecked")
public static <T extends Node> void findNodes(List<Node> nodes, Class<T> cls, List<T> results) {
for (Node n : nodes) {
if (n instanceof ContainerNode) {
findNodes(((ContainerNode) n).getNodes(), cls, results);
}
if (cls == ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
"extends",
"Node",
">",
"void",
"findNodes",
"(",
"List",
"<",
"Node",
">",
"nodes",
",",
"Class",
"<",
"T",
">",
"cls",
",",
"List",
"<",
"T",
">",
"results",
")",
"{"... | This method recursively scans a node hierarchy to locate instances of a particular
type.
@param nodes The nodes to scan
@param cls The class of the node to be returned
@param results The list of nodes found | [
"This",
"method",
"recursively",
"scans",
"a",
"node",
"hierarchy",
"to",
"locate",
"instances",
"of",
"a",
"particular",
"type",
"."
] | train | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/api/src/main/java/org/hawkular/apm/api/utils/NodeUtil.java#L236-L247 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java | MercatorProjection.longitudeToTileXWithScaleFactor | public static int longitudeToTileXWithScaleFactor(double longitude, double scaleFactor) {
"""
Converts a longitude coordinate (in degrees) to the tile X number at a certain scale factor.
@param longitude the longitude coordinate that should be converted.
@param scaleFactor the scale factor at which the coord... | java | public static int longitudeToTileXWithScaleFactor(double longitude, double scaleFactor) {
return pixelXToTileXWithScaleFactor(longitudeToPixelXWithScaleFactor(longitude, scaleFactor, DUMMY_TILE_SIZE), scaleFactor, DUMMY_TILE_SIZE);
} | [
"public",
"static",
"int",
"longitudeToTileXWithScaleFactor",
"(",
"double",
"longitude",
",",
"double",
"scaleFactor",
")",
"{",
"return",
"pixelXToTileXWithScaleFactor",
"(",
"longitudeToPixelXWithScaleFactor",
"(",
"longitude",
",",
"scaleFactor",
",",
"DUMMY_TILE_SIZE",... | Converts a longitude coordinate (in degrees) to the tile X number at a certain scale factor.
@param longitude the longitude coordinate that should be converted.
@param scaleFactor the scale factor at which the coordinate should be converted.
@return the tile X number of the longitude value. | [
"Converts",
"a",
"longitude",
"coordinate",
"(",
"in",
"degrees",
")",
"to",
"the",
"tile",
"X",
"number",
"at",
"a",
"certain",
"scale",
"factor",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java#L289-L291 |
JakeWharton/NineOldAndroids | library/src/com/nineoldandroids/animation/ObjectAnimator.java | ObjectAnimator.ofFloat | public static ObjectAnimator ofFloat(Object target, String propertyName, float... values) {
"""
Constructs and returns an ObjectAnimator that animates between float values. A single
value implies that that value is the one being animated to. Two values imply a starting
and ending values. More than two values imp... | java | public static ObjectAnimator ofFloat(Object target, String propertyName, float... values) {
ObjectAnimator anim = new ObjectAnimator(target, propertyName);
anim.setFloatValues(values);
return anim;
} | [
"public",
"static",
"ObjectAnimator",
"ofFloat",
"(",
"Object",
"target",
",",
"String",
"propertyName",
",",
"float",
"...",
"values",
")",
"{",
"ObjectAnimator",
"anim",
"=",
"new",
"ObjectAnimator",
"(",
"target",
",",
"propertyName",
")",
";",
"anim",
".",... | Constructs and returns an ObjectAnimator that animates between float values. A single
value implies that that value is the one being animated to. Two values imply a starting
and ending values. More than two values imply a starting value, values to animate through
along the way, and an ending value (these values will be... | [
"Constructs",
"and",
"returns",
"an",
"ObjectAnimator",
"that",
"animates",
"between",
"float",
"values",
".",
"A",
"single",
"value",
"implies",
"that",
"that",
"value",
"is",
"the",
"one",
"being",
"animated",
"to",
".",
"Two",
"values",
"imply",
"a",
"sta... | train | https://github.com/JakeWharton/NineOldAndroids/blob/d582f0ec8e79013e9fa96c07986160b52e662e63/library/src/com/nineoldandroids/animation/ObjectAnimator.java#L230-L234 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixesInner.java | PublicIPPrefixesInner.beginDelete | public void beginDelete(String resourceGroupName, String publicIpPrefixName) {
"""
Deletes the specified public IP prefix.
@param resourceGroupName The name of the resource group.
@param publicIpPrefixName The name of the PublicIpPrefix.
@throws IllegalArgumentException thrown if parameters fail the validatio... | java | public void beginDelete(String resourceGroupName, String publicIpPrefixName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpPrefixName).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"resourceGroupName",
",",
"String",
"publicIpPrefixName",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"publicIpPrefixName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
... | Deletes the specified public IP prefix.
@param resourceGroupName The name of the resource group.
@param publicIpPrefixName The name of the PublicIpPrefix.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeExceptio... | [
"Deletes",
"the",
"specified",
"public",
"IP",
"prefix",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixesInner.java#L191-L193 |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/RedisClusterStorage.java | RedisClusterStorage.pauseTrigger | @Override
public void pauseTrigger(TriggerKey triggerKey, JedisCluster jedis) throws JobPersistenceException {
"""
Pause the trigger with the given key
@param triggerKey the key of the trigger to be paused
@param jedis a thread-safe Redis connection
@throws JobPersistenceException if the desired trig... | java | @Override
public void pauseTrigger(TriggerKey triggerKey, JedisCluster jedis) throws JobPersistenceException {
final String triggerHashKey = redisSchema.triggerHashKey(triggerKey);
Boolean exists = jedis.exists(triggerHashKey);
Double completedScore = jedis.zscore(redisSchema.triggerStateKey... | [
"@",
"Override",
"public",
"void",
"pauseTrigger",
"(",
"TriggerKey",
"triggerKey",
",",
"JedisCluster",
"jedis",
")",
"throws",
"JobPersistenceException",
"{",
"final",
"String",
"triggerHashKey",
"=",
"redisSchema",
".",
"triggerHashKey",
"(",
"triggerKey",
")",
"... | Pause the trigger with the given key
@param triggerKey the key of the trigger to be paused
@param jedis a thread-safe Redis connection
@throws JobPersistenceException if the desired trigger does not exist | [
"Pause",
"the",
"trigger",
"with",
"the",
"given",
"key"
] | train | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/RedisClusterStorage.java#L421-L444 |
neo4j/neo4j-java-driver | driver/src/main/java/org/neo4j/driver/internal/packstream/PackStream.java | Unpacker.unpackNull | public Object unpackNull() throws IOException {
"""
This may seem confusing. This method exists to move forward the internal pointer when encountering
a null value. The idiomatic usage would be someone using {@link #peekNextType()} to detect a null type,
and then this method to "skip past it".
@return null
@th... | java | public Object unpackNull() throws IOException
{
final byte markerByte = in.readByte();
if ( markerByte != NULL )
{
throw new Unexpected( "Expected a null, but got: 0x" + toHexString( markerByte & 0xFF ) );
}
return null;
} | [
"public",
"Object",
"unpackNull",
"(",
")",
"throws",
"IOException",
"{",
"final",
"byte",
"markerByte",
"=",
"in",
".",
"readByte",
"(",
")",
";",
"if",
"(",
"markerByte",
"!=",
"NULL",
")",
"{",
"throw",
"new",
"Unexpected",
"(",
"\"Expected a null, but go... | This may seem confusing. This method exists to move forward the internal pointer when encountering
a null value. The idiomatic usage would be someone using {@link #peekNextType()} to detect a null type,
and then this method to "skip past it".
@return null
@throws IOException if the unpacked value was not null | [
"This",
"may",
"seem",
"confusing",
".",
"This",
"method",
"exists",
"to",
"move",
"forward",
"the",
"internal",
"pointer",
"when",
"encountering",
"a",
"null",
"value",
".",
"The",
"idiomatic",
"usage",
"would",
"be",
"someone",
"using",
"{"
] | train | https://github.com/neo4j/neo4j-java-driver/blob/8dad6c48251fa1ab7017e72d9998a24fa2337a22/driver/src/main/java/org/neo4j/driver/internal/packstream/PackStream.java#L527-L535 |
actorapp/actor-platform | actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java | ImageLoading.getScaleFactor | private static int getScaleFactor(ImageMetadata metadata, int minW, int minH) {
"""
Calculating scale factor with limit of pixel amount
@param metadata image metadata
@param minH minimal height
@param minW minimal width
@return scale factor
"""
int scale = 1;
int scaledW = metadat... | java | private static int getScaleFactor(ImageMetadata metadata, int minW, int minH) {
int scale = 1;
int scaledW = metadata.getW();
int scaledH = metadata.getH();
while (scaledW / 2 > minW && scaledH / 2 > minH) {
scale *= 2;
scaledH /= 2;
scaledW /= 2;
... | [
"private",
"static",
"int",
"getScaleFactor",
"(",
"ImageMetadata",
"metadata",
",",
"int",
"minW",
",",
"int",
"minH",
")",
"{",
"int",
"scale",
"=",
"1",
";",
"int",
"scaledW",
"=",
"metadata",
".",
"getW",
"(",
")",
";",
"int",
"scaledH",
"=",
"meta... | Calculating scale factor with limit of pixel amount
@param metadata image metadata
@param minH minimal height
@param minW minimal width
@return scale factor | [
"Calculating",
"scale",
"factor",
"with",
"limit",
"of",
"pixel",
"amount"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java#L555-L565 |
alkacon/opencms-core | src/org/opencms/workplace/editors/CmsEditor.java | CmsEditor.buttonActionDirectEdit | public String buttonActionDirectEdit(String jsFunction, int type) {
"""
Builds the html to display the special action button for the direct edit mode of the editor.<p>
@param jsFunction the JavaScript function which will be executed on the mouseup event
@param type 0: image only (default), 1: image and text, 2... | java | public String buttonActionDirectEdit(String jsFunction, int type) {
// get the action class from the OpenCms runtime property
I_CmsEditorActionHandler actionClass = OpenCms.getWorkplaceManager().getEditorActionHandler();
String url;
String name;
boolean active = false;
i... | [
"public",
"String",
"buttonActionDirectEdit",
"(",
"String",
"jsFunction",
",",
"int",
"type",
")",
"{",
"// get the action class from the OpenCms runtime property",
"I_CmsEditorActionHandler",
"actionClass",
"=",
"OpenCms",
".",
"getWorkplaceManager",
"(",
")",
".",
"getEd... | Builds the html to display the special action button for the direct edit mode of the editor.<p>
@param jsFunction the JavaScript function which will be executed on the mouseup event
@param type 0: image only (default), 1: image and text, 2: text only
@return the html to display the special action button | [
"Builds",
"the",
"html",
"to",
"display",
"the",
"special",
"action",
"button",
"for",
"the",
"direct",
"edit",
"mode",
"of",
"the",
"editor",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/editors/CmsEditor.java#L366-L401 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java | SARLQuickfixProvider.fixInvalidImplementedType | @Fix(io.sarl.lang.validation.IssueCodes.INVALID_IMPLEMENTED_TYPE)
public void fixInvalidImplementedType(final Issue issue, IssueResolutionAcceptor acceptor) {
"""
Quick fix for "Invalid implemented type".
@param issue the issue.
@param acceptor the quick fix acceptor.
"""
ImplementedTypeRemoveModificati... | java | @Fix(io.sarl.lang.validation.IssueCodes.INVALID_IMPLEMENTED_TYPE)
public void fixInvalidImplementedType(final Issue issue, IssueResolutionAcceptor acceptor) {
ImplementedTypeRemoveModification.accept(this, issue, acceptor, RemovalType.OTHER);
} | [
"@",
"Fix",
"(",
"io",
".",
"sarl",
".",
"lang",
".",
"validation",
".",
"IssueCodes",
".",
"INVALID_IMPLEMENTED_TYPE",
")",
"public",
"void",
"fixInvalidImplementedType",
"(",
"final",
"Issue",
"issue",
",",
"IssueResolutionAcceptor",
"acceptor",
")",
"{",
"Imp... | Quick fix for "Invalid implemented type".
@param issue the issue.
@param acceptor the quick fix acceptor. | [
"Quick",
"fix",
"for",
"Invalid",
"implemented",
"type",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java#L805-L808 |
weld/core | environments/servlet/core/src/main/java/org/jboss/weld/environment/servlet/WeldServletLifecycle.java | WeldServletLifecycle.findContainer | protected Container findContainer(ContainerContext ctx, StringBuilder dump) {
"""
Find container env.
@param ctx the container context
@param dump the exception dump
@return valid container or null
"""
Container container = null;
// 1. Custom container class
String containerClassNa... | java | protected Container findContainer(ContainerContext ctx, StringBuilder dump) {
Container container = null;
// 1. Custom container class
String containerClassName = ctx.getServletContext().getInitParameter(Container.CONTEXT_PARAM_CONTAINER_CLASS);
if (containerClassName != null) {
... | [
"protected",
"Container",
"findContainer",
"(",
"ContainerContext",
"ctx",
",",
"StringBuilder",
"dump",
")",
"{",
"Container",
"container",
"=",
"null",
";",
"// 1. Custom container class",
"String",
"containerClassName",
"=",
"ctx",
".",
"getServletContext",
"(",
")... | Find container env.
@param ctx the container context
@param dump the exception dump
@return valid container or null | [
"Find",
"container",
"env",
"."
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/servlet/core/src/main/java/org/jboss/weld/environment/servlet/WeldServletLifecycle.java#L341-L366 |
alkacon/opencms-core | src/org/opencms/workflow/CmsExtendedWorkflowManager.java | CmsExtendedWorkflowManager.checkNewParentsInList | protected void checkNewParentsInList(CmsObject userCms, List<CmsResource> resources) throws CmsException {
"""
Checks that the parent folders of new resources which are released are either not new or are also released.<p>
@param userCms the user CMS context
@param resources the resources to check
@throws Cm... | java | protected void checkNewParentsInList(CmsObject userCms, List<CmsResource> resources) throws CmsException {
Map<String, CmsResource> resourcesByPath = new HashMap<String, CmsResource>();
CmsObject rootCms = OpenCms.initCmsObject(m_adminCms);
rootCms.getRequestContext().setCurrentProject(user... | [
"protected",
"void",
"checkNewParentsInList",
"(",
"CmsObject",
"userCms",
",",
"List",
"<",
"CmsResource",
">",
"resources",
")",
"throws",
"CmsException",
"{",
"Map",
"<",
"String",
",",
"CmsResource",
">",
"resourcesByPath",
"=",
"new",
"HashMap",
"<",
"Strin... | Checks that the parent folders of new resources which are released are either not new or are also released.<p>
@param userCms the user CMS context
@param resources the resources to check
@throws CmsException if the check fails | [
"Checks",
"that",
"the",
"parent",
"folders",
"of",
"new",
"resources",
"which",
"are",
"released",
"are",
"either",
"not",
"new",
"or",
"are",
"also",
"released",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workflow/CmsExtendedWorkflowManager.java#L368-L392 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/tools/StringTools.java | StringTools.uppercaseFirstChar | @Nullable
public static String uppercaseFirstChar(String str, Language language) {
"""
Like {@link #uppercaseFirstChar(String)}, but handles a special case for Dutch (IJ in
e.g. "ijsselmeer" -> "IJsselmeer").
@param language the language, will be ignored if it's {@code null}
@since 2.7
"""
if (lang... | java | @Nullable
public static String uppercaseFirstChar(String str, Language language) {
if (language != null && "nl".equals(language.getShortCode()) && str != null && str.toLowerCase().startsWith("ij")) {
// hack to fix https://github.com/languagetool-org/languagetool/issues/148
return "IJ" + str.substring... | [
"@",
"Nullable",
"public",
"static",
"String",
"uppercaseFirstChar",
"(",
"String",
"str",
",",
"Language",
"language",
")",
"{",
"if",
"(",
"language",
"!=",
"null",
"&&",
"\"nl\"",
".",
"equals",
"(",
"language",
".",
"getShortCode",
"(",
")",
")",
"&&",... | Like {@link #uppercaseFirstChar(String)}, but handles a special case for Dutch (IJ in
e.g. "ijsselmeer" -> "IJsselmeer").
@param language the language, will be ignored if it's {@code null}
@since 2.7 | [
"Like",
"{"
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/tools/StringTools.java#L206-L214 |
aws/aws-sdk-java | aws-java-sdk-guardduty/src/main/java/com/amazonaws/services/guardduty/model/FindingStatistics.java | FindingStatistics.withCountBySeverity | public FindingStatistics withCountBySeverity(java.util.Map<String, Integer> countBySeverity) {
"""
Represents a map of severity to count statistic for a set of findings
@param countBySeverity
Represents a map of severity to count statistic for a set of findings
@return Returns a reference to this object so th... | java | public FindingStatistics withCountBySeverity(java.util.Map<String, Integer> countBySeverity) {
setCountBySeverity(countBySeverity);
return this;
} | [
"public",
"FindingStatistics",
"withCountBySeverity",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"Integer",
">",
"countBySeverity",
")",
"{",
"setCountBySeverity",
"(",
"countBySeverity",
")",
";",
"return",
"this",
";",
"}"
] | Represents a map of severity to count statistic for a set of findings
@param countBySeverity
Represents a map of severity to count statistic for a set of findings
@return Returns a reference to this object so that method calls can be chained together. | [
"Represents",
"a",
"map",
"of",
"severity",
"to",
"count",
"statistic",
"for",
"a",
"set",
"of",
"findings"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-guardduty/src/main/java/com/amazonaws/services/guardduty/model/FindingStatistics.java#L61-L64 |
OpenLiberty/open-liberty | dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixCompareCommandTask.java | IFixCompareCommandTask.isIFixApplicable | private boolean isIFixApplicable(Version productVersion, IFixInfo iFixInfo) throws VersionParsingException {
"""
Returns <code>true</code> if the IFixInfo applies the current installation version.
@param productVersion
@param iFixInfo
@return
"""
// If we don't know the product version just retu... | java | private boolean isIFixApplicable(Version productVersion, IFixInfo iFixInfo) throws VersionParsingException {
// If we don't know the product version just return true
if (productVersion == null) {
return true;
}
// Get the applicability for the iFix
Applicability appl... | [
"private",
"boolean",
"isIFixApplicable",
"(",
"Version",
"productVersion",
",",
"IFixInfo",
"iFixInfo",
")",
"throws",
"VersionParsingException",
"{",
"// If we don't know the product version just return true",
"if",
"(",
"productVersion",
"==",
"null",
")",
"{",
"return",... | Returns <code>true</code> if the IFixInfo applies the current installation version.
@param productVersion
@param iFixInfo
@return | [
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"the",
"IFixInfo",
"applies",
"the",
"current",
"installation",
"version",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixCompareCommandTask.java#L474-L504 |
airbnb/lottie-android | lottie/src/main/java/com/airbnb/lottie/model/KeyPath.java | KeyPath.fullyResolvesTo | @RestrictTo(RestrictTo.Scope.LIBRARY)
public boolean fullyResolvesTo(String key, int depth) {
"""
Returns whether the key at specified depth is fully specific enough to match the full set of
keys in this keypath.
"""
if (depth >= keys.size()) {
return false;
}
boolean isLastDepth = depth =... | java | @RestrictTo(RestrictTo.Scope.LIBRARY)
public boolean fullyResolvesTo(String key, int depth) {
if (depth >= keys.size()) {
return false;
}
boolean isLastDepth = depth == keys.size() - 1;
String keyAtDepth = keys.get(depth);
boolean isGlobstar = keyAtDepth.equals("**");
if (!isGlobstar) {... | [
"@",
"RestrictTo",
"(",
"RestrictTo",
".",
"Scope",
".",
"LIBRARY",
")",
"public",
"boolean",
"fullyResolvesTo",
"(",
"String",
"key",
",",
"int",
"depth",
")",
"{",
"if",
"(",
"depth",
">=",
"keys",
".",
"size",
"(",
")",
")",
"{",
"return",
"false",
... | Returns whether the key at specified depth is fully specific enough to match the full set of
keys in this keypath. | [
"Returns",
"whether",
"the",
"key",
"at",
"specified",
"depth",
"is",
"fully",
"specific",
"enough",
"to",
"match",
"the",
"full",
"set",
"of",
"keys",
"in",
"this",
"keypath",
"."
] | train | https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/model/KeyPath.java#L148-L178 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularTools_F32.java | EquirectangularTools_F32.latlonToEqui | public void latlonToEqui(float lat, float lon, Point2D_F32 rect) {
"""
Convert from latitude-longitude coordinates into equirectangular coordinates
@param lat Latitude
@param lon Longitude
@param rect (Output) equirectangular coordinate
"""
rect.x = UtilAngle.wrapZeroToOne(lon / GrlConstants.F_PI2 + 0.5f)... | java | public void latlonToEqui(float lat, float lon, Point2D_F32 rect) {
rect.x = UtilAngle.wrapZeroToOne(lon / GrlConstants.F_PI2 + 0.5f)*width;
rect.y = UtilAngle.reflectZeroToOne(lat / GrlConstants.F_PI + 0.5f)*(height-1);
} | [
"public",
"void",
"latlonToEqui",
"(",
"float",
"lat",
",",
"float",
"lon",
",",
"Point2D_F32",
"rect",
")",
"{",
"rect",
".",
"x",
"=",
"UtilAngle",
".",
"wrapZeroToOne",
"(",
"lon",
"/",
"GrlConstants",
".",
"F_PI2",
"+",
"0.5f",
")",
"*",
"width",
"... | Convert from latitude-longitude coordinates into equirectangular coordinates
@param lat Latitude
@param lon Longitude
@param rect (Output) equirectangular coordinate | [
"Convert",
"from",
"latitude",
"-",
"longitude",
"coordinates",
"into",
"equirectangular",
"coordinates"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularTools_F32.java#L145-L148 |
GenesysPureEngage/provisioning-client-java | src/main/java/com/genesys/internal/provisioning/api/UsersApi.java | UsersApi.updateUser | public ApiSuccessResponse updateUser(String dbid, UpdateUserData updateUserData) throws ApiException {
"""
Update a user.
Update a user ([CfgPerson](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgPerson)) with the specified attributes.
@param dbid The user's DBID. (required)
@param upd... | java | public ApiSuccessResponse updateUser(String dbid, UpdateUserData updateUserData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = updateUserWithHttpInfo(dbid, updateUserData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"updateUser",
"(",
"String",
"dbid",
",",
"UpdateUserData",
"updateUserData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"updateUserWithHttpInfo",
"(",
"dbid",
",",
"updateUserData",
... | Update a user.
Update a user ([CfgPerson](https://docs.genesys.com/Documentation/PSDK/latest/ConfigLayerRef/CfgPerson)) with the specified attributes.
@param dbid The user's DBID. (required)
@param updateUserData Update user data (required)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.... | [
"Update",
"a",
"user",
".",
"Update",
"a",
"user",
"(",
"[",
"CfgPerson",
"]",
"(",
"https",
":",
"//",
"docs",
".",
"genesys",
".",
"com",
"/",
"Documentation",
"/",
"PSDK",
"/",
"latest",
"/",
"ConfigLayerRef",
"/",
"CfgPerson",
"))",
"with",
"the",
... | train | https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/UsersApi.java#L800-L803 |
infinispan/infinispan | hibernate/cache-commons/src/main/java/org/infinispan/hibernate/cache/commons/access/PutFromLoadValidator.java | PutFromLoadValidator.endInvalidatingKey | public boolean endInvalidatingKey(Object lockOwner, Object key, boolean doPFER) {
"""
Called after the transaction completes, allowing caching of entries. It is possible that this method
is called without previous invocation of {@link #beginInvalidatingKey(Object, Object)}, then it should be a no-op.
@param lo... | java | public boolean endInvalidatingKey(Object lockOwner, Object key, boolean doPFER) {
PendingPutMap pending = pendingPuts.get(key);
if (pending == null) {
if (trace) {
log.tracef("endInvalidatingKey(%s#%s, %s) could not find pending puts", cache.getName(), key, lockOwnerToString(lockOwner));
}
return true;... | [
"public",
"boolean",
"endInvalidatingKey",
"(",
"Object",
"lockOwner",
",",
"Object",
"key",
",",
"boolean",
"doPFER",
")",
"{",
"PendingPutMap",
"pending",
"=",
"pendingPuts",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"pending",
"==",
"null",
")",
"{",... | Called after the transaction completes, allowing caching of entries. It is possible that this method
is called without previous invocation of {@link #beginInvalidatingKey(Object, Object)}, then it should be a no-op.
@param lockOwner owner of the invalidation - transaction or thread
@param key
@return | [
"Called",
"after",
"the",
"transaction",
"completes",
"allowing",
"caching",
"of",
"entries",
".",
"It",
"is",
"possible",
"that",
"this",
"method",
"is",
"called",
"without",
"previous",
"invocation",
"of",
"{",
"@link",
"#beginInvalidatingKey",
"(",
"Object",
... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/hibernate/cache-commons/src/main/java/org/infinispan/hibernate/cache/commons/access/PutFromLoadValidator.java#L623-L652 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/feature/Feature.java | Feature.setStringAttribute | public void setStringAttribute(String name, String value) {
"""
Set attribute value of given type.
@param name attribute name
@param value attribute value
"""
Attribute attribute = getAttributes().get(name);
if (!(attribute instanceof StringAttribute)) {
throw new IllegalStateException("Cannot set b... | java | public void setStringAttribute(String name, String value) {
Attribute attribute = getAttributes().get(name);
if (!(attribute instanceof StringAttribute)) {
throw new IllegalStateException("Cannot set boolean value on attribute with different type, " +
attribute.getClass().getName() + " setting value " + val... | [
"public",
"void",
"setStringAttribute",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"Attribute",
"attribute",
"=",
"getAttributes",
"(",
")",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"!",
"(",
"attribute",
"instanceof",
"StringAttribute",
... | Set attribute value of given type.
@param name attribute name
@param value attribute value | [
"Set",
"attribute",
"value",
"of",
"given",
"type",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/feature/Feature.java#L350-L357 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/hylafax/HylaFaxClientSpi.java | HylaFaxClientSpi.cancelFaxJob | protected void cancelFaxJob(HylaFaxJob faxJob,HylaFAXClient client) throws Exception {
"""
This function will cancel an existing fax job.
@param client
The client instance
@param faxJob
The fax job object containing the needed information
@throws Exception
Any exception
"""
//get job
... | java | protected void cancelFaxJob(HylaFaxJob faxJob,HylaFAXClient client) throws Exception
{
//get job
Job job=faxJob.getHylaFaxJob();
//cancel job
client.kill(job);
} | [
"protected",
"void",
"cancelFaxJob",
"(",
"HylaFaxJob",
"faxJob",
",",
"HylaFAXClient",
"client",
")",
"throws",
"Exception",
"{",
"//get job",
"Job",
"job",
"=",
"faxJob",
".",
"getHylaFaxJob",
"(",
")",
";",
"//cancel job",
"client",
".",
"kill",
"(",
"job",... | This function will cancel an existing fax job.
@param client
The client instance
@param faxJob
The fax job object containing the needed information
@throws Exception
Any exception | [
"This",
"function",
"will",
"cancel",
"an",
"existing",
"fax",
"job",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/hylafax/HylaFaxClientSpi.java#L491-L498 |
fuwjax/ev-oss | funco/src/main/java/org/fuwjax/oss/util/assertion/Assert2.java | Assert2.assertByteEquals | public static void assertByteEquals(final Path sub, final Path expected, final Path actual) throws IOException {
"""
Asserts that two paths are byte-equivalent.
@param sub the shared portion of the two paths
@param expected the expected path
@param actual the actual path
@throws IOException if the paths cannot... | java | public static void assertByteEquals(final Path sub, final Path expected, final Path actual) throws IOException {
final int length = 4096;
final byte[] hereBuffer = new byte[length];
final byte[] thereBuffer = new byte[length];
long hereLimit = 0;
long thereLimit = 0;
try(InputStream hereStream = newInputStr... | [
"public",
"static",
"void",
"assertByteEquals",
"(",
"final",
"Path",
"sub",
",",
"final",
"Path",
"expected",
",",
"final",
"Path",
"actual",
")",
"throws",
"IOException",
"{",
"final",
"int",
"length",
"=",
"4096",
";",
"final",
"byte",
"[",
"]",
"hereBu... | Asserts that two paths are byte-equivalent.
@param sub the shared portion of the two paths
@param expected the expected path
@param actual the actual path
@throws IOException if the paths cannot be opened and consumed | [
"Asserts",
"that",
"two",
"paths",
"are",
"byte",
"-",
"equivalent",
"."
] | train | https://github.com/fuwjax/ev-oss/blob/cbd88592e9b2fa9547c3bdd41e52e790061a2253/funco/src/main/java/org/fuwjax/oss/util/assertion/Assert2.java#L152-L178 |
alkacon/opencms-core | src/org/opencms/file/CmsProperty.java | CmsProperty.createValueFromMap | private String createValueFromMap(Map<String, String> valueMap) {
"""
Returns the single String value representation for the given value map.<p>
@param valueMap the value map to create the single String value for
@return the single String value representation for the given value map
"""
if (valu... | java | private String createValueFromMap(Map<String, String> valueMap) {
if (valueMap == null) {
return null;
}
StringBuffer result = new StringBuffer(valueMap.size() * 32);
Iterator<Map.Entry<String, String>> i = valueMap.entrySet().iterator();
while (i.hasNext()) {
... | [
"private",
"String",
"createValueFromMap",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"valueMap",
")",
"{",
"if",
"(",
"valueMap",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
"valueMap"... | Returns the single String value representation for the given value map.<p>
@param valueMap the value map to create the single String value for
@return the single String value representation for the given value map | [
"Returns",
"the",
"single",
"String",
"value",
"representation",
"for",
"the",
"given",
"value",
"map",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsProperty.java#L1304-L1327 |
rhuss/jolokia | agent/jmx/src/main/java/org/jolokia/jmx/JolokiaMBeanServer.java | JolokiaMBeanServer.fromJson | Object fromJson(OpenType type, String json) {
"""
Convert from JSON for OpenType objects. Throws an {@link IllegalArgumentException} if
@param type open type
@param json JSON representation to convert from
@return the converted object
"""
return converters.getToOpenTypeConverter().convertToObject(... | java | Object fromJson(OpenType type, String json) {
return converters.getToOpenTypeConverter().convertToObject(type,json);
} | [
"Object",
"fromJson",
"(",
"OpenType",
"type",
",",
"String",
"json",
")",
"{",
"return",
"converters",
".",
"getToOpenTypeConverter",
"(",
")",
".",
"convertToObject",
"(",
"type",
",",
"json",
")",
";",
"}"
] | Convert from JSON for OpenType objects. Throws an {@link IllegalArgumentException} if
@param type open type
@param json JSON representation to convert from
@return the converted object | [
"Convert",
"from",
"JSON",
"for",
"OpenType",
"objects",
".",
"Throws",
"an",
"{",
"@link",
"IllegalArgumentException",
"}",
"if"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jmx/src/main/java/org/jolokia/jmx/JolokiaMBeanServer.java#L178-L180 |
osglworks/java-mvc | src/main/java/org/osgl/mvc/result/Gone.java | Gone.of | public static Gone of(Throwable cause) {
"""
Returns a static Gone instance and set the {@link #payload} thread local
with cause specified.
When calling the instance on {@link #getMessage()} method, it will return whatever
stored in the {@link #payload} thread local
@param cause the cause
@return a static... | java | public static Gone of(Throwable cause) {
if (_localizedErrorMsg()) {
return of(cause, defaultMessage(GONE));
} else {
touchPayload().cause(cause);
return _INSTANCE;
}
} | [
"public",
"static",
"Gone",
"of",
"(",
"Throwable",
"cause",
")",
"{",
"if",
"(",
"_localizedErrorMsg",
"(",
")",
")",
"{",
"return",
"of",
"(",
"cause",
",",
"defaultMessage",
"(",
"GONE",
")",
")",
";",
"}",
"else",
"{",
"touchPayload",
"(",
")",
"... | Returns a static Gone instance and set the {@link #payload} thread local
with cause specified.
When calling the instance on {@link #getMessage()} method, it will return whatever
stored in the {@link #payload} thread local
@param cause the cause
@return a static Gone instance as described above | [
"Returns",
"a",
"static",
"Gone",
"instance",
"and",
"set",
"the",
"{",
"@link",
"#payload",
"}",
"thread",
"local",
"with",
"cause",
"specified",
"."
] | train | https://github.com/osglworks/java-mvc/blob/4d2b2ec40498ac6ee7040c0424377cbeacab124b/src/main/java/org/osgl/mvc/result/Gone.java#L130-L137 |
hawkular/hawkular-apm | api/src/main/java/org/hawkular/apm/api/utils/NodeUtil.java | NodeUtil.rewriteURI | @Deprecated
public static void rewriteURI(Node node, String uri) {
"""
This method rewrites the URI associated with the supplied
node and stores the original in the node's details.
@param node The node
@param uri The new URI
@deprecated Only used in original JavaAgent. Not to be used with OpenTracing.
... | java | @Deprecated
public static void rewriteURI(Node node, String uri) {
node.getProperties().add(new Property(APM_ORIGINAL_URI, node.getUri()));
node.setUri(uri);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"rewriteURI",
"(",
"Node",
"node",
",",
"String",
"uri",
")",
"{",
"node",
".",
"getProperties",
"(",
")",
".",
"add",
"(",
"new",
"Property",
"(",
"APM_ORIGINAL_URI",
",",
"node",
".",
"getUri",
"(",
")",
... | This method rewrites the URI associated with the supplied
node and stores the original in the node's details.
@param node The node
@param uri The new URI
@deprecated Only used in original JavaAgent. Not to be used with OpenTracing. | [
"This",
"method",
"rewrites",
"the",
"URI",
"associated",
"with",
"the",
"supplied",
"node",
"and",
"stores",
"the",
"original",
"in",
"the",
"node",
"s",
"details",
"."
] | train | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/api/src/main/java/org/hawkular/apm/api/utils/NodeUtil.java#L65-L69 |
virgo47/javasimon | jdbc41/src/main/java/org/javasimon/jdbcx4/WrappingSimonDataSource.java | WrappingSimonDataSource.getConnection | @Override
public Connection getConnection(String user, String password) throws SQLException {
"""
Attempts to establish a connection with the data source that this {@code DataSource} object represents.
@param user the database user on whose behalf the connection is being made
@param password the user's passwo... | java | @Override
public Connection getConnection(String user, String password) throws SQLException {
return new SimonConnection(getDataSource().getConnection(user, password), getPrefix());
} | [
"@",
"Override",
"public",
"Connection",
"getConnection",
"(",
"String",
"user",
",",
"String",
"password",
")",
"throws",
"SQLException",
"{",
"return",
"new",
"SimonConnection",
"(",
"getDataSource",
"(",
")",
".",
"getConnection",
"(",
"user",
",",
"password"... | Attempts to establish a connection with the data source that this {@code DataSource} object represents.
@param user the database user on whose behalf the connection is being made
@param password the user's password
@return a connection to the data source
@throws SQLException if a database access error occurs | [
"Attempts",
"to",
"establish",
"a",
"connection",
"with",
"the",
"data",
"source",
"that",
"this",
"{",
"@code",
"DataSource",
"}",
"object",
"represents",
"."
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/jdbc41/src/main/java/org/javasimon/jdbcx4/WrappingSimonDataSource.java#L66-L69 |
google/closure-compiler | src/com/google/debugging/sourcemap/SourceMapGeneratorV3.java | SourceMapGeneratorV3.addExtension | public void addExtension(String name, Object object)
throws SourceMapParseException {
"""
Adds field extensions to the json source map. The value is allowed to be
any value accepted by json, eg. string, JsonObject, JsonArray, etc.
Extensions must follow the format x_orgranization_field (based on V3
prop... | java | public void addExtension(String name, Object object)
throws SourceMapParseException{
if (!name.startsWith("x_")){
throw new SourceMapParseException("Extension '" + name +
"' must start with 'x_'");
}
this.extensions.put(name, object);
} | [
"public",
"void",
"addExtension",
"(",
"String",
"name",
",",
"Object",
"object",
")",
"throws",
"SourceMapParseException",
"{",
"if",
"(",
"!",
"name",
".",
"startsWith",
"(",
"\"x_\"",
")",
")",
"{",
"throw",
"new",
"SourceMapParseException",
"(",
"\"Extensi... | Adds field extensions to the json source map. The value is allowed to be
any value accepted by json, eg. string, JsonObject, JsonArray, etc.
Extensions must follow the format x_orgranization_field (based on V3
proposal), otherwise a {@code SourceMapParseExtension} will be thrown.
@param name The name of the extension... | [
"Adds",
"field",
"extensions",
"to",
"the",
"json",
"source",
"map",
".",
"The",
"value",
"is",
"allowed",
"to",
"be",
"any",
"value",
"accepted",
"by",
"json",
"eg",
".",
"string",
"JsonObject",
"JsonArray",
"etc",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/debugging/sourcemap/SourceMapGeneratorV3.java#L448-L455 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java | DatabasesInner.importMethod | public ImportExportResponseInner importMethod(String resourceGroupName, String serverName, ImportRequest parameters) {
"""
Imports a bacpac into a new database.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or th... | java | public ImportExportResponseInner importMethod(String resourceGroupName, String serverName, ImportRequest parameters) {
return importMethodWithServiceResponseAsync(resourceGroupName, serverName, parameters).toBlocking().last().body();
} | [
"public",
"ImportExportResponseInner",
"importMethod",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"ImportRequest",
"parameters",
")",
"{",
"return",
"importMethodWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
",",
"paramet... | Imports a bacpac into a new database.
@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 parameters The required parameters for importing a Bacpac into a databa... | [
"Imports",
"a",
"bacpac",
"into",
"a",
"new",
"database",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java#L1737-L1739 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/XlsLoader.java | XlsLoader.loadDetail | public <P> SheetBindingErrors<P> loadDetail(final InputStream xlsIn, final Class<P> clazz)
throws XlsMapperException, IOException {
"""
Excelファイルの1シートを読み込み、任意のクラスにマッピングする。
@param <P> シートをマッピングするクラスタイプ
@param xlsIn 読み込み元のExcelファイルのストリーム。
@param clazz マッピング先のクラスタイプ。
@return マッピングの詳細情報。
{@link Con... | java | public <P> SheetBindingErrors<P> loadDetail(final InputStream xlsIn, final Class<P> clazz)
throws XlsMapperException, IOException {
ArgUtils.notNull(xlsIn, "xlsIn");
ArgUtils.notNull(clazz, "clazz");
final AnnotationReader annoReader = new AnnotationReader(configuration.getAn... | [
"public",
"<",
"P",
">",
"SheetBindingErrors",
"<",
"P",
">",
"loadDetail",
"(",
"final",
"InputStream",
"xlsIn",
",",
"final",
"Class",
"<",
"P",
">",
"clazz",
")",
"throws",
"XlsMapperException",
",",
"IOException",
"{",
"ArgUtils",
".",
"notNull",
"(",
... | Excelファイルの1シートを読み込み、任意のクラスにマッピングする。
@param <P> シートをマッピングするクラスタイプ
@param xlsIn 読み込み元のExcelファイルのストリーム。
@param clazz マッピング先のクラスタイプ。
@return マッピングの詳細情報。
{@link Configuration#isIgnoreSheetNotFound()}の値がtrueで、シートが見つからない場合、nullを返します。
@throws IllegalArgumentException {@literal xlsIn == null or clazz == null}
@throws XlsMappe... | [
"Excelファイルの1シートを読み込み、任意のクラスにマッピングする。"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/XlsLoader.java#L102-L139 |
mygreen/excel-cellformatter | src/main/java/com/github/mygreen/cellformatter/lang/MessageResolver.java | MessageResolver.loadDefaultResource | private MessageResource loadDefaultResource(final boolean allowedNoDefault, final boolean appendUserResource) {
"""
プロパティファイルから取得する。
<p>プロパティ名を補完する。
@param path プロパティファイルのパス名
@param allowedNoDefault デフォルトのメッセージがない場合を許可するかどうか。
@param appendUserResource クラスパスのルートにあるユーザ定義のメッセージソースも読み込むかどうか指定します。
@return
"""
... | java | private MessageResource loadDefaultResource(final boolean allowedNoDefault, final boolean appendUserResource) {
final String path = getPropertyPath();
Properties props = new Properties();
try {
props.load(new InputStreamReader(MessageResolver.class.getResourceAsStream(path), "U... | [
"private",
"MessageResource",
"loadDefaultResource",
"(",
"final",
"boolean",
"allowedNoDefault",
",",
"final",
"boolean",
"appendUserResource",
")",
"{",
"final",
"String",
"path",
"=",
"getPropertyPath",
"(",
")",
";",
"Properties",
"props",
"=",
"new",
"Propertie... | プロパティファイルから取得する。
<p>プロパティ名を補完する。
@param path プロパティファイルのパス名
@param allowedNoDefault デフォルトのメッセージがない場合を許可するかどうか。
@param appendUserResource クラスパスのルートにあるユーザ定義のメッセージソースも読み込むかどうか指定します。
@return | [
"プロパティファイルから取得する。",
"<p",
">",
"プロパティ名を補完する。"
] | train | https://github.com/mygreen/excel-cellformatter/blob/e802af273d49889500591e03799c9262cbf29185/src/main/java/com/github/mygreen/cellformatter/lang/MessageResolver.java#L128-L158 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Getter.java | Getter.getView | public View getView(int id, int index, int timeout) {
"""
Returns a {@code View} with a given id.
@param id the R.id of the {@code View} to be returned
@param index the index of the {@link View}. {@code 0} if only one is available
@param timeout the timeout in milliseconds
@return a {@code View} with a given... | java | public View getView(int id, int index, int timeout){
return waiter.waitForView(id, index, timeout);
} | [
"public",
"View",
"getView",
"(",
"int",
"id",
",",
"int",
"index",
",",
"int",
"timeout",
")",
"{",
"return",
"waiter",
".",
"waitForView",
"(",
"id",
",",
"index",
",",
"timeout",
")",
";",
"}"
] | Returns a {@code View} with a given id.
@param id the R.id of the {@code View} to be returned
@param index the index of the {@link View}. {@code 0} if only one is available
@param timeout the timeout in milliseconds
@return a {@code View} with a given id | [
"Returns",
"a",
"{",
"@code",
"View",
"}",
"with",
"a",
"given",
"id",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Getter.java#L116-L118 |
ksclarke/vertx-pairtree | src/main/java/info/freelibrary/pairtree/PairtreeUtils.java | PairtreeUtils.removePrefix | public static String removePrefix(final String aPrefix, final String aID) {
"""
Removes the supplied Pairtree prefix from the supplied ID.
@param aPrefix A Pairtree prefix
@param aID An ID
@return The ID without the Pairtree prefix prepended to it
@throws PairtreeRuntimeException If the supplied prefix or ID... | java | public static String removePrefix(final String aPrefix, final String aID) {
Objects.requireNonNull(aPrefix, LOGGER.getMessage(MessageCodes.PT_006));
Objects.requireNonNull(aID, LOGGER.getMessage(MessageCodes.PT_004));
final String id;
if (aID.indexOf(aPrefix) == 0) {
id = a... | [
"public",
"static",
"String",
"removePrefix",
"(",
"final",
"String",
"aPrefix",
",",
"final",
"String",
"aID",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"aPrefix",
",",
"LOGGER",
".",
"getMessage",
"(",
"MessageCodes",
".",
"PT_006",
")",
")",
";",
... | Removes the supplied Pairtree prefix from the supplied ID.
@param aPrefix A Pairtree prefix
@param aID An ID
@return The ID without the Pairtree prefix prepended to it
@throws PairtreeRuntimeException If the supplied prefix or ID is null | [
"Removes",
"the",
"supplied",
"Pairtree",
"prefix",
"from",
"the",
"supplied",
"ID",
"."
] | train | https://github.com/ksclarke/vertx-pairtree/blob/b2ea1e32057e5df262e9265540d346a732b718df/src/main/java/info/freelibrary/pairtree/PairtreeUtils.java#L343-L356 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/searchindex/CmsEditFieldDialog.java | CmsEditFieldDialog.getTokenizedWidgetConfiguration | private List<CmsSelectWidgetOption> getTokenizedWidgetConfiguration() {
"""
Returns a list for the indexed select box.<p>
@return a list for the indexed select box
"""
List<CmsSelectWidgetOption> result = new ArrayList<CmsSelectWidgetOption>();
result.add(new CmsSelectWidgetOption("true", t... | java | private List<CmsSelectWidgetOption> getTokenizedWidgetConfiguration() {
List<CmsSelectWidgetOption> result = new ArrayList<CmsSelectWidgetOption>();
result.add(new CmsSelectWidgetOption("true", true));
result.add(new CmsSelectWidgetOption("false", false));
result.add(new CmsSelectWidget... | [
"private",
"List",
"<",
"CmsSelectWidgetOption",
">",
"getTokenizedWidgetConfiguration",
"(",
")",
"{",
"List",
"<",
"CmsSelectWidgetOption",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"CmsSelectWidgetOption",
">",
"(",
")",
";",
"result",
".",
"add",
"(",
"ne... | Returns a list for the indexed select box.<p>
@return a list for the indexed select box | [
"Returns",
"a",
"list",
"for",
"the",
"indexed",
"select",
"box",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/searchindex/CmsEditFieldDialog.java#L180-L187 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java | ComputerVisionImpl.analyzeImageByDomainInStream | public DomainModelResults analyzeImageByDomainInStream(String model, byte[] image, AnalyzeImageByDomainInStreamOptionalParameter analyzeImageByDomainInStreamOptionalParameter) {
"""
This operation recognizes content within an image by applying a domain-specific model. The list of domain-specific models that are s... | java | public DomainModelResults analyzeImageByDomainInStream(String model, byte[] image, AnalyzeImageByDomainInStreamOptionalParameter analyzeImageByDomainInStreamOptionalParameter) {
return analyzeImageByDomainInStreamWithServiceResponseAsync(model, image, analyzeImageByDomainInStreamOptionalParameter).toBlocking().... | [
"public",
"DomainModelResults",
"analyzeImageByDomainInStream",
"(",
"String",
"model",
",",
"byte",
"[",
"]",
"image",
",",
"AnalyzeImageByDomainInStreamOptionalParameter",
"analyzeImageByDomainInStreamOptionalParameter",
")",
"{",
"return",
"analyzeImageByDomainInStreamWithServic... | This operation recognizes content within an image by applying a domain-specific model. The list of domain-specific models that are supported by the Computer Vision API can be retrieved using the /models GET request. Currently, the API only provides a single domain-specific model: celebrities. Two input methods are su... | [
"This",
"operation",
"recognizes",
"content",
"within",
"an",
"image",
"by",
"applying",
"a",
"domain",
"-",
"specific",
"model",
".",
"The",
"list",
"of",
"domain",
"-",
"specific",
"models",
"that",
"are",
"supported",
"by",
"the",
"Computer",
"Vision",
"A... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java#L257-L259 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java | IOGroovyMethods.withPrintWriter | public static <T> T withPrintWriter(OutputStream stream, @ClosureParams(value=SimpleType.class, options="java.io.PrintWriter") Closure<T> closure) throws IOException {
"""
Create a new PrintWriter for this OutputStream. The writer is passed to the
closure, and will be closed before this method returns.
@param... | java | public static <T> T withPrintWriter(OutputStream stream, @ClosureParams(value=SimpleType.class, options="java.io.PrintWriter") Closure<T> closure) throws IOException {
return withWriter(newPrintWriter(stream), closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"withPrintWriter",
"(",
"OutputStream",
"stream",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.io.PrintWriter\"",
")",
"Closure",
"<",
"T",
">",
"closure",
")",... | Create a new PrintWriter for this OutputStream. The writer is passed to the
closure, and will be closed before this method returns.
@param stream an OutputStream
@param closure the closure to invoke with the PrintWriter
@return the value returned by the closure
@throws IOException if an IOException occurs.
@since 2.... | [
"Create",
"a",
"new",
"PrintWriter",
"for",
"this",
"OutputStream",
".",
"The",
"writer",
"is",
"passed",
"to",
"the",
"closure",
"and",
"will",
"be",
"closed",
"before",
"this",
"method",
"returns",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java#L1117-L1119 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/dbinfo/DatabaseInformationMain.java | DatabaseInformationMain.allTables | protected final Iterator allTables() {
"""
Retrieves an enumeration over all of the tables in this database.
This means all user tables, views, system tables, system views,
including temporary and text tables. <p>
@return an enumeration over all of the tables in this database
"""
return new Wrapp... | java | protected final Iterator allTables() {
return new WrapperIterator(
database.schemaManager.databaseObjectIterator(SchemaObject.TABLE),
new WrapperIterator(sysTables, true));
} | [
"protected",
"final",
"Iterator",
"allTables",
"(",
")",
"{",
"return",
"new",
"WrapperIterator",
"(",
"database",
".",
"schemaManager",
".",
"databaseObjectIterator",
"(",
"SchemaObject",
".",
"TABLE",
")",
",",
"new",
"WrapperIterator",
"(",
"sysTables",
",",
... | Retrieves an enumeration over all of the tables in this database.
This means all user tables, views, system tables, system views,
including temporary and text tables. <p>
@return an enumeration over all of the tables in this database | [
"Retrieves",
"an",
"enumeration",
"over",
"all",
"of",
"the",
"tables",
"in",
"this",
"database",
".",
"This",
"means",
"all",
"user",
"tables",
"views",
"system",
"tables",
"system",
"views",
"including",
"temporary",
"and",
"text",
"tables",
".",
"<p",
">"... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/dbinfo/DatabaseInformationMain.java#L268-L273 |
NextFaze/power-adapters | power-adapters/src/main/java/com/nextfaze/poweradapters/PowerAdapter.java | PowerAdapter.compose | @CheckResult
@NonNull
public final PowerAdapter compose(@NonNull Transformer transformer) {
"""
Applies the specified {@link Transformer} to this adapter, and returns the result.
"""
return checkNotNull(transformer, "transformer").transform(this);
} | java | @CheckResult
@NonNull
public final PowerAdapter compose(@NonNull Transformer transformer) {
return checkNotNull(transformer, "transformer").transform(this);
} | [
"@",
"CheckResult",
"@",
"NonNull",
"public",
"final",
"PowerAdapter",
"compose",
"(",
"@",
"NonNull",
"Transformer",
"transformer",
")",
"{",
"return",
"checkNotNull",
"(",
"transformer",
",",
"\"transformer\"",
")",
".",
"transform",
"(",
"this",
")",
";",
"... | Applies the specified {@link Transformer} to this adapter, and returns the result. | [
"Applies",
"the",
"specified",
"{"
] | train | https://github.com/NextFaze/power-adapters/blob/cdf00b1b723ed9d6bcd549ae9741a19dd59651e1/power-adapters/src/main/java/com/nextfaze/poweradapters/PowerAdapter.java#L369-L373 |
krummas/DrizzleJDBC | src/main/java/org/drizzle/jdbc/DrizzleBlob.java | DrizzleBlob.getBinaryStream | public InputStream getBinaryStream(final long pos, final long length) throws SQLException {
"""
Returns an <code>InputStream</code> object that contains a partial <code>Blob</code> value, starting with the
byte specified by pos, which is length bytes in length.
@param pos the offset to the first byte of th... | java | public InputStream getBinaryStream(final long pos, final long length) throws SQLException {
if (pos < 1 || pos > actualSize || pos + length > actualSize) {
throw SQLExceptionMapper.getSQLException("Out of range");
}
return new ByteArrayInputStream(Utils.copyRange(blobContent,
... | [
"public",
"InputStream",
"getBinaryStream",
"(",
"final",
"long",
"pos",
",",
"final",
"long",
"length",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"pos",
"<",
"1",
"||",
"pos",
">",
"actualSize",
"||",
"pos",
"+",
"length",
">",
"actualSize",
")",
"... | Returns an <code>InputStream</code> object that contains a partial <code>Blob</code> value, starting with the
byte specified by pos, which is length bytes in length.
@param pos the offset to the first byte of the partial value to be retrieved. The first byte in the
<code>Blob</code> is at position 1
@param length ... | [
"Returns",
"an",
"<code",
">",
"InputStream<",
"/",
"code",
">",
"object",
"that",
"contains",
"a",
"partial",
"<code",
">",
"Blob<",
"/",
"code",
">",
"value",
"starting",
"with",
"the",
"byte",
"specified",
"by",
"pos",
"which",
"is",
"length",
"bytes",
... | train | https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzleBlob.java#L341-L349 |
craftercms/commons | utilities/src/main/java/org/craftercms/commons/zip/ZipUtils.java | ZipUtils.zipFiles | public static void zipFiles(List<File> files, OutputStream outputStream) throws IOException {
"""
Zips a collection of files to a destination zip output stream.
@param files A collection of files and directories
@param outputStream The output stream of the destination zip file
@throws FileNotFoundExcep... | java | public static void zipFiles(List<File> files, OutputStream outputStream) throws IOException {
ZipOutputStream zos = new ZipOutputStream(outputStream);
for (File file : files) {
if (file.isDirectory()) { //if it's a folder
addFolderToZip("", file, zos);
} else {... | [
"public",
"static",
"void",
"zipFiles",
"(",
"List",
"<",
"File",
">",
"files",
",",
"OutputStream",
"outputStream",
")",
"throws",
"IOException",
"{",
"ZipOutputStream",
"zos",
"=",
"new",
"ZipOutputStream",
"(",
"outputStream",
")",
";",
"for",
"(",
"File",
... | Zips a collection of files to a destination zip output stream.
@param files A collection of files and directories
@param outputStream The output stream of the destination zip file
@throws FileNotFoundException
@throws IOException | [
"Zips",
"a",
"collection",
"of",
"files",
"to",
"a",
"destination",
"zip",
"output",
"stream",
"."
] | train | https://github.com/craftercms/commons/blob/3074fe49e56c2a4aae0832f40b17ae563335dc83/utilities/src/main/java/org/craftercms/commons/zip/ZipUtils.java#L53-L65 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java | FSDataset.removeVolumes | public void removeVolumes(Configuration conf, List<File> directories)
throws Exception {
"""
remove directories that are given from the list of volumes to use.
This function also makes sure to remove all the blocks that belong to
these volumes.
"""
if (directories == null || directories.isEmpty())... | java | public void removeVolumes(Configuration conf, List<File> directories)
throws Exception {
if (directories == null || directories.isEmpty()) {
DataNode.LOG.warn("There were no directories to remove. Exiting ");
return;
}
List<FSVolume> volArray = null;
lock.readLock().lock();
try {
... | [
"public",
"void",
"removeVolumes",
"(",
"Configuration",
"conf",
",",
"List",
"<",
"File",
">",
"directories",
")",
"throws",
"Exception",
"{",
"if",
"(",
"directories",
"==",
"null",
"||",
"directories",
".",
"isEmpty",
"(",
")",
")",
"{",
"DataNode",
"."... | remove directories that are given from the list of volumes to use.
This function also makes sure to remove all the blocks that belong to
these volumes. | [
"remove",
"directories",
"that",
"are",
"given",
"from",
"the",
"list",
"of",
"volumes",
"to",
"use",
".",
"This",
"function",
"also",
"makes",
"sure",
"to",
"remove",
"all",
"the",
"blocks",
"that",
"belong",
"to",
"these",
"volumes",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java#L2873-L2902 |
protostuff/protostuff | protostuff-json/src/main/java/io/protostuff/JsonIOUtil.java | JsonIOUtil.mergeFrom | public static <T> void mergeFrom(JsonParser parser, T message, Schema<T> schema,
boolean numeric) throws IOException {
"""
Merges the {@code message} from the JsonParser using the given {@code schema}.
"""
if (parser.nextToken() != JsonToken.START_OBJECT)
{
throw new... | java | public static <T> void mergeFrom(JsonParser parser, T message, Schema<T> schema,
boolean numeric) throws IOException
{
if (parser.nextToken() != JsonToken.START_OBJECT)
{
throw new JsonInputException("Expected token: { but was " +
parser.getCurrentTo... | [
"public",
"static",
"<",
"T",
">",
"void",
"mergeFrom",
"(",
"JsonParser",
"parser",
",",
"T",
"message",
",",
"Schema",
"<",
"T",
">",
"schema",
",",
"boolean",
"numeric",
")",
"throws",
"IOException",
"{",
"if",
"(",
"parser",
".",
"nextToken",
"(",
... | Merges the {@code message} from the JsonParser using the given {@code schema}. | [
"Merges",
"the",
"{"
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-json/src/main/java/io/protostuff/JsonIOUtil.java#L327-L345 |
lotaris/rox-commons-maven-plugin | src/main/java/com/lotaris/maven/plugin/AbstractGenericMojo.java | AbstractGenericMojo.useCleanPlugin | protected void useCleanPlugin(Element ... elements) throws MojoExecutionException {
"""
Utility method to use the clean plugin in the cleanup methods
@param elements Elements to configure the clean plugin
@throws MojoExecutionException Throws when error occurred in the clean plugin
"""
List<Element> temp... | java | protected void useCleanPlugin(Element ... elements) throws MojoExecutionException {
List<Element> tempElems = new ArrayList<>(Arrays.asList(elements));
tempElems.add(new Element("excludeDefaultDirectories", "true"));
// Configure the Maven Clean Plugin to clean working files
executeMojo(
plugin(
group... | [
"protected",
"void",
"useCleanPlugin",
"(",
"Element",
"...",
"elements",
")",
"throws",
"MojoExecutionException",
"{",
"List",
"<",
"Element",
">",
"tempElems",
"=",
"new",
"ArrayList",
"<>",
"(",
"Arrays",
".",
"asList",
"(",
"elements",
")",
")",
";",
"te... | Utility method to use the clean plugin in the cleanup methods
@param elements Elements to configure the clean plugin
@throws MojoExecutionException Throws when error occurred in the clean plugin | [
"Utility",
"method",
"to",
"use",
"the",
"clean",
"plugin",
"in",
"the",
"cleanup",
"methods"
] | train | https://github.com/lotaris/rox-commons-maven-plugin/blob/e2602d7f1e8c2e6994c0df07cc0003828adfa2af/src/main/java/com/lotaris/maven/plugin/AbstractGenericMojo.java#L122-L143 |
JavaMoney/jsr354-ri-bp | src/main/java/org/javamoney/moneta/internal/ConfigurableCurrencyUnitProvider.java | ConfigurableCurrencyUnitProvider.registerCurrencyUnit | public static CurrencyUnit registerCurrencyUnit(CurrencyUnit currencyUnit, Locale locale) {
"""
Registers a bew currency unit under the given Locale.
@param currencyUnit the new currency to be registered, not null.
@param locale the Locale, not null.
@return any unit instance registered previously by th... | java | public static CurrencyUnit registerCurrencyUnit(CurrencyUnit currencyUnit, Locale locale) {
Objects.requireNonNull(locale);
Objects.requireNonNull(currencyUnit);
return ConfigurableCurrencyUnitProvider.currencyUnitsByLocale.put(locale, currencyUnit);
} | [
"public",
"static",
"CurrencyUnit",
"registerCurrencyUnit",
"(",
"CurrencyUnit",
"currencyUnit",
",",
"Locale",
"locale",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"locale",
")",
";",
"Objects",
".",
"requireNonNull",
"(",
"currencyUnit",
")",
";",
"return"... | Registers a bew currency unit under the given Locale.
@param currencyUnit the new currency to be registered, not null.
@param locale the Locale, not null.
@return any unit instance registered previously by this instance, or null. | [
"Registers",
"a",
"bew",
"currency",
"unit",
"under",
"the",
"given",
"Locale",
"."
] | train | https://github.com/JavaMoney/jsr354-ri-bp/blob/9c147ef5623d8032a6dc4c0e5eefdfb41641a9a2/src/main/java/org/javamoney/moneta/internal/ConfigurableCurrencyUnitProvider.java#L90-L94 |
nulab/backlog4j | src/main/java/com/nulabinc/backlog4j/internal/http/MimeHelper.java | MimeHelper.decodeContentDisposition | public static String decodeContentDisposition(String value, Map<String, String> params) {
"""
Decodes the Content-Disposition header value according to RFC 2183 and
RFC 2231.
<p/>
Does not deal with continuation lines.
<p/>
See <a href="http://tools.ietf.org/html/rfc2231">RFC 2231</a> for
details.
@param ... | java | public static String decodeContentDisposition(String value, Map<String, String> params) {
try {
HeaderTokenizer tokenizer = new HeaderTokenizer(value);
// get the first token, which must be an ATOM
Token token = tokenizer.next();
if (token.getType() != Token.ATOM)... | [
"public",
"static",
"String",
"decodeContentDisposition",
"(",
"String",
"value",
",",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"{",
"try",
"{",
"HeaderTokenizer",
"tokenizer",
"=",
"new",
"HeaderTokenizer",
"(",
"value",
")",
";",
"// get the ... | Decodes the Content-Disposition header value according to RFC 2183 and
RFC 2231.
<p/>
Does not deal with continuation lines.
<p/>
See <a href="http://tools.ietf.org/html/rfc2231">RFC 2231</a> for
details.
@param value the header value to decode
@param params the map of parameters to fill
@return the disposition | [
"Decodes",
"the",
"Content",
"-",
"Disposition",
"header",
"value",
"according",
"to",
"RFC",
"2183",
"and",
"RFC",
"2231",
".",
"<p",
"/",
">",
"Does",
"not",
"deal",
"with",
"continuation",
"lines",
".",
"<p",
"/",
">",
"See",
"<a",
"href",
"=",
"htt... | train | https://github.com/nulab/backlog4j/blob/862ae0586ad808b2ec413f665b8dfc0c9a107b4e/src/main/java/com/nulabinc/backlog4j/internal/http/MimeHelper.java#L61-L81 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/analyzer/PythonDistributionAnalyzer.java | PythonDistributionAnalyzer.getNextTempDirectory | private File getNextTempDirectory() throws AnalysisException {
"""
Retrieves the next temporary destination directory for extracting an
archive.
@return a directory
@throws AnalysisException thrown if unable to create temporary directory
"""
File directory;
// getting an exception for som... | java | private File getNextTempDirectory() throws AnalysisException {
File directory;
// getting an exception for some directories not being able to be
// created; might be because the directory already exists?
do {
final int dirCount = DIR_COUNT.incrementAndGet();
dire... | [
"private",
"File",
"getNextTempDirectory",
"(",
")",
"throws",
"AnalysisException",
"{",
"File",
"directory",
";",
"// getting an exception for some directories not being able to be",
"// created; might be because the directory already exists?",
"do",
"{",
"final",
"int",
"dirCount... | Retrieves the next temporary destination directory for extracting an
archive.
@return a directory
@throws AnalysisException thrown if unable to create temporary directory | [
"Retrieves",
"the",
"next",
"temporary",
"destination",
"directory",
"for",
"extracting",
"an",
"archive",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/PythonDistributionAnalyzer.java#L392-L407 |
Azure/azure-sdk-for-java | datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java | ServicesInner.checkChildrenNameAvailabilityAsync | public Observable<NameAvailabilityResponseInner> checkChildrenNameAvailabilityAsync(String groupName, String serviceName, NameAvailabilityRequest parameters) {
"""
Check nested resource name validity and availability.
This method checks whether a proposed nested resource name is valid and available.
@param gro... | java | public Observable<NameAvailabilityResponseInner> checkChildrenNameAvailabilityAsync(String groupName, String serviceName, NameAvailabilityRequest parameters) {
return checkChildrenNameAvailabilityWithServiceResponseAsync(groupName, serviceName, parameters).map(new Func1<ServiceResponse<NameAvailabilityResponseI... | [
"public",
"Observable",
"<",
"NameAvailabilityResponseInner",
">",
"checkChildrenNameAvailabilityAsync",
"(",
"String",
"groupName",
",",
"String",
"serviceName",
",",
"NameAvailabilityRequest",
"parameters",
")",
"{",
"return",
"checkChildrenNameAvailabilityWithServiceResponseAs... | Check nested resource name validity and availability.
This method checks whether a proposed nested resource name is valid and available.
@param groupName Name of the resource group
@param serviceName Name of the service
@param parameters Requested name to validate
@throws IllegalArgumentException thrown if parameters ... | [
"Check",
"nested",
"resource",
"name",
"validity",
"and",
"availability",
".",
"This",
"method",
"checks",
"whether",
"a",
"proposed",
"nested",
"resource",
"name",
"is",
"valid",
"and",
"available",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java#L1512-L1519 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.