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 |
|---|---|---|---|---|---|---|---|---|---|---|
nulab/backlog4j | src/main/java/com/nulabinc/backlog4j/BacklogEndPointSupport.java | BacklogEndPointSupport.getPullRequestAttachmentEndpoint | public String getPullRequestAttachmentEndpoint(Object projectIdOrKey, Object repoIdOrName, Object number, Object attachmentId) {
"""
Returns the endpoint of attachment file.
@param projectIdOrKey the project identifier
@param repoIdOrName the repository name
@param number the pull request identifier
@param a... | java | public String getPullRequestAttachmentEndpoint(Object projectIdOrKey, Object repoIdOrName, Object number, Object attachmentId) {
return buildEndpoint("projects/" + projectIdOrKey +
"/git/repositories/" + repoIdOrName +
"/pullRequests/" + number +
"/attachments/" +... | [
"public",
"String",
"getPullRequestAttachmentEndpoint",
"(",
"Object",
"projectIdOrKey",
",",
"Object",
"repoIdOrName",
",",
"Object",
"number",
",",
"Object",
"attachmentId",
")",
"{",
"return",
"buildEndpoint",
"(",
"\"projects/\"",
"+",
"projectIdOrKey",
"+",
"\"/g... | Returns the endpoint of attachment file.
@param projectIdOrKey the project identifier
@param repoIdOrName the repository name
@param number the pull request identifier
@param attachmentId the pull request attachment identifier
@return the endpoint | [
"Returns",
"the",
"endpoint",
"of",
"attachment",
"file",
"."
] | train | https://github.com/nulab/backlog4j/blob/862ae0586ad808b2ec413f665b8dfc0c9a107b4e/src/main/java/com/nulabinc/backlog4j/BacklogEndPointSupport.java#L95-L100 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newNoAvailablePortException | public static NoAvailablePortException newNoAvailablePortException(Throwable cause, String message, Object... args) {
"""
Constructs and initializes a new {@link NoAvailablePortException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@par... | java | public static NoAvailablePortException newNoAvailablePortException(Throwable cause, String message, Object... args) {
return new NoAvailablePortException(format(message, args), cause);
} | [
"public",
"static",
"NoAvailablePortException",
"newNoAvailablePortException",
"(",
"Throwable",
"cause",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"NoAvailablePortException",
"(",
"format",
"(",
"message",
",",
"args",
")",
... | Constructs and initializes a new {@link NoAvailablePortException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Throwable} identified as the reason this {@link NoAvailablePortException} was thrown.
@param message {@link String... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"NoAvailablePortException",
"}",
"with",
"the",
"given",
"{",
"@link",
"Throwable",
"cause",
"}",
"and",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L569-L571 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Searches.java | Searches.findFirst | public static <E> E findFirst(Iterable<E> iterable, Predicate<E> predicate) {
"""
Searches the first matching element returning it.
@param <E> the element type parameter
@param iterable the iterable to be searched
@param predicate the predicate to be applied to each element
@throws IllegalArgumentException i... | java | public static <E> E findFirst(Iterable<E> iterable, Predicate<E> predicate) {
dbc.precondition(iterable != null, "cannot findFirst with a null iterable");
final Iterator<E> filtered = new FilteringIterator<E>(iterable.iterator(), predicate);
return new FirstElement<E>().apply(filtered);
} | [
"public",
"static",
"<",
"E",
">",
"E",
"findFirst",
"(",
"Iterable",
"<",
"E",
">",
"iterable",
",",
"Predicate",
"<",
"E",
">",
"predicate",
")",
"{",
"dbc",
".",
"precondition",
"(",
"iterable",
"!=",
"null",
",",
"\"cannot findFirst with a null iterable\... | Searches the first matching element returning it.
@param <E> the element type parameter
@param iterable the iterable to be searched
@param predicate the predicate to be applied to each element
@throws IllegalArgumentException if no element matches
@return the found element | [
"Searches",
"the",
"first",
"matching",
"element",
"returning",
"it",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Searches.java#L434-L438 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/matrix/TransformStatistics.java | TransformStatistics.extractStatistics | public static MatrixStatistics extractStatistics(
File inputMatrixFile, Format format) {
"""
Extracts the full row, column, and matrix summations based on entries in
the given {@link Matrix} file.
@param inputMatrixFfile a {@link Matrix} file to sum over
@param format the matrix {@link Format} of... | java | public static MatrixStatistics extractStatistics(
File inputMatrixFile, Format format) {
return extractStatistics(inputMatrixFile, format, false, false);
} | [
"public",
"static",
"MatrixStatistics",
"extractStatistics",
"(",
"File",
"inputMatrixFile",
",",
"Format",
"format",
")",
"{",
"return",
"extractStatistics",
"(",
"inputMatrixFile",
",",
"format",
",",
"false",
",",
"false",
")",
";",
"}"
] | Extracts the full row, column, and matrix summations based on entries in
the given {@link Matrix} file.
@param inputMatrixFfile a {@link Matrix} file to sum over
@param format the matrix {@link Format} of {@code inputMatrixFile}
@return a {@link MatrixStatistics} instance containing the summations | [
"Extracts",
"the",
"full",
"row",
"column",
"and",
"matrix",
"summations",
"based",
"on",
"entries",
"in",
"the",
"given",
"{",
"@link",
"Matrix",
"}",
"file",
"."
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/matrix/TransformStatistics.java#L124-L127 |
jmeetsma/Iglu-Util | src/main/java/org/ijsberg/iglu/util/misc/StringSupport.java | StringSupport.containsCharacters | public static boolean containsCharacters(String in, String chars) {
"""
tells whether one or more characters in a String are part of a given String
@param in String to evaluate
@param chars characters which are to be tested in the given String
"""
for (int i = 0; i < chars.length(); i++) {
if (in.inde... | java | public static boolean containsCharacters(String in, String chars) {
for (int i = 0; i < chars.length(); i++) {
if (in.indexOf(chars.charAt(i)) != -1) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"containsCharacters",
"(",
"String",
"in",
",",
"String",
"chars",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"chars",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"in",
".",
"indexO... | tells whether one or more characters in a String are part of a given String
@param in String to evaluate
@param chars characters which are to be tested in the given String | [
"tells",
"whether",
"one",
"or",
"more",
"characters",
"in",
"a",
"String",
"are",
"part",
"of",
"a",
"given",
"String"
] | train | https://github.com/jmeetsma/Iglu-Util/blob/971eb022115247b1e34dc26dd02e7e621e29e910/src/main/java/org/ijsberg/iglu/util/misc/StringSupport.java#L415-L422 |
hawtio/hawtio | hawtio-system/src/main/java/io/hawt/web/auth/keycloak/KeycloakUserServlet.java | KeycloakUserServlet.getKeycloakUsername | protected String getKeycloakUsername(final HttpServletRequest req, HttpServletResponse resp) {
"""
With Keycloak integration, the Authorization header is available in the request to the UserServlet.
"""
AtomicReference<String> username = new AtomicReference<>();
Authenticator.authenticate(
... | java | protected String getKeycloakUsername(final HttpServletRequest req, HttpServletResponse resp) {
AtomicReference<String> username = new AtomicReference<>();
Authenticator.authenticate(
authConfiguration, req,
subject -> {
username.set(AuthHelpers.getUsername(subject... | [
"protected",
"String",
"getKeycloakUsername",
"(",
"final",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"resp",
")",
"{",
"AtomicReference",
"<",
"String",
">",
"username",
"=",
"new",
"AtomicReference",
"<>",
"(",
")",
";",
"Authenticator",
".",
"aut... | With Keycloak integration, the Authorization header is available in the request to the UserServlet. | [
"With",
"Keycloak",
"integration",
"the",
"Authorization",
"header",
"is",
"available",
"in",
"the",
"request",
"to",
"the",
"UserServlet",
"."
] | train | https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-system/src/main/java/io/hawt/web/auth/keycloak/KeycloakUserServlet.java#L39-L51 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/SeaGlassSynthPainterImpl.java | SeaGlassSynthPainterImpl.paintSplitPaneDragDivider | public void paintSplitPaneDragDivider(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation) {
"""
Paints the divider, when the user is dragging the divider, of a split
pane.
@param context SynthContext identifying the <code>JComponent</code>
and <code>Region</code> to paint to
@p... | java | public void paintSplitPaneDragDivider(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation) {
paintBackground(context, g, x, y, w, h, null);
} | [
"public",
"void",
"paintSplitPaneDragDivider",
"(",
"SynthContext",
"context",
",",
"Graphics",
"g",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"w",
",",
"int",
"h",
",",
"int",
"orientation",
")",
"{",
"paintBackground",
"(",
"context",
",",
"g",
","... | Paints the divider, when the user is dragging the divider, of a split
pane.
@param context SynthContext identifying the <code>JComponent</code>
and <code>Region</code> to paint to
@param g <code>Graphics</code> to paint to
@param x X coordinate of the area to paint to
@param y Y coord... | [
"Paints",
"the",
"divider",
"when",
"the",
"user",
"is",
"dragging",
"the",
"divider",
"of",
"a",
"split",
"pane",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/SeaGlassSynthPainterImpl.java#L1881-L1883 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.updatePrebuiltEntityRole | public OperationStatus updatePrebuiltEntityRole(UUID appId, String versionId, UUID entityId, UUID roleId, UpdatePrebuiltEntityRoleOptionalParameter updatePrebuiltEntityRoleOptionalParameter) {
"""
Update an entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@para... | java | public OperationStatus updatePrebuiltEntityRole(UUID appId, String versionId, UUID entityId, UUID roleId, UpdatePrebuiltEntityRoleOptionalParameter updatePrebuiltEntityRoleOptionalParameter) {
return updatePrebuiltEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId, updatePrebuiltEntityRoleOpt... | [
"public",
"OperationStatus",
"updatePrebuiltEntityRole",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"UUID",
"roleId",
",",
"UpdatePrebuiltEntityRoleOptionalParameter",
"updatePrebuiltEntityRoleOptionalParameter",
")",
"{",
"return",
"upd... | Update an entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity ID.
@param roleId The entity role ID.
@param updatePrebuiltEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API
@throws Illegal... | [
"Update",
"an",
"entity",
"role",
"for",
"a",
"given",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L11245-L11247 |
alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/ClientBlobStore.java | ClientBlobStore.createBlob | public final AtomicOutputStream createBlob(String key, SettableBlobMeta meta) throws KeyAlreadyExistsException {
"""
Client facing API to create a blob.
@param key blob key name.
@param meta contains ACL information.
@return AtomicOutputStream returns an output stream into which data can be written.
@throws Au... | java | public final AtomicOutputStream createBlob(String key, SettableBlobMeta meta) throws KeyAlreadyExistsException {
return createBlobToExtend(key, meta);
} | [
"public",
"final",
"AtomicOutputStream",
"createBlob",
"(",
"String",
"key",
",",
"SettableBlobMeta",
"meta",
")",
"throws",
"KeyAlreadyExistsException",
"{",
"return",
"createBlobToExtend",
"(",
"key",
",",
"meta",
")",
";",
"}"
] | Client facing API to create a blob.
@param key blob key name.
@param meta contains ACL information.
@return AtomicOutputStream returns an output stream into which data can be written.
@throws AuthorizationException
@throws KeyAlreadyExistsException | [
"Client",
"facing",
"API",
"to",
"create",
"a",
"blob",
"."
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/ClientBlobStore.java#L157-L159 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/platform/developer/DeveloperAdminUserAuthTicketUrl.java | DeveloperAdminUserAuthTicketUrl.createDeveloperUserAuthTicketUrl | public static MozuUrl createDeveloperUserAuthTicketUrl(Integer developerAccountId, String responseFields) {
"""
Get Resource Url for CreateDeveloperUserAuthTicket
@param developerAccountId Unique identifier of the developer account.
@param responseFields Filtering syntax appended to an API call to increase or de... | java | public static MozuUrl createDeveloperUserAuthTicketUrl(Integer developerAccountId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/developer/authtickets/?developerAccountId={developerAccountId}&responseFields={responseFields}");
formatter.formatUrl("developerAccountId", develop... | [
"public",
"static",
"MozuUrl",
"createDeveloperUserAuthTicketUrl",
"(",
"Integer",
"developerAccountId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/platform/developer/authtickets/?developerAccountId={developerA... | Get Resource Url for CreateDeveloperUserAuthTicket
@param developerAccountId Unique identifier of the developer account.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attemptin... | [
"Get",
"Resource",
"Url",
"for",
"CreateDeveloperUserAuthTicket"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/platform/developer/DeveloperAdminUserAuthTicketUrl.java#L22-L28 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/util/ClickCallback.java | ClickCallback.showError | protected void showError (Throwable cause, Widget near) {
"""
Displays a popup reporting the specified error, near the specified widget if it is non-null.
"""
if (near == null) {
Popups.error(formatError(cause));
} else {
Popups.errorBelow(formatError(cause), near);
... | java | protected void showError (Throwable cause, Widget near)
{
if (near == null) {
Popups.error(formatError(cause));
} else {
Popups.errorBelow(formatError(cause), near);
}
} | [
"protected",
"void",
"showError",
"(",
"Throwable",
"cause",
",",
"Widget",
"near",
")",
"{",
"if",
"(",
"near",
"==",
"null",
")",
"{",
"Popups",
".",
"error",
"(",
"formatError",
"(",
"cause",
")",
")",
";",
"}",
"else",
"{",
"Popups",
".",
"errorB... | Displays a popup reporting the specified error, near the specified widget if it is non-null. | [
"Displays",
"a",
"popup",
"reporting",
"the",
"specified",
"error",
"near",
"the",
"specified",
"widget",
"if",
"it",
"is",
"non",
"-",
"null",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/ClickCallback.java#L149-L156 |
arquillian/arquillian-algeron | common/git/src/main/java/org/arquillian/algeron/git/GitOperations.java | GitOperations.checkoutTag | public Ref checkoutTag(Git git, String tag) {
"""
Checkout existing tag.
@param git
instance.
@param tag
to move
@return Ref to current branch
"""
try {
return git.checkout()
.setName("tags/" + tag).call();
} catch (GitAPIException e) {
throw new... | java | public Ref checkoutTag(Git git, String tag) {
try {
return git.checkout()
.setName("tags/" + tag).call();
} catch (GitAPIException e) {
throw new IllegalStateException(e);
}
} | [
"public",
"Ref",
"checkoutTag",
"(",
"Git",
"git",
",",
"String",
"tag",
")",
"{",
"try",
"{",
"return",
"git",
".",
"checkout",
"(",
")",
".",
"setName",
"(",
"\"tags/\"",
"+",
"tag",
")",
".",
"call",
"(",
")",
";",
"}",
"catch",
"(",
"GitAPIExce... | Checkout existing tag.
@param git
instance.
@param tag
to move
@return Ref to current branch | [
"Checkout",
"existing",
"tag",
"."
] | train | https://github.com/arquillian/arquillian-algeron/blob/ec79372defdafe99ab2f7bb696f1c1eabdbbacb6/common/git/src/main/java/org/arquillian/algeron/git/GitOperations.java#L78-L85 |
jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/SelectBuilder.java | SelectBuilder.orderBy | public SelectBuilder orderBy(String name, boolean ascending) {
"""
Adds an ORDER BY item with a direction indicator.
@param name
Name of the column by which to sort.
@param ascending
If true, specifies the direction "asc", otherwise, specifies
the direction "desc".
"""
if (ascending) {
... | java | public SelectBuilder orderBy(String name, boolean ascending) {
if (ascending) {
orderBys.add(name + " asc");
} else {
orderBys.add(name + " desc");
}
return this;
} | [
"public",
"SelectBuilder",
"orderBy",
"(",
"String",
"name",
",",
"boolean",
"ascending",
")",
"{",
"if",
"(",
"ascending",
")",
"{",
"orderBys",
".",
"add",
"(",
"name",
"+",
"\" asc\"",
")",
";",
"}",
"else",
"{",
"orderBys",
".",
"add",
"(",
"name",... | Adds an ORDER BY item with a direction indicator.
@param name
Name of the column by which to sort.
@param ascending
If true, specifies the direction "asc", otherwise, specifies
the direction "desc". | [
"Adds",
"an",
"ORDER",
"BY",
"item",
"with",
"a",
"direction",
"indicator",
"."
] | train | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/SelectBuilder.java#L248-L255 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/ObjectField.java | ObjectField.setupDefaultView | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties) {
"""
Set up the default screen control for this field.
You should override this method depending of the concrete display type.
@param itsLocation... | java | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties)
{
return null;
} | [
"public",
"ScreenComponent",
"setupDefaultView",
"(",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"Convert",
"converter",
",",
"int",
"iDisplayFieldDesc",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"return",
... | Set up the default screen control for this field.
You should override this method depending of the concrete display type.
@param itsLocation Location of this component on screen (ie., GridBagConstraint).
@param targetScreen Where to place this component (ie., Parent screen or GridBagLayout).
@param converter The conver... | [
"Set",
"up",
"the",
"default",
"screen",
"control",
"for",
"this",
"field",
".",
"You",
"should",
"override",
"this",
"method",
"depending",
"of",
"the",
"concrete",
"display",
"type",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/ObjectField.java#L105-L108 |
wcm-io-caravan/caravan-hal | resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java | HalResource.addEmbedded | public HalResource addEmbedded(String relation, Iterable<HalResource> resources) {
"""
Embed resources for the given relation
@param relation Embedded resource relation
@param resources Resources to embed
@return HAL resource
"""
return addEmbedded(relation, Iterables.toArray(resources, HalResource.clas... | java | public HalResource addEmbedded(String relation, Iterable<HalResource> resources) {
return addEmbedded(relation, Iterables.toArray(resources, HalResource.class));
} | [
"public",
"HalResource",
"addEmbedded",
"(",
"String",
"relation",
",",
"Iterable",
"<",
"HalResource",
">",
"resources",
")",
"{",
"return",
"addEmbedded",
"(",
"relation",
",",
"Iterables",
".",
"toArray",
"(",
"resources",
",",
"HalResource",
".",
"class",
... | Embed resources for the given relation
@param relation Embedded resource relation
@param resources Resources to embed
@return HAL resource | [
"Embed",
"resources",
"for",
"the",
"given",
"relation"
] | train | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java#L362-L364 |
sailthru/sailthru-java-client | src/main/com/sailthru/client/AbstractSailthruClient.java | AbstractSailthruClient.apiPost | public JsonResponse apiPost(ApiAction action, Map<String, Object> data) throws IOException {
"""
HTTP POST Request with Map
@param action
@param data
@throws IOException
"""
return httpRequestJson(action, HttpRequestMethod.POST, data);
} | java | public JsonResponse apiPost(ApiAction action, Map<String, Object> data) throws IOException {
return httpRequestJson(action, HttpRequestMethod.POST, data);
} | [
"public",
"JsonResponse",
"apiPost",
"(",
"ApiAction",
"action",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
")",
"throws",
"IOException",
"{",
"return",
"httpRequestJson",
"(",
"action",
",",
"HttpRequestMethod",
".",
"POST",
",",
"data",
")",
";... | HTTP POST Request with Map
@param action
@param data
@throws IOException | [
"HTTP",
"POST",
"Request",
"with",
"Map"
] | train | https://github.com/sailthru/sailthru-java-client/blob/62b491f6a39b41b836bfc021779200d29b6d2069/src/main/com/sailthru/client/AbstractSailthruClient.java#L271-L273 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/enhance/impl/ImplEnhanceHistogram.java | ImplEnhanceHistogram.localHistogram | public static void localHistogram( GrayU16 input , int x0 , int y0 , int x1, int y1 , int histogram[] ) {
"""
Computes the local histogram just for the specified inner region
"""
for( int i = 0; i < histogram.length; i++ )
histogram[i] = 0;
for( int i = y0; i < y1; i++ ) {
int index = input.startInd... | java | public static void localHistogram( GrayU16 input , int x0 , int y0 , int x1, int y1 , int histogram[] ) {
for( int i = 0; i < histogram.length; i++ )
histogram[i] = 0;
for( int i = y0; i < y1; i++ ) {
int index = input.startIndex + i*input.stride + x0;
int end = index + x1-x0;
for( ; index < end; index... | [
"public",
"static",
"void",
"localHistogram",
"(",
"GrayU16",
"input",
",",
"int",
"x0",
",",
"int",
"y0",
",",
"int",
"x1",
",",
"int",
"y1",
",",
"int",
"histogram",
"[",
"]",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"histogra... | Computes the local histogram just for the specified inner region | [
"Computes",
"the",
"local",
"histogram",
"just",
"for",
"the",
"specified",
"inner",
"region"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/enhance/impl/ImplEnhanceHistogram.java#L718-L729 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/client/gui/component/container/UIPlayerInventory.java | UIPlayerInventory.addSlot | @Override
protected void addSlot(MalisisSlot slot, int number) {
"""
Creates and adds <code>UISlot</code> into this <code>UIPlayerInventory</code>.
@param slot the slot
@param number the number
"""
UISlot uislot = new UISlot(slot);
if (number < 9)
uislot.setPosition(Position.of(number * 18, 69));
... | java | @Override
protected void addSlot(MalisisSlot slot, int number)
{
UISlot uislot = new UISlot(slot);
if (number < 9)
uislot.setPosition(Position.of(number * 18, 69));
else if (number < 36)
{
int row = (number - 9) / 9;
int col = number % 9;
uislot.setPosition(Position.of(col * 18, 11 + row * 18));
... | [
"@",
"Override",
"protected",
"void",
"addSlot",
"(",
"MalisisSlot",
"slot",
",",
"int",
"number",
")",
"{",
"UISlot",
"uislot",
"=",
"new",
"UISlot",
"(",
"slot",
")",
";",
"if",
"(",
"number",
"<",
"9",
")",
"uislot",
".",
"setPosition",
"(",
"Positi... | Creates and adds <code>UISlot</code> into this <code>UIPlayerInventory</code>.
@param slot the slot
@param number the number | [
"Creates",
"and",
"adds",
"<code",
">",
"UISlot<",
"/",
"code",
">",
"into",
"this",
"<code",
">",
"UIPlayerInventory<",
"/",
"code",
">",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/client/gui/component/container/UIPlayerInventory.java#L61-L77 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsDynamicFunctionParser.java | CmsDynamicFunctionParser.parseFunctionBean | public CmsDynamicFunctionBean parseFunctionBean(CmsObject cms, CmsXmlContent content) throws CmsException {
"""
Parses a dynamic function bean from an in-memory XML content object.<p>
@param cms the current CMS context
@param content the XML content from which to read the dynamic function bean
@return the d... | java | public CmsDynamicFunctionBean parseFunctionBean(CmsObject cms, CmsXmlContent content) throws CmsException {
Locale locale = getLocaleToUse(cms, content);
String oldSiteRoot = cms.getRequestContext().getSiteRoot();
try {
cms.getRequestContext().setSiteRoot("");
CmsR... | [
"public",
"CmsDynamicFunctionBean",
"parseFunctionBean",
"(",
"CmsObject",
"cms",
",",
"CmsXmlContent",
"content",
")",
"throws",
"CmsException",
"{",
"Locale",
"locale",
"=",
"getLocaleToUse",
"(",
"cms",
",",
"content",
")",
";",
"String",
"oldSiteRoot",
"=",
"c... | Parses a dynamic function bean from an in-memory XML content object.<p>
@param cms the current CMS context
@param content the XML content from which to read the dynamic function bean
@return the dynamic function bean read from the XML content
@throws CmsException if something goes wrong | [
"Parses",
"a",
"dynamic",
"function",
"bean",
"from",
"an",
"in",
"-",
"memory",
"XML",
"content",
"object",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsDynamicFunctionParser.java#L89-L102 |
52inc/android-52Kit | library/src/main/java/com/ftinc/kit/widget/EmptyView.java | EmptyView.parseAttributes | private void parseAttributes(Context context, AttributeSet attrs, int defStyle) {
"""
Parse XML attributes
@param attrs the attributes to parse
"""
int defaultColor = context.getResources().getColor(R.color.black26);
final TypedArray a = context.obtainStyledAttributes(attrs,
... | java | private void parseAttributes(Context context, AttributeSet attrs, int defStyle){
int defaultColor = context.getResources().getColor(R.color.black26);
final TypedArray a = context.obtainStyledAttributes(attrs,
R.styleable.EmptyView, defStyle, 0);
if (a == null) {
mEmpt... | [
"private",
"void",
"parseAttributes",
"(",
"Context",
"context",
",",
"AttributeSet",
"attrs",
",",
"int",
"defStyle",
")",
"{",
"int",
"defaultColor",
"=",
"context",
".",
"getResources",
"(",
")",
".",
"getColor",
"(",
"R",
".",
"color",
".",
"black26",
... | Parse XML attributes
@param attrs the attributes to parse | [
"Parse",
"XML",
"attributes"
] | train | https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library/src/main/java/com/ftinc/kit/widget/EmptyView.java#L173-L208 |
icode/ameba | src/main/java/ameba/mvc/template/internal/AbstractTemplateProcessor.java | AbstractTemplateProcessor.getNearTemplateURL | protected URL getNearTemplateURL(String jarFile, String template) {
"""
<p>getNearTemplateURL.</p>
@param jarFile a {@link java.lang.String} object.
@param template a {@link java.lang.String} object.
@return a {@link java.net.URL} object.
"""
if (jarFile != null) {
Enumeration<URL> url... | java | protected URL getNearTemplateURL(String jarFile, String template) {
if (jarFile != null) {
Enumeration<URL> urls = IOUtils.getResources(template);
while (urls.hasMoreElements()) {
URL url = urls.nextElement();
if (url.getPath().startsWith(jarFile)) {
... | [
"protected",
"URL",
"getNearTemplateURL",
"(",
"String",
"jarFile",
",",
"String",
"template",
")",
"{",
"if",
"(",
"jarFile",
"!=",
"null",
")",
"{",
"Enumeration",
"<",
"URL",
">",
"urls",
"=",
"IOUtils",
".",
"getResources",
"(",
"template",
")",
";",
... | <p>getNearTemplateURL.</p>
@param jarFile a {@link java.lang.String} object.
@param template a {@link java.lang.String} object.
@return a {@link java.net.URL} object. | [
"<p",
">",
"getNearTemplateURL",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/mvc/template/internal/AbstractTemplateProcessor.java#L225-L236 |
Azure/azure-sdk-for-java | signalr/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/signalr/v2018_03_01_preview/implementation/SignalRsInner.java | SignalRsInner.beginRegenerateKeyAsync | public Observable<SignalRKeysInner> beginRegenerateKeyAsync(String resourceGroupName, String resourceName) {
"""
Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time.
@param resourceGroupName The name of the resource group that contains the resource. You can ... | java | public Observable<SignalRKeysInner> beginRegenerateKeyAsync(String resourceGroupName, String resourceName) {
return beginRegenerateKeyWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<SignalRKeysInner>, SignalRKeysInner>() {
@Override
public SignalRK... | [
"public",
"Observable",
"<",
"SignalRKeysInner",
">",
"beginRegenerateKeyAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"beginRegenerateKeyWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
")",
".",
"... | Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time.
@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 resourceName The name of the SignalR resourc... | [
"Regenerate",
"SignalR",
"service",
"access",
"key",
".",
"PrimaryKey",
"and",
"SecondaryKey",
"cannot",
"be",
"regenerated",
"at",
"the",
"same",
"time",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/signalr/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/signalr/v2018_03_01_preview/implementation/SignalRsInner.java#L764-L771 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java | DateUtil.formatBetween | public static String formatBetween(Date beginDate, Date endDate, BetweenFormater.Level level) {
"""
格式化日期间隔输出
@param beginDate 起始日期
@param endDate 结束日期
@param level 级别,按照天、小时、分、秒、毫秒分为5个等级
@return XX天XX小时XX分XX秒
"""
return formatBetween(between(beginDate, endDate, DateUnit.MS), level);
} | java | public static String formatBetween(Date beginDate, Date endDate, BetweenFormater.Level level) {
return formatBetween(between(beginDate, endDate, DateUnit.MS), level);
} | [
"public",
"static",
"String",
"formatBetween",
"(",
"Date",
"beginDate",
",",
"Date",
"endDate",
",",
"BetweenFormater",
".",
"Level",
"level",
")",
"{",
"return",
"formatBetween",
"(",
"between",
"(",
"beginDate",
",",
"endDate",
",",
"DateUnit",
".",
"MS",
... | 格式化日期间隔输出
@param beginDate 起始日期
@param endDate 结束日期
@param level 级别,按照天、小时、分、秒、毫秒分为5个等级
@return XX天XX小时XX分XX秒 | [
"格式化日期间隔输出"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java#L1318-L1320 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.createCompositeEntityRoleAsync | public Observable<UUID> createCompositeEntityRoleAsync(UUID appId, String versionId, UUID cEntityId, CreateCompositeEntityRoleOptionalParameter createCompositeEntityRoleOptionalParameter) {
"""
Create an entity role for an entity in the application.
@param appId The application ID.
@param versionId The version... | java | public Observable<UUID> createCompositeEntityRoleAsync(UUID appId, String versionId, UUID cEntityId, CreateCompositeEntityRoleOptionalParameter createCompositeEntityRoleOptionalParameter) {
return createCompositeEntityRoleWithServiceResponseAsync(appId, versionId, cEntityId, createCompositeEntityRoleOptionalPar... | [
"public",
"Observable",
"<",
"UUID",
">",
"createCompositeEntityRoleAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"cEntityId",
",",
"CreateCompositeEntityRoleOptionalParameter",
"createCompositeEntityRoleOptionalParameter",
")",
"{",
"return",
"crea... | Create an entity role for an entity in the application.
@param appId The application ID.
@param versionId The version ID.
@param cEntityId The composite entity extractor ID.
@param createCompositeEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API
@throws Illeg... | [
"Create",
"an",
"entity",
"role",
"for",
"an",
"entity",
"in",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L8901-L8908 |
wcm-io-caravan/caravan-hal | resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java | HalResource.addLinks | public HalResource addLinks(String relation, Iterable<Link> links) {
"""
Adds links for the given relation
@param relation Link relation
@param links Links to add
@return HAL resource
"""
return addLinks(relation, Iterables.toArray(links, Link.class));
} | java | public HalResource addLinks(String relation, Iterable<Link> links) {
return addLinks(relation, Iterables.toArray(links, Link.class));
} | [
"public",
"HalResource",
"addLinks",
"(",
"String",
"relation",
",",
"Iterable",
"<",
"Link",
">",
"links",
")",
"{",
"return",
"addLinks",
"(",
"relation",
",",
"Iterables",
".",
"toArray",
"(",
"links",
",",
"Link",
".",
"class",
")",
")",
";",
"}"
] | Adds links for the given relation
@param relation Link relation
@param links Links to add
@return HAL resource | [
"Adds",
"links",
"for",
"the",
"given",
"relation"
] | train | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java#L327-L329 |
sdl/odata | odata_client/src/main/java/com/sdl/odata/client/URLConnectionRequestPropertiesBuilder.java | URLConnectionRequestPropertiesBuilder.withCookie | public URLConnectionRequestPropertiesBuilder withCookie(String cookieName, String cookieValue) {
"""
Add provided cookie to 'Cookie' request property.
@param cookieName The cookie name
@param cookieValue The ccokie value
@return this
"""
if (requestProperties.containsKey("Cookie")) {
// ... | java | public URLConnectionRequestPropertiesBuilder withCookie(String cookieName, String cookieValue) {
if (requestProperties.containsKey("Cookie")) {
// there are existing cookies so just append the new cookie at the end
final String cookies = requestProperties.get("Cookie");
reque... | [
"public",
"URLConnectionRequestPropertiesBuilder",
"withCookie",
"(",
"String",
"cookieName",
",",
"String",
"cookieValue",
")",
"{",
"if",
"(",
"requestProperties",
".",
"containsKey",
"(",
"\"Cookie\"",
")",
")",
"{",
"// there are existing cookies so just append the new ... | Add provided cookie to 'Cookie' request property.
@param cookieName The cookie name
@param cookieValue The ccokie value
@return this | [
"Add",
"provided",
"cookie",
"to",
"Cookie",
"request",
"property",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_client/src/main/java/com/sdl/odata/client/URLConnectionRequestPropertiesBuilder.java#L36-L46 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/TrueTypeFontUnicode.java | TrueTypeFontUnicode.getToUnicode | private PdfStream getToUnicode(Object metrics[]) {
"""
Creates a ToUnicode CMap to allow copy and paste from Acrobat.
@param metrics metrics[0] contains the glyph index and metrics[2]
contains the Unicode code
@return the stream representing this CMap or <CODE>null</CODE>
"""
metrics = filterCmapMetric... | java | private PdfStream getToUnicode(Object metrics[]) {
metrics = filterCmapMetrics(metrics);
if (metrics.length == 0)
return null;
StringBuffer buf = new StringBuffer(
"/CIDInit /ProcSet findresource begin\n" +
"12 dict begin\n" +
"begincmap\n" +
"/CIDSystemI... | [
"private",
"PdfStream",
"getToUnicode",
"(",
"Object",
"metrics",
"[",
"]",
")",
"{",
"metrics",
"=",
"filterCmapMetrics",
"(",
"metrics",
")",
";",
"if",
"(",
"metrics",
".",
"length",
"==",
"0",
")",
"return",
"null",
";",
"StringBuffer",
"buf",
"=",
"... | Creates a ToUnicode CMap to allow copy and paste from Acrobat.
@param metrics metrics[0] contains the glyph index and metrics[2]
contains the Unicode code
@return the stream representing this CMap or <CODE>null</CODE> | [
"Creates",
"a",
"ToUnicode",
"CMap",
"to",
"allow",
"copy",
"and",
"paste",
"from",
"Acrobat",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/TrueTypeFontUnicode.java#L209-L250 |
google/closure-compiler | src/com/google/javascript/rhino/jstype/UnionTypeBuilder.java | UnionTypeBuilder.build | public JSType build() {
"""
Creates a union.
@return A UnionType if it has two or more alternates, the
only alternate if it has one and otherwise {@code NO_TYPE}.
"""
if (result == null) {
result = reduceAlternatesWithoutUnion();
if (result == null) {
result = new UnionType(registry, ... | java | public JSType build() {
if (result == null) {
result = reduceAlternatesWithoutUnion();
if (result == null) {
result = new UnionType(registry, ImmutableList.copyOf(getAlternates()));
}
}
return result;
} | [
"public",
"JSType",
"build",
"(",
")",
"{",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"result",
"=",
"reduceAlternatesWithoutUnion",
"(",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"result",
"=",
"new",
"UnionType",
"(",
"registry",
",",... | Creates a union.
@return A UnionType if it has two or more alternates, the
only alternate if it has one and otherwise {@code NO_TYPE}. | [
"Creates",
"a",
"union",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/UnionTypeBuilder.java#L387-L395 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.getAdvertisedRoutes | public GatewayRouteListResultInner getAdvertisedRoutes(String resourceGroupName, String virtualNetworkGatewayName, String peer) {
"""
This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer.
@param resourceGroupName The name of the resource group.
@param virtu... | java | public GatewayRouteListResultInner getAdvertisedRoutes(String resourceGroupName, String virtualNetworkGatewayName, String peer) {
return getAdvertisedRoutesWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer).toBlocking().last().body();
} | [
"public",
"GatewayRouteListResultInner",
"getAdvertisedRoutes",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
",",
"String",
"peer",
")",
"{",
"return",
"getAdvertisedRoutesWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualNetwo... | This operation retrieves a list of routes the virtual network gateway is advertising to the specified peer.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@param peer The IP address of the peer
@throws IllegalArgumentException thrown i... | [
"This",
"operation",
"retrieves",
"a",
"list",
"of",
"routes",
"the",
"virtual",
"network",
"gateway",
"is",
"advertising",
"to",
"the",
"specified",
"peer",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L2493-L2495 |
eclipse/hawkbit | hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java | SPUIComponentProvider.getDistributionSetInfo | public static Panel getDistributionSetInfo(final DistributionSet distributionSet, final String caption,
final String style1, final String style2) {
"""
Get DistributionSet Info Panel.
@param distributionSet
as DistributionSet
@param caption
as string
@param style1
as string
@param style2
as s... | java | public static Panel getDistributionSetInfo(final DistributionSet distributionSet, final String caption,
final String style1, final String style2) {
return new DistributionSetInfoPanel(distributionSet, caption, style1, style2);
} | [
"public",
"static",
"Panel",
"getDistributionSetInfo",
"(",
"final",
"DistributionSet",
"distributionSet",
",",
"final",
"String",
"caption",
",",
"final",
"String",
"style1",
",",
"final",
"String",
"style2",
")",
"{",
"return",
"new",
"DistributionSetInfoPanel",
"... | Get DistributionSet Info Panel.
@param distributionSet
as DistributionSet
@param caption
as string
@param style1
as string
@param style2
as string
@return Panel | [
"Get",
"DistributionSet",
"Info",
"Panel",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java#L186-L189 |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/features/custom/NumberFeaturesTile.java | NumberFeaturesTile.drawTile | private BufferedImage drawTile(int tileWidth, int tileHeight, String text) {
"""
Draw a tile with the provided text label in the middle
@param tileWidth
@param tileHeight
@param text
@return
"""
// Create the image and graphics
BufferedImage image = new BufferedImage(tileWidth, tileHeight,
Buffe... | java | private BufferedImage drawTile(int tileWidth, int tileHeight, String text) {
// Create the image and graphics
BufferedImage image = new BufferedImage(tileWidth, tileHeight,
BufferedImage.TYPE_INT_ARGB);
Graphics2D graphics = image.createGraphics();
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,... | [
"private",
"BufferedImage",
"drawTile",
"(",
"int",
"tileWidth",
",",
"int",
"tileHeight",
",",
"String",
"text",
")",
"{",
"// Create the image and graphics",
"BufferedImage",
"image",
"=",
"new",
"BufferedImage",
"(",
"tileWidth",
",",
"tileHeight",
",",
"Buffered... | Draw a tile with the provided text label in the middle
@param tileWidth
@param tileHeight
@param text
@return | [
"Draw",
"a",
"tile",
"with",
"the",
"provided",
"text",
"label",
"in",
"the",
"middle"
] | train | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/custom/NumberFeaturesTile.java#L394-L461 |
apptik/jus | jus-java/src/main/java/io/apptik/comm/jus/toolbox/HttpHeaderParser.java | HttpHeaderParser.parseCharset | public static String parseCharset(Map<String, String> headers, String defaultCharset) {
"""
Retrieve a charset from headers
@param headers An {@link java.util.Map} of headers
@param defaultCharset Charset to return if none can be found
@return Returns the charset specified in the Content-Type of this h... | java | public static String parseCharset(Map<String, String> headers, String defaultCharset) {
String contentType = headers.get(HTTP.CONTENT_TYPE);
if (contentType != null) {
String[] params = contentType.split(";");
for (int i = 1; i < params.length; i++) {
String[] pai... | [
"public",
"static",
"String",
"parseCharset",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
",",
"String",
"defaultCharset",
")",
"{",
"String",
"contentType",
"=",
"headers",
".",
"get",
"(",
"HTTP",
".",
"CONTENT_TYPE",
")",
";",
"if",
"(",
... | Retrieve a charset from headers
@param headers An {@link java.util.Map} of headers
@param defaultCharset Charset to return if none can be found
@return Returns the charset specified in the Content-Type of this header,
or the defaultCharset if none can be found. | [
"Retrieve",
"a",
"charset",
"from",
"headers"
] | train | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/jus-java/src/main/java/io/apptik/comm/jus/toolbox/HttpHeaderParser.java#L152-L167 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCapturesInner.java | PacketCapturesInner.createAsync | public Observable<PacketCaptureResultInner> createAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) {
"""
Create and start a packet capture on the specified VM.
@param resourceGroupName The name of the resource group.
@param networkWatcherName T... | java | public Observable<PacketCaptureResultInner> createAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) {
return createWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).map(new Func1<ServiceResponse<Packet... | [
"public",
"Observable",
"<",
"PacketCaptureResultInner",
">",
"createAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"String",
"packetCaptureName",
",",
"PacketCaptureInner",
"parameters",
")",
"{",
"return",
"createWithServiceResponseA... | Create and start a packet capture on the specified VM.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param packetCaptureName The name of the packet capture session.
@param parameters Parameters that define the create packet capture operation.
@thro... | [
"Create",
"and",
"start",
"a",
"packet",
"capture",
"on",
"the",
"specified",
"VM",
"."
] | 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/PacketCapturesInner.java#L147-L154 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/cache/JMapperCache.java | JMapperCache.getMapper | public static <D,S> IJMapper<D, S> getMapper(final Class<D> destination,final Class<S> source,final JMapperAPI api) {
"""
Returns an instance of JMapper from cache if exists, in alternative a new instance.
<br>Taking configuration by API.
@param destination the Destination Class
@param source the Source Class... | java | public static <D,S> IJMapper<D, S> getMapper(final Class<D> destination,final Class<S> source,final JMapperAPI api) {
return getMapper(destination,source,api.toXStream().toString());
} | [
"public",
"static",
"<",
"D",
",",
"S",
">",
"IJMapper",
"<",
"D",
",",
"S",
">",
"getMapper",
"(",
"final",
"Class",
"<",
"D",
">",
"destination",
",",
"final",
"Class",
"<",
"S",
">",
"source",
",",
"final",
"JMapperAPI",
"api",
")",
"{",
"return... | Returns an instance of JMapper from cache if exists, in alternative a new instance.
<br>Taking configuration by API.
@param destination the Destination Class
@param source the Source Class
@param api JMapperAPI configuration
@param <D> Destination class
@param <S> Source Class
@return the mapper instance | [
"Returns",
"an",
"instance",
"of",
"JMapper",
"from",
"cache",
"if",
"exists",
"in",
"alternative",
"a",
"new",
"instance",
".",
"<br",
">",
"Taking",
"configuration",
"by",
"API",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/cache/JMapperCache.java#L88-L90 |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java | ClientFactory.createMessageReceiverFromConnectionString | public static IMessageReceiver createMessageReceiverFromConnectionString(String amqpConnectionString, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException {
"""
Create {@link IMessageReceiver} in default {@link ReceiveMode#PEEKLOCK} mode from service bus connection string with <a href="https:/... | java | public static IMessageReceiver createMessageReceiverFromConnectionString(String amqpConnectionString, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException {
return Utils.completeFuture(createMessageReceiverFromConnectionStringAsync(amqpConnectionString, receiveMode));
} | [
"public",
"static",
"IMessageReceiver",
"createMessageReceiverFromConnectionString",
"(",
"String",
"amqpConnectionString",
",",
"ReceiveMode",
"receiveMode",
")",
"throws",
"InterruptedException",
",",
"ServiceBusException",
"{",
"return",
"Utils",
".",
"completeFuture",
"("... | Create {@link IMessageReceiver} in default {@link ReceiveMode#PEEKLOCK} mode from service bus connection string with <a href="https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-sas">Shared Access Signatures</a>
@param amqpConnectionString the connection string
@param receiveMode {@link R... | [
"Create",
"{",
"@link",
"IMessageReceiver",
"}",
"in",
"default",
"{",
"@link",
"ReceiveMode#PEEKLOCK",
"}",
"mode",
"from",
"service",
"bus",
"connection",
"string",
"with",
"<a",
"href",
"=",
"https",
":",
"//",
"docs",
".",
"microsoft",
".",
"com",
"/",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java#L237-L239 |
VoltDB/voltdb | src/frontend/org/voltdb/NonVoltDBBackend.java | NonVoltDBBackend.handleParens | protected String handleParens(String group, String prefix, String suffix, boolean debugPrint) {
"""
This base version simply returns a String consisting of the <i>prefix</i>,
<i>group</i>, and <i>suffix</i> concatenated (in that order); however,
it may be overridden to do something more complicated, to make sure... | java | protected String handleParens(String group, String prefix, String suffix, boolean debugPrint) {
return prefix + group + suffix;
} | [
"protected",
"String",
"handleParens",
"(",
"String",
"group",
",",
"String",
"prefix",
",",
"String",
"suffix",
",",
"boolean",
"debugPrint",
")",
"{",
"return",
"prefix",
"+",
"group",
"+",
"suffix",
";",
"}"
] | This base version simply returns a String consisting of the <i>prefix</i>,
<i>group</i>, and <i>suffix</i> concatenated (in that order); however,
it may be overridden to do something more complicated, to make sure that
the prefix and suffix go in the right place, relative to any parentheses
found in the group. | [
"This",
"base",
"version",
"simply",
"returns",
"a",
"String",
"consisting",
"of",
"the",
"<i",
">",
"prefix<",
"/",
"i",
">",
"<i",
">",
"group<",
"/",
"i",
">",
"and",
"<i",
">",
"suffix<",
"/",
"i",
">",
"concatenated",
"(",
"in",
"that",
"order",... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/NonVoltDBBackend.java#L704-L706 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/GrassLegacyUtilities.java | GrassLegacyUtilities.rowColToCenterCoordinates | public static Coordinate rowColToCenterCoordinates( Window active, int row, int col ) {
"""
<p>
Transforms row and column index of the active region into the regarding northing and easting
coordinates. The center of the cell is taken.
</p>
<p>
NOTE: basically the inverse of
{@link GrassLegacyUtilities#coordi... | java | public static Coordinate rowColToCenterCoordinates( Window active, int row, int col ) {
double north = active.getNorth();
double west = active.getWest();
double nsres = active.getNSResolution();
double ewres = active.getWEResolution();
double northing = north - row * nsres - ns... | [
"public",
"static",
"Coordinate",
"rowColToCenterCoordinates",
"(",
"Window",
"active",
",",
"int",
"row",
",",
"int",
"col",
")",
"{",
"double",
"north",
"=",
"active",
".",
"getNorth",
"(",
")",
";",
"double",
"west",
"=",
"active",
".",
"getWest",
"(",
... | <p>
Transforms row and column index of the active region into the regarding northing and easting
coordinates. The center of the cell is taken.
</p>
<p>
NOTE: basically the inverse of
{@link GrassLegacyUtilities#coordinateToNearestRowCol(Window, Coordinate)}
</p>
@param active - the active region (can be null)
@param r... | [
"<p",
">",
"Transforms",
"row",
"and",
"column",
"index",
"of",
"the",
"active",
"region",
"into",
"the",
"regarding",
"northing",
"and",
"easting",
"coordinates",
".",
"The",
"center",
"of",
"the",
"cell",
"is",
"taken",
".",
"<",
"/",
"p",
">",
"<p",
... | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/GrassLegacyUtilities.java#L507-L518 |
GoogleCloudPlatform/bigdata-interop | bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/output/BigQueryOutputConfiguration.java | BigQueryOutputConfiguration.setFileOutputFormatOutputPath | @VisibleForTesting
static void setFileOutputFormatOutputPath(Configuration conf, String outputPath)
throws IOException {
"""
Sets the output path for FileOutputFormat.
@param conf the configuration to pass to FileOutputFormat.
@param outputPath the path to set as the output path.
@throws IOException
... | java | @VisibleForTesting
static void setFileOutputFormatOutputPath(Configuration conf, String outputPath)
throws IOException {
Job tempJob = new JobConfigurationAdapter(conf);
FileOutputFormat.setOutputPath(tempJob, new Path(outputPath));
} | [
"@",
"VisibleForTesting",
"static",
"void",
"setFileOutputFormatOutputPath",
"(",
"Configuration",
"conf",
",",
"String",
"outputPath",
")",
"throws",
"IOException",
"{",
"Job",
"tempJob",
"=",
"new",
"JobConfigurationAdapter",
"(",
"conf",
")",
";",
"FileOutputFormat... | Sets the output path for FileOutputFormat.
@param conf the configuration to pass to FileOutputFormat.
@param outputPath the path to set as the output path.
@throws IOException | [
"Sets",
"the",
"output",
"path",
"for",
"FileOutputFormat",
"."
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/bigquery/src/main/java/com/google/cloud/hadoop/io/bigquery/output/BigQueryOutputConfiguration.java#L423-L428 |
reactor/reactor-netty | src/main/java/reactor/netty/tcp/TcpServer.java | TcpServer.doOnUnbound | public final TcpServer doOnUnbound(Consumer<? super DisposableServer> doOnUnbind) {
"""
Setups a callback called when {@link io.netty.channel.ServerChannel} is
unbound.
@param doOnUnbind a consumer observing server stop event
@return a new {@link TcpServer}
"""
Objects.requireNonNull(doOnUnbind, "doOn... | java | public final TcpServer doOnUnbound(Consumer<? super DisposableServer> doOnUnbind) {
Objects.requireNonNull(doOnUnbind, "doOnUnbound");
return new TcpServerDoOn(this, null, null, doOnUnbind);
} | [
"public",
"final",
"TcpServer",
"doOnUnbound",
"(",
"Consumer",
"<",
"?",
"super",
"DisposableServer",
">",
"doOnUnbind",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"doOnUnbind",
",",
"\"doOnUnbound\"",
")",
";",
"return",
"new",
"TcpServerDoOn",
"(",
"thi... | Setups a callback called when {@link io.netty.channel.ServerChannel} is
unbound.
@param doOnUnbind a consumer observing server stop event
@return a new {@link TcpServer} | [
"Setups",
"a",
"callback",
"called",
"when",
"{",
"@link",
"io",
".",
"netty",
".",
"channel",
".",
"ServerChannel",
"}",
"is",
"unbound",
"."
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/tcp/TcpServer.java#L284-L287 |
ecclesia/kipeto | kipeto/src/main/java/de/ecclesia/kipeto/RepositoryResolver.java | RepositoryResolver.resolveReposUrl | public String resolveReposUrl() throws IOException {
"""
Versucht, im übergebenen Repository die Konfigurations-Datei zu finden
und daraus ein passendes Repository abzuleiten. Schlägt dies fehlt oder
tritt ein Fehler auf, wird dieser Fehler gelogt, und das übergebene
Repository zurückgegeben.
@return
@throw... | java | public String resolveReposUrl() throws IOException {
// Zur Zeit nur für HTTP implementiert.
try {
URL url;
// TODO: Schön machen
try {
url = new URL(defaultRepositoryUrl);
} catch (MalformedURLException e) {
url = new File(defaultRepositoryUrl).toURI().toURL();
}
if (!url.getProtocol().e... | [
"public",
"String",
"resolveReposUrl",
"(",
")",
"throws",
"IOException",
"{",
"// Zur Zeit nur für HTTP implementiert.",
"try",
"{",
"URL",
"url",
";",
"// TODO: Schön machen",
"try",
"{",
"url",
"=",
"new",
"URL",
"(",
"defaultRepositoryUrl",
")",
";",
"}",
"cat... | Versucht, im übergebenen Repository die Konfigurations-Datei zu finden
und daraus ein passendes Repository abzuleiten. Schlägt dies fehlt oder
tritt ein Fehler auf, wird dieser Fehler gelogt, und das übergebene
Repository zurückgegeben.
@return
@throws IOException | [
"Versucht",
"im",
"übergebenen",
"Repository",
"die",
"Konfigurations",
"-",
"Datei",
"zu",
"finden",
"und",
"daraus",
"ein",
"passendes",
"Repository",
"abzuleiten",
".",
"Schlägt",
"dies",
"fehlt",
"oder",
"tritt",
"ein",
"Fehler",
"auf",
"wird",
"dieser",
"Fe... | train | https://github.com/ecclesia/kipeto/blob/ea39a10ae4eaa550f71a856ab2f2845270a64913/kipeto/src/main/java/de/ecclesia/kipeto/RepositoryResolver.java#L69-L99 |
jbundle/jbundle | base/screen/view/data/src/main/java/org/jbundle/base/screen/view/data/DJnlpAccessScreen.java | DJnlpAccessScreen.sendData | public void sendData(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
"""
Process an HTML get or post.
@param req The servlet request.
@param res The servlet response object.
@exception ServletException From inherited class.
@exception IOException From inherited ... | java | public void sendData(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
// res.setContentType("application/x-java-jnlp-file");
//x PrintWriter out = new PrintWriter(res.getOutputStream());
// PrintWriter out = res.getWriter();
// this.printX... | [
"public",
"void",
"sendData",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"// res.setContentType(\"application/x-java-jnlp-file\");",
"//x PrintWriter out = new PrintWriter(res.getOutpu... | Process an HTML get or post.
@param req The servlet request.
@param res The servlet response object.
@exception ServletException From inherited class.
@exception IOException From inherited class. | [
"Process",
"an",
"HTML",
"get",
"or",
"post",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/data/src/main/java/org/jbundle/base/screen/view/data/DJnlpAccessScreen.java#L77-L100 |
steveash/jopenfst | src/main/java/com/github/steveash/jopenfst/MutableFst.java | MutableFst.addArc | public MutableArc addArc(String startStateSymbol, String inSymbol, String outSymbol, String endStateSymbol, double weight) {
"""
Adds a new arc in the FST between startStateSymbol and endStateSymbol with inSymbol and outSymbol
and edge weight; if the state symbols or in/out symbols dont exist then they will be ad... | java | public MutableArc addArc(String startStateSymbol, String inSymbol, String outSymbol, String endStateSymbol, double weight) {
Preconditions.checkNotNull(stateSymbols, "cant use this without state symbols; call useStateSymbols()");
return addArc(
getOrNewState(startStateSymbol),
inSymbol,
... | [
"public",
"MutableArc",
"addArc",
"(",
"String",
"startStateSymbol",
",",
"String",
"inSymbol",
",",
"String",
"outSymbol",
",",
"String",
"endStateSymbol",
",",
"double",
"weight",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"stateSymbols",
",",
"\"cant ... | Adds a new arc in the FST between startStateSymbol and endStateSymbol with inSymbol and outSymbol
and edge weight; if the state symbols or in/out symbols dont exist then they will be added
@param startStateSymbol
@param inSymbol
@param outSymbol
@param endStateSymbol
@param weight
@return | [
"Adds",
"a",
"new",
"arc",
"in",
"the",
"FST",
"between",
"startStateSymbol",
"and",
"endStateSymbol",
"with",
"inSymbol",
"and",
"outSymbol",
"and",
"edge",
"weight",
";",
"if",
"the",
"state",
"symbols",
"or",
"in",
"/",
"out",
"symbols",
"dont",
"exist",
... | train | https://github.com/steveash/jopenfst/blob/4c675203015c1cfad2072556cb532b6edc73261d/src/main/java/com/github/steveash/jopenfst/MutableFst.java#L368-L377 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwsignatures.java | appfwsignatures.get | public static appfwsignatures get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch appfwsignatures resource of given name .
"""
appfwsignatures obj = new appfwsignatures();
obj.set_name(name);
appfwsignatures response = (appfwsignatures) obj.get_resource(service);
return... | java | public static appfwsignatures get(nitro_service service, String name) throws Exception{
appfwsignatures obj = new appfwsignatures();
obj.set_name(name);
appfwsignatures response = (appfwsignatures) obj.get_resource(service);
return response;
} | [
"public",
"static",
"appfwsignatures",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"appfwsignatures",
"obj",
"=",
"new",
"appfwsignatures",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"app... | Use this API to fetch appfwsignatures resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"appfwsignatures",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwsignatures.java#L330-L335 |
apache/groovy | src/main/java/org/codehaus/groovy/syntax/Types.java | Types.lookup | public static int lookup(String text, int filter) {
"""
Returns the type for the specified symbol/keyword text. Returns UNKNOWN
if the text isn't found. You can filter finds on a type.
"""
int type = UNKNOWN;
if (LOOKUP.containsKey(text)) {
type = LOOKUP.get(text);
i... | java | public static int lookup(String text, int filter) {
int type = UNKNOWN;
if (LOOKUP.containsKey(text)) {
type = LOOKUP.get(text);
if (filter != UNKNOWN && !ofType(type, filter)) {
type = UNKNOWN;
}
}
return type;
} | [
"public",
"static",
"int",
"lookup",
"(",
"String",
"text",
",",
"int",
"filter",
")",
"{",
"int",
"type",
"=",
"UNKNOWN",
";",
"if",
"(",
"LOOKUP",
".",
"containsKey",
"(",
"text",
")",
")",
"{",
"type",
"=",
"LOOKUP",
".",
"get",
"(",
"text",
")"... | Returns the type for the specified symbol/keyword text. Returns UNKNOWN
if the text isn't found. You can filter finds on a type. | [
"Returns",
"the",
"type",
"for",
"the",
"specified",
"symbol",
"/",
"keyword",
"text",
".",
"Returns",
"UNKNOWN",
"if",
"the",
"text",
"isn",
"t",
"found",
".",
"You",
"can",
"filter",
"finds",
"on",
"a",
"type",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/syntax/Types.java#L1052-L1063 |
inkstand-io/scribble | scribble-jcr/src/main/java/io/inkstand/scribble/jcr/JCRAssert.java | JCRAssert.assertMixinNodeType | public static void assertMixinNodeType(final Node node, final String mixinType) throws RepositoryException {
"""
Asserts one of the node's mixin type equals the specified nodetype
@param node
the node whose mixin types should be checked
@param mixinType
the node type that is asserted to be one of the mixin t... | java | public static void assertMixinNodeType(final Node node, final String mixinType) throws RepositoryException {
for (final NodeType nt : node.getMixinNodeTypes()) {
if (mixinType.equals(nt.getName())) {
return;
}
}
fail("Node " + node.getPath() + " has no mix... | [
"public",
"static",
"void",
"assertMixinNodeType",
"(",
"final",
"Node",
"node",
",",
"final",
"String",
"mixinType",
")",
"throws",
"RepositoryException",
"{",
"for",
"(",
"final",
"NodeType",
"nt",
":",
"node",
".",
"getMixinNodeTypes",
"(",
")",
")",
"{",
... | Asserts one of the node's mixin type equals the specified nodetype
@param node
the node whose mixin types should be checked
@param mixinType
the node type that is asserted to be one of the mixin types of the node
@throws RepositoryException | [
"Asserts",
"one",
"of",
"the",
"node",
"s",
"mixin",
"type",
"equals",
"the",
"specified",
"nodetype"
] | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-jcr/src/main/java/io/inkstand/scribble/jcr/JCRAssert.java#L187-L194 |
opengeospatial/teamengine | teamengine-spi-ctl/src/main/java/com/occamlab/te/spi/ctl/CtlExecutor.java | CtlExecutor.getResultsFile | File getResultsFile(String mediaType, String outputDirectory) throws FileNotFoundException {
"""
Returns the test results in the specified format. The default media type
is "application/xml", but "application/rdf+xml" (RDF/XML) is also
supported.
@param mediaType
The media type of the test results (XML or RD... | java | File getResultsFile(String mediaType, String outputDirectory) throws FileNotFoundException {
// split out any media type parameters
String contentType = mediaType.split(";")[0];
String fileName = null;
if(contentType.endsWith("rdf+xml") || contentType.endsWith("rdf+earl")){
fileNa... | [
"File",
"getResultsFile",
"(",
"String",
"mediaType",
",",
"String",
"outputDirectory",
")",
"throws",
"FileNotFoundException",
"{",
"// split out any media type parameters",
"String",
"contentType",
"=",
"mediaType",
".",
"split",
"(",
"\";\"",
")",
"[",
"0",
"]",
... | Returns the test results in the specified format. The default media type
is "application/xml", but "application/rdf+xml" (RDF/XML) is also
supported.
@param mediaType
The media type of the test results (XML or RDF/XML).
@param outputDirectory
The directory containing the test run output.
@return A File containing the ... | [
"Returns",
"the",
"test",
"results",
"in",
"the",
"specified",
"format",
".",
"The",
"default",
"media",
"type",
"is",
"application",
"/",
"xml",
"but",
"application",
"/",
"rdf",
"+",
"xml",
"(",
"RDF",
"/",
"XML",
")",
"is",
"also",
"supported",
"."
] | train | https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-spi-ctl/src/main/java/com/occamlab/te/spi/ctl/CtlExecutor.java#L169-L187 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java | Utils.copyStreamUnsafelyUseWithCaution | public static void copyStreamUnsafelyUseWithCaution( InputStream in, OutputStream os ) throws IOException {
"""
Copies the content from in into os.
<p>
Neither <i>in</i> nor <i>os</i> are closed by this method.<br>
They must be explicitly closed after this method is called.
</p>
<p>
Be careful, this method s... | java | public static void copyStreamUnsafelyUseWithCaution( InputStream in, OutputStream os ) throws IOException {
byte[] buf = new byte[ 1024 ];
int len;
while((len = in.read( buf )) > 0) {
os.write( buf, 0, len );
}
} | [
"public",
"static",
"void",
"copyStreamUnsafelyUseWithCaution",
"(",
"InputStream",
"in",
",",
"OutputStream",
"os",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"buf",
"=",
"new",
"byte",
"[",
"1024",
"]",
";",
"int",
"len",
";",
"while",
"(",
"("... | Copies the content from in into os.
<p>
Neither <i>in</i> nor <i>os</i> are closed by this method.<br>
They must be explicitly closed after this method is called.
</p>
<p>
Be careful, this method should be avoided when possible.
It was responsible for memory leaks. See #489.
</p>
@param in an input stream (not null)
@... | [
"Copies",
"the",
"content",
"from",
"in",
"into",
"os",
".",
"<p",
">",
"Neither",
"<i",
">",
"in<",
"/",
"i",
">",
"nor",
"<i",
">",
"os<",
"/",
"i",
">",
"are",
"closed",
"by",
"this",
"method",
".",
"<br",
">",
"They",
"must",
"be",
"explicitl... | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java#L311-L318 |
glookast/commons-timecode | src/main/java/com/glookast/commons/timecode/AbstractTimecode.java | AbstractTimecode.calculateDuration | public static TimecodeDuration calculateDuration(Timecode inPoint, Timecode outPoint) {
"""
Calculates duration between given inPoint and outPoint.
In case outPoint does not have the same Timecode base and/or dropFrame flag
it will convert it to the same Timecode base and dropFrame flag of the inPoint
@param ... | java | public static TimecodeDuration calculateDuration(Timecode inPoint, Timecode outPoint)
{
if (!inPoint.isCompatible(outPoint)) {
MutableTimecode mutableTimecode = new MutableTimecode(outPoint);
mutableTimecode.setTimecodeBase(inPoint.getTimecodeBase());
mutableTimecode.setD... | [
"public",
"static",
"TimecodeDuration",
"calculateDuration",
"(",
"Timecode",
"inPoint",
",",
"Timecode",
"outPoint",
")",
"{",
"if",
"(",
"!",
"inPoint",
".",
"isCompatible",
"(",
"outPoint",
")",
")",
"{",
"MutableTimecode",
"mutableTimecode",
"=",
"new",
"Mut... | Calculates duration between given inPoint and outPoint.
In case outPoint does not have the same Timecode base and/or dropFrame flag
it will convert it to the same Timecode base and dropFrame flag of the inPoint
@param inPoint
@param outPoint
@return duration | [
"Calculates",
"duration",
"between",
"given",
"inPoint",
"and",
"outPoint",
".",
"In",
"case",
"outPoint",
"does",
"not",
"have",
"the",
"same",
"Timecode",
"base",
"and",
"/",
"or",
"dropFrame",
"flag",
"it",
"will",
"convert",
"it",
"to",
"the",
"same",
... | train | https://github.com/glookast/commons-timecode/blob/ec2f682a51d1cc435d0b42d80de48ff15adb4ee8/src/main/java/com/glookast/commons/timecode/AbstractTimecode.java#L586-L601 |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/FilteredAttributes.java | FilteredAttributes.getType | public String getType(String uri, String localName) {
"""
Get the type of the attribute.
@param uri The attribute uri.
@param localName The attribute local name.
"""
return attributes.getType(getRealIndex(uri, localName));
} | java | public String getType(String uri, String localName) {
return attributes.getType(getRealIndex(uri, localName));
} | [
"public",
"String",
"getType",
"(",
"String",
"uri",
",",
"String",
"localName",
")",
"{",
"return",
"attributes",
".",
"getType",
"(",
"getRealIndex",
"(",
"uri",
",",
"localName",
")",
")",
";",
"}"
] | Get the type of the attribute.
@param uri The attribute uri.
@param localName The attribute local name. | [
"Get",
"the",
"type",
"of",
"the",
"attribute",
"."
] | train | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/FilteredAttributes.java#L158-L160 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FailoverGroupsInner.java | FailoverGroupsInner.beginFailoverAsync | public Observable<FailoverGroupInner> beginFailoverAsync(String resourceGroupName, String serverName, String failoverGroupName) {
"""
Fails over from the current primary server to this server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the ... | java | public Observable<FailoverGroupInner> beginFailoverAsync(String resourceGroupName, String serverName, String failoverGroupName) {
return beginFailoverWithServiceResponseAsync(resourceGroupName, serverName, failoverGroupName).map(new Func1<ServiceResponse<FailoverGroupInner>, FailoverGroupInner>() {
... | [
"public",
"Observable",
"<",
"FailoverGroupInner",
">",
"beginFailoverAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"failoverGroupName",
")",
"{",
"return",
"beginFailoverWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"... | Fails over from the current primary server to this server.
@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 containing the failover group.
@param failoverGroupName Th... | [
"Fails",
"over",
"from",
"the",
"current",
"primary",
"server",
"to",
"this",
"server",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FailoverGroupsInner.java#L993-L1000 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/ConvexHull.java | ConvexHull.lineLineIntersect | public static Point2D lineLineIntersect(final Line2D lineA, final Line2D lineB) {
"""
Calculate the intersection of two lines.
@param lineA a line
@param lineB another line
@return the point where the two lines intersect (or null)
"""
return lineLineIntersect(lineA.getX1(), lineA.getY1(), lineA.ge... | java | public static Point2D lineLineIntersect(final Line2D lineA, final Line2D lineB) {
return lineLineIntersect(lineA.getX1(), lineA.getY1(), lineA.getX2(), lineA.getY2(), lineB.getX1(),
lineB.getY1(), lineB.getX2(), lineB.getY2());
} | [
"public",
"static",
"Point2D",
"lineLineIntersect",
"(",
"final",
"Line2D",
"lineA",
",",
"final",
"Line2D",
"lineB",
")",
"{",
"return",
"lineLineIntersect",
"(",
"lineA",
".",
"getX1",
"(",
")",
",",
"lineA",
".",
"getY1",
"(",
")",
",",
"lineA",
".",
... | Calculate the intersection of two lines.
@param lineA a line
@param lineB another line
@return the point where the two lines intersect (or null) | [
"Calculate",
"the",
"intersection",
"of",
"two",
"lines",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/ConvexHull.java#L236-L240 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/BitsUtil.java | BitsUtil.cycleLeftI | public static long[] cycleLeftI(long[] v, int shift, int len) {
"""
Cycle a bitstring to the right.
@param v Bit string
@param shift Number of steps to cycle
@param len Length
"""
long[] t = copy(v, len, shift);
return orI(shiftRightI(v, len - shift), truncateI(t, len));
} | java | public static long[] cycleLeftI(long[] v, int shift, int len) {
long[] t = copy(v, len, shift);
return orI(shiftRightI(v, len - shift), truncateI(t, len));
} | [
"public",
"static",
"long",
"[",
"]",
"cycleLeftI",
"(",
"long",
"[",
"]",
"v",
",",
"int",
"shift",
",",
"int",
"len",
")",
"{",
"long",
"[",
"]",
"t",
"=",
"copy",
"(",
"v",
",",
"len",
",",
"shift",
")",
";",
"return",
"orI",
"(",
"shiftRigh... | Cycle a bitstring to the right.
@param v Bit string
@param shift Number of steps to cycle
@param len Length | [
"Cycle",
"a",
"bitstring",
"to",
"the",
"right",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/BitsUtil.java#L851-L854 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/ModifyBeanHelper.java | ModifyBeanHelper.buildReturnCode | public void buildReturnCode(MethodSpec.Builder methodBuilder, boolean updateMode, SQLiteModelMethod method, TypeName returnType) {
"""
Builds the return code.
@param methodBuilder
the method builder
@param updateMode
the update mode
@param method
the method
@param returnType
the return type
"""
if ... | java | public void buildReturnCode(MethodSpec.Builder methodBuilder, boolean updateMode, SQLiteModelMethod method, TypeName returnType) {
if (returnType == TypeName.VOID) {
} else if (isTypeIncludedIn(returnType, Boolean.TYPE, Boolean.class)) {
methodBuilder.addJavadoc("\n");
if (updateMode)
methodBuilder.addJa... | [
"public",
"void",
"buildReturnCode",
"(",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"boolean",
"updateMode",
",",
"SQLiteModelMethod",
"method",
",",
"TypeName",
"returnType",
")",
"{",
"if",
"(",
"returnType",
"==",
"TypeName",
".",
"VOID",
")",
"{",
... | Builds the return code.
@param methodBuilder
the method builder
@param updateMode
the update mode
@param method
the method
@param returnType
the return type | [
"Builds",
"the",
"return",
"code",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/ModifyBeanHelper.java#L256-L282 |
Headline/CleverBotAPI-Java | src/main/java/com/michaelwflaherty/cleverbotapi/CleverBotQuery.java | CleverBotQuery.formatRequest | private static String formatRequest(String url, String key, String phrase, String conversationID) {
"""
URL request formater
@param url starting url to connect to
@param key API key (cleverbot.com/api)
@param phrase input to be sent to CleverBot servers
@param conversationID unique conversation identifer
@r... | java | private static String formatRequest(String url, String key, String phrase, String conversationID)
{
String formattedPhrase = phrase.replaceAll("\\s+", "+");
return String.format("%s%s&input=%s&wrapper=Headline22JavaAPI%s", url, key, formattedPhrase, ((conversationID.equals("")) ? "" : ("&cs=" + conv... | [
"private",
"static",
"String",
"formatRequest",
"(",
"String",
"url",
",",
"String",
"key",
",",
"String",
"phrase",
",",
"String",
"conversationID",
")",
"{",
"String",
"formattedPhrase",
"=",
"phrase",
".",
"replaceAll",
"(",
"\"\\\\s+\"",
",",
"\"+\"",
")",... | URL request formater
@param url starting url to connect to
@param key API key (cleverbot.com/api)
@param phrase input to be sent to CleverBot servers
@param conversationID unique conversation identifer
@return String object containing properly formatted URL | [
"URL",
"request",
"formater"
] | train | https://github.com/Headline/CleverBotAPI-Java/blob/fe6818362eec687cdfeb7ee8deb4d2ee19611676/src/main/java/com/michaelwflaherty/cleverbotapi/CleverBotQuery.java#L206-L210 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/tools/SSTableExport.java | SSTableExport.writeKey | private static void writeKey(PrintStream out, String value) {
"""
JSON Hash Key serializer
@param out The output steam to write data
@param value value to set as a key
"""
writeJSON(out, value);
out.print(": ");
} | java | private static void writeKey(PrintStream out, String value)
{
writeJSON(out, value);
out.print(": ");
} | [
"private",
"static",
"void",
"writeKey",
"(",
"PrintStream",
"out",
",",
"String",
"value",
")",
"{",
"writeJSON",
"(",
"out",
",",
"value",
")",
";",
"out",
".",
"print",
"(",
"\": \"",
")",
";",
"}"
] | JSON Hash Key serializer
@param out The output steam to write data
@param value value to set as a key | [
"JSON",
"Hash",
"Key",
"serializer"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/tools/SSTableExport.java#L91-L95 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/scale/TaiInstant.java | TaiInstant.minus | public TaiInstant minus(Duration duration) {
"""
Returns a copy of this instant with the specified duration subtracted.
<p>
The duration is subtracted using simple subtraction of the seconds and nanoseconds
in the duration from the seconds and nanoseconds of this instant.
As a result, the duration is treated a... | java | public TaiInstant minus(Duration duration) {
long secsToSubtract = duration.getSeconds();
int nanosToSubtract = duration.getNano();
if ((secsToSubtract | nanosToSubtract) == 0) {
return this;
}
long secs = Math.subtractExact(seconds, secsToSubtract);
long nano... | [
"public",
"TaiInstant",
"minus",
"(",
"Duration",
"duration",
")",
"{",
"long",
"secsToSubtract",
"=",
"duration",
".",
"getSeconds",
"(",
")",
";",
"int",
"nanosToSubtract",
"=",
"duration",
".",
"getNano",
"(",
")",
";",
"if",
"(",
"(",
"secsToSubtract",
... | Returns a copy of this instant with the specified duration subtracted.
<p>
The duration is subtracted using simple subtraction of the seconds and nanoseconds
in the duration from the seconds and nanoseconds of this instant.
As a result, the duration is treated as being measured in TAI compatible seconds
for the purpose... | [
"Returns",
"a",
"copy",
"of",
"this",
"instant",
"with",
"the",
"specified",
"duration",
"subtracted",
".",
"<p",
">",
"The",
"duration",
"is",
"subtracted",
"using",
"simple",
"subtraction",
"of",
"the",
"seconds",
"and",
"nanoseconds",
"in",
"the",
"duration... | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/scale/TaiInstant.java#L334-L343 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cdn_dedicated_serviceName_backend_GET | public ArrayList<String> cdn_dedicated_serviceName_backend_GET(String serviceName, Long backend) throws IOException {
"""
Get allowed durations for 'backend' option
REST: GET /order/cdn/dedicated/{serviceName}/backend
@param backend [required] Backend number that will be ordered
@param serviceName [required] ... | java | public ArrayList<String> cdn_dedicated_serviceName_backend_GET(String serviceName, Long backend) throws IOException {
String qPath = "/order/cdn/dedicated/{serviceName}/backend";
StringBuilder sb = path(qPath, serviceName);
query(sb, "backend", backend);
String resp = exec(qPath, "GET", sb.toString(), null);
... | [
"public",
"ArrayList",
"<",
"String",
">",
"cdn_dedicated_serviceName_backend_GET",
"(",
"String",
"serviceName",
",",
"Long",
"backend",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cdn/dedicated/{serviceName}/backend\"",
";",
"StringBuilder",
"sb... | Get allowed durations for 'backend' option
REST: GET /order/cdn/dedicated/{serviceName}/backend
@param backend [required] Backend number that will be ordered
@param serviceName [required] The internal name of your CDN offer | [
"Get",
"allowed",
"durations",
"for",
"backend",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L5261-L5267 |
baratine/baratine | framework/src/main/java/com/caucho/v5/bartender/pod/PodHeartbeatImpl.java | PodHeartbeatImpl.onJoinStart | void onJoinStart() {
"""
Update the sequence for all init pods after the join has completed.
"""
//long now = CurrentTime.getCurrentTime();
ArrayList<UpdatePod> updatePods = new ArrayList<>();
updateClusterRoot();
/*
for (UpdatePod updatePod : _podUpdateMap.values()) {
if (updat... | java | void onJoinStart()
{
//long now = CurrentTime.getCurrentTime();
ArrayList<UpdatePod> updatePods = new ArrayList<>();
updateClusterRoot();
/*
for (UpdatePod updatePod : _podUpdateMap.values()) {
if (updatePod.getSequence() == 0) {
updatePods.add(new UpdatePod(updatePod, now));
... | [
"void",
"onJoinStart",
"(",
")",
"{",
"//long now = CurrentTime.getCurrentTime();",
"ArrayList",
"<",
"UpdatePod",
">",
"updatePods",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"updateClusterRoot",
"(",
")",
";",
"/*\n for (UpdatePod updatePod : _podUpdateMap.values... | Update the sequence for all init pods after the join has completed. | [
"Update",
"the",
"sequence",
"for",
"all",
"init",
"pods",
"after",
"the",
"join",
"has",
"completed",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/pod/PodHeartbeatImpl.java#L538-L566 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java | H2GISFunctions.load | public static void load(Connection connection, String BundleSymbolicName, String BundleVersion) throws SQLException {
"""
Register GEOMETRY type and register H2GIS functions
@param connection Active H2 connection
@param BundleSymbolicName OSGi Bundle symbolic name
@param BundleVersion OSGi Bundle version
@thro... | java | public static void load(Connection connection, String BundleSymbolicName, String BundleVersion) throws SQLException {
String packagePrepend = BundleSymbolicName+":"+BundleVersion+":";
registerH2GISFunctions(connection,packagePrepend);
registerGeometryType(connection);
connection.commit()... | [
"public",
"static",
"void",
"load",
"(",
"Connection",
"connection",
",",
"String",
"BundleSymbolicName",
",",
"String",
"BundleVersion",
")",
"throws",
"SQLException",
"{",
"String",
"packagePrepend",
"=",
"BundleSymbolicName",
"+",
"\":\"",
"+",
"BundleVersion",
"... | Register GEOMETRY type and register H2GIS functions
@param connection Active H2 connection
@param BundleSymbolicName OSGi Bundle symbolic name
@param BundleVersion OSGi Bundle version
@throws java.sql.SQLException | [
"Register",
"GEOMETRY",
"type",
"and",
"register",
"H2GIS",
"functions"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/factory/H2GISFunctions.java#L339-L344 |
EdwardRaff/JSAT | JSAT/src/jsat/math/decayrates/PowerDecay.java | PowerDecay.setTau | public void setTau(double tau) {
"""
Controls the rate early in time, but has a decreasing impact on the rate
returned as time goes forward. Larger values of τ dampen the initial
rates returned, while lower values let the initial rates start higher.
@param tau the early rate dampening parameter
"""
... | java | public void setTau(double tau)
{
if(tau <= 0 || Double.isInfinite(tau) || Double.isNaN(tau))
throw new IllegalArgumentException("tau must be a positive constant, not " + tau);
this.tau = tau;
} | [
"public",
"void",
"setTau",
"(",
"double",
"tau",
")",
"{",
"if",
"(",
"tau",
"<=",
"0",
"||",
"Double",
".",
"isInfinite",
"(",
"tau",
")",
"||",
"Double",
".",
"isNaN",
"(",
"tau",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"tau mus... | Controls the rate early in time, but has a decreasing impact on the rate
returned as time goes forward. Larger values of τ dampen the initial
rates returned, while lower values let the initial rates start higher.
@param tau the early rate dampening parameter | [
"Controls",
"the",
"rate",
"early",
"in",
"time",
"but",
"has",
"a",
"decreasing",
"impact",
"on",
"the",
"rate",
"returned",
"as",
"time",
"goes",
"forward",
".",
"Larger",
"values",
"of",
"&tau",
";",
"dampen",
"the",
"initial",
"rates",
"returned",
"whi... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/math/decayrates/PowerDecay.java#L75-L80 |
twilliamson/mogwee-logging | src/main/java/com/mogwee/logging/Logger.java | Logger.infoDebug | public final void infoDebug(final Throwable cause, final String message) {
"""
Logs a message and stack trace if DEBUG logging is enabled
or a formatted message and exception description if INFO logging is enabled.
@param cause an exception to print stack trace of if DEBUG logging is enabled
@param message ... | java | public final void infoDebug(final Throwable cause, final String message)
{
logDebug(Level.INFO, cause, message);
} | [
"public",
"final",
"void",
"infoDebug",
"(",
"final",
"Throwable",
"cause",
",",
"final",
"String",
"message",
")",
"{",
"logDebug",
"(",
"Level",
".",
"INFO",
",",
"cause",
",",
"message",
")",
";",
"}"
] | Logs a message and stack trace if DEBUG logging is enabled
or a formatted message and exception description if INFO logging is enabled.
@param cause an exception to print stack trace of if DEBUG logging is enabled
@param message a message | [
"Logs",
"a",
"message",
"and",
"stack",
"trace",
"if",
"DEBUG",
"logging",
"is",
"enabled",
"or",
"a",
"formatted",
"message",
"and",
"exception",
"description",
"if",
"INFO",
"logging",
"is",
"enabled",
"."
] | train | https://github.com/twilliamson/mogwee-logging/blob/30b99c2649de455432d956a8f6a74316de4cd62c/src/main/java/com/mogwee/logging/Logger.java#L345-L348 |
atomix/atomix | utils/src/main/java/io/atomix/utils/concurrent/ComposableFuture.java | ComposableFuture.exceptAsync | public CompletableFuture<T> exceptAsync(Consumer<Throwable> consumer) {
"""
Sets a consumer to be called asynchronously when the future is failed.
@param consumer The consumer to call.
@return A new future.
"""
return whenCompleteAsync((result, error) -> {
if (error != null) {
consumer.ac... | java | public CompletableFuture<T> exceptAsync(Consumer<Throwable> consumer) {
return whenCompleteAsync((result, error) -> {
if (error != null) {
consumer.accept(error);
}
});
} | [
"public",
"CompletableFuture",
"<",
"T",
">",
"exceptAsync",
"(",
"Consumer",
"<",
"Throwable",
">",
"consumer",
")",
"{",
"return",
"whenCompleteAsync",
"(",
"(",
"result",
",",
"error",
")",
"->",
"{",
"if",
"(",
"error",
"!=",
"null",
")",
"{",
"consu... | Sets a consumer to be called asynchronously when the future is failed.
@param consumer The consumer to call.
@return A new future. | [
"Sets",
"a",
"consumer",
"to",
"be",
"called",
"asynchronously",
"when",
"the",
"future",
"is",
"failed",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/utils/src/main/java/io/atomix/utils/concurrent/ComposableFuture.java#L59-L65 |
hibernate/hibernate-metamodelgen | src/main/java/org/hibernate/jpamodelgen/util/TypeUtils.java | TypeUtils.getAccessTypeInCaseElementIsRoot | private static AccessType getAccessTypeInCaseElementIsRoot(TypeElement searchedElement, Context context) {
"""
Iterates all elements of a type to check whether they contain the id annotation. If so the placement of this
annotation determines the access type
@param searchedElement the type to be searched
@para... | java | private static AccessType getAccessTypeInCaseElementIsRoot(TypeElement searchedElement, Context context) {
List<? extends Element> myMembers = searchedElement.getEnclosedElements();
for ( Element subElement : myMembers ) {
List<? extends AnnotationMirror> entityAnnotations =
context.getElementUtils().getAll... | [
"private",
"static",
"AccessType",
"getAccessTypeInCaseElementIsRoot",
"(",
"TypeElement",
"searchedElement",
",",
"Context",
"context",
")",
"{",
"List",
"<",
"?",
"extends",
"Element",
">",
"myMembers",
"=",
"searchedElement",
".",
"getEnclosedElements",
"(",
")",
... | Iterates all elements of a type to check whether they contain the id annotation. If so the placement of this
annotation determines the access type
@param searchedElement the type to be searched
@param context The global execution context
@return returns the access type of the element annotated with the id annotation.... | [
"Iterates",
"all",
"elements",
"of",
"a",
"type",
"to",
"check",
"whether",
"they",
"contain",
"the",
"id",
"annotation",
".",
"If",
"so",
"the",
"placement",
"of",
"this",
"annotation",
"determines",
"the",
"access",
"type"
] | train | https://github.com/hibernate/hibernate-metamodelgen/blob/2c87b262bc03b1a5a541789fc00c54e0531a36b2/src/main/java/org/hibernate/jpamodelgen/util/TypeUtils.java#L340-L353 |
AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/Identifier.java | Identifier.fromLong | public static Identifier fromLong(long longValue, int desiredByteLength) {
"""
Creates an Identifer backed by an array of length desiredByteLength
@param longValue a long to put into the identifier
@param desiredByteLength how many bytes to make the identifier
@return
"""
if (desiredByteLength < 0) ... | java | public static Identifier fromLong(long longValue, int desiredByteLength) {
if (desiredByteLength < 0) {
throw new IllegalArgumentException("Identifier length must be > 0.");
}
byte[] newValue = new byte[desiredByteLength];
for (int i = desiredByteLength-1; i >= 0; i--) {
... | [
"public",
"static",
"Identifier",
"fromLong",
"(",
"long",
"longValue",
",",
"int",
"desiredByteLength",
")",
"{",
"if",
"(",
"desiredByteLength",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Identifier length must be > 0.\"",
")",
";",
... | Creates an Identifer backed by an array of length desiredByteLength
@param longValue a long to put into the identifier
@param desiredByteLength how many bytes to make the identifier
@return | [
"Creates",
"an",
"Identifer",
"backed",
"by",
"an",
"array",
"of",
"length",
"desiredByteLength"
] | train | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/Identifier.java#L130-L140 |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/FileUtils.java | FileUtils.removeDuplicatesFromOutputDirectory | public static void removeDuplicatesFromOutputDirectory(File outputDirectory,
File originDirectory) {
"""
Utility to remove duplicate files from an "output" directory if they already exist
in an "origin". Recursively scans the origin directory looking for files (not
directories) that exist in both places and d... | java | public static void removeDuplicatesFromOutputDirectory(File outputDirectory,
File originDirectory) {
if (originDirectory.isDirectory()) {
for (String name : originDirectory.list()) {
File targetFile = new File(outputDirectory, name);
if (targetFile.exists() && targetFile.canWrite()) {
if (!targetFi... | [
"public",
"static",
"void",
"removeDuplicatesFromOutputDirectory",
"(",
"File",
"outputDirectory",
",",
"File",
"originDirectory",
")",
"{",
"if",
"(",
"originDirectory",
".",
"isDirectory",
"(",
")",
")",
"{",
"for",
"(",
"String",
"name",
":",
"originDirectory",... | Utility to remove duplicate files from an "output" directory if they already exist
in an "origin". Recursively scans the origin directory looking for files (not
directories) that exist in both places and deleting the copy.
@param outputDirectory the output directory
@param originDirectory the origin directory | [
"Utility",
"to",
"remove",
"duplicate",
"files",
"from",
"an",
"output",
"directory",
"if",
"they",
"already",
"exist",
"in",
"an",
"origin",
".",
"Recursively",
"scans",
"the",
"origin",
"directory",
"looking",
"for",
"files",
"(",
"not",
"directories",
")",
... | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/FileUtils.java#L41-L57 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShippingMethodPersistenceImpl.java | CommerceShippingMethodPersistenceImpl.countByG_E | @Override
public int countByG_E(long groupId, String engineKey) {
"""
Returns the number of commerce shipping methods where groupId = ? and engineKey = ?.
@param groupId the group ID
@param engineKey the engine key
@return the number of matching commerce shipping methods
"""
FinderPath finderPa... | java | @Override
public int countByG_E(long groupId, String engineKey) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_G_E;
Object[] finderArgs = new Object[] { groupId, engineKey };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
StringBundler query = new StringBundl... | [
"@",
"Override",
"public",
"int",
"countByG_E",
"(",
"long",
"groupId",
",",
"String",
"engineKey",
")",
"{",
"FinderPath",
"finderPath",
"=",
"FINDER_PATH_COUNT_BY_G_E",
";",
"Object",
"[",
"]",
"finderArgs",
"=",
"new",
"Object",
"[",
"]",
"{",
"groupId",
... | Returns the number of commerce shipping methods where groupId = ? and engineKey = ?.
@param groupId the group ID
@param engineKey the engine key
@return the number of matching commerce shipping methods | [
"Returns",
"the",
"number",
"of",
"commerce",
"shipping",
"methods",
"where",
"groupId",
"=",
"?",
";",
"and",
"engineKey",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShippingMethodPersistenceImpl.java#L789-L850 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/util/MainApplication.java | MainApplication.createRemoteTask | public RemoteTask createRemoteTask(String strServer, String strRemoteApp, String strUserID, String strPassword) {
"""
Connect to the remote server and get the remote server object.
@param strServer The (rmi) server.
@param The remote application name in jndi index.
@return The remote server object.
"""
... | java | public RemoteTask createRemoteTask(String strServer, String strRemoteApp, String strUserID, String strPassword)
{
RemoteTask remoteTask = super.createRemoteTask(strServer, strRemoteApp, strUserID, strPassword);
return remoteTask;
} | [
"public",
"RemoteTask",
"createRemoteTask",
"(",
"String",
"strServer",
",",
"String",
"strRemoteApp",
",",
"String",
"strUserID",
",",
"String",
"strPassword",
")",
"{",
"RemoteTask",
"remoteTask",
"=",
"super",
".",
"createRemoteTask",
"(",
"strServer",
",",
"st... | Connect to the remote server and get the remote server object.
@param strServer The (rmi) server.
@param The remote application name in jndi index.
@return The remote server object. | [
"Connect",
"to",
"the",
"remote",
"server",
"and",
"get",
"the",
"remote",
"server",
"object",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/util/MainApplication.java#L636-L640 |
rmpestano/cukedoctor | cukedoctor-extension/src/main/java/com/github/cukedoctor/extension/util/FileUtil.java | FileUtil.saveFile | public static File saveFile(String name, String data) {
"""
Saves a file into filesystem. Note that name can be saved as absolute (if it has a leading slash) or relative to current path.
EX: /target/name.adoc will save the file into
@param name file name
@param data file content
@return
"""
if (n... | java | public static File saveFile(String name, String data) {
if (name == null) {
name = "";
}
String fullyQualifiedName = name;
/**
* if filename is not absolute use current path as base dir
*/
if (!new File(fullyQualifiedName).isAbsolute()) {
... | [
"public",
"static",
"File",
"saveFile",
"(",
"String",
"name",
",",
"String",
"data",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"name",
"=",
"\"\"",
";",
"}",
"String",
"fullyQualifiedName",
"=",
"name",
";",
"/**\n * if filename is not ab... | Saves a file into filesystem. Note that name can be saved as absolute (if it has a leading slash) or relative to current path.
EX: /target/name.adoc will save the file into
@param name file name
@param data file content
@return | [
"Saves",
"a",
"file",
"into",
"filesystem",
".",
"Note",
"that",
"name",
"can",
"be",
"saved",
"as",
"absolute",
"(",
"if",
"it",
"has",
"a",
"leading",
"slash",
")",
"or",
"relative",
"to",
"current",
"path",
".",
"EX",
":",
"/",
"target",
"/",
"nam... | train | https://github.com/rmpestano/cukedoctor/blob/0e86dedbd8498ad551ce314a219e78cbabb7ff7d/cukedoctor-extension/src/main/java/com/github/cukedoctor/extension/util/FileUtil.java#L32-L59 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.resourcedefinition.jms.2.0/src/com/ibm/ws/jca/processor/jms/util/JMSResourceDefinitionHelper.java | JMSResourceDefinitionHelper.getBundle | public static Bundle getBundle(BundleContext bundleContext, String resourceAdapter) throws ConfigEvaluatorException {
"""
Get the bundle where the resource adapter's Metatype Information exists.
@param resourceAdapter
@return
@throws ConfigEvaluatorException
"""
Bundle bundle = null;
if ... | java | public static Bundle getBundle(BundleContext bundleContext, String resourceAdapter) throws ConfigEvaluatorException {
Bundle bundle = null;
if (JMSResourceDefinitionConstants.RESOURCE_ADAPTER_WASJMS.equals(resourceAdapter)
|| JMSResourceDefinitionConstants.RESOURCE_ADAPTER_WMQJMS.equals(re... | [
"public",
"static",
"Bundle",
"getBundle",
"(",
"BundleContext",
"bundleContext",
",",
"String",
"resourceAdapter",
")",
"throws",
"ConfigEvaluatorException",
"{",
"Bundle",
"bundle",
"=",
"null",
";",
"if",
"(",
"JMSResourceDefinitionConstants",
".",
"RESOURCE_ADAPTER_... | Get the bundle where the resource adapter's Metatype Information exists.
@param resourceAdapter
@return
@throws ConfigEvaluatorException | [
"Get",
"the",
"bundle",
"where",
"the",
"resource",
"adapter",
"s",
"Metatype",
"Information",
"exists",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.resourcedefinition.jms.2.0/src/com/ibm/ws/jca/processor/jms/util/JMSResourceDefinitionHelper.java#L34-L53 |
puniverse/capsule | capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java | Jar.addEntry | public Jar addEntry(Path path, String file) throws IOException {
"""
Adds an entry to this JAR.
@param path the entry's path within the JAR
@param file the path of the file to add as an entry
@return {@code this}
"""
return addEntry(path, Paths.get(file));
} | java | public Jar addEntry(Path path, String file) throws IOException {
return addEntry(path, Paths.get(file));
} | [
"public",
"Jar",
"addEntry",
"(",
"Path",
"path",
",",
"String",
"file",
")",
"throws",
"IOException",
"{",
"return",
"addEntry",
"(",
"path",
",",
"Paths",
".",
"get",
"(",
"file",
")",
")",
";",
"}"
] | Adds an entry to this JAR.
@param path the entry's path within the JAR
@param file the path of the file to add as an entry
@return {@code this} | [
"Adds",
"an",
"entry",
"to",
"this",
"JAR",
"."
] | train | https://github.com/puniverse/capsule/blob/291a54e501a32aaf0284707b8c1fbff6a566822b/capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java#L343-L345 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/GraphBuilder.java | GraphBuilder.build | public GraphHopperStorage build() {
"""
Default graph is a {@link GraphHopperStorage} with an in memory directory and disabled storing on flush.
Afterwards you'll need to call {@link GraphHopperStorage#create} to have a usable object. Better use
{@link #create} directly.
"""
Directory dir = mmap ?
... | java | public GraphHopperStorage build() {
Directory dir = mmap ?
new MMapDirectory(location) :
new RAMDirectory(location, store);
GraphExtension graphExtension = encodingManager.needsTurnCostsSupport() ?
new TurnCostExtension() :
new TurnCostExt... | [
"public",
"GraphHopperStorage",
"build",
"(",
")",
"{",
"Directory",
"dir",
"=",
"mmap",
"?",
"new",
"MMapDirectory",
"(",
"location",
")",
":",
"new",
"RAMDirectory",
"(",
"location",
",",
"store",
")",
";",
"GraphExtension",
"graphExtension",
"=",
"encodingM... | Default graph is a {@link GraphHopperStorage} with an in memory directory and disabled storing on flush.
Afterwards you'll need to call {@link GraphHopperStorage#create} to have a usable object. Better use
{@link #create} directly. | [
"Default",
"graph",
"is",
"a",
"{"
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/GraphBuilder.java#L100-L114 |
dynjs/dynjs | src/main/java/org/dynjs/ir/representations/CFGLinearizer.java | CFGLinearizer.addJumpIfNextNotDestination | private static void addJumpIfNextNotDestination(CFG cfg, BasicBlock next, Instruction lastInstr, BasicBlock current) {
"""
If there is no jump at add of block and the next block is not destination insert a valid jump
"""
Iterator<BasicBlock> outs = cfg.getOutgoingDestinations(current).iterator();
... | java | private static void addJumpIfNextNotDestination(CFG cfg, BasicBlock next, Instruction lastInstr, BasicBlock current) {
Iterator<BasicBlock> outs = cfg.getOutgoingDestinations(current).iterator();
BasicBlock target = outs.hasNext() ? outs.next() : null;
if (target != null && !outs.hasNext()) {
... | [
"private",
"static",
"void",
"addJumpIfNextNotDestination",
"(",
"CFG",
"cfg",
",",
"BasicBlock",
"next",
",",
"Instruction",
"lastInstr",
",",
"BasicBlock",
"current",
")",
"{",
"Iterator",
"<",
"BasicBlock",
">",
"outs",
"=",
"cfg",
".",
"getOutgoingDestinations... | If there is no jump at add of block and the next block is not destination insert a valid jump | [
"If",
"there",
"is",
"no",
"jump",
"at",
"add",
"of",
"block",
"and",
"the",
"next",
"block",
"is",
"not",
"destination",
"insert",
"a",
"valid",
"jump"
] | train | https://github.com/dynjs/dynjs/blob/4bc6715eff8768f8cd92c6a167d621bbfc1e1a91/src/main/java/org/dynjs/ir/representations/CFGLinearizer.java#L127-L136 |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/account/selfedit/AccountPasswordFormValidator.java | AccountPasswordFormValidator.validateEnterPassword | public void validateEnterPassword(AccountPasswordForm form, MessageContext context) {
"""
/*
NB: This validation method correctly matches a state defined in the
edit-account flow, but there doesn't appear currently to be a way to
enter it.
"""
// ensure that a current account password was entered
... | java | public void validateEnterPassword(AccountPasswordForm form, MessageContext context) {
// ensure that a current account password was entered
if (StringUtils.isBlank(form.getCurrentPassword())) {
context.addMessage(
new MessageBuilder()
.error()... | [
"public",
"void",
"validateEnterPassword",
"(",
"AccountPasswordForm",
"form",
",",
"MessageContext",
"context",
")",
"{",
"// ensure that a current account password was entered",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"form",
".",
"getCurrentPassword",
"(",
")",
... | /*
NB: This validation method correctly matches a state defined in the
edit-account flow, but there doesn't appear currently to be a way to
enter it. | [
"/",
"*",
"NB",
":",
"This",
"validation",
"method",
"correctly",
"matches",
"a",
"state",
"defined",
"in",
"the",
"edit",
"-",
"account",
"flow",
"but",
"there",
"doesn",
"t",
"appear",
"currently",
"to",
"be",
"a",
"way",
"to",
"enter",
"it",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/account/selfedit/AccountPasswordFormValidator.java#L52-L118 |
seedstack/shed | src/main/java/org/seedstack/shed/exception/BaseException.java | BaseException.createNew | public static <E extends BaseException> E createNew(Class<E> exceptionType, ErrorCode errorCode) {
"""
Create a new subclass of BaseException from an {@link ErrorCode}.
@param exceptionType the subclass of BaseException to create.
@param errorCode the error code to set.
@param <E> the subtype.
... | java | public static <E extends BaseException> E createNew(Class<E> exceptionType, ErrorCode errorCode) {
try {
Constructor<E> constructor = exceptionType.getDeclaredConstructor(ErrorCode.class);
constructor.setAccessible(true);
return constructor.newInstance(errorCode);
} c... | [
"public",
"static",
"<",
"E",
"extends",
"BaseException",
">",
"E",
"createNew",
"(",
"Class",
"<",
"E",
">",
"exceptionType",
",",
"ErrorCode",
"errorCode",
")",
"{",
"try",
"{",
"Constructor",
"<",
"E",
">",
"constructor",
"=",
"exceptionType",
".",
"get... | Create a new subclass of BaseException from an {@link ErrorCode}.
@param exceptionType the subclass of BaseException to create.
@param errorCode the error code to set.
@param <E> the subtype.
@return the created BaseException. | [
"Create",
"a",
"new",
"subclass",
"of",
"BaseException",
"from",
"an",
"{",
"@link",
"ErrorCode",
"}",
"."
] | train | https://github.com/seedstack/shed/blob/49ecb25aa3777539ab0f29f89abaae5ee93b572e/src/main/java/org/seedstack/shed/exception/BaseException.java#L101-L111 |
structurizr/java | structurizr-core/src/com/structurizr/model/Model.java | Model.addDeploymentNode | @Nonnull
public DeploymentNode addDeploymentNode(@Nonnull String name, String description, String technology, int instances, Map<String, String> properties) {
"""
Adds a top-level deployment node to this model.
@param name the name of the deployment node
@param description the description of the dep... | java | @Nonnull
public DeploymentNode addDeploymentNode(@Nonnull String name, String description, String technology, int instances, Map<String, String> properties) {
return addDeploymentNode(DeploymentElement.DEFAULT_DEPLOYMENT_ENVIRONMENT, name, description, technology, instances, properties);
} | [
"@",
"Nonnull",
"public",
"DeploymentNode",
"addDeploymentNode",
"(",
"@",
"Nonnull",
"String",
"name",
",",
"String",
"description",
",",
"String",
"technology",
",",
"int",
"instances",
",",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
")",
"{",
... | Adds a top-level deployment node to this model.
@param name the name of the deployment node
@param description the description of the deployment node
@param technology the technology associated with the deployment node
@param instances the number of instances of the deployment node
@param properties a map o... | [
"Adds",
"a",
"top",
"-",
"level",
"deployment",
"node",
"to",
"this",
"model",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/model/Model.java#L620-L623 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPBitOutputStream.java | JBBPBitOutputStream.writeInt | public void writeInt(final int value, final JBBPByteOrder byteOrder) throws IOException {
"""
Write an integer value into the output stream.
@param value a value to be written into the output stream.
@param byteOrder the byte order of the value bytes to be used for writing.
@throws IOException it will be ... | java | public void writeInt(final int value, final JBBPByteOrder byteOrder) throws IOException {
if (byteOrder == JBBPByteOrder.BIG_ENDIAN) {
this.writeShort(value >>> 16, byteOrder);
this.writeShort(value, byteOrder);
} else {
this.writeShort(value, byteOrder);
this.writeShort(value >>> 16, by... | [
"public",
"void",
"writeInt",
"(",
"final",
"int",
"value",
",",
"final",
"JBBPByteOrder",
"byteOrder",
")",
"throws",
"IOException",
"{",
"if",
"(",
"byteOrder",
"==",
"JBBPByteOrder",
".",
"BIG_ENDIAN",
")",
"{",
"this",
".",
"writeShort",
"(",
"value",
">... | Write an integer value into the output stream.
@param value a value to be written into the output stream.
@param byteOrder the byte order of the value bytes to be used for writing.
@throws IOException it will be thrown for transport errors
@see JBBPByteOrder#BIG_ENDIAN
@see JBBPByteOrder#LITTLE_ENDIAN | [
"Write",
"an",
"integer",
"value",
"into",
"the",
"output",
"stream",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPBitOutputStream.java#L111-L119 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/linsol/qr/AdjLinearSolverQr_DDRM.java | AdjLinearSolverQr_DDRM.getA | @Override
public DMatrixRMaj getA() {
"""
Compute the A matrix from the Q and R matrices.
@return The A matrix.
"""
if( A.data.length < numRows*numCols ) {
A = new DMatrixRMaj(numRows,numCols);
}
A.reshape(numRows,numCols, false);
CommonOps_DDRM.mult(Q,R,A);
... | java | @Override
public DMatrixRMaj getA() {
if( A.data.length < numRows*numCols ) {
A = new DMatrixRMaj(numRows,numCols);
}
A.reshape(numRows,numCols, false);
CommonOps_DDRM.mult(Q,R,A);
return A;
} | [
"@",
"Override",
"public",
"DMatrixRMaj",
"getA",
"(",
")",
"{",
"if",
"(",
"A",
".",
"data",
".",
"length",
"<",
"numRows",
"*",
"numCols",
")",
"{",
"A",
"=",
"new",
"DMatrixRMaj",
"(",
"numRows",
",",
"numCols",
")",
";",
"}",
"A",
".",
"reshape... | Compute the A matrix from the Q and R matrices.
@return The A matrix. | [
"Compute",
"the",
"A",
"matrix",
"from",
"the",
"Q",
"and",
"R",
"matrices",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/linsol/qr/AdjLinearSolverQr_DDRM.java#L60-L69 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/debug/cli/ShellFactory.java | ShellFactory.createConsoleShell | public static Shell createConsoleShell(String prompt, String appName, Object mainHandler) {
"""
Facade method for operating the Shell.
Run the obtained Shell with commandLoop().
@see org.gearvrf.debug.cli.Shell#Shell(org.gearvrf.debug.cli.Shell.Settings, org.gearvrf.debug.cli.CommandTable, java.util.List)
... | java | public static Shell createConsoleShell(String prompt, String appName, Object mainHandler) {
return createConsoleShell(prompt, appName, mainHandler, new EmptyMultiMap<String, Object>());
} | [
"public",
"static",
"Shell",
"createConsoleShell",
"(",
"String",
"prompt",
",",
"String",
"appName",
",",
"Object",
"mainHandler",
")",
"{",
"return",
"createConsoleShell",
"(",
"prompt",
",",
"appName",
",",
"mainHandler",
",",
"new",
"EmptyMultiMap",
"<",
"St... | Facade method for operating the Shell.
Run the obtained Shell with commandLoop().
@see org.gearvrf.debug.cli.Shell#Shell(org.gearvrf.debug.cli.Shell.Settings, org.gearvrf.debug.cli.CommandTable, java.util.List)
@param prompt Prompt to be displayed
@param appName The app name string
@param mainHandler Command handler... | [
"Facade",
"method",
"for",
"operating",
"the",
"Shell",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/debug/cli/ShellFactory.java#L104-L106 |
phax/ph-css | ph-css/src/main/java/com/helger/css/decl/CSSExpression.java | CSSExpression.addMember | @Nonnull
public CSSExpression addMember (@Nonnegative final int nIndex, @Nonnull final ICSSExpressionMember aMember) {
"""
Add an expression member
@param nIndex
The index where the member should be added. Must be ≥ 0.
@param aMember
The member to be added. May not be <code>null</code>.
@return this
... | java | @Nonnull
public CSSExpression addMember (@Nonnegative final int nIndex, @Nonnull final ICSSExpressionMember aMember)
{
ValueEnforcer.isGE0 (nIndex, "Index");
ValueEnforcer.notNull (aMember, "ExpressionMember");
if (nIndex >= getMemberCount ())
m_aMembers.add (aMember);
else
m_aMembers.a... | [
"@",
"Nonnull",
"public",
"CSSExpression",
"addMember",
"(",
"@",
"Nonnegative",
"final",
"int",
"nIndex",
",",
"@",
"Nonnull",
"final",
"ICSSExpressionMember",
"aMember",
")",
"{",
"ValueEnforcer",
".",
"isGE0",
"(",
"nIndex",
",",
"\"Index\"",
")",
";",
"Val... | Add an expression member
@param nIndex
The index where the member should be added. Must be ≥ 0.
@param aMember
The member to be added. May not be <code>null</code>.
@return this | [
"Add",
"an",
"expression",
"member"
] | train | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/decl/CSSExpression.java#L77-L88 |
infinispan/infinispan | commons/src/main/java/org/infinispan/commons/util/ReflectionUtil.java | ReflectionUtil.notFound | private static boolean notFound(Method m, Collection<Method> s) {
"""
Tests whether a method has already been found, i.e., overridden.
@param m method to inspect
@param s collection of methods found
@return true a method with the same signature already exists.
"""
for (Method found : s) {
i... | java | private static boolean notFound(Method m, Collection<Method> s) {
for (Method found : s) {
if (m.getName().equals(found.getName()) &&
Arrays.equals(m.getParameterTypes(), found.getParameterTypes()))
return false;
}
return true;
} | [
"private",
"static",
"boolean",
"notFound",
"(",
"Method",
"m",
",",
"Collection",
"<",
"Method",
">",
"s",
")",
"{",
"for",
"(",
"Method",
"found",
":",
"s",
")",
"{",
"if",
"(",
"m",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"found",
".",
"... | Tests whether a method has already been found, i.e., overridden.
@param m method to inspect
@param s collection of methods found
@return true a method with the same signature already exists. | [
"Tests",
"whether",
"a",
"method",
"has",
"already",
"been",
"found",
"i",
".",
"e",
".",
"overridden",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/util/ReflectionUtil.java#L154-L161 |
google/closure-compiler | src/com/google/javascript/jscomp/Es6RewriteClass.java | Es6RewriteClass.visitMethod | private void visitMethod(Node member, ClassDeclarationMetadata metadata) {
"""
Handles transpilation of a standard class member function. Getters, setters, and the
constructor are not handled here.
"""
Node qualifiedMemberAccess = getQualifiedMemberAccess(member, metadata);
Node method = member.getLas... | java | private void visitMethod(Node member, ClassDeclarationMetadata metadata) {
Node qualifiedMemberAccess = getQualifiedMemberAccess(member, metadata);
Node method = member.getLastChild().detach();
// Use the source info from the method (a FUNCTION) not the MEMBER_FUNCTION_DEF
// because the MEMBER_FUNCTIO... | [
"private",
"void",
"visitMethod",
"(",
"Node",
"member",
",",
"ClassDeclarationMetadata",
"metadata",
")",
"{",
"Node",
"qualifiedMemberAccess",
"=",
"getQualifiedMemberAccess",
"(",
"member",
",",
"metadata",
")",
";",
"Node",
"method",
"=",
"member",
".",
"getLa... | Handles transpilation of a standard class member function. Getters, setters, and the
constructor are not handled here. | [
"Handles",
"transpilation",
"of",
"a",
"standard",
"class",
"member",
"function",
".",
"Getters",
"setters",
"and",
"the",
"constructor",
"are",
"not",
"handled",
"here",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Es6RewriteClass.java#L500-L523 |
uscexp/grappa.extension | src/main/java/com/github/uscexp/grappa/extension/interpreter/ProcessStore.java | ProcessStore.setVariable | public boolean setVariable(Object key, Object value) {
"""
set an already defined variable, first from the highest block hierarchy
down to the global variables.
@param key
name of the variable
@param value
value of the variable
@return true if successfully assignd to an existing variable else false
"""... | java | public boolean setVariable(Object key, Object value) {
boolean success = false;
Object object = null;
for (int i = working.size() - 1; i >= 0; --i) {
Map<Object, Object> map = working.get(i);
object = map.get(key);
if (object != null) {
map.put(key, value);
success = true;
break;
}
}
... | [
"public",
"boolean",
"setVariable",
"(",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"boolean",
"success",
"=",
"false",
";",
"Object",
"object",
"=",
"null",
";",
"for",
"(",
"int",
"i",
"=",
"working",
".",
"size",
"(",
")",
"-",
"1",
";",
... | set an already defined variable, first from the highest block hierarchy
down to the global variables.
@param key
name of the variable
@param value
value of the variable
@return true if successfully assignd to an existing variable else false | [
"set",
"an",
"already",
"defined",
"variable",
"first",
"from",
"the",
"highest",
"block",
"hierarchy",
"down",
"to",
"the",
"global",
"variables",
"."
] | train | https://github.com/uscexp/grappa.extension/blob/a6001eb6eee434a09e2870e7513f883c7fdaea94/src/main/java/com/github/uscexp/grappa/extension/interpreter/ProcessStore.java#L267-L288 |
phax/ph-oton | ph-oton-html/src/main/java/com/helger/html/markdown/MarkdownHelper.java | MarkdownHelper.readRawUntil | public static int readRawUntil (final StringBuilder out, final String in, final int start, final char end) {
"""
Reads characters until the end character is encountered, ignoring escape
sequences.
@param out
The StringBuilder to write to.
@param in
The Input String.
@param start
Starting position.
@param... | java | public static int readRawUntil (final StringBuilder out, final String in, final int start, final char end)
{
int pos = start;
while (pos < in.length ())
{
final char ch = in.charAt (pos);
if (ch == end)
break;
out.append (ch);
pos++;
}
return (pos == in.length ()) ... | [
"public",
"static",
"int",
"readRawUntil",
"(",
"final",
"StringBuilder",
"out",
",",
"final",
"String",
"in",
",",
"final",
"int",
"start",
",",
"final",
"char",
"end",
")",
"{",
"int",
"pos",
"=",
"start",
";",
"while",
"(",
"pos",
"<",
"in",
".",
... | Reads characters until the end character is encountered, ignoring escape
sequences.
@param out
The StringBuilder to write to.
@param in
The Input String.
@param start
Starting position.
@param end
End characters.
@return The new position or -1 if no 'end' char was found. | [
"Reads",
"characters",
"until",
"the",
"end",
"character",
"is",
"encountered",
"ignoring",
"escape",
"sequences",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/markdown/MarkdownHelper.java#L337-L350 |
astrapi69/jaulp-wicket | jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/request/mapper/HighScoreRequestMapper.java | HighScoreRequestMapper.initializeRequestMappers | private Collection<RequestMapperBean> initializeRequestMappers(final Request request) {
"""
Initialize request mappers.
@param request
the request
@return the collection
"""
final Set<RequestMapperBean> mapperBeans = new TreeSet<>(getComparator());
for (final IRequestMapper requestMapper : this.requ... | java | private Collection<RequestMapperBean> initializeRequestMappers(final Request request)
{
final Set<RequestMapperBean> mapperBeans = new TreeSet<>(getComparator());
for (final IRequestMapper requestMapper : this.requestMappers)
{
mapperBeans.add(
new RequestMapperBean(requestMapper, requestMapper.getC... | [
"private",
"Collection",
"<",
"RequestMapperBean",
">",
"initializeRequestMappers",
"(",
"final",
"Request",
"request",
")",
"{",
"final",
"Set",
"<",
"RequestMapperBean",
">",
"mapperBeans",
"=",
"new",
"TreeSet",
"<>",
"(",
"getComparator",
"(",
")",
")",
";",... | Initialize request mappers.
@param request
the request
@return the collection | [
"Initialize",
"request",
"mappers",
"."
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/request/mapper/HighScoreRequestMapper.java#L116-L125 |
kiegroup/drools | kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/codegen/feel11/DirectCompilerVisitor.java | DirectCompilerVisitor.groundToNullIfAnyIsNull | private Expression groundToNullIfAnyIsNull(Expression originalOperation, Expression... arguments) {
"""
PLEASE NOTICE:
operation may perform a check for null-literal values, but might need this utility for runtime purposes.
"""
// Q: What is heavier, checking a list of arguments each one is not null, ... | java | private Expression groundToNullIfAnyIsNull(Expression originalOperation, Expression... arguments) {
// Q: What is heavier, checking a list of arguments each one is not null, or just doing the operation on the arguments and try-catch the NPE, please?
// A: raising exceptions is a lot heavier
Bina... | [
"private",
"Expression",
"groundToNullIfAnyIsNull",
"(",
"Expression",
"originalOperation",
",",
"Expression",
"...",
"arguments",
")",
"{",
"// Q: What is heavier, checking a list of arguments each one is not null, or just doing the operation on the arguments and try-catch the NPE, please?"... | PLEASE NOTICE:
operation may perform a check for null-literal values, but might need this utility for runtime purposes. | [
"PLEASE",
"NOTICE",
":",
"operation",
"may",
"perform",
"a",
"check",
"for",
"null",
"-",
"literal",
"values",
"but",
"might",
"need",
"this",
"utility",
"for",
"runtime",
"purposes",
"."
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/codegen/feel11/DirectCompilerVisitor.java#L318-L327 |
eclipse/xtext-core | org.eclipse.xtext.ide/xtend-gen/org/eclipse/xtext/ide/server/rename/RenameService2.java | RenameService2.mayPerformRename | protected boolean mayPerformRename(final Either<Range, PrepareRenameResult> prepareRenameResult, final RenameParams renameParams) {
"""
If this method returns {@code false}, it is sure, that the rename operation will fail.
There is no guarantee that it will succeed even if it returns {@code true}.
"""
ret... | java | protected boolean mayPerformRename(final Either<Range, PrepareRenameResult> prepareRenameResult, final RenameParams renameParams) {
return (((prepareRenameResult != null) && (prepareRenameResult.getLeft() != null)) &&
Ranges.containsPosition(prepareRenameResult.getLeft(), renameParams.getPosition()));
} | [
"protected",
"boolean",
"mayPerformRename",
"(",
"final",
"Either",
"<",
"Range",
",",
"PrepareRenameResult",
">",
"prepareRenameResult",
",",
"final",
"RenameParams",
"renameParams",
")",
"{",
"return",
"(",
"(",
"(",
"prepareRenameResult",
"!=",
"null",
")",
"&&... | If this method returns {@code false}, it is sure, that the rename operation will fail.
There is no guarantee that it will succeed even if it returns {@code true}. | [
"If",
"this",
"method",
"returns",
"{"
] | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext.ide/xtend-gen/org/eclipse/xtext/ide/server/rename/RenameService2.java#L328-L331 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/publickey/ConsoleKnownHostsKeyVerification.java | ConsoleKnownHostsKeyVerification.onUnknownHost | public void onUnknownHost(String host, SshPublicKey pk) {
"""
<p>
Prompts the user through the console to verify the host key.
</p>
@param host
the name of the host
@param pk
the public key supplied by the host
@since 0.2.0
"""
try {
System.out.println("The host " + host
+ " is currently u... | java | public void onUnknownHost(String host, SshPublicKey pk) {
try {
System.out.println("The host " + host
+ " is currently unknown to the system");
System.out.println("The MD5 host key " + "(" + pk.getAlgorithm()
+ ") fingerprint is: " + pk.getFingerprint());
System.out.println("The SHA1 host key "
... | [
"public",
"void",
"onUnknownHost",
"(",
"String",
"host",
",",
"SshPublicKey",
"pk",
")",
"{",
"try",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"The host \"",
"+",
"host",
"+",
"\" is currently unknown to the system\"",
")",
";",
"System",
".",
"out",
... | <p>
Prompts the user through the console to verify the host key.
</p>
@param host
the name of the host
@param pk
the public key supplied by the host
@since 0.2.0 | [
"<p",
">",
"Prompts",
"the",
"user",
"through",
"the",
"console",
"to",
"verify",
"the",
"host",
"key",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/publickey/ConsoleKnownHostsKeyVerification.java#L115-L141 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java | CopyJobConfiguration.of | public static CopyJobConfiguration of(TableId destinationTable, TableId sourceTable) {
"""
Returns a BigQuery Copy Job configuration for the given destination and source table.
"""
return newBuilder(destinationTable, sourceTable).build();
} | java | public static CopyJobConfiguration of(TableId destinationTable, TableId sourceTable) {
return newBuilder(destinationTable, sourceTable).build();
} | [
"public",
"static",
"CopyJobConfiguration",
"of",
"(",
"TableId",
"destinationTable",
",",
"TableId",
"sourceTable",
")",
"{",
"return",
"newBuilder",
"(",
"destinationTable",
",",
"sourceTable",
")",
".",
"build",
"(",
")",
";",
"}"
] | Returns a BigQuery Copy Job configuration for the given destination and source table. | [
"Returns",
"a",
"BigQuery",
"Copy",
"Job",
"configuration",
"for",
"the",
"given",
"destination",
"and",
"source",
"table",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java#L267-L269 |
oglimmer/utils | src/main/java/de/oglimmer/utils/random/RandomString.java | RandomString.getRandomString | public static String getRandomString(final int size, final String stringSet) {
"""
Creates a size byte long unicode string. All codes are from the set "stringSet"
@param size
number of characters in the return string
@param stringSet
set of characters used for string creation
@return a random string build f... | java | public static String getRandomString(final int size, final String stringSet) {
final StringBuilder buff = new StringBuilder(size);
for (int i = 0; i < size; i++) {
final char nextChar = stringSet.charAt(RAN.nextInt(stringSet.length()));
buff.append(nextChar);
}
return buff.toString();
} | [
"public",
"static",
"String",
"getRandomString",
"(",
"final",
"int",
"size",
",",
"final",
"String",
"stringSet",
")",
"{",
"final",
"StringBuilder",
"buff",
"=",
"new",
"StringBuilder",
"(",
"size",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",... | Creates a size byte long unicode string. All codes are from the set "stringSet"
@param size
number of characters in the return string
@param stringSet
set of characters used for string creation
@return a random string build from "stringSet" | [
"Creates",
"a",
"size",
"byte",
"long",
"unicode",
"string",
".",
"All",
"codes",
"are",
"from",
"the",
"set",
"stringSet"
] | train | https://github.com/oglimmer/utils/blob/bc46c57a24e60c9dbda4c73a810c163b0ce407ea/src/main/java/de/oglimmer/utils/random/RandomString.java#L77-L86 |
Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/server/ServerBuilder.java | ServerBuilder.setIcon | public ServerBuilder setIcon(InputStream icon, String fileType) {
"""
Sets the server's icon.
@param icon The icon of the server.
@param fileType The type of the icon, e.g. "png" or "jpg".
@return The current instance in order to chain call methods.
"""
delegate.setIcon(icon, fileType);
re... | java | public ServerBuilder setIcon(InputStream icon, String fileType) {
delegate.setIcon(icon, fileType);
return this;
} | [
"public",
"ServerBuilder",
"setIcon",
"(",
"InputStream",
"icon",
",",
"String",
"fileType",
")",
"{",
"delegate",
".",
"setIcon",
"(",
"icon",
",",
"fileType",
")",
";",
"return",
"this",
";",
"}"
] | Sets the server's icon.
@param icon The icon of the server.
@param fileType The type of the icon, e.g. "png" or "jpg".
@return The current instance in order to chain call methods. | [
"Sets",
"the",
"server",
"s",
"icon",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/server/ServerBuilder.java#L201-L204 |
BotMill/fb-botmill | src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/ActionResponseBuilder.java | ActionResponseBuilder.build | public FbBotMillResponse build(MessageEnvelope envelope) {
"""
{@inheritDoc} It returns a {@link FbBotMillActionResponse} with the
{@link TypingAction} to perform.
"""
User recipient = getRecipient(envelope);
return new FbBotMillActionResponse(recipient, action);
} | java | public FbBotMillResponse build(MessageEnvelope envelope) {
User recipient = getRecipient(envelope);
return new FbBotMillActionResponse(recipient, action);
} | [
"public",
"FbBotMillResponse",
"build",
"(",
"MessageEnvelope",
"envelope",
")",
"{",
"User",
"recipient",
"=",
"getRecipient",
"(",
"envelope",
")",
";",
"return",
"new",
"FbBotMillActionResponse",
"(",
"recipient",
",",
"action",
")",
";",
"}"
] | {@inheritDoc} It returns a {@link FbBotMillActionResponse} with the
{@link TypingAction} to perform. | [
"{"
] | train | https://github.com/BotMill/fb-botmill/blob/d94da3615a7339822c137ef75c92a03d791ee969/src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/ActionResponseBuilder.java#L63-L66 |
tvesalainen/util | util/src/main/java/org/vesalainen/math/Vectors.java | Vectors.areAligned | public static final boolean areAligned(double ox, double oy, double x1, double y1, double x2, double y2) {
"""
Returns true if vectors (x1, y1) and (x2, y2) are aligned (ox, oy) centered
coordinate.
@param ox
@param oy
@param x1
@param y1
@param x2
@param y2
@return
"""
return areAligned(x1-ox... | java | public static final boolean areAligned(double ox, double oy, double x1, double y1, double x2, double y2)
{
return areAligned(x1-ox, y1-oy, x2-ox, y2-oy);
} | [
"public",
"static",
"final",
"boolean",
"areAligned",
"(",
"double",
"ox",
",",
"double",
"oy",
",",
"double",
"x1",
",",
"double",
"y1",
",",
"double",
"x2",
",",
"double",
"y2",
")",
"{",
"return",
"areAligned",
"(",
"x1",
"-",
"ox",
",",
"y1",
"-"... | Returns true if vectors (x1, y1) and (x2, y2) are aligned (ox, oy) centered
coordinate.
@param ox
@param oy
@param x1
@param y1
@param x2
@param y2
@return | [
"Returns",
"true",
"if",
"vectors",
"(",
"x1",
"y1",
")",
"and",
"(",
"x2",
"y2",
")",
"are",
"aligned",
"(",
"ox",
"oy",
")",
"centered",
"coordinate",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/Vectors.java#L91-L94 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java | UCharacter.getStringPropertyValue | @Deprecated
///CLOVER:OFF
public static String getStringPropertyValue(int propertyEnum, int codepoint, int nameChoice) {
"""
<strong>[icu]</strong> Returns a string version of the property value.
@param propertyEnum The property enum value.
@param codepoint The codepoint value.
@param nameChoice The cho... | java | @Deprecated
///CLOVER:OFF
public static String getStringPropertyValue(int propertyEnum, int codepoint, int nameChoice) {
if ((propertyEnum >= UProperty.BINARY_START && propertyEnum < UProperty.BINARY_LIMIT) ||
(propertyEnum >= UProperty.INT_START && propertyEnum < UProperty.INT_LIMIT)) {... | [
"@",
"Deprecated",
"///CLOVER:OFF",
"public",
"static",
"String",
"getStringPropertyValue",
"(",
"int",
"propertyEnum",
",",
"int",
"codepoint",
",",
"int",
"nameChoice",
")",
"{",
"if",
"(",
"(",
"propertyEnum",
">=",
"UProperty",
".",
"BINARY_START",
"&&",
"pr... | <strong>[icu]</strong> Returns a string version of the property value.
@param propertyEnum The property enum value.
@param codepoint The codepoint value.
@param nameChoice The choice of the name.
@return value as string
@deprecated This API is ICU internal only.
@hide original deprecated declaration
@hide draft / provi... | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Returns",
"a",
"string",
"version",
"of",
"the",
"property",
"value",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java#L5100-L5128 |
mgm-tp/jfunk | jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/ResourceLoader.java | ResourceLoader.getConfigBufferedReader | public static BufferedReader getConfigBufferedReader(final String resource, final String encoding) throws IOException {
"""
Loads a resource as {@link BufferedReader} relative {@link #getConfigDir()}.
@param resource
The resource to be loaded.
@param encoding
The encoding to use
@return The reader
"""
... | java | public static BufferedReader getConfigBufferedReader(final String resource, final String encoding) throws IOException {
return new BufferedReader(getConfigInputStreamReader(resource, encoding));
} | [
"public",
"static",
"BufferedReader",
"getConfigBufferedReader",
"(",
"final",
"String",
"resource",
",",
"final",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"return",
"new",
"BufferedReader",
"(",
"getConfigInputStreamReader",
"(",
"resource",
",",
"enc... | Loads a resource as {@link BufferedReader} relative {@link #getConfigDir()}.
@param resource
The resource to be loaded.
@param encoding
The encoding to use
@return The reader | [
"Loads",
"a",
"resource",
"as",
"{",
"@link",
"BufferedReader",
"}",
"relative",
"{",
"@link",
"#getConfigDir",
"()",
"}",
"."
] | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/ResourceLoader.java#L129-L131 |
eclipse/xtext-core | org.eclipse.xtext.ide/xtend-gen/org/eclipse/xtext/ide/editor/contentassist/IdeContentProposalCreator.java | IdeContentProposalCreator.createProposal | public ContentAssistEntry createProposal(final String proposal, final ContentAssistContext context, final Procedure1<? super ContentAssistEntry> init) {
"""
Returns an entry with the given proposal and the prefix from the context, or null if the proposal is not valid.
If it is valid, the initializer function is a... | java | public ContentAssistEntry createProposal(final String proposal, final ContentAssistContext context, final Procedure1<? super ContentAssistEntry> init) {
return this.createProposal(proposal, context.getPrefix(), context, ContentAssistEntry.KIND_UNKNOWN, init);
} | [
"public",
"ContentAssistEntry",
"createProposal",
"(",
"final",
"String",
"proposal",
",",
"final",
"ContentAssistContext",
"context",
",",
"final",
"Procedure1",
"<",
"?",
"super",
"ContentAssistEntry",
">",
"init",
")",
"{",
"return",
"this",
".",
"createProposal"... | Returns an entry with the given proposal and the prefix from the context, or null if the proposal is not valid.
If it is valid, the initializer function is applied to it. | [
"Returns",
"an",
"entry",
"with",
"the",
"given",
"proposal",
"and",
"the",
"prefix",
"from",
"the",
"context",
"or",
"null",
"if",
"the",
"proposal",
"is",
"not",
"valid",
".",
"If",
"it",
"is",
"valid",
"the",
"initializer",
"function",
"is",
"applied",
... | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext.ide/xtend-gen/org/eclipse/xtext/ide/editor/contentassist/IdeContentProposalCreator.java#L55-L57 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/JimfsFileSystems.java | JimfsFileSystems.newFileSystem | public static JimfsFileSystem newFileSystem(
JimfsFileSystemProvider provider, URI uri, Configuration config) throws IOException {
"""
Initialize and configure a new file system with the given provider and URI, using the given
configuration.
"""
PathService pathService = new PathService(config);
... | java | public static JimfsFileSystem newFileSystem(
JimfsFileSystemProvider provider, URI uri, Configuration config) throws IOException {
PathService pathService = new PathService(config);
FileSystemState state = new FileSystemState(removeFileSystemRunnable(uri));
JimfsFileStore fileStore = createFileStore(... | [
"public",
"static",
"JimfsFileSystem",
"newFileSystem",
"(",
"JimfsFileSystemProvider",
"provider",
",",
"URI",
"uri",
",",
"Configuration",
"config",
")",
"throws",
"IOException",
"{",
"PathService",
"pathService",
"=",
"new",
"PathService",
"(",
"config",
")",
";"... | Initialize and configure a new file system with the given provider and URI, using the given
configuration. | [
"Initialize",
"and",
"configure",
"a",
"new",
"file",
"system",
"with",
"the",
"given",
"provider",
"and",
"URI",
"using",
"the",
"given",
"configuration",
"."
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/JimfsFileSystems.java#L68-L82 |
m-m-m/util | datatype/src/main/java/net/sf/mmm/util/datatype/api/color/GenericColor.java | GenericColor.valueOf | public static GenericColor valueOf(Hue hue, Saturation saturation, Lightness lightness, Alpha alpha) {
"""
Creates a {@link GenericColor} from the given {@link Segment}s of {@link ColorModel#HSL}.
@param hue is the {@link Hue} part.
@param saturation is the {@link Saturation} part.
@param lightness is the {@l... | java | public static GenericColor valueOf(Hue hue, Saturation saturation, Lightness lightness, Alpha alpha) {
Objects.requireNonNull(hue, "hue");
Objects.requireNonNull(saturation, "saturation");
Objects.requireNonNull(lightness, "lightness");
Objects.requireNonNull(alpha, "alpha");
GenericColor genericCo... | [
"public",
"static",
"GenericColor",
"valueOf",
"(",
"Hue",
"hue",
",",
"Saturation",
"saturation",
",",
"Lightness",
"lightness",
",",
"Alpha",
"alpha",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"hue",
",",
"\"hue\"",
")",
";",
"Objects",
".",
"requir... | Creates a {@link GenericColor} from the given {@link Segment}s of {@link ColorModel#HSL}.
@param hue is the {@link Hue} part.
@param saturation is the {@link Saturation} part.
@param lightness is the {@link Lightness} part.
@param alpha is the {@link Alpha} value.
@return the {@link GenericColor}. | [
"Creates",
"a",
"{",
"@link",
"GenericColor",
"}",
"from",
"the",
"given",
"{",
"@link",
"Segment",
"}",
"s",
"of",
"{",
"@link",
"ColorModel#HSL",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/datatype/src/main/java/net/sf/mmm/util/datatype/api/color/GenericColor.java#L296-L326 |
Coveros/selenified | src/main/java/com/coveros/selenified/element/check/azzert/AssertMatches.java | AssertMatches.text | public void text(int row, int col, String pattern) {
"""
Asserts that the element's pattern in a particular cell matches the regular expression
pattern provided. If the element isn't present, or a table, this will
constitute a failure, same as a mismatch. This information will be logged
and recorded, with a scr... | java | public void text(int row, int col, String pattern) {
String text = checkText(row, col, pattern, 0, 0);
assertNotNull(NO_ELEMENT_FOUND, text);
assertTrue("Text Mismatch: text of '" + text + DOES_NOT_MATCH_PATTERN + pattern + "'", text.matches(pattern));
} | [
"public",
"void",
"text",
"(",
"int",
"row",
",",
"int",
"col",
",",
"String",
"pattern",
")",
"{",
"String",
"text",
"=",
"checkText",
"(",
"row",
",",
"col",
",",
"pattern",
",",
"0",
",",
"0",
")",
";",
"assertNotNull",
"(",
"NO_ELEMENT_FOUND",
",... | Asserts that the element's pattern in a particular cell matches the regular expression
pattern provided. If the element isn't present, or a table, this will
constitute a failure, same as a mismatch. This information will be logged
and recorded, with a screenshot for traceability and added debugging
support.
@param row... | [
"Asserts",
"that",
"the",
"element",
"s",
"pattern",
"in",
"a",
"particular",
"cell",
"matches",
"the",
"regular",
"expression",
"pattern",
"provided",
".",
"If",
"the",
"element",
"isn",
"t",
"present",
"or",
"a",
"table",
"this",
"will",
"constitute",
"a",... | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/check/azzert/AssertMatches.java#L104-L108 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker.java | WebSocketServerHandshaker.close | public ChannelFuture close(Channel channel, CloseWebSocketFrame frame, ChannelPromise promise) {
"""
Performs the closing handshake
@param channel
Channel
@param frame
Closing Frame that was received
@param promise
the {@link ChannelPromise} to be notified when the closing handshake is done
"""
... | java | public ChannelFuture close(Channel channel, CloseWebSocketFrame frame, ChannelPromise promise) {
if (channel == null) {
throw new NullPointerException("channel");
}
return channel.writeAndFlush(frame, promise).addListener(ChannelFutureListener.CLOSE);
} | [
"public",
"ChannelFuture",
"close",
"(",
"Channel",
"channel",
",",
"CloseWebSocketFrame",
"frame",
",",
"ChannelPromise",
"promise",
")",
"{",
"if",
"(",
"channel",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"channel\"",
")",
";",
... | Performs the closing handshake
@param channel
Channel
@param frame
Closing Frame that was received
@param promise
the {@link ChannelPromise} to be notified when the closing handshake is done | [
"Performs",
"the",
"closing",
"handshake"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker.java#L327-L332 |
jenkinsci/jenkins | core/src/main/java/hudson/tasks/BuildTrigger.java | BuildTrigger.execute | public static boolean execute(AbstractBuild build, BuildListener listener) {
"""
Convenience method to trigger downstream builds.
@param build
The current build. Its downstreams will be triggered.
@param listener
Receives the progress report.
"""
PrintStream logger = listener.getLogger();
... | java | public static boolean execute(AbstractBuild build, BuildListener listener) {
PrintStream logger = listener.getLogger();
// Check all downstream Project of the project, not just those defined by BuildTrigger
// TODO this may not yet be up to date if rebuildDependencyGraphAsync has been used; need... | [
"public",
"static",
"boolean",
"execute",
"(",
"AbstractBuild",
"build",
",",
"BuildListener",
"listener",
")",
"{",
"PrintStream",
"logger",
"=",
"listener",
".",
"getLogger",
"(",
")",
";",
"// Check all downstream Project of the project, not just those defined by BuildTr... | Convenience method to trigger downstream builds.
@param build
The current build. Its downstreams will be triggered.
@param listener
Receives the progress report. | [
"Convenience",
"method",
"to",
"trigger",
"downstream",
"builds",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/tasks/BuildTrigger.java#L254-L291 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.