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 |
|---|---|---|---|---|---|---|---|---|---|---|
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/framework/Domain.java | Domain.chooseValue | public Object chooseValue(String vcf) throws IllegalValueChoiceFunction {
"""
Choose a value from this {@link Domain} according to the given {@link ValueChoiceFunction} identifier.
@param vcf A {@link ValueChoiceFunction} function identifier.
@return A value chosen according to the given {@link ValueChoiceFuncti... | java | public Object chooseValue(String vcf) throws IllegalValueChoiceFunction {
if (!valueChoiceFunctions.containsKey(this.getClass())) throw new Error ("No value choice function defined for domains fo type " + this.getClass().getSimpleName());
HashMap<String,ValueChoiceFunction> vcfs = valueChoiceFunctions.get(this.ge... | [
"public",
"Object",
"chooseValue",
"(",
"String",
"vcf",
")",
"throws",
"IllegalValueChoiceFunction",
"{",
"if",
"(",
"!",
"valueChoiceFunctions",
".",
"containsKey",
"(",
"this",
".",
"getClass",
"(",
")",
")",
")",
"throw",
"new",
"Error",
"(",
"\"No value c... | Choose a value from this {@link Domain} according to the given {@link ValueChoiceFunction} identifier.
@param vcf A {@link ValueChoiceFunction} function identifier.
@return A value chosen according to the given {@link ValueChoiceFunction}.
@throws IllegalValueChoiceFunction | [
"Choose",
"a",
"value",
"from",
"this",
"{"
] | train | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/framework/Domain.java#L82-L89 |
joniles/mpxj | src/main/java/net/sf/mpxj/primavera/PrimaveraReader.java | PrimaveraReader.populateUserDefinedFieldValues | private void populateUserDefinedFieldValues(String tableName, FieldTypeClass type, FieldContainer container, Integer uniqueID) {
"""
Populate the UDF values for this entity.
@param tableName parent table name
@param type entity type
@param container entity
@param uniqueID entity Unique ID
"""
Map<I... | java | private void populateUserDefinedFieldValues(String tableName, FieldTypeClass type, FieldContainer container, Integer uniqueID)
{
Map<Integer, List<Row>> tableData = m_udfValues.get(tableName);
if (tableData != null)
{
List<Row> udf = tableData.get(uniqueID);
if (udf != null)
... | [
"private",
"void",
"populateUserDefinedFieldValues",
"(",
"String",
"tableName",
",",
"FieldTypeClass",
"type",
",",
"FieldContainer",
"container",
",",
"Integer",
"uniqueID",
")",
"{",
"Map",
"<",
"Integer",
",",
"List",
"<",
"Row",
">",
">",
"tableData",
"=",
... | Populate the UDF values for this entity.
@param tableName parent table name
@param type entity type
@param container entity
@param uniqueID entity Unique ID | [
"Populate",
"the",
"UDF",
"values",
"for",
"this",
"entity",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraReader.java#L951-L965 |
netceteragroup/valdr-bean-validation | valdr-bean-validation/src/main/java/com/github/valdr/thirdparty/spring/AnnotationUtils.java | AnnotationUtils.getAnnotation | public static <T extends Annotation> T getAnnotation(AnnotatedElement ae, Class<T> annotationType) {
"""
Get a single {@link java.lang.annotation.Annotation} of {@code annotationType} from the supplied
Method, Constructor or Field. Meta-annotations will be searched if the annotation
is not declared locally on th... | java | public static <T extends Annotation> T getAnnotation(AnnotatedElement ae, Class<T> annotationType) {
T ann = ae.getAnnotation(annotationType);
if (ann == null) {
for (Annotation metaAnn : ae.getAnnotations()) {
ann = metaAnn.annotationType().getAnnotation(annotationType);
if (ann != null) ... | [
"public",
"static",
"<",
"T",
"extends",
"Annotation",
">",
"T",
"getAnnotation",
"(",
"AnnotatedElement",
"ae",
",",
"Class",
"<",
"T",
">",
"annotationType",
")",
"{",
"T",
"ann",
"=",
"ae",
".",
"getAnnotation",
"(",
"annotationType",
")",
";",
"if",
... | Get a single {@link java.lang.annotation.Annotation} of {@code annotationType} from the supplied
Method, Constructor or Field. Meta-annotations will be searched if the annotation
is not declared locally on the supplied element.
@param ae the Method, Constructor or Field from which to get the annotation
@param annotatio... | [
"Get",
"a",
"single",
"{"
] | train | https://github.com/netceteragroup/valdr-bean-validation/blob/3f49f1357c575a11331be2de867cf47809a83823/valdr-bean-validation/src/main/java/com/github/valdr/thirdparty/spring/AnnotationUtils.java#L69-L80 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.readString | public static String readString(File file, String charsetName) throws IORuntimeException {
"""
读取文件内容
@param file 文件
@param charsetName 字符集
@return 内容
@throws IORuntimeException IO异常
"""
return readString(file, CharsetUtil.charset(charsetName));
} | java | public static String readString(File file, String charsetName) throws IORuntimeException {
return readString(file, CharsetUtil.charset(charsetName));
} | [
"public",
"static",
"String",
"readString",
"(",
"File",
"file",
",",
"String",
"charsetName",
")",
"throws",
"IORuntimeException",
"{",
"return",
"readString",
"(",
"file",
",",
"CharsetUtil",
".",
"charset",
"(",
"charsetName",
")",
")",
";",
"}"
] | 读取文件内容
@param file 文件
@param charsetName 字符集
@return 内容
@throws IORuntimeException IO异常 | [
"读取文件内容"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2090-L2092 |
alkacon/opencms-core | src/org/opencms/ui/favorites/CmsFavoriteDialog.java | CmsFavoriteDialog.getSite | private String getSite(CmsObject cms, CmsFavoriteEntry entry) {
"""
Gets the site label for the entry.
@param cms the current CMS context
@param entry the entry
@return the site label for the entry
"""
CmsSite site = OpenCms.getSiteManager().getSiteForRootPath(entry.getSiteRoot());
Item i... | java | private String getSite(CmsObject cms, CmsFavoriteEntry entry) {
CmsSite site = OpenCms.getSiteManager().getSiteForRootPath(entry.getSiteRoot());
Item item = m_sitesContainer.getItem(entry.getSiteRoot());
if (item != null) {
return (String)(item.getItemProperty("caption").getValue())... | [
"private",
"String",
"getSite",
"(",
"CmsObject",
"cms",
",",
"CmsFavoriteEntry",
"entry",
")",
"{",
"CmsSite",
"site",
"=",
"OpenCms",
".",
"getSiteManager",
"(",
")",
".",
"getSiteForRootPath",
"(",
"entry",
".",
"getSiteRoot",
"(",
")",
")",
";",
"Item",
... | Gets the site label for the entry.
@param cms the current CMS context
@param entry the entry
@return the site label for the entry | [
"Gets",
"the",
"site",
"label",
"for",
"the",
"entry",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/favorites/CmsFavoriteDialog.java#L393-L407 |
auth0/Lock.Android | lib/src/main/java/com/auth0/android/lock/views/ViewUtils.java | ViewUtils.getRoundedBackground | static ShapeDrawable getRoundedBackground(@NonNull View view, @ColorInt int color, @Corners int corners) {
"""
Generates a rounded drawable with the given background color and the specified corners.
@param view a valid View context
@param color the color to use as background.
@param corners the rounded c... | java | static ShapeDrawable getRoundedBackground(@NonNull View view, @ColorInt int color, @Corners int corners) {
int r = view.getResources().getDimensionPixelSize(R.dimen.com_auth0_lock_widget_corner_radius);
float[] outerR = new float[0];
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSI... | [
"static",
"ShapeDrawable",
"getRoundedBackground",
"(",
"@",
"NonNull",
"View",
"view",
",",
"@",
"ColorInt",
"int",
"color",
",",
"@",
"Corners",
"int",
"corners",
")",
"{",
"int",
"r",
"=",
"view",
".",
"getResources",
"(",
")",
".",
"getDimensionPixelSize... | Generates a rounded drawable with the given background color and the specified corners.
@param view a valid View context
@param color the color to use as background.
@param corners the rounded corners this drawable will have. Can be one of ONLY_LEFT, ONLY_RIGHT, ALL
@return the rounded drawable. | [
"Generates",
"a",
"rounded",
"drawable",
"with",
"the",
"given",
"background",
"color",
"and",
"the",
"specified",
"corners",
"."
] | train | https://github.com/auth0/Lock.Android/blob/8eb2a979048d2eb6cf0ec631e82e6c3fe6e7d220/lib/src/main/java/com/auth0/android/lock/views/ViewUtils.java#L87-L113 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/sampling/ReservoirItemsUnion.java | ReservoirItemsUnion.update | public void update(final long n, final int k, final ArrayList<T> input) {
"""
Present this union with raw elements of a sketch. Useful when operating in a distributed
environment like Pig Latin scripts, where an explicit SerDe may be overly complicated but
keeping raw values is simple. Values are <em>not</em> co... | java | public void update(final long n, final int k, final ArrayList<T> input) {
ReservoirItemsSketch<T> ris = ReservoirItemsSketch.newInstance(input, n,
ResizeFactor.X8, k); // forcing a resize factor
ris = (ris.getK() <= maxK_ ? ris : ris.downsampledCopy(maxK_));
if (gadget_ == null) {
createN... | [
"public",
"void",
"update",
"(",
"final",
"long",
"n",
",",
"final",
"int",
"k",
",",
"final",
"ArrayList",
"<",
"T",
">",
"input",
")",
"{",
"ReservoirItemsSketch",
"<",
"T",
">",
"ris",
"=",
"ReservoirItemsSketch",
".",
"newInstance",
"(",
"input",
","... | Present this union with raw elements of a sketch. Useful when operating in a distributed
environment like Pig Latin scripts, where an explicit SerDe may be overly complicated but
keeping raw values is simple. Values are <em>not</em> copied and the input array may be
modified.
@param n Total items seen
@param k Reservo... | [
"Present",
"this",
"union",
"with",
"raw",
"elements",
"of",
"a",
"sketch",
".",
"Useful",
"when",
"operating",
"in",
"a",
"distributed",
"environment",
"like",
"Pig",
"Latin",
"scripts",
"where",
"an",
"explicit",
"SerDe",
"may",
"be",
"overly",
"complicated"... | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/sampling/ReservoirItemsUnion.java#L201-L211 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/style/Color.java | Color.setColor | public void setColor(float red, float green, float blue) {
"""
Set the color with arithmetic RGB values
@param red
red float color inclusively between 0.0 and 1.0
@param green
green float color inclusively between 0.0 and 1.0
@param blue
blue float color inclusively between 0.0 and 1.0
"""
setRed(red... | java | public void setColor(float red, float green, float blue) {
setRed(red);
setGreen(green);
setBlue(blue);
} | [
"public",
"void",
"setColor",
"(",
"float",
"red",
",",
"float",
"green",
",",
"float",
"blue",
")",
"{",
"setRed",
"(",
"red",
")",
";",
"setGreen",
"(",
"green",
")",
";",
"setBlue",
"(",
"blue",
")",
";",
"}"
] | Set the color with arithmetic RGB values
@param red
red float color inclusively between 0.0 and 1.0
@param green
green float color inclusively between 0.0 and 1.0
@param blue
blue float color inclusively between 0.0 and 1.0 | [
"Set",
"the",
"color",
"with",
"arithmetic",
"RGB",
"values"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/style/Color.java#L391-L395 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/wrapper/PAbstractObject.java | PAbstractObject.getDouble | @Override
public final double getDouble(final String key) {
"""
Get a property as a double or throw an exception.
@param key the property name
"""
Double result = optDouble(key);
if (result == null) {
throw new ObjectMissingException(this, key);
}
return resul... | java | @Override
public final double getDouble(final String key) {
Double result = optDouble(key);
if (result == null) {
throw new ObjectMissingException(this, key);
}
return result;
} | [
"@",
"Override",
"public",
"final",
"double",
"getDouble",
"(",
"final",
"String",
"key",
")",
"{",
"Double",
"result",
"=",
"optDouble",
"(",
"key",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"throw",
"new",
"ObjectMissingException",
"(",
"t... | Get a property as a double or throw an exception.
@param key the property name | [
"Get",
"a",
"property",
"as",
"a",
"double",
"or",
"throw",
"an",
"exception",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/wrapper/PAbstractObject.java#L102-L109 |
cloudfoundry/uaa | server/src/main/java/org/cloudfoundry/identity/uaa/oauth/beans/org/springframework/security/oauth2/provider/endpoint/DefaultRedirectResolver.java | DefaultRedirectResolver.obtainMatchingRedirect | private String obtainMatchingRedirect(Set<String> redirectUris, String requestedRedirect) {
"""
Attempt to match one of the registered URIs to the that of the requested one.
@param redirectUris the set of the registered URIs to try and find a match. This cannot be null or empty.
@param requestedRedirect the UR... | java | private String obtainMatchingRedirect(Set<String> redirectUris, String requestedRedirect) {
Assert.notEmpty(redirectUris, "Redirect URIs cannot be empty");
if (redirectUris.size() == 1 && requestedRedirect == null) {
return redirectUris.iterator().next();
}
for (String redir... | [
"private",
"String",
"obtainMatchingRedirect",
"(",
"Set",
"<",
"String",
">",
"redirectUris",
",",
"String",
"requestedRedirect",
")",
"{",
"Assert",
".",
"notEmpty",
"(",
"redirectUris",
",",
"\"Redirect URIs cannot be empty\"",
")",
";",
"if",
"(",
"redirectUris"... | Attempt to match one of the registered URIs to the that of the requested one.
@param redirectUris the set of the registered URIs to try and find a match. This cannot be null or empty.
@param requestedRedirect the URI used as part of the request
@return the matching URI
@throws RedirectMismatchException if no match was... | [
"Attempt",
"to",
"match",
"one",
"of",
"the",
"registered",
"URIs",
"to",
"the",
"that",
"of",
"the",
"requested",
"one",
"."
] | train | https://github.com/cloudfoundry/uaa/blob/e8df3d7060580c92d33461106399f9e4f36e3cd2/server/src/main/java/org/cloudfoundry/identity/uaa/oauth/beans/org/springframework/security/oauth2/provider/endpoint/DefaultRedirectResolver.java#L176-L189 |
auth0/auth0-java | src/main/java/com/auth0/client/mgmt/GuardianEntity.java | GuardianEntity.resetSNSFactorProvider | public Request<SNSFactorProvider> resetSNSFactorProvider() {
"""
Reset Guardian's SNS push-notification Factor Provider to the defaults.
A token with scope update:guardian_factors is needed.
@return a Request to execute.
@see <a href="https://auth0.com/docs/api/management/v2#!/Guardian/put_sns">Management API... | java | public Request<SNSFactorProvider> resetSNSFactorProvider() {
return updateSNSFactorProvider(new SNSFactorProvider(null, null, null, null, null));
} | [
"public",
"Request",
"<",
"SNSFactorProvider",
">",
"resetSNSFactorProvider",
"(",
")",
"{",
"return",
"updateSNSFactorProvider",
"(",
"new",
"SNSFactorProvider",
"(",
"null",
",",
"null",
",",
"null",
",",
"null",
",",
"null",
")",
")",
";",
"}"
] | Reset Guardian's SNS push-notification Factor Provider to the defaults.
A token with scope update:guardian_factors is needed.
@return a Request to execute.
@see <a href="https://auth0.com/docs/api/management/v2#!/Guardian/put_sns">Management API2 docs</a> | [
"Reset",
"Guardian",
"s",
"SNS",
"push",
"-",
"notification",
"Factor",
"Provider",
"to",
"the",
"defaults",
".",
"A",
"token",
"with",
"scope",
"update",
":",
"guardian_factors",
"is",
"needed",
"."
] | train | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/client/mgmt/GuardianEntity.java#L253-L255 |
jmeter-maven-plugin/jmeter-maven-plugin | src/main/java/com/lazerycode/jmeter/mojo/ConfigureJMeterMojo.java | ConfigureJMeterMojo.copyExplicitLibraries | private void copyExplicitLibraries(List<String> desiredArtifacts, File destination, boolean downloadDependencies) throws MojoExecutionException {
"""
Copy a list of libraries to a specific folder.
@param desiredArtifacts A list of artifacts
@param destination A destination folder to copy these art... | java | private void copyExplicitLibraries(List<String> desiredArtifacts, File destination, boolean downloadDependencies) throws MojoExecutionException {
for (String desiredArtifact : desiredArtifacts) {
copyExplicitLibrary(desiredArtifact, destination, downloadDependencies);
}
} | [
"private",
"void",
"copyExplicitLibraries",
"(",
"List",
"<",
"String",
">",
"desiredArtifacts",
",",
"File",
"destination",
",",
"boolean",
"downloadDependencies",
")",
"throws",
"MojoExecutionException",
"{",
"for",
"(",
"String",
"desiredArtifact",
":",
"desiredArt... | Copy a list of libraries to a specific folder.
@param desiredArtifacts A list of artifacts
@param destination A destination folder to copy these artifacts to
@param downloadDependencies Do we download dependencies
@throws MojoExecutionException MojoExecutionException | [
"Copy",
"a",
"list",
"of",
"libraries",
"to",
"a",
"specific",
"folder",
"."
] | train | https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/blob/63dc8b49cc6b9542deb681e25a2ada6025ddbf6b/src/main/java/com/lazerycode/jmeter/mojo/ConfigureJMeterMojo.java#L464-L468 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermListsImpl.java | ListManagementTermListsImpl.createAsync | public Observable<TermList> createAsync(String contentType, BodyModel bodyParameter) {
"""
Creates a Term List.
@param contentType The content type.
@param bodyParameter Schema of the body.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the TermList object... | java | public Observable<TermList> createAsync(String contentType, BodyModel bodyParameter) {
return createWithServiceResponseAsync(contentType, bodyParameter).map(new Func1<ServiceResponse<TermList>, TermList>() {
@Override
public TermList call(ServiceResponse<TermList> response) {
... | [
"public",
"Observable",
"<",
"TermList",
">",
"createAsync",
"(",
"String",
"contentType",
",",
"BodyModel",
"bodyParameter",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"contentType",
",",
"bodyParameter",
")",
".",
"map",
"(",
"new",
"Func1",
"<",... | Creates a Term List.
@param contentType The content type.
@param bodyParameter Schema of the body.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the TermList object | [
"Creates",
"a",
"Term",
"List",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermListsImpl.java#L372-L379 |
alkacon/opencms-core | src/org/opencms/ade/configuration/formatters/CmsFormatterConfigurationCache.java | CmsFormatterConfigurationCache.checkIfUpdateIsNeeded | private void checkIfUpdateIsNeeded(CmsUUID structureId, String path, int resourceType) {
"""
Checks if an update of the formatter is needed and if so, adds its structure id to the update set.<p>
@param structureId the structure id of the formatter
@param path the path of the formatter
@param resourceType the ... | java | private void checkIfUpdateIsNeeded(CmsUUID structureId, String path, int resourceType) {
if (CmsResource.isTemporaryFileName(path)) {
return;
}
CmsResourceManager manager = OpenCms.getResourceManager();
if (manager.matchResourceType(TYPE_SETTINGS_CONFIG, resourceType)) {
... | [
"private",
"void",
"checkIfUpdateIsNeeded",
"(",
"CmsUUID",
"structureId",
",",
"String",
"path",
",",
"int",
"resourceType",
")",
"{",
"if",
"(",
"CmsResource",
".",
"isTemporaryFileName",
"(",
"path",
")",
")",
"{",
"return",
";",
"}",
"CmsResourceManager",
... | Checks if an update of the formatter is needed and if so, adds its structure id to the update set.<p>
@param structureId the structure id of the formatter
@param path the path of the formatter
@param resourceType the resource type | [
"Checks",
"if",
"an",
"update",
"of",
"the",
"formatter",
"is",
"needed",
"and",
"if",
"so",
"adds",
"its",
"structure",
"id",
"to",
"the",
"update",
"set",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/formatters/CmsFormatterConfigurationCache.java#L368-L389 |
eyp/serfj | src/main/java/net/sf/serfj/UrlInspector.java | UrlInspector.isMainId | private Boolean isMainId(String id, String resource, String lastElement) {
"""
Checks if is the main id, or it is a secondary id.
@param id
Current id.
@param resource
Current resource.
@param lastElement
Last element of the URL.
@return true if is the main id, false otherwise.
"""
Boolean isMainId ... | java | private Boolean isMainId(String id, String resource, String lastElement) {
Boolean isMainId = false;
if (id == null) {
if (!utils.singularize(utils.cleanURL(lastElement)).equals(resource) && resource == null) {
isMainId = true;
}
}
return isMainId;
} | [
"private",
"Boolean",
"isMainId",
"(",
"String",
"id",
",",
"String",
"resource",
",",
"String",
"lastElement",
")",
"{",
"Boolean",
"isMainId",
"=",
"false",
";",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"if",
"(",
"!",
"utils",
".",
"singularize",
"(... | Checks if is the main id, or it is a secondary id.
@param id
Current id.
@param resource
Current resource.
@param lastElement
Last element of the URL.
@return true if is the main id, false otherwise. | [
"Checks",
"if",
"is",
"the",
"main",
"id",
"or",
"it",
"is",
"a",
"secondary",
"id",
"."
] | train | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/UrlInspector.java#L117-L125 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_ripe_GET | public OvhRipeInfos ip_ripe_GET(String ip) throws IOException {
"""
Get this object properties
REST: GET /ip/{ip}/ripe
@param ip [required]
"""
String qPath = "/ip/{ip}/ripe";
StringBuilder sb = path(qPath, ip);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhRipeIn... | java | public OvhRipeInfos ip_ripe_GET(String ip) throws IOException {
String qPath = "/ip/{ip}/ripe";
StringBuilder sb = path(qPath, ip);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhRipeInfos.class);
} | [
"public",
"OvhRipeInfos",
"ip_ripe_GET",
"(",
"String",
"ip",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}/ripe\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"ip",
")",
";",
"String",
"resp",
"=",
"exec",
"(",
"q... | Get this object properties
REST: GET /ip/{ip}/ripe
@param ip [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L168-L173 |
spring-cloud/spring-cloud-contract | spring-cloud-contract-spec/src/main/groovy/repackaged/nl/flotsam/xeger/Xeger.java | Xeger.getRandomInt | static int getRandomInt(int min, int max, Random random) {
"""
Generates a random number within the given bounds.
@param min The minimum number (inclusive).
@param max The maximum number (inclusive).
@param random The object used as the randomizer.
@return A random number in the given range.
"""
// Use r... | java | static int getRandomInt(int min, int max, Random random) {
// Use random.nextInt as it guarantees a uniform distribution
int maxForRandom = max - min + 1;
return random.nextInt(maxForRandom) + min;
} | [
"static",
"int",
"getRandomInt",
"(",
"int",
"min",
",",
"int",
"max",
",",
"Random",
"random",
")",
"{",
"// Use random.nextInt as it guarantees a uniform distribution",
"int",
"maxForRandom",
"=",
"max",
"-",
"min",
"+",
"1",
";",
"return",
"random",
".",
"nex... | Generates a random number within the given bounds.
@param min The minimum number (inclusive).
@param max The maximum number (inclusive).
@param random The object used as the randomizer.
@return A random number in the given range. | [
"Generates",
"a",
"random",
"number",
"within",
"the",
"given",
"bounds",
"."
] | train | https://github.com/spring-cloud/spring-cloud-contract/blob/857da51950a87b393286e3bb1b2208c420c01087/spring-cloud-contract-spec/src/main/groovy/repackaged/nl/flotsam/xeger/Xeger.java#L94-L98 |
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java | XMLSerializer.writeDecimalAttribute | public void writeDecimalAttribute(String prefix, String namespaceURI, String localName, BigDecimal value) throws Exception {
"""
Write decimal attribute.
@param prefix the prefix
@param namespaceURI the namespace URI
@param localName the local name
@param value the value
@throws Exception the exception
... | java | public void writeDecimalAttribute(String prefix, String namespaceURI, String localName, BigDecimal value) throws Exception {
this.attribute(namespaceURI, localName, value.toPlainString());
} | [
"public",
"void",
"writeDecimalAttribute",
"(",
"String",
"prefix",
",",
"String",
"namespaceURI",
",",
"String",
"localName",
",",
"BigDecimal",
"value",
")",
"throws",
"Exception",
"{",
"this",
".",
"attribute",
"(",
"namespaceURI",
",",
"localName",
",",
"val... | Write decimal attribute.
@param prefix the prefix
@param namespaceURI the namespace URI
@param localName the local name
@param value the value
@throws Exception the exception | [
"Write",
"decimal",
"attribute",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L1644-L1646 |
alibaba/Tangram-Android | tangram/src/main/java/com/tmall/wireless/tangram/DefaultResolverRegistry.java | DefaultResolverRegistry.registerCell | public <V extends View> void registerCell(String type, @NonNull Class<? extends BaseCell> cellClz, @NonNull ViewHolderCreator viewHolderCreator) {
"""
register cell with custom model class and view creator
@param type
@param cellClz
@param viewHolderCreator
@param <V>
"""
viewHolderMap.put(type, vi... | java | public <V extends View> void registerCell(String type, @NonNull Class<? extends BaseCell> cellClz, @NonNull ViewHolderCreator viewHolderCreator) {
viewHolderMap.put(type, viewHolderCreator);
registerCell(type, cellClz, viewHolderCreator.viewClz);
} | [
"public",
"<",
"V",
"extends",
"View",
">",
"void",
"registerCell",
"(",
"String",
"type",
",",
"@",
"NonNull",
"Class",
"<",
"?",
"extends",
"BaseCell",
">",
"cellClz",
",",
"@",
"NonNull",
"ViewHolderCreator",
"viewHolderCreator",
")",
"{",
"viewHolderMap",
... | register cell with custom model class and view creator
@param type
@param cellClz
@param viewHolderCreator
@param <V> | [
"register",
"cell",
"with",
"custom",
"model",
"class",
"and",
"view",
"creator"
] | train | https://github.com/alibaba/Tangram-Android/blob/caa57f54e009c8dacd34a2322d5761956ebed321/tangram/src/main/java/com/tmall/wireless/tangram/DefaultResolverRegistry.java#L81-L84 |
jbundle/jbundle | model/base/src/main/java/org/jbundle/model/util/Util.java | Util.transferStream | public static void transferStream(Reader in, Writer out) {
"""
Transfer the data stream from in stream to out stream.
Note: This does not close the out stream.
@param in Stream in
@param out Stream out
"""
try {
char[] cbuf = new char[1000];
int iLen = 0;
while ((iLen... | java | public static void transferStream(Reader in, Writer out)
{
try {
char[] cbuf = new char[1000];
int iLen = 0;
while ((iLen = in.read(cbuf, 0, cbuf.length)) > 0)
{ // Write the entire file to the output buffer
out.write(cbuf, 0, iLen);
}
... | [
"public",
"static",
"void",
"transferStream",
"(",
"Reader",
"in",
",",
"Writer",
"out",
")",
"{",
"try",
"{",
"char",
"[",
"]",
"cbuf",
"=",
"new",
"char",
"[",
"1000",
"]",
";",
"int",
"iLen",
"=",
"0",
";",
"while",
"(",
"(",
"iLen",
"=",
"in"... | Transfer the data stream from in stream to out stream.
Note: This does not close the out stream.
@param in Stream in
@param out Stream out | [
"Transfer",
"the",
"data",
"stream",
"from",
"in",
"stream",
"to",
"out",
"stream",
".",
"Note",
":",
"This",
"does",
"not",
"close",
"the",
"out",
"stream",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/model/base/src/main/java/org/jbundle/model/util/Util.java#L434-L449 |
azkaban/azkaban | azkaban-web-server/src/main/java/azkaban/webapp/servlet/LoginAbstractAzkabanServlet.java | LoginAbstractAzkabanServlet.filterProjectByPermission | protected Project filterProjectByPermission(final Project project, final User user,
final Permission.Type type, final Map<String, Object> ret) {
"""
Filter Project based on user authorization
@param project project
@param user user
@param type permission allowance
@param ret return map for holding mess... | java | protected Project filterProjectByPermission(final Project project, final User user,
final Permission.Type type, final Map<String, Object> ret) {
if (project == null) {
if (ret != null) {
ret.put("error", "Project 'null' not found.");
}
} else if (!hasPermission(project, user, type)) {
... | [
"protected",
"Project",
"filterProjectByPermission",
"(",
"final",
"Project",
"project",
",",
"final",
"User",
"user",
",",
"final",
"Permission",
".",
"Type",
"type",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"ret",
")",
"{",
"if",
"(",
"pro... | Filter Project based on user authorization
@param project project
@param user user
@param type permission allowance
@param ret return map for holding messages
@return authorized project itself or null if the project is not authorized | [
"Filter",
"Project",
"based",
"on",
"user",
"authorization"
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/LoginAbstractAzkabanServlet.java#L420-L437 |
square/dagger | core/src/main/java/dagger/internal/Keys.java | Keys.getSetKey | public static String getSetKey(Type type, Annotation[] annotations, Object subject) {
"""
Returns a key for {@code type} annotated with {@code annotations},
wrapped by {@code Set}, reporting failures against {@code subject}.
@param annotations the annotations on a single method, field or parameter.
This array... | java | public static String getSetKey(Type type, Annotation[] annotations, Object subject) {
Annotation qualifier = extractQualifier(annotations, subject);
type = boxIfPrimitive(type);
StringBuilder result = new StringBuilder();
if (qualifier != null) {
result.append(qualifier).append("/");
}
res... | [
"public",
"static",
"String",
"getSetKey",
"(",
"Type",
"type",
",",
"Annotation",
"[",
"]",
"annotations",
",",
"Object",
"subject",
")",
"{",
"Annotation",
"qualifier",
"=",
"extractQualifier",
"(",
"annotations",
",",
"subject",
")",
";",
"type",
"=",
"bo... | Returns a key for {@code type} annotated with {@code annotations},
wrapped by {@code Set}, reporting failures against {@code subject}.
@param annotations the annotations on a single method, field or parameter.
This array may contain at most one qualifier annotation. | [
"Returns",
"a",
"key",
"for",
"{",
"@code",
"type",
"}",
"annotated",
"with",
"{",
"@code",
"annotations",
"}",
"wrapped",
"by",
"{",
"@code",
"Set",
"}",
"reporting",
"failures",
"against",
"{",
"@code",
"subject",
"}",
"."
] | train | https://github.com/square/dagger/blob/572cdd2fe97fc3c148fb3d8e1b2ce7beb4dcbcde/core/src/main/java/dagger/internal/Keys.java#L91-L102 |
ZenHarbinger/l2fprod-properties-editor | src/main/java/com/l2fprod/common/propertysheet/PropertySheetTable.java | PropertySheetTable.getCellEditor | @Override
public TableCellEditor getCellEditor(int row, int column) {
"""
Gets the CellEditor for the given row and column. It uses the editor
registry to find a suitable editor for the property.
@return
@see javax.swing.JTable#getCellEditor(int, int)
"""
if (column == 0) {
retu... | java | @Override
public TableCellEditor getCellEditor(int row, int column) {
if (column == 0) {
return null;
}
Item item = getSheetModel().getPropertySheetElement(row);
if (!item.isProperty()) {
return null;
}
TableCellEditor result = nul... | [
"@",
"Override",
"public",
"TableCellEditor",
"getCellEditor",
"(",
"int",
"row",
",",
"int",
"column",
")",
"{",
"if",
"(",
"column",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"Item",
"item",
"=",
"getSheetModel",
"(",
")",
".",
"getPropertySheet... | Gets the CellEditor for the given row and column. It uses the editor
registry to find a suitable editor for the property.
@return
@see javax.swing.JTable#getCellEditor(int, int) | [
"Gets",
"the",
"CellEditor",
"for",
"the",
"given",
"row",
"and",
"column",
".",
"It",
"uses",
"the",
"editor",
"registry",
"to",
"find",
"a",
"suitable",
"editor",
"for",
"the",
"property",
"."
] | train | https://github.com/ZenHarbinger/l2fprod-properties-editor/blob/d9b15c3f0b6ac1d9a2a9d315be073d2a4a419c32/src/main/java/com/l2fprod/common/propertysheet/PropertySheetTable.java#L337-L356 |
Squarespace/cldr | compiler/src/main/java/com/squarespace/cldr/codegen/NumberCodeGenerator.java | NumberCodeGenerator.addCurrencyInfoMethod | private void addCurrencyInfoMethod(TypeSpec.Builder type, String name, Map<String, String> mapping) {
"""
Adds a method to return the symbol or display name for a currency.
"""
MethodSpec.Builder method = MethodSpec.methodBuilder(name)
.addModifiers(PUBLIC)
.addParameter(Types.CLDR_CURRENCY... | java | private void addCurrencyInfoMethod(TypeSpec.Builder type, String name, Map<String, String> mapping) {
MethodSpec.Builder method = MethodSpec.methodBuilder(name)
.addModifiers(PUBLIC)
.addParameter(Types.CLDR_CURRENCY_ENUM, "code")
.returns(String.class);
method.beginControlFlow("if (cod... | [
"private",
"void",
"addCurrencyInfoMethod",
"(",
"TypeSpec",
".",
"Builder",
"type",
",",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"String",
">",
"mapping",
")",
"{",
"MethodSpec",
".",
"Builder",
"method",
"=",
"MethodSpec",
".",
"methodBuilder",
"... | Adds a method to return the symbol or display name for a currency. | [
"Adds",
"a",
"method",
"to",
"return",
"the",
"symbol",
"or",
"display",
"name",
"for",
"a",
"currency",
"."
] | train | https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/compiler/src/main/java/com/squarespace/cldr/codegen/NumberCodeGenerator.java#L475-L497 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getHexEncoded | @Nonnull
public static String getHexEncoded (@Nonnull final byte [] aInput, final int nOfs, final int nLen) {
"""
Convert a byte array to a hexadecimal encoded string.
@param aInput
The byte array to be converted to a String. May not be
<code>null</code>.
@param nOfs
Byte array offset
@param nLen
Number... | java | @Nonnull
public static String getHexEncoded (@Nonnull final byte [] aInput, final int nOfs, final int nLen)
{
ValueEnforcer.isArrayOfsLen (aInput, nOfs, nLen);
final StringBuilder aSB = new StringBuilder (nLen * 2);
for (int i = nOfs; i < (nOfs + nLen); ++i)
{
final byte b = aInput[i];
... | [
"@",
"Nonnull",
"public",
"static",
"String",
"getHexEncoded",
"(",
"@",
"Nonnull",
"final",
"byte",
"[",
"]",
"aInput",
",",
"final",
"int",
"nOfs",
",",
"final",
"int",
"nLen",
")",
"{",
"ValueEnforcer",
".",
"isArrayOfsLen",
"(",
"aInput",
",",
"nOfs",
... | Convert a byte array to a hexadecimal encoded string.
@param aInput
The byte array to be converted to a String. May not be
<code>null</code>.
@param nOfs
Byte array offset
@param nLen
Number of bytes to encode
@return The String representation of the byte array. | [
"Convert",
"a",
"byte",
"array",
"to",
"a",
"hexadecimal",
"encoded",
"string",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L638-L652 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_alerting_id_alert_alertId_GET | public OvhAlertingAlert project_serviceName_alerting_id_alert_alertId_GET(String serviceName, String id, Long alertId) throws IOException {
"""
Get this object properties
REST: GET /cloud/project/{serviceName}/alerting/{id}/alert/{alertId}
@param serviceName [required] The project id
@param id [required] Aler... | java | public OvhAlertingAlert project_serviceName_alerting_id_alert_alertId_GET(String serviceName, String id, Long alertId) throws IOException {
String qPath = "/cloud/project/{serviceName}/alerting/{id}/alert/{alertId}";
StringBuilder sb = path(qPath, serviceName, id, alertId);
String resp = exec(qPath, "GET", sb.toS... | [
"public",
"OvhAlertingAlert",
"project_serviceName_alerting_id_alert_alertId_GET",
"(",
"String",
"serviceName",
",",
"String",
"id",
",",
"Long",
"alertId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/alerting/{id}/alert/{alertId}... | Get this object properties
REST: GET /cloud/project/{serviceName}/alerting/{id}/alert/{alertId}
@param serviceName [required] The project id
@param id [required] Alerting unique UUID
@param alertId [required] Alert id | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2196-L2201 |
xdcrafts/flower | flower-tools/src/main/java/com/github/xdcrafts/flower/tools/ListApi.java | ListApi.getNullable | public static Object getNullable(final List list, final Integer... path) {
"""
Get object value by path.
@param list subject
@param path nodes to walk in map
@return value
"""
return getNullable(list, Object.class, path);
} | java | public static Object getNullable(final List list, final Integer... path) {
return getNullable(list, Object.class, path);
} | [
"public",
"static",
"Object",
"getNullable",
"(",
"final",
"List",
"list",
",",
"final",
"Integer",
"...",
"path",
")",
"{",
"return",
"getNullable",
"(",
"list",
",",
"Object",
".",
"class",
",",
"path",
")",
";",
"}"
] | Get object value by path.
@param list subject
@param path nodes to walk in map
@return value | [
"Get",
"object",
"value",
"by",
"path",
"."
] | train | https://github.com/xdcrafts/flower/blob/96a8e49102fea434bd383a3c7852f0ee9545f999/flower-tools/src/main/java/com/github/xdcrafts/flower/tools/ListApi.java#L140-L142 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/AbstractTagLibrary.java | AbstractTagLibrary.addConverter | protected final void addConverter(String name, String converterId, Class<? extends TagHandler> type) {
"""
Add a ConvertHandler for the specified converterId of a TagHandler type
@see javax.faces.view.facelets.ConverterHandler
@see javax.faces.view.facelets.ConverterConfig
@see javax.faces.application.Applica... | java | protected final void addConverter(String name, String converterId, Class<? extends TagHandler> type)
{
_factories.put(name, new UserConverterHandlerFactory(converterId, type));
} | [
"protected",
"final",
"void",
"addConverter",
"(",
"String",
"name",
",",
"String",
"converterId",
",",
"Class",
"<",
"?",
"extends",
"TagHandler",
">",
"type",
")",
"{",
"_factories",
".",
"put",
"(",
"name",
",",
"new",
"UserConverterHandlerFactory",
"(",
... | Add a ConvertHandler for the specified converterId of a TagHandler type
@see javax.faces.view.facelets.ConverterHandler
@see javax.faces.view.facelets.ConverterConfig
@see javax.faces.application.Application#createConverter(java.lang.String)
@param name
name to use, "foo" would be <my:foo />
@param converterId
id t... | [
"Add",
"a",
"ConvertHandler",
"for",
"the",
"specified",
"converterId",
"of",
"a",
"TagHandler",
"type"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/AbstractTagLibrary.java#L215-L218 |
OpenLiberty/open-liberty | dev/com.ibm.ws.session.db/src/com/ibm/ws/session/store/db/DatabaseHashMap.java | DatabaseHashMap.doesIndexExists | private boolean doesIndexExists(Connection con, String indexName) {
"""
PK56991 we are checking if there is an existing index for the session table
in distributed and iSeries platforms. The same test does not apply to zOS
system as if we ask the customer to create the session index manually during
table creatio... | java | private boolean doesIndexExists(Connection con, String indexName) {
if (usingDB2) {
if (usingAS400DB2) {
return doesIndexExistsiSeries(con, indexName);
}
return doesIndexExistsDistributed(con, indexName);
} else
return false;
} | [
"private",
"boolean",
"doesIndexExists",
"(",
"Connection",
"con",
",",
"String",
"indexName",
")",
"{",
"if",
"(",
"usingDB2",
")",
"{",
"if",
"(",
"usingAS400DB2",
")",
"{",
"return",
"doesIndexExistsiSeries",
"(",
"con",
",",
"indexName",
")",
";",
"}",
... | PK56991 we are checking if there is an existing index for the session table
in distributed and iSeries platforms. The same test does not apply to zOS
system as if we ask the customer to create the session index manually during
table creation. Session manager does not create session index. | [
"PK56991",
"we",
"are",
"checking",
"if",
"there",
"is",
"an",
"existing",
"index",
"for",
"the",
"session",
"table",
"in",
"distributed",
"and",
"iSeries",
"platforms",
".",
"The",
"same",
"test",
"does",
"not",
"apply",
"to",
"zOS",
"system",
"as",
"if",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session.db/src/com/ibm/ws/session/store/db/DatabaseHashMap.java#L3188-L3197 |
apache/fluo | modules/core/src/main/java/org/apache/fluo/core/util/SpanUtil.java | SpanUtil.toKey | public static Key toKey(RowColumn rc) {
"""
Converts from a Fluo RowColumn to a Accumulo Key
@param rc RowColumn
@return Key
"""
if ((rc == null) || (rc.getRow().equals(Bytes.EMPTY))) {
return null;
}
Text row = ByteUtil.toText(rc.getRow());
if ((rc.getColumn().equals(Column.EMPTY)) |... | java | public static Key toKey(RowColumn rc) {
if ((rc == null) || (rc.getRow().equals(Bytes.EMPTY))) {
return null;
}
Text row = ByteUtil.toText(rc.getRow());
if ((rc.getColumn().equals(Column.EMPTY)) || !rc.getColumn().isFamilySet()) {
return new Key(row);
}
Text cf = ByteUtil.toText(rc.g... | [
"public",
"static",
"Key",
"toKey",
"(",
"RowColumn",
"rc",
")",
"{",
"if",
"(",
"(",
"rc",
"==",
"null",
")",
"||",
"(",
"rc",
".",
"getRow",
"(",
")",
".",
"equals",
"(",
"Bytes",
".",
"EMPTY",
")",
")",
")",
"{",
"return",
"null",
";",
"}",
... | Converts from a Fluo RowColumn to a Accumulo Key
@param rc RowColumn
@return Key | [
"Converts",
"from",
"a",
"Fluo",
"RowColumn",
"to",
"a",
"Accumulo",
"Key"
] | train | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/util/SpanUtil.java#L50-L68 |
JOML-CI/JOML | src/org/joml/Vector2f.java | Vector2f.set | public Vector2f set(int index, FloatBuffer buffer) {
"""
Read this vector from the supplied {@link FloatBuffer} starting at the specified
absolute buffer position/index.
<p>
This method will not increment the position of the given FloatBuffer.
@param index
the absolute position into the FloatBuffer
@param ... | java | public Vector2f set(int index, FloatBuffer buffer) {
MemUtil.INSTANCE.get(this, index, buffer);
return this;
} | [
"public",
"Vector2f",
"set",
"(",
"int",
"index",
",",
"FloatBuffer",
"buffer",
")",
"{",
"MemUtil",
".",
"INSTANCE",
".",
"get",
"(",
"this",
",",
"index",
",",
"buffer",
")",
";",
"return",
"this",
";",
"}"
] | Read this vector from the supplied {@link FloatBuffer} starting at the specified
absolute buffer position/index.
<p>
This method will not increment the position of the given FloatBuffer.
@param index
the absolute position into the FloatBuffer
@param buffer
values will be read in <code>x, y</code> order
@return this | [
"Read",
"this",
"vector",
"from",
"the",
"supplied",
"{",
"@link",
"FloatBuffer",
"}",
"starting",
"at",
"the",
"specified",
"absolute",
"buffer",
"position",
"/",
"index",
".",
"<p",
">",
"This",
"method",
"will",
"not",
"increment",
"the",
"position",
"of"... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector2f.java#L328-L331 |
xwiki/xwiki-rendering | xwiki-rendering-api/src/main/java/org/xwiki/rendering/util/IdGenerator.java | IdGenerator.generateUniqueId | public String generateUniqueId(String prefix, String text) {
"""
Generate a unique id attribute using the passed text as the seed value. The generated id complies with the XHTML
specification. Extract from <a href="http://www.w3.org/TR/xhtml1/#C_8">XHTML RFC</a>:
<p>
<code> When defining fragment identifiers to... | java | public String generateUniqueId(String prefix, String text)
{
// Verify that the passed prefix contains only alpha characters since the generated id must be a valid HTML id.
if (StringUtils.isEmpty(prefix) || !StringUtils.isAlpha(prefix)) {
throw new IllegalArgumentException(
... | [
"public",
"String",
"generateUniqueId",
"(",
"String",
"prefix",
",",
"String",
"text",
")",
"{",
"// Verify that the passed prefix contains only alpha characters since the generated id must be a valid HTML id.",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"prefix",
")",
"... | Generate a unique id attribute using the passed text as the seed value. The generated id complies with the XHTML
specification. Extract from <a href="http://www.w3.org/TR/xhtml1/#C_8">XHTML RFC</a>:
<p>
<code> When defining fragment identifiers to be backward-compatible, only strings matching the pattern
[A-Za-z][A-Za-... | [
"Generate",
"a",
"unique",
"id",
"attribute",
"using",
"the",
"passed",
"text",
"as",
"the",
"seed",
"value",
".",
"The",
"generated",
"id",
"complies",
"with",
"the",
"XHTML",
"specification",
".",
"Extract",
"from",
"<a",
"href",
"=",
"http",
":",
"//",
... | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-api/src/main/java/org/xwiki/rendering/util/IdGenerator.java#L117-L138 |
Azure/azure-sdk-for-java | policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyEventsInner.java | PolicyEventsInner.listQueryResultsForManagementGroup | public PolicyEventsQueryResultsInner listQueryResultsForManagementGroup(String managementGroupName, QueryOptions queryOptions) {
"""
Queries policy events for the resources under the management group.
@param managementGroupName Management group name.
@param queryOptions Additional parameters for the operation
... | java | public PolicyEventsQueryResultsInner listQueryResultsForManagementGroup(String managementGroupName, QueryOptions queryOptions) {
return listQueryResultsForManagementGroupWithServiceResponseAsync(managementGroupName, queryOptions).toBlocking().single().body();
} | [
"public",
"PolicyEventsQueryResultsInner",
"listQueryResultsForManagementGroup",
"(",
"String",
"managementGroupName",
",",
"QueryOptions",
"queryOptions",
")",
"{",
"return",
"listQueryResultsForManagementGroupWithServiceResponseAsync",
"(",
"managementGroupName",
",",
"queryOptions... | Queries policy events for the resources under the management group.
@param managementGroupName Management group name.
@param queryOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@throws QueryFailureException thrown if the request is rejected by ... | [
"Queries",
"policy",
"events",
"for",
"the",
"resources",
"under",
"the",
"management",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyEventsInner.java#L185-L187 |
gitblit/fathom | fathom-mailer/src/main/java/fathom/mailer/Mailer.java | Mailer.newHtmlMailRequest | public MailRequest newHtmlMailRequest(String subject, String body) {
"""
Creates an html MailRequest with the specified subject and body.
The request id is automatically generated.
@param subject
@param body
@return an html mail request
"""
return createMailRequest(generateRequestId(), true, subj... | java | public MailRequest newHtmlMailRequest(String subject, String body) {
return createMailRequest(generateRequestId(), true, subject, body);
} | [
"public",
"MailRequest",
"newHtmlMailRequest",
"(",
"String",
"subject",
",",
"String",
"body",
")",
"{",
"return",
"createMailRequest",
"(",
"generateRequestId",
"(",
")",
",",
"true",
",",
"subject",
",",
"body",
")",
";",
"}"
] | Creates an html MailRequest with the specified subject and body.
The request id is automatically generated.
@param subject
@param body
@return an html mail request | [
"Creates",
"an",
"html",
"MailRequest",
"with",
"the",
"specified",
"subject",
"and",
"body",
".",
"The",
"request",
"id",
"is",
"automatically",
"generated",
"."
] | train | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-mailer/src/main/java/fathom/mailer/Mailer.java#L122-L124 |
wildfly/wildfly-core | security-manager/src/main/java/org/wildfly/extension/security/manager/SecurityManagerExtensionTransformerRegistration.java | SecurityManagerExtensionTransformerRegistration.registerTransformers | @Override
public void registerTransformers(SubsystemTransformerRegistration subsystemRegistration) {
"""
Registers the transformers for JBoss EAP 7.0.0.
@param subsystemRegistration contains data about the subsystem registration
"""
ResourceTransformationDescriptionBuilder builder = ResourceTran... | java | @Override
public void registerTransformers(SubsystemTransformerRegistration subsystemRegistration) {
ResourceTransformationDescriptionBuilder builder = ResourceTransformationDescriptionBuilder.Factory.createSubsystemInstance();
builder.addChildResource(DeploymentPermissionsResourceDefinition.DEPLOYM... | [
"@",
"Override",
"public",
"void",
"registerTransformers",
"(",
"SubsystemTransformerRegistration",
"subsystemRegistration",
")",
"{",
"ResourceTransformationDescriptionBuilder",
"builder",
"=",
"ResourceTransformationDescriptionBuilder",
".",
"Factory",
".",
"createSubsystemInstan... | Registers the transformers for JBoss EAP 7.0.0.
@param subsystemRegistration contains data about the subsystem registration | [
"Registers",
"the",
"transformers",
"for",
"JBoss",
"EAP",
"7",
".",
"0",
".",
"0",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/security-manager/src/main/java/org/wildfly/extension/security/manager/SecurityManagerExtensionTransformerRegistration.java#L50-L70 |
cdk/cdk | app/depict/src/main/java/org/openscience/cdk/depict/Abbreviations.java | Abbreviations.matchExact | private IQueryAtomContainer matchExact(IAtomContainer mol) {
"""
Internal - create a query atom container that exactly matches the molecule provided.
Similar to {@link org.openscience.cdk.isomorphism.matchers.QueryAtomContainerCreator}
but we can't access SMARTS query classes from that module (cdk-isomorphism).
... | java | private IQueryAtomContainer matchExact(IAtomContainer mol) {
final IChemObjectBuilder bldr = mol.getBuilder();
final IQueryAtomContainer qry = new QueryAtomContainer(mol.getBuilder());
final Map<IAtom, IAtom> atmmap = new HashMap<>();
for (IAtom atom : mol.atoms()) {
IAtom q... | [
"private",
"IQueryAtomContainer",
"matchExact",
"(",
"IAtomContainer",
"mol",
")",
"{",
"final",
"IChemObjectBuilder",
"bldr",
"=",
"mol",
".",
"getBuilder",
"(",
")",
";",
"final",
"IQueryAtomContainer",
"qry",
"=",
"new",
"QueryAtomContainer",
"(",
"mol",
".",
... | Internal - create a query atom container that exactly matches the molecule provided.
Similar to {@link org.openscience.cdk.isomorphism.matchers.QueryAtomContainerCreator}
but we can't access SMARTS query classes from that module (cdk-isomorphism).
@param mol molecule
@return query container
@see org.openscience.cdk.is... | [
"Internal",
"-",
"create",
"a",
"query",
"atom",
"container",
"that",
"exactly",
"matches",
"the",
"molecule",
"provided",
".",
"Similar",
"to",
"{",
"@link",
"org",
".",
"openscience",
".",
"cdk",
".",
"isomorphism",
".",
"matchers",
".",
"QueryAtomContainerC... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/app/depict/src/main/java/org/openscience/cdk/depict/Abbreviations.java#L729-L755 |
beangle/beangle3 | ioc/spring/src/main/java/org/beangle/inject/spring/config/BeanDefinitionParser.java | BeanDefinitionParser.parsePropertyElement | public void parsePropertyElement(Element ele, BeanDefinition bd) {
"""
Parse a property element.
@param ele a {@link org.w3c.dom.Element} object.
@param bd a {@link org.springframework.beans.factory.config.BeanDefinition} object.
"""
String propertyName = ele.getAttribute(NAME_ATTRIBUTE);
if (!Stri... | java | public void parsePropertyElement(Element ele, BeanDefinition bd) {
String propertyName = ele.getAttribute(NAME_ATTRIBUTE);
if (!StringUtils.hasLength(propertyName)) {
error("Tag 'property' must have a 'name' attribute", ele);
return;
}
this.parseState.push(new PropertyEntry(propertyName));
... | [
"public",
"void",
"parsePropertyElement",
"(",
"Element",
"ele",
",",
"BeanDefinition",
"bd",
")",
"{",
"String",
"propertyName",
"=",
"ele",
".",
"getAttribute",
"(",
"NAME_ATTRIBUTE",
")",
";",
"if",
"(",
"!",
"StringUtils",
".",
"hasLength",
"(",
"propertyN... | Parse a property element.
@param ele a {@link org.w3c.dom.Element} object.
@param bd a {@link org.springframework.beans.factory.config.BeanDefinition} object. | [
"Parse",
"a",
"property",
"element",
"."
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/ioc/spring/src/main/java/org/beangle/inject/spring/config/BeanDefinitionParser.java#L520-L540 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java | DataStream.assignTimestamps | @Deprecated
public SingleOutputStreamOperator<T> assignTimestamps(TimestampExtractor<T> extractor) {
"""
Extracts a timestamp from an element and assigns it as the internal timestamp of that element.
The internal timestamps are, for example, used to to event-time window operations.
<p>If you know that the tim... | java | @Deprecated
public SingleOutputStreamOperator<T> assignTimestamps(TimestampExtractor<T> extractor) {
// match parallelism to input, otherwise dop=1 sources could lead to some strange
// behaviour: the watermark will creep along very slowly because the elements
// from the source go to each extraction operator ro... | [
"@",
"Deprecated",
"public",
"SingleOutputStreamOperator",
"<",
"T",
">",
"assignTimestamps",
"(",
"TimestampExtractor",
"<",
"T",
">",
"extractor",
")",
"{",
"// match parallelism to input, otherwise dop=1 sources could lead to some strange",
"// behaviour: the watermark will cree... | Extracts a timestamp from an element and assigns it as the internal timestamp of that element.
The internal timestamps are, for example, used to to event-time window operations.
<p>If you know that the timestamps are strictly increasing you can use an
{@link AscendingTimestampExtractor}. Otherwise,
you should provide ... | [
"Extracts",
"a",
"timestamp",
"from",
"an",
"element",
"and",
"assigns",
"it",
"as",
"the",
"internal",
"timestamp",
"of",
"that",
"element",
".",
"The",
"internal",
"timestamps",
"are",
"for",
"example",
"used",
"to",
"to",
"event",
"-",
"time",
"window",
... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java#L841-L850 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/managers/GuildController.java | GuildController.setDeafen | @CheckReturnValue
public AuditableRestAction<Void> setDeafen(Member member, boolean deafen) {
"""
Sets the Guild Deafened state state of the {@link net.dv8tion.jda.core.entities.Member Member} based on the provided
boolean.
<p><b>Note:</b> The Member's {@link net.dv8tion.jda.core.entities.GuildVoiceState#i... | java | @CheckReturnValue
public AuditableRestAction<Void> setDeafen(Member member, boolean deafen)
{
Checks.notNull(member, "Member");
checkGuild(member.getGuild(), "Member");
checkPermission(Permission.VOICE_DEAF_OTHERS);
//We check the owner instead of Position because, apparently, D... | [
"@",
"CheckReturnValue",
"public",
"AuditableRestAction",
"<",
"Void",
">",
"setDeafen",
"(",
"Member",
"member",
",",
"boolean",
"deafen",
")",
"{",
"Checks",
".",
"notNull",
"(",
"member",
",",
"\"Member\"",
")",
";",
"checkGuild",
"(",
"member",
".",
"get... | Sets the Guild Deafened state state of the {@link net.dv8tion.jda.core.entities.Member Member} based on the provided
boolean.
<p><b>Note:</b> The Member's {@link net.dv8tion.jda.core.entities.GuildVoiceState#isGuildDeafened() GuildVoiceState.isGuildDeafened()} value won't change
until JDA receives the {@link net.dv8ti... | [
"Sets",
"the",
"Guild",
"Deafened",
"state",
"state",
"of",
"the",
"{",
"@link",
"net",
".",
"dv8tion",
".",
"jda",
".",
"core",
".",
"entities",
".",
"Member",
"Member",
"}",
"based",
"on",
"the",
"provided",
"boolean",
"."
] | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/managers/GuildController.java#L970-L999 |
jbossas/jboss-invocation | src/main/java/org/jboss/invocation/proxy/AbstractProxyFactory.java | AbstractProxyFactory.loadMethodIdentifier | protected void loadMethodIdentifier(Method methodToLoad, ClassMethod method) {
"""
Writes the bytecode to load an instance of Method for the given method onto the stack
<p/>
If loadMethod has not already been called for the given method then a static field to hold the method is added to the
class, and code is a... | java | protected void loadMethodIdentifier(Method methodToLoad, ClassMethod method) {
if (!methodIdentifiers.containsKey(methodToLoad)) {
int identifierNo = identifierCount++;
String fieldName = METHOD_FIELD_PREFIX + identifierNo;
classFile.addField(AccessFlag.PRIVATE | AccessFlag.S... | [
"protected",
"void",
"loadMethodIdentifier",
"(",
"Method",
"methodToLoad",
",",
"ClassMethod",
"method",
")",
"{",
"if",
"(",
"!",
"methodIdentifiers",
".",
"containsKey",
"(",
"methodToLoad",
")",
")",
"{",
"int",
"identifierNo",
"=",
"identifierCount",
"++",
... | Writes the bytecode to load an instance of Method for the given method onto the stack
<p/>
If loadMethod has not already been called for the given method then a static field to hold the method is added to the
class, and code is added to the static constructor to initialize the field to the correct Method.
@param metho... | [
"Writes",
"the",
"bytecode",
"to",
"load",
"an",
"instance",
"of",
"Method",
"for",
"the",
"given",
"method",
"onto",
"the",
"stack",
"<p",
"/",
">",
"If",
"loadMethod",
"has",
"not",
"already",
"been",
"called",
"for",
"the",
"given",
"method",
"then",
... | train | https://github.com/jbossas/jboss-invocation/blob/f72586a554264cbc78fcdad9fdd3e84b833249c9/src/main/java/org/jboss/invocation/proxy/AbstractProxyFactory.java#L185-L195 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/event/SubCountHandler.java | SubCountHandler.init | public void init(Record record, Record recordMain, String iMainFilesField, BaseField fieldMain, String fsToCount, boolean bRecountOnSelect, boolean bVerifyOnEOF, boolean bResetOnBreak) // Init this field override for other value {
"""
Constructor for counting the value of a field in this record.
@param fieldMa... | java | public void init(Record record, Record recordMain, String iMainFilesField, BaseField fieldMain, String fsToCount, boolean bRecountOnSelect, boolean bVerifyOnEOF, boolean bResetOnBreak) // Init this field override for other value
{
super.init(record);
this.fsToCount = fsToCount;
if (fieldM... | [
"public",
"void",
"init",
"(",
"Record",
"record",
",",
"Record",
"recordMain",
",",
"String",
"iMainFilesField",
",",
"BaseField",
"fieldMain",
",",
"String",
"fsToCount",
",",
"boolean",
"bRecountOnSelect",
",",
"boolean",
"bVerifyOnEOF",
",",
"boolean",
"bReset... | Constructor for counting the value of a field in this record.
@param fieldMain The field to receive the count.
@param ifsToCount The field in this record to add up.
@param bVerifyOnEOF Verify the total on End of File (true default).
@param bRecountOnSelect Recount the total each time a file select is called (False defa... | [
"Constructor",
"for",
"counting",
"the",
"value",
"of",
"a",
"field",
"in",
"this",
"record",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/SubCountHandler.java#L127-L144 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java | MapMessage.put | public void put(final String key, final String value) {
"""
Adds an item to the data Map.
@param key The name of the data item.
@param value The value of the data item.
"""
if (value == null) {
throw new IllegalArgumentException("No value provided for key " + key);
}
valid... | java | public void put(final String key, final String value) {
if (value == null) {
throw new IllegalArgumentException("No value provided for key " + key);
}
validate(key, value);
data.putValue(key, value);
} | [
"public",
"void",
"put",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"No value provided for key \"",
"+",
"key",
")",
";",
"}",
"va... | Adds an item to the data Map.
@param key The name of the data item.
@param value The value of the data item. | [
"Adds",
"an",
"item",
"to",
"the",
"data",
"Map",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java#L190-L196 |
tvesalainen/util | util/src/main/java/org/vesalainen/nio/IntArray.java | IntArray.getInstance | public static IntArray getInstance(short[] buffer, int offset, int length) {
"""
Creates IntArray backed by short array
@param buffer
@param offset
@param length
@return
"""
return getInstance(ShortBuffer.wrap(buffer, offset, length));
} | java | public static IntArray getInstance(short[] buffer, int offset, int length)
{
return getInstance(ShortBuffer.wrap(buffer, offset, length));
} | [
"public",
"static",
"IntArray",
"getInstance",
"(",
"short",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"return",
"getInstance",
"(",
"ShortBuffer",
".",
"wrap",
"(",
"buffer",
",",
"offset",
",",
"length",
")",
")",
";",
... | Creates IntArray backed by short array
@param buffer
@param offset
@param length
@return | [
"Creates",
"IntArray",
"backed",
"by",
"short",
"array"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/IntArray.java#L117-L120 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.eachByte | public static void eachByte(Byte[] self, @ClosureParams(FirstParam.Component.class) Closure closure) {
"""
Traverse through each byte of this Byte array. Alias for each.
@param self a Byte array
@param closure a closure
@see #each(java.lang.Object, groovy.lang.Closure)
@since 1.5.5
"""
each(se... | java | public static void eachByte(Byte[] self, @ClosureParams(FirstParam.Component.class) Closure closure) {
each(self, closure);
} | [
"public",
"static",
"void",
"eachByte",
"(",
"Byte",
"[",
"]",
"self",
",",
"@",
"ClosureParams",
"(",
"FirstParam",
".",
"Component",
".",
"class",
")",
"Closure",
"closure",
")",
"{",
"each",
"(",
"self",
",",
"closure",
")",
";",
"}"
] | Traverse through each byte of this Byte array. Alias for each.
@param self a Byte array
@param closure a closure
@see #each(java.lang.Object, groovy.lang.Closure)
@since 1.5.5 | [
"Traverse",
"through",
"each",
"byte",
"of",
"this",
"Byte",
"array",
".",
"Alias",
"for",
"each",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L16669-L16671 |
spring-projects/spring-hateoas | src/main/java/org/springframework/hateoas/server/mvc/RepresentationModelProcessorInvoker.java | RepresentationModelProcessorInvoker.invokeProcessorsFor | public <T extends RepresentationModel<T>> T invokeProcessorsFor(T value) {
"""
Invokes all {@link RepresentationModelProcessor} instances registered for the type of the given value.
@param value must not be {@literal null}.
@return
"""
Assert.notNull(value, "Value must not be null!");
return invokePr... | java | public <T extends RepresentationModel<T>> T invokeProcessorsFor(T value) {
Assert.notNull(value, "Value must not be null!");
return invokeProcessorsFor(value, ResolvableType.forClass(value.getClass()));
} | [
"public",
"<",
"T",
"extends",
"RepresentationModel",
"<",
"T",
">",
">",
"T",
"invokeProcessorsFor",
"(",
"T",
"value",
")",
"{",
"Assert",
".",
"notNull",
"(",
"value",
",",
"\"Value must not be null!\"",
")",
";",
"return",
"invokeProcessorsFor",
"(",
"valu... | Invokes all {@link RepresentationModelProcessor} instances registered for the type of the given value.
@param value must not be {@literal null}.
@return | [
"Invokes",
"all",
"{",
"@link",
"RepresentationModelProcessor",
"}",
"instances",
"registered",
"for",
"the",
"type",
"of",
"the",
"given",
"value",
"."
] | train | https://github.com/spring-projects/spring-hateoas/blob/70ebff9309f086cd8d6a97daf67e0dc215c87d9c/src/main/java/org/springframework/hateoas/server/mvc/RepresentationModelProcessorInvoker.java#L86-L91 |
google/auto | common/src/main/java/com/google/auto/common/GeneratedAnnotationSpecs.java | GeneratedAnnotationSpecs.generatedAnnotationSpec | @Deprecated
public static Optional<AnnotationSpec> generatedAnnotationSpec(
Elements elements, Class<?> processorClass) {
"""
Returns {@code @Generated("processorClass"} if either {@code
javax.annotation.processing.Generated} or {@code javax.annotation.Generated} is {@linkplain
GeneratedAnnotations#gener... | java | @Deprecated
public static Optional<AnnotationSpec> generatedAnnotationSpec(
Elements elements, Class<?> processorClass) {
return generatedAnnotationSpecBuilder(elements, processorClass)
.map(AnnotationSpec.Builder::build);
} | [
"@",
"Deprecated",
"public",
"static",
"Optional",
"<",
"AnnotationSpec",
">",
"generatedAnnotationSpec",
"(",
"Elements",
"elements",
",",
"Class",
"<",
"?",
">",
"processorClass",
")",
"{",
"return",
"generatedAnnotationSpecBuilder",
"(",
"elements",
",",
"process... | Returns {@code @Generated("processorClass"} if either {@code
javax.annotation.processing.Generated} or {@code javax.annotation.Generated} is {@linkplain
GeneratedAnnotations#generatedAnnotation(Elements) available at compile time}.
@deprecated prefer {@link #generatedAnnotationSpec(Elements, SourceVersion, Class)} | [
"Returns",
"{",
"@code",
"@Generated",
"(",
"processorClass",
"}",
"if",
"either",
"{",
"@code",
"javax",
".",
"annotation",
".",
"processing",
".",
"Generated",
"}",
"or",
"{",
"@code",
"javax",
".",
"annotation",
".",
"Generated",
"}",
"is",
"{",
"@linkp... | train | https://github.com/google/auto/blob/4158a5fa71f1ef763e683b627f4d29bc04cfde9d/common/src/main/java/com/google/auto/common/GeneratedAnnotationSpecs.java#L36-L41 |
undera/jmeter-plugins | plugins/functions/src/main/java/kg/apc/jmeter/functions/CaseFormat.java | CaseFormat.camelFormat | private static String camelFormat(String str, boolean isFirstCapitalized) {
"""
Camel format string
@param str
@param isFirstCapitalized
@return String in camelFormat
"""
StringBuilder builder = new StringBuilder(str.length());
String[] tokens = NOT_ALPHANUMERIC_REGEX.split(str);
for (int i = 0; i <... | java | private static String camelFormat(String str, boolean isFirstCapitalized) {
StringBuilder builder = new StringBuilder(str.length());
String[] tokens = NOT_ALPHANUMERIC_REGEX.split(str);
for (int i = 0; i < tokens.length; i++) {
String lowerCased = StringUtils.lowerCase(tokens[i]);
if (i == 0) {
builder.... | [
"private",
"static",
"String",
"camelFormat",
"(",
"String",
"str",
",",
"boolean",
"isFirstCapitalized",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
"str",
".",
"length",
"(",
")",
")",
";",
"String",
"[",
"]",
"tokens",
"=",
"... | Camel format string
@param str
@param isFirstCapitalized
@return String in camelFormat | [
"Camel",
"format",
"string"
] | train | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/plugins/functions/src/main/java/kg/apc/jmeter/functions/CaseFormat.java#L155-L167 |
upwork/java-upwork | src/com/Upwork/api/Routers/Hr/Jobs.java | Jobs.deleteJob | public JSONObject deleteJob(String key, HashMap<String, String> params) throws JSONException {
"""
Delete existent job
@param key Job key
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject}
"""
return oClient.delete("/hr/v2/jobs/" + key, params);
} | java | public JSONObject deleteJob(String key, HashMap<String, String> params) throws JSONException {
return oClient.delete("/hr/v2/jobs/" + key, params);
} | [
"public",
"JSONObject",
"deleteJob",
"(",
"String",
"key",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"JSONException",
"{",
"return",
"oClient",
".",
"delete",
"(",
"\"/hr/v2/jobs/\"",
"+",
"key",
",",
"params",
")",
";",
"... | Delete existent job
@param key Job key
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject} | [
"Delete",
"existent",
"job"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Hr/Jobs.java#L99-L101 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/metadata/Utils.java | Utils.compareStringLists | public static boolean compareStringLists(List<String> list1, List<String> list2) {
"""
Compares two lists of strings for equality.
@param list1
@param list2
@return true iff each list contains the same strings in the same order
"""
if (list1 == null && list2 == null)
return true;
... | java | public static boolean compareStringLists(List<String> list1, List<String> list2) {
if (list1 == null && list2 == null)
return true;
if (list1 == null || list2 == null)
return false;
if (list1.size() != list2.size())
return false;
for (int i = 0; i < li... | [
"public",
"static",
"boolean",
"compareStringLists",
"(",
"List",
"<",
"String",
">",
"list1",
",",
"List",
"<",
"String",
">",
"list2",
")",
"{",
"if",
"(",
"list1",
"==",
"null",
"&&",
"list2",
"==",
"null",
")",
"return",
"true",
";",
"if",
"(",
"... | Compares two lists of strings for equality.
@param list1
@param list2
@return true iff each list contains the same strings in the same order | [
"Compares",
"two",
"lists",
"of",
"strings",
"for",
"equality",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/metadata/Utils.java#L76-L90 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java | DiagnosticsInner.getSiteDiagnosticCategorySlotAsync | public Observable<DiagnosticCategoryInner> getSiteDiagnosticCategorySlotAsync(String resourceGroupName, String siteName, String diagnosticCategory, String slot) {
"""
Get Diagnostics Category.
Get Diagnostics Category.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param s... | java | public Observable<DiagnosticCategoryInner> getSiteDiagnosticCategorySlotAsync(String resourceGroupName, String siteName, String diagnosticCategory, String slot) {
return getSiteDiagnosticCategorySlotWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, slot).map(new Func1<ServiceResponse<Dia... | [
"public",
"Observable",
"<",
"DiagnosticCategoryInner",
">",
"getSiteDiagnosticCategorySlotAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"siteName",
",",
"String",
"diagnosticCategory",
",",
"String",
"slot",
")",
"{",
"return",
"getSiteDiagnosticCategorySlotWi... | Get Diagnostics Category.
Get Diagnostics Category.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param diagnosticCategory Diagnostic Category
@param slot Slot Name
@throws IllegalArgumentException thrown if parameters fail the validation
@return the obse... | [
"Get",
"Diagnostics",
"Category",
".",
"Get",
"Diagnostics",
"Category",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L1517-L1524 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/VoiceApi.java | VoiceApi.completeConference | public ApiSuccessResponse completeConference(String id, CompleteConferenceData completeConferenceData) throws ApiException {
"""
Complete a conference
Complete a previously initiated two-step conference identified by the provided IDs. Once completed, the two separate calls are brought together so that all three p... | java | public ApiSuccessResponse completeConference(String id, CompleteConferenceData completeConferenceData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = completeConferenceWithHttpInfo(id, completeConferenceData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"completeConference",
"(",
"String",
"id",
",",
"CompleteConferenceData",
"completeConferenceData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"completeConferenceWithHttpInfo",
"(",
"id",
... | Complete a conference
Complete a previously initiated two-step conference identified by the provided IDs. Once completed, the two separate calls are brought together so that all three parties are participating in the same call.
@param id The connection ID of the consult call (established). (required)
@param completeCon... | [
"Complete",
"a",
"conference",
"Complete",
"a",
"previously",
"initiated",
"two",
"-",
"step",
"conference",
"identified",
"by",
"the",
"provided",
"IDs",
".",
"Once",
"completed",
"the",
"two",
"separate",
"calls",
"are",
"brought",
"together",
"so",
"that",
... | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/VoiceApi.java#L947-L950 |
SvenEwald/xmlbeam | src/main/java/org/xmlbeam/evaluation/DefaultXPathEvaluator.java | DefaultXPathEvaluator.asInt | @Override
public int asInt() {
"""
Evaluates the XPath as a int value. This method is just a shortcut for as(Integer.TYPE);
@return int value of evaluation result.
"""
final Class<?> callerClass = ReflectionHelper.getDirectCallerClass();
return evaluateSingeValue(Integer.TYPE, callerClas... | java | @Override
public int asInt() {
final Class<?> callerClass = ReflectionHelper.getDirectCallerClass();
return evaluateSingeValue(Integer.TYPE, callerClass);
} | [
"@",
"Override",
"public",
"int",
"asInt",
"(",
")",
"{",
"final",
"Class",
"<",
"?",
">",
"callerClass",
"=",
"ReflectionHelper",
".",
"getDirectCallerClass",
"(",
")",
";",
"return",
"evaluateSingeValue",
"(",
"Integer",
".",
"TYPE",
",",
"callerClass",
")... | Evaluates the XPath as a int value. This method is just a shortcut for as(Integer.TYPE);
@return int value of evaluation result. | [
"Evaluates",
"the",
"XPath",
"as",
"a",
"int",
"value",
".",
"This",
"method",
"is",
"just",
"a",
"shortcut",
"for",
"as",
"(",
"Integer",
".",
"TYPE",
")",
";"
] | train | https://github.com/SvenEwald/xmlbeam/blob/acaac1b8fa28d246f17187f5e3c6696458a0b447/src/main/java/org/xmlbeam/evaluation/DefaultXPathEvaluator.java#L91-L95 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java | ParagraphVectors.inferVector | public INDArray inferVector(LabelledDocument document) {
"""
This method calculates inferred vector for given document, with default parameters for learning rate and iterations
@param document
@return
"""
return inferVector(document, this.learningRate.get(), this.minLearningRate,
... | java | public INDArray inferVector(LabelledDocument document) {
return inferVector(document, this.learningRate.get(), this.minLearningRate,
this.numEpochs * this.numIterations);
} | [
"public",
"INDArray",
"inferVector",
"(",
"LabelledDocument",
"document",
")",
"{",
"return",
"inferVector",
"(",
"document",
",",
"this",
".",
"learningRate",
".",
"get",
"(",
")",
",",
"this",
".",
"minLearningRate",
",",
"this",
".",
"numEpochs",
"*",
"th... | This method calculates inferred vector for given document, with default parameters for learning rate and iterations
@param document
@return | [
"This",
"method",
"calculates",
"inferred",
"vector",
"for",
"given",
"document",
"with",
"default",
"parameters",
"for",
"learning",
"rate",
"and",
"iterations"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java#L302-L305 |
feedzai/pdb | src/main/java/com/feedzai/commons/sql/abstraction/dml/Expression.java | Expression.leftOuterJoin | public Expression leftOuterJoin(final Expression table, final Expression expr) {
"""
Sets a left outer join with the current table.
@param table The table to join.
@param expr The expressions to join.
@return This expression.
"""
if (table instanceof Query) {
table.enclose();
... | java | public Expression leftOuterJoin(final Expression table, final Expression expr) {
if (table instanceof Query) {
table.enclose();
}
joins.add(new Join("LEFT OUTER JOIN", table, expr));
return this;
} | [
"public",
"Expression",
"leftOuterJoin",
"(",
"final",
"Expression",
"table",
",",
"final",
"Expression",
"expr",
")",
"{",
"if",
"(",
"table",
"instanceof",
"Query",
")",
"{",
"table",
".",
"enclose",
"(",
")",
";",
"}",
"joins",
".",
"add",
"(",
"new",... | Sets a left outer join with the current table.
@param table The table to join.
@param expr The expressions to join.
@return This expression. | [
"Sets",
"a",
"left",
"outer",
"join",
"with",
"the",
"current",
"table",
"."
] | train | https://github.com/feedzai/pdb/blob/fe07ca08417e0ddcd620a36aa1fdbca7f338be98/src/main/java/com/feedzai/commons/sql/abstraction/dml/Expression.java#L182-L190 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/RegularFile.java | RegularFile.get | private static int get(byte[] block, int offset, byte[] b, int off, int len) {
"""
Reads len bytes starting at the given offset in the given block into the given slice of the
given byte array.
"""
System.arraycopy(block, offset, b, off, len);
return len;
} | java | private static int get(byte[] block, int offset, byte[] b, int off, int len) {
System.arraycopy(block, offset, b, off, len);
return len;
} | [
"private",
"static",
"int",
"get",
"(",
"byte",
"[",
"]",
"block",
",",
"int",
"offset",
",",
"byte",
"[",
"]",
"b",
",",
"int",
"off",
",",
"int",
"len",
")",
"{",
"System",
".",
"arraycopy",
"(",
"block",
",",
"offset",
",",
"b",
",",
"off",
... | Reads len bytes starting at the given offset in the given block into the given slice of the
given byte array. | [
"Reads",
"len",
"bytes",
"starting",
"at",
"the",
"given",
"offset",
"in",
"the",
"given",
"block",
"into",
"the",
"given",
"slice",
"of",
"the",
"given",
"byte",
"array",
"."
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/RegularFile.java#L651-L654 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/list/DoubleArrayList.java | DoubleArrayList.binarySearchFromTo | public int binarySearchFromTo(double key, int from, int to) {
"""
Searches the receiver for the specified value using
the binary search algorithm. The receiver must <strong>must</strong> be
sorted (as by the sort method) prior to making this call. If
it is not sorted, the results are undefined: in particular,... | java | public int binarySearchFromTo(double key, int from, int to) {
//return cern.colt.Sorting.binarySearchFromTo(this.elements,key,from,to);
return java.util.Arrays.binarySearch(this.elements,key);
} | [
"public",
"int",
"binarySearchFromTo",
"(",
"double",
"key",
",",
"int",
"from",
",",
"int",
"to",
")",
"{",
"//return cern.colt.Sorting.binarySearchFromTo(this.elements,key,from,to);\r",
"return",
"java",
".",
"util",
".",
"Arrays",
".",
"binarySearch",
"(",
"this",
... | Searches the receiver for the specified value using
the binary search algorithm. The receiver must <strong>must</strong> be
sorted (as by the sort method) prior to making this call. If
it is not sorted, the results are undefined: in particular, the call
may enter an infinite loop. If the receiver contains multiple e... | [
"Searches",
"the",
"receiver",
"for",
"the",
"specified",
"value",
"using",
"the",
"binary",
"search",
"algorithm",
".",
"The",
"receiver",
"must",
"<strong",
">",
"must<",
"/",
"strong",
">",
"be",
"sorted",
"(",
"as",
"by",
"the",
"sort",
"method",
")",
... | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/DoubleArrayList.java#L105-L108 |
cache2k/cache2k | cache2k-core/src/main/java/org/cache2k/core/HeapCache.java | HeapCache.insertOrUpdateAndCalculateExpiry | protected final void insertOrUpdateAndCalculateExpiry(Entry<K, V> e, V v, long t0, long t, final long _refreshTime, byte _updateStatistics) {
"""
Calculate the next refresh time if a timer / expiry is needed and call insert.
"""
long _nextRefreshTime;
try {
_nextRefreshTime = timing.calculateNext... | java | protected final void insertOrUpdateAndCalculateExpiry(Entry<K, V> e, V v, long t0, long t, final long _refreshTime, byte _updateStatistics) {
long _nextRefreshTime;
try {
_nextRefreshTime = timing.calculateNextRefreshTime(e, v, _refreshTime);
} catch (Exception ex) {
RuntimeException _wrappedExc... | [
"protected",
"final",
"void",
"insertOrUpdateAndCalculateExpiry",
"(",
"Entry",
"<",
"K",
",",
"V",
">",
"e",
",",
"V",
"v",
",",
"long",
"t0",
",",
"long",
"t",
",",
"final",
"long",
"_refreshTime",
",",
"byte",
"_updateStatistics",
")",
"{",
"long",
"_... | Calculate the next refresh time if a timer / expiry is needed and call insert. | [
"Calculate",
"the",
"next",
"refresh",
"time",
"if",
"a",
"timer",
"/",
"expiry",
"is",
"needed",
"and",
"call",
"insert",
"."
] | train | https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-core/src/main/java/org/cache2k/core/HeapCache.java#L1459-L1473 |
molgenis/molgenis | molgenis-security/src/main/java/org/molgenis/security/account/AccountController.java | AccountController.registerUser | @PostMapping(value = "/register", headers = "Content-Type=application/x-www-form-urlencoded")
@ResponseBody
public Map<String, String> registerUser(
@Valid @ModelAttribute RegisterRequest registerRequest, HttpServletRequest request)
throws Exception {
"""
Spring's FormHttpMessageConverter cannot bi... | java | @PostMapping(value = "/register", headers = "Content-Type=application/x-www-form-urlencoded")
@ResponseBody
public Map<String, String> registerUser(
@Valid @ModelAttribute RegisterRequest registerRequest, HttpServletRequest request)
throws Exception {
if (authenticationSettings.getSignUp()) {
... | [
"@",
"PostMapping",
"(",
"value",
"=",
"\"/register\"",
",",
"headers",
"=",
"\"Content-Type=application/x-www-form-urlencoded\"",
")",
"@",
"ResponseBody",
"public",
"Map",
"<",
"String",
",",
"String",
">",
"registerUser",
"(",
"@",
"Valid",
"@",
"ModelAttribute",... | Spring's FormHttpMessageConverter cannot bind target classes (as ModelAttribute can) | [
"Spring",
"s",
"FormHttpMessageConverter",
"cannot",
"bind",
"target",
"classes",
"(",
"as",
"ModelAttribute",
"can",
")"
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-security/src/main/java/org/molgenis/security/account/AccountController.java#L134-L170 |
zxing/zxing | core/src/main/java/com/google/zxing/qrcode/encoder/MaskUtil.java | MaskUtil.applyMaskPenaltyRule1Internal | private static int applyMaskPenaltyRule1Internal(ByteMatrix matrix, boolean isHorizontal) {
"""
Helper function for applyMaskPenaltyRule1. We need this for doing this calculation in both
vertical and horizontal orders respectively.
"""
int penalty = 0;
int iLimit = isHorizontal ? matrix.getHeight() : ... | java | private static int applyMaskPenaltyRule1Internal(ByteMatrix matrix, boolean isHorizontal) {
int penalty = 0;
int iLimit = isHorizontal ? matrix.getHeight() : matrix.getWidth();
int jLimit = isHorizontal ? matrix.getWidth() : matrix.getHeight();
byte[][] array = matrix.getArray();
for (int i = 0; i <... | [
"private",
"static",
"int",
"applyMaskPenaltyRule1Internal",
"(",
"ByteMatrix",
"matrix",
",",
"boolean",
"isHorizontal",
")",
"{",
"int",
"penalty",
"=",
"0",
";",
"int",
"iLimit",
"=",
"isHorizontal",
"?",
"matrix",
".",
"getHeight",
"(",
")",
":",
"matrix",... | Helper function for applyMaskPenaltyRule1. We need this for doing this calculation in both
vertical and horizontal orders respectively. | [
"Helper",
"function",
"for",
"applyMaskPenaltyRule1",
".",
"We",
"need",
"this",
"for",
"doing",
"this",
"calculation",
"in",
"both",
"vertical",
"and",
"horizontal",
"orders",
"respectively",
"."
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/qrcode/encoder/MaskUtil.java#L195-L220 |
LearnLib/automatalib | commons/util/src/main/java/net/automatalib/commons/util/ReflectUtil.java | ReflectUtil.findMethodRT | public static Method findMethodRT(Class<?> clazz, String name, Class<?> returnType, Class<?>... params) {
"""
See {@link #findMethod(Class, String, Class...)}. This variation allows to additionally narrow the method by
specifying its return type.
@param clazz
the class which should be scanned for methods
@pa... | java | public static Method findMethodRT(Class<?> clazz, String name, Class<?> returnType, Class<?>... params) {
Method m = findMethod(clazz, name, params);
if (m == null) {
return null;
} else if (returnType == null) {
return m;
}
Class<?> rt = m.getReturnType... | [
"public",
"static",
"Method",
"findMethodRT",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"returnType",
",",
"Class",
"<",
"?",
">",
"...",
"params",
")",
"{",
"Method",
"m",
"=",
"findMethod",
"(",
"claz... | See {@link #findMethod(Class, String, Class...)}. This variation allows to additionally narrow the method by
specifying its return type.
@param clazz
the class which should be scanned for methods
@param name
the name of the method
@param returnType
the type of the returned object
@param params
the types of the method ... | [
"See",
"{",
"@link",
"#findMethod",
"(",
"Class",
"String",
"Class",
"...",
")",
"}",
".",
"This",
"variation",
"allows",
"to",
"additionally",
"narrow",
"the",
"method",
"by",
"specifying",
"its",
"return",
"type",
"."
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/commons/util/src/main/java/net/automatalib/commons/util/ReflectUtil.java#L147-L163 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Instance.java | Instance.detachDisk | public Operation detachDisk(String deviceName, OperationOption... options) {
"""
Detaches a disk from this instance.
@return a zone operation if the detach request was issued correctly, {@code null} if the
instance was not found
@throws ComputeException upon failure
"""
return compute.detachDisk(getIn... | java | public Operation detachDisk(String deviceName, OperationOption... options) {
return compute.detachDisk(getInstanceId(), deviceName, options);
} | [
"public",
"Operation",
"detachDisk",
"(",
"String",
"deviceName",
",",
"OperationOption",
"...",
"options",
")",
"{",
"return",
"compute",
".",
"detachDisk",
"(",
"getInstanceId",
"(",
")",
",",
"deviceName",
",",
"options",
")",
";",
"}"
] | Detaches a disk from this instance.
@return a zone operation if the detach request was issued correctly, {@code null} if the
instance was not found
@throws ComputeException upon failure | [
"Detaches",
"a",
"disk",
"from",
"this",
"instance",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Instance.java#L291-L293 |
scalanlp/breeze | math/src/main/java/breeze/linalg/operators/DenseVectorSupportMethods.java | DenseVectorSupportMethods.smallDotProduct_Float | public static float smallDotProduct_Float(float[] a, float[] b, int length) {
"""
WARNING: only returns the right answer for vectors of length < MAX_SMALL_DOT_PRODUCT_LENGTH
@param a
@param b
@param length
@return
"""
float sumA = 0.0f;
float sumB = 0.0f;
switch (length) {
... | java | public static float smallDotProduct_Float(float[] a, float[] b, int length) {
float sumA = 0.0f;
float sumB = 0.0f;
switch (length) {
case 7:
sumA = a[6] * b[6];
case 6:
sumB = a[5] * b[5];
case 5:
sumA += a[4] *... | [
"public",
"static",
"float",
"smallDotProduct_Float",
"(",
"float",
"[",
"]",
"a",
",",
"float",
"[",
"]",
"b",
",",
"int",
"length",
")",
"{",
"float",
"sumA",
"=",
"0.0f",
";",
"float",
"sumB",
"=",
"0.0f",
";",
"switch",
"(",
"length",
")",
"{",
... | WARNING: only returns the right answer for vectors of length < MAX_SMALL_DOT_PRODUCT_LENGTH
@param a
@param b
@param length
@return | [
"WARNING",
":",
"only",
"returns",
"the",
"right",
"answer",
"for",
"vectors",
"of",
"length",
"<",
"MAX_SMALL_DOT_PRODUCT_LENGTH"
] | train | https://github.com/scalanlp/breeze/blob/aeb3360ce77d79490fe48bc5fe2bb40f18289908/math/src/main/java/breeze/linalg/operators/DenseVectorSupportMethods.java#L85-L107 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.hosting_web_serviceName_changeMainDomain_duration_POST | public OvhOrder hosting_web_serviceName_changeMainDomain_duration_POST(String serviceName, String duration, String domain, OvhMxPlanEnum mxplan) throws IOException {
"""
Create order
REST: POST /order/hosting/web/{serviceName}/changeMainDomain/{duration}
@param domain [required] New domain for change the main ... | java | public OvhOrder hosting_web_serviceName_changeMainDomain_duration_POST(String serviceName, String duration, String domain, OvhMxPlanEnum mxplan) throws IOException {
String qPath = "/order/hosting/web/{serviceName}/changeMainDomain/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
HashMap<String... | [
"public",
"OvhOrder",
"hosting_web_serviceName_changeMainDomain_duration_POST",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"String",
"domain",
",",
"OvhMxPlanEnum",
"mxplan",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/hosting/w... | Create order
REST: POST /order/hosting/web/{serviceName}/changeMainDomain/{duration}
@param domain [required] New domain for change the main domain
@param mxplan [required] MX plan linked to the odl main domain
@param serviceName [required] The internal name of your hosting
@param duration [required] Duration | [
"Create",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L4908-L4916 |
unbescape/unbescape | src/main/java/org/unbescape/html/HtmlEscape.java | HtmlEscape.escapeHtml5Xml | public static void escapeHtml5Xml(final String text, final Writer writer)
throws IOException {
"""
<p>
Perform an HTML5 level 1 (XML-style) <strong>escape</strong> operation on a <tt>String</tt> input,
writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 1</em> means this method will only esca... | java | public static void escapeHtml5Xml(final String text, final Writer writer)
throws IOException {
escapeHtml(text, writer, HtmlEscapeType.HTML5_NAMED_REFERENCES_DEFAULT_TO_DECIMAL,
HtmlEscapeLevel.LEVEL_1_ONLY_MARKUP_SIGNIFICANT);
} | [
"public",
"static",
"void",
"escapeHtml5Xml",
"(",
"final",
"String",
"text",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeHtml",
"(",
"text",
",",
"writer",
",",
"HtmlEscapeType",
".",
"HTML5_NAMED_REFERENCES_DEFAULT_TO_DECIMAL",
",",... | <p>
Perform an HTML5 level 1 (XML-style) <strong>escape</strong> operation on a <tt>String</tt> input,
writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 1</em> means this method will only escape the five markup-significant characters:
<tt><</tt>, <tt>></tt>, <tt>&</tt>, <tt>"</tt> and <tt>'</t... | [
"<p",
">",
"Perform",
"an",
"HTML5",
"level",
"1",
"(",
"XML",
"-",
"style",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",
">",
"W... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/html/HtmlEscape.java#L449-L453 |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.addChildTaskBefore | public void addChildTaskBefore(Task child, Task previousSibling) {
"""
Inserts a child task prior to a given sibling task.
@param child new child task
@param previousSibling sibling task
"""
int index = m_children.indexOf(previousSibling);
if (index == -1)
{
m_children.add(child)... | java | public void addChildTaskBefore(Task child, Task previousSibling)
{
int index = m_children.indexOf(previousSibling);
if (index == -1)
{
m_children.add(child);
}
else
{
m_children.add(index, child);
}
child.m_parent = this;
setSummary(true);
... | [
"public",
"void",
"addChildTaskBefore",
"(",
"Task",
"child",
",",
"Task",
"previousSibling",
")",
"{",
"int",
"index",
"=",
"m_children",
".",
"indexOf",
"(",
"previousSibling",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"m_children",
".",
... | Inserts a child task prior to a given sibling task.
@param child new child task
@param previousSibling sibling task | [
"Inserts",
"a",
"child",
"task",
"prior",
"to",
"a",
"given",
"sibling",
"task",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L280-L299 |
blackfizz/EazeGraph | EazeGraphLibrary/src/main/java/org/eazegraph/lib/charts/ValueLineChart.java | ValueLineChart.onSizeChanged | @Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
"""
This is called during layout when the size of this view has changed. If
you were just added to the view hierarchy, you're called with the old
values of 0.
@param w Current width of this view.
@param h Current height of t... | java | @Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
mUsableGraphHeight = (int) (mGraphHeight - mGraphHeightPadding);
onDataChanged();
if(mUseCustomLegend) {
onLegendDataChanged();
}
} | [
"@",
"Override",
"protected",
"void",
"onSizeChanged",
"(",
"int",
"w",
",",
"int",
"h",
",",
"int",
"oldw",
",",
"int",
"oldh",
")",
"{",
"super",
".",
"onSizeChanged",
"(",
"w",
",",
"h",
",",
"oldw",
",",
"oldh",
")",
";",
"mUsableGraphHeight",
"=... | This is called during layout when the size of this view has changed. If
you were just added to the view hierarchy, you're called with the old
values of 0.
@param w Current width of this view.
@param h Current height of this view.
@param oldw Old width of this view.
@param oldh Old height of this view. | [
"This",
"is",
"called",
"during",
"layout",
"when",
"the",
"size",
"of",
"this",
"view",
"has",
"changed",
".",
"If",
"you",
"were",
"just",
"added",
"to",
"the",
"view",
"hierarchy",
"you",
"re",
"called",
"with",
"the",
"old",
"values",
"of",
"0",
".... | train | https://github.com/blackfizz/EazeGraph/blob/ce5e68ecc70e154f83bbb2fcce1a970db125c1e6/EazeGraphLibrary/src/main/java/org/eazegraph/lib/charts/ValueLineChart.java#L604-L614 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java | SARLQuickfixProvider.fixDuplicateMethod | @Fix(IssueCodes.DUPLICATE_METHOD)
public void fixDuplicateMethod(Issue issue, IssueResolutionAcceptor acceptor) {
"""
Quick fix for "Duplicate method".
@param issue the issue.
@param acceptor the quick fix acceptor.
"""
MemberRemoveModification.accept(this, issue, acceptor);
} | java | @Fix(IssueCodes.DUPLICATE_METHOD)
public void fixDuplicateMethod(Issue issue, IssueResolutionAcceptor acceptor) {
MemberRemoveModification.accept(this, issue, acceptor);
} | [
"@",
"Fix",
"(",
"IssueCodes",
".",
"DUPLICATE_METHOD",
")",
"public",
"void",
"fixDuplicateMethod",
"(",
"Issue",
"issue",
",",
"IssueResolutionAcceptor",
"acceptor",
")",
"{",
"MemberRemoveModification",
".",
"accept",
"(",
"this",
",",
"issue",
",",
"acceptor",... | Quick fix for "Duplicate method".
@param issue the issue.
@param acceptor the quick fix acceptor. | [
"Quick",
"fix",
"for",
"Duplicate",
"method",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java#L687-L690 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/SafeDatasetCommit.java | SafeDatasetCommit.persistDatasetState | private void persistDatasetState(String datasetUrn, JobState.DatasetState datasetState)
throws IOException {
"""
Persist dataset state of a given dataset identified by the dataset URN.
"""
log.info("Persisting dataset state for dataset " + datasetUrn);
this.jobContext.getDatasetStateStore().persi... | java | private void persistDatasetState(String datasetUrn, JobState.DatasetState datasetState)
throws IOException {
log.info("Persisting dataset state for dataset " + datasetUrn);
this.jobContext.getDatasetStateStore().persistDatasetState(datasetUrn, datasetState);
} | [
"private",
"void",
"persistDatasetState",
"(",
"String",
"datasetUrn",
",",
"JobState",
".",
"DatasetState",
"datasetState",
")",
"throws",
"IOException",
"{",
"log",
".",
"info",
"(",
"\"Persisting dataset state for dataset \"",
"+",
"datasetUrn",
")",
";",
"this",
... | Persist dataset state of a given dataset identified by the dataset URN. | [
"Persist",
"dataset",
"state",
"of",
"a",
"given",
"dataset",
"identified",
"by",
"the",
"dataset",
"URN",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/SafeDatasetCommit.java#L415-L419 |
instacount/appengine-counter | src/main/java/io/instacount/appengine/counter/service/ShardedCounterServiceImpl.java | ShardedCounterServiceImpl.getOrCreateCounterData | @VisibleForTesting
protected CounterDataGetCreateContainer getOrCreateCounterData(final String counterName) {
"""
Helper method to get (or create and then get) a {@link CounterData} from the Datastore with a given name. The
result of this function is guaranteed to be non-null if no exception is thrown.
@param... | java | @VisibleForTesting
protected CounterDataGetCreateContainer getOrCreateCounterData(final String counterName)
{
// Validation failures will throw an exception. See JavaDoc for details.
this.counterNameValidator.validateCounterName(counterName);
final Key<CounterData> counterKey = CounterData.key(counterName);
... | [
"@",
"VisibleForTesting",
"protected",
"CounterDataGetCreateContainer",
"getOrCreateCounterData",
"(",
"final",
"String",
"counterName",
")",
"{",
"// Validation failures will throw an exception. See JavaDoc for details.",
"this",
".",
"counterNameValidator",
".",
"validateCounterNam... | Helper method to get (or create and then get) a {@link CounterData} from the Datastore with a given name. The
result of this function is guaranteed to be non-null if no exception is thrown.
@param counterName
@return
@throws NullPointerException if the {@code counterName} is null.
@throws InvalidCounterNameException I... | [
"Helper",
"method",
"to",
"get",
"(",
"or",
"create",
"and",
"then",
"get",
")",
"a",
"{",
"@link",
"CounterData",
"}",
"from",
"the",
"Datastore",
"with",
"a",
"given",
"name",
".",
"The",
"result",
"of",
"this",
"function",
"is",
"guaranteed",
"to",
... | train | https://github.com/instacount/appengine-counter/blob/60aa86ab28f173ec1642539926b69924b8bda238/src/main/java/io/instacount/appengine/counter/service/ShardedCounterServiceImpl.java#L1253-L1279 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/endpoint/kv/KeyValueHandler.java | KeyValueHandler.handleSubdocumentMultiLookupResponseMessages | private static CouchbaseResponse handleSubdocumentMultiLookupResponseMessages(BinaryRequest request,
FullBinaryMemcacheResponse msg, ChannelHandlerContext ctx, ResponseStatus status) {
"""
Helper method to decode all multi lookup response messages.
@param request the current request.
@param msg the... | java | private static CouchbaseResponse handleSubdocumentMultiLookupResponseMessages(BinaryRequest request,
FullBinaryMemcacheResponse msg, ChannelHandlerContext ctx, ResponseStatus status) {
if (!(request instanceof BinarySubdocMultiLookupRequest))
return null;
BinarySubdocMultiLookupR... | [
"private",
"static",
"CouchbaseResponse",
"handleSubdocumentMultiLookupResponseMessages",
"(",
"BinaryRequest",
"request",
",",
"FullBinaryMemcacheResponse",
"msg",
",",
"ChannelHandlerContext",
"ctx",
",",
"ResponseStatus",
"status",
")",
"{",
"if",
"(",
"!",
"(",
"reque... | Helper method to decode all multi lookup response messages.
@param request the current request.
@param msg the current response message.
@param ctx the handler context.
@param status the response status code.
@return the decoded response or null if it wasn't a subdocument multi lookup. | [
"Helper",
"method",
"to",
"decode",
"all",
"multi",
"lookup",
"response",
"messages",
"."
] | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/endpoint/kv/KeyValueHandler.java#L1190-L1226 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WHorizontalRuleRenderer.java | WHorizontalRuleRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
"""
Paints the given WHorizontalRule.
@param component the WHorizontalRule to paint.
@param renderContext the RenderContext to paint to.
"""
XmlStringBuilder xml = renderContext.getWriter();
xml.appen... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
XmlStringBuilder xml = renderContext.getWriter();
xml.appendTagOpen("hr");
xml.appendOptionalAttribute("class", component.getHtmlClass());
xml.appendEnd();
} | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"XmlStringBuilder",
"xml",
"=",
"renderContext",
".",
"getWriter",
"(",
")",
";",
"xml",
".",
"appendTagOpen",
... | Paints the given WHorizontalRule.
@param component the WHorizontalRule to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WHorizontalRule",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WHorizontalRuleRenderer.java#L23-L29 |
paymill/paymill-java | src/main/java/com/paymill/services/SubscriptionService.java | SubscriptionService.changeAmount | public Subscription changeAmount( String subscriptionId, Integer amount ) {
"""
Changes the amount of a subscription.<br>
<br>
The new amount is valid until the end of the subscription. If you want to set a temporary one-time amount use
{@link SubscriptionService#changeAmountTemporary(String, Integer)}
@para... | java | public Subscription changeAmount( String subscriptionId, Integer amount ) {
return this.changeAmount( new Subscription( subscriptionId ), amount );
} | [
"public",
"Subscription",
"changeAmount",
"(",
"String",
"subscriptionId",
",",
"Integer",
"amount",
")",
"{",
"return",
"this",
".",
"changeAmount",
"(",
"new",
"Subscription",
"(",
"subscriptionId",
")",
",",
"amount",
")",
";",
"}"
] | Changes the amount of a subscription.<br>
<br>
The new amount is valid until the end of the subscription. If you want to set a temporary one-time amount use
{@link SubscriptionService#changeAmountTemporary(String, Integer)}
@param subscriptionId
the Id of the subscription.
@param amount
the new amount.
@return the upd... | [
"Changes",
"the",
"amount",
"of",
"a",
"subscription",
".",
"<br",
">",
"<br",
">",
"The",
"new",
"amount",
"is",
"valid",
"until",
"the",
"end",
"of",
"the",
"subscription",
".",
"If",
"you",
"want",
"to",
"set",
"a",
"temporary",
"one",
"-",
"time",
... | train | https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/SubscriptionService.java#L289-L291 |
googleads/googleads-java-lib | extensions/adwords_rate_limiter/src/main/java/com/google/api/ads/adwords/extension/ratelimiter/ApiRetryStrategyManager.java | ApiRetryStrategyManager.getRateLimitBucket | private static @Nullable ApiRateLimitBucket getRateLimitBucket(String name, boolean isUtility) {
"""
Get the {@link ApiRateLimitBucket} for the specified AdWords API service / utility name.
@param name the specified AdWords API service / utility name
@param isUtility whether this is for some AdWords API utilit... | java | private static @Nullable ApiRateLimitBucket getRateLimitBucket(String name, boolean isUtility) {
if (isUtility) {
// For utilities, we only support ReportDownloader but not others (such as BatchJobHelper).
return reportingClasses.contains(name) ? ApiRateLimitBucket.REPORTING : null;
} else {
/... | [
"private",
"static",
"@",
"Nullable",
"ApiRateLimitBucket",
"getRateLimitBucket",
"(",
"String",
"name",
",",
"boolean",
"isUtility",
")",
"{",
"if",
"(",
"isUtility",
")",
"{",
"// For utilities, we only support ReportDownloader but not others (such as BatchJobHelper).",
"re... | Get the {@link ApiRateLimitBucket} for the specified AdWords API service / utility name.
@param name the specified AdWords API service / utility name
@param isUtility whether this is for some AdWords API utility
@return the corresponding {@link ApiRateLimitBucket} enum, or null if it's not supported by
this rate limit... | [
"Get",
"the",
"{",
"@link",
"ApiRateLimitBucket",
"}",
"for",
"the",
"specified",
"AdWords",
"API",
"service",
"/",
"utility",
"name",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/extensions/adwords_rate_limiter/src/main/java/com/google/api/ads/adwords/extension/ratelimiter/ApiRetryStrategyManager.java#L45-L53 |
m-m-m/util | gwt/src/main/resources/net/sf/mmm/util/gwt/supersource/net/sf/mmm/util/lang/api/ComparatorHelper.java | ComparatorHelper.evalComparable | @SuppressWarnings( {
"""
Logic for {@link CompareOperator#eval(Object, Object)} with {@link Comparable} arguments.
@param comparator is the {@link CompareOperator}.
@param arg1 is the first argument.
@param arg2 is the second argument.
@return the result of the {@link Comparator} applied to the given argumen... | java | @SuppressWarnings({ "rawtypes", "unchecked" })
static boolean evalComparable(CompareOperator comparator, Comparable arg1, Comparable arg2) {
int delta;
try {
delta = signum(arg1.compareTo(arg2));
} catch (ClassCastException e) {
// delta = -arg2.compareTo(arg1);
// incompatible compara... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"static",
"boolean",
"evalComparable",
"(",
"CompareOperator",
"comparator",
",",
"Comparable",
"arg1",
",",
"Comparable",
"arg2",
")",
"{",
"int",
"delta",
";",
"try",
"{",
"de... | Logic for {@link CompareOperator#eval(Object, Object)} with {@link Comparable} arguments.
@param comparator is the {@link CompareOperator}.
@param arg1 is the first argument.
@param arg2 is the second argument.
@return the result of the {@link Comparator} applied to the given arguments. | [
"Logic",
"for",
"{",
"@link",
"CompareOperator#eval",
"(",
"Object",
"Object",
")",
"}",
"with",
"{",
"@link",
"Comparable",
"}",
"arguments",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/gwt/src/main/resources/net/sf/mmm/util/gwt/supersource/net/sf/mmm/util/lang/api/ComparatorHelper.java#L49-L62 |
dadoonet/fscrawler | elasticsearch-client/elasticsearch-client-v6/src/main/java/fr/pilato/elasticsearch/crawler/fs/client/v6/ElasticsearchClientV6.java | ElasticsearchClientV6.createIndex | public void createIndex(String index, boolean ignoreErrors, String indexSettings) throws IOException {
"""
Create an index
@param index index name
@param ignoreErrors don't fail if the index already exists
@param indexSettings index settings if any
@throws IOException In case of error
"""
logger.de... | java | public void createIndex(String index, boolean ignoreErrors, String indexSettings) throws IOException {
logger.debug("create index [{}]", index);
logger.trace("index settings: [{}]", indexSettings);
CreateIndexRequest cir = new CreateIndexRequest(index);
if (!isNullOrEmpty(indexSettings))... | [
"public",
"void",
"createIndex",
"(",
"String",
"index",
",",
"boolean",
"ignoreErrors",
",",
"String",
"indexSettings",
")",
"throws",
"IOException",
"{",
"logger",
".",
"debug",
"(",
"\"create index [{}]\"",
",",
"index",
")",
";",
"logger",
".",
"trace",
"(... | Create an index
@param index index name
@param ignoreErrors don't fail if the index already exists
@param indexSettings index settings if any
@throws IOException In case of error | [
"Create",
"an",
"index"
] | train | https://github.com/dadoonet/fscrawler/blob/cca00a14e21ef9986aa30e19b160463aed6bf921/elasticsearch-client/elasticsearch-client-v6/src/main/java/fr/pilato/elasticsearch/crawler/fs/client/v6/ElasticsearchClientV6.java#L232-L250 |
eserating/siren4j | src/main/java/com/google/code/siren4j/converter/ReflectingConverter.java | ReflectingConverter.handleSelfLink | private void handleSelfLink(EntityBuilder builder, String resolvedUri) {
"""
Add the self link to the entity.
@param builder assumed not <code>null</code>.
@param resolvedUri the token resolved uri. Assumed not blank.
"""
if (StringUtils.isBlank(resolvedUri)) {
return;
}
... | java | private void handleSelfLink(EntityBuilder builder, String resolvedUri) {
if (StringUtils.isBlank(resolvedUri)) {
return;
}
Link link = LinkBuilder.newInstance().setRelationship(Link.RELATIONSHIP_SELF).setHref(resolvedUri).build();
builder.addLink(link);
} | [
"private",
"void",
"handleSelfLink",
"(",
"EntityBuilder",
"builder",
",",
"String",
"resolvedUri",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"resolvedUri",
")",
")",
"{",
"return",
";",
"}",
"Link",
"link",
"=",
"LinkBuilder",
".",
"newInstan... | Add the self link to the entity.
@param builder assumed not <code>null</code>.
@param resolvedUri the token resolved uri. Assumed not blank. | [
"Add",
"the",
"self",
"link",
"to",
"the",
"entity",
"."
] | train | https://github.com/eserating/siren4j/blob/f12e3185076ad920352ec4f6eb2a071a3683505f/src/main/java/com/google/code/siren4j/converter/ReflectingConverter.java#L579-L585 |
spotify/async-google-pubsub-client | src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java | Pubsub.createSubscription | public PubsubFuture<Subscription> createSubscription(final String canonicalSubscriptionName,
final String canonicalTopic) {
"""
Create a Pub/Sub subscription.
@param canonicalSubscriptionName The canonical (including project) name of the scubscription to cr... | java | public PubsubFuture<Subscription> createSubscription(final String canonicalSubscriptionName,
final String canonicalTopic) {
return createSubscription(Subscription.of(canonicalSubscriptionName, canonicalTopic));
} | [
"public",
"PubsubFuture",
"<",
"Subscription",
">",
"createSubscription",
"(",
"final",
"String",
"canonicalSubscriptionName",
",",
"final",
"String",
"canonicalTopic",
")",
"{",
"return",
"createSubscription",
"(",
"Subscription",
".",
"of",
"(",
"canonicalSubscription... | Create a Pub/Sub subscription.
@param canonicalSubscriptionName The canonical (including project) name of the scubscription to create.
@param canonicalTopic The canonical (including project) name of the topic to subscribe to.
@return A future that is completed when this request is completed. | [
"Create",
"a",
"Pub",
"/",
"Sub",
"subscription",
"."
] | train | https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L395-L398 |
softlayer/softlayer-java | src/main/java/com/softlayer/api/Type.java | Type.setUnknownProperties | public void setUnknownProperties(Map<String, Object> unknownProperties) {
"""
Set the unknown properties for this type. The values are copied to an immutable map.
Note, these values are NOT serialized into the type.
"""
this.unknownProperties = Collections.unmodifiableMap(
new HashMap<>(un... | java | public void setUnknownProperties(Map<String, Object> unknownProperties) {
this.unknownProperties = Collections.unmodifiableMap(
new HashMap<>(unknownProperties));
} | [
"public",
"void",
"setUnknownProperties",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"unknownProperties",
")",
"{",
"this",
".",
"unknownProperties",
"=",
"Collections",
".",
"unmodifiableMap",
"(",
"new",
"HashMap",
"<>",
"(",
"unknownProperties",
")",
")",... | Set the unknown properties for this type. The values are copied to an immutable map.
Note, these values are NOT serialized into the type. | [
"Set",
"the",
"unknown",
"properties",
"for",
"this",
"type",
".",
"The",
"values",
"are",
"copied",
"to",
"an",
"immutable",
"map",
".",
"Note",
"these",
"values",
"are",
"NOT",
"serialized",
"into",
"the",
"type",
"."
] | train | https://github.com/softlayer/softlayer-java/blob/0bb17f4b520aae0d0878f3dcaad0d9ee96472363/src/main/java/com/softlayer/api/Type.java#L26-L29 |
vdmeer/skb-java-base | src/main/java/de/vandermeer/skb/base/managers/MessageMgr.java | MessageMgr.createErrorMessage | public static Message5WH createErrorMessage(String what, Object ... obj) {
"""
Creates a new error message.
@param what the what part of the message (what has happened)
@param obj objects to add to the message
@return new information message
"""
return new Message5WH_Builder().addWhat(FormattingTupleWrapp... | java | public static Message5WH createErrorMessage(String what, Object ... obj){
return new Message5WH_Builder().addWhat(FormattingTupleWrapper.create(what, obj)).setType(E_MessageType.ERROR).build();
} | [
"public",
"static",
"Message5WH",
"createErrorMessage",
"(",
"String",
"what",
",",
"Object",
"...",
"obj",
")",
"{",
"return",
"new",
"Message5WH_Builder",
"(",
")",
".",
"addWhat",
"(",
"FormattingTupleWrapper",
".",
"create",
"(",
"what",
",",
"obj",
")",
... | Creates a new error message.
@param what the what part of the message (what has happened)
@param obj objects to add to the message
@return new information message | [
"Creates",
"a",
"new",
"error",
"message",
"."
] | train | https://github.com/vdmeer/skb-java-base/blob/6d845bcc482aa9344d016e80c0c3455aeae13a13/src/main/java/de/vandermeer/skb/base/managers/MessageMgr.java#L122-L124 |
nguillaumin/slick2d-maven | slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/PositionControls.java | PositionControls.setPosition | public void setPosition(int x,int y) {
"""
Set the position of the emitter
@param x The x position of the emitter
@param y The y position of the emitter
"""
int cx = (xoffset.getMin() + xoffset.getMax()) / 2;
int cy = (yoffset.getMin() + yoffset.getMax()) / 2;
int dx = x - cx;
int dy = y - ... | java | public void setPosition(int x,int y) {
int cx = (xoffset.getMin() + xoffset.getMax()) / 2;
int cy = (yoffset.getMin() + yoffset.getMax()) / 2;
int dx = x - cx;
int dy = y - cy;
xoffset.setMin(xoffset.getMin() + dx);
xoffset.setMax(xoffset.getMax() + dx);
yoffset.setMin(yoffset.getMin() + dy... | [
"public",
"void",
"setPosition",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"int",
"cx",
"=",
"(",
"xoffset",
".",
"getMin",
"(",
")",
"+",
"xoffset",
".",
"getMax",
"(",
")",
")",
"/",
"2",
";",
"int",
"cy",
"=",
"(",
"yoffset",
".",
"getMin"... | Set the position of the emitter
@param x The x position of the emitter
@param y The y position of the emitter | [
"Set",
"the",
"position",
"of",
"the",
"emitter"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/PositionControls.java#L37-L51 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.indexElasticsearchDocument | @When("^I index a document in the index named '(.+?)' using the mapping named '(.+?)' with key '(.+?)' and value '(.+?)'$")
public void indexElasticsearchDocument(String indexName, String mappingName, String key, String value) throws Exception {
"""
Index a document within a mapping type.
@param indexName
... | java | @When("^I index a document in the index named '(.+?)' using the mapping named '(.+?)' with key '(.+?)' and value '(.+?)'$")
public void indexElasticsearchDocument(String indexName, String mappingName, String key, String value) throws Exception {
ArrayList<XContentBuilder> mappingsource = new ArrayList<XCont... | [
"@",
"When",
"(",
"\"^I index a document in the index named '(.+?)' using the mapping named '(.+?)' with key '(.+?)' and value '(.+?)'$\"",
")",
"public",
"void",
"indexElasticsearchDocument",
"(",
"String",
"indexName",
",",
"String",
"mappingName",
",",
"String",
"key",
",",
"S... | Index a document within a mapping type.
@param indexName
@param mappingName
@param key
@param value
@throws Exception | [
"Index",
"a",
"document",
"within",
"a",
"mapping",
"type",
"."
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L556-L562 |
looly/hutool | hutool-http/src/main/java/cn/hutool/http/webservice/SoapClient.java | SoapClient.create | public static SoapClient create(String url, SoapProtocol protocol, String namespaceURI) {
"""
创建SOAP客户端
@param url WS的URL地址
@param protocol 协议,见{@link SoapProtocol}
@param namespaceURI 方法上的命名空间URI
@return {@link SoapClient}
@since 4.5.6
"""
return new SoapClient(url, protocol, namespaceURI);
} | java | public static SoapClient create(String url, SoapProtocol protocol, String namespaceURI) {
return new SoapClient(url, protocol, namespaceURI);
} | [
"public",
"static",
"SoapClient",
"create",
"(",
"String",
"url",
",",
"SoapProtocol",
"protocol",
",",
"String",
"namespaceURI",
")",
"{",
"return",
"new",
"SoapClient",
"(",
"url",
",",
"protocol",
",",
"namespaceURI",
")",
";",
"}"
] | 创建SOAP客户端
@param url WS的URL地址
@param protocol 协议,见{@link SoapProtocol}
@param namespaceURI 方法上的命名空间URI
@return {@link SoapClient}
@since 4.5.6 | [
"创建SOAP客户端"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/webservice/SoapClient.java#L85-L87 |
micrometer-metrics/micrometer | micrometer-core/src/main/java/io/micrometer/core/instrument/binder/jpa/HibernateMetrics.java | HibernateMetrics.monitor | public static void monitor(MeterRegistry registry, SessionFactory sessionFactory, String sessionFactoryName, Iterable<Tag> tags) {
"""
Create {@code HibernateMetrics} and bind to the specified meter registry.
@param registry meter registry to use
@param sessionFactory session factory to use
@param sessionFact... | java | public static void monitor(MeterRegistry registry, SessionFactory sessionFactory, String sessionFactoryName, Iterable<Tag> tags) {
new HibernateMetrics(sessionFactory, sessionFactoryName, tags).bindTo(registry);
} | [
"public",
"static",
"void",
"monitor",
"(",
"MeterRegistry",
"registry",
",",
"SessionFactory",
"sessionFactory",
",",
"String",
"sessionFactoryName",
",",
"Iterable",
"<",
"Tag",
">",
"tags",
")",
"{",
"new",
"HibernateMetrics",
"(",
"sessionFactory",
",",
"sessi... | Create {@code HibernateMetrics} and bind to the specified meter registry.
@param registry meter registry to use
@param sessionFactory session factory to use
@param sessionFactoryName session factory name as a tag value
@param tags additional tags | [
"Create",
"{",
"@code",
"HibernateMetrics",
"}",
"and",
"bind",
"to",
"the",
"specified",
"meter",
"registry",
"."
] | train | https://github.com/micrometer-metrics/micrometer/blob/127fa3265325cc894f368312ed8890b76a055d88/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/jpa/HibernateMetrics.java#L70-L72 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java | SqlDateTimeUtils.toTimestamp | public static Long toTimestamp(String dateStr, String format, TimeZone tz) {
"""
Parse date time string to timestamp based on the given time zone and format.
Returns null if parsing failed.
@param dateStr the date time string
@param format date time string format
@param tz the time zone
"""
SimpleDateF... | java | public static Long toTimestamp(String dateStr, String format, TimeZone tz) {
SimpleDateFormat formatter = FORMATTER_CACHE.get(format);
formatter.setTimeZone(tz);
try {
return formatter.parse(dateStr).getTime();
} catch (ParseException e) {
return null;
}
} | [
"public",
"static",
"Long",
"toTimestamp",
"(",
"String",
"dateStr",
",",
"String",
"format",
",",
"TimeZone",
"tz",
")",
"{",
"SimpleDateFormat",
"formatter",
"=",
"FORMATTER_CACHE",
".",
"get",
"(",
"format",
")",
";",
"formatter",
".",
"setTimeZone",
"(",
... | Parse date time string to timestamp based on the given time zone and format.
Returns null if parsing failed.
@param dateStr the date time string
@param format date time string format
@param tz the time zone | [
"Parse",
"date",
"time",
"string",
"to",
"timestamp",
"based",
"on",
"the",
"given",
"time",
"zone",
"and",
"format",
".",
"Returns",
"null",
"if",
"parsing",
"failed",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java#L271-L279 |
negusoft/holoaccent | HoloAccent/src/com/negusoft/holoaccent/util/BitmapUtils.java | BitmapUtils.changeTintColor | public static Bitmap changeTintColor(Bitmap bitmap, int originalColor, int destinationColor) {
"""
Creates a copy of the bitmap by calculating the transformation based on the
original color and applying it to the the destination color.
@param bitmap The original bitmap.
@param originalColor Tint color in the or... | java | public static Bitmap changeTintColor(Bitmap bitmap, int originalColor, int destinationColor) {
// original tint color
int[] o = new int[] {
Color.red(originalColor),
Color.green(originalColor),
Color.blue(originalColor) };
// destination tint color
int[] d = new int[] {
Color.red(destinationColo... | [
"public",
"static",
"Bitmap",
"changeTintColor",
"(",
"Bitmap",
"bitmap",
",",
"int",
"originalColor",
",",
"int",
"destinationColor",
")",
"{",
"// original tint color",
"int",
"[",
"]",
"o",
"=",
"new",
"int",
"[",
"]",
"{",
"Color",
".",
"red",
"(",
"or... | Creates a copy of the bitmap by calculating the transformation based on the
original color and applying it to the the destination color.
@param bitmap The original bitmap.
@param originalColor Tint color in the original bitmap.
@param destinationColor Tint color to be applied.
@return A copy of the given bitmap with th... | [
"Creates",
"a",
"copy",
"of",
"the",
"bitmap",
"by",
"calculating",
"the",
"transformation",
"based",
"on",
"the",
"original",
"color",
"and",
"applying",
"it",
"to",
"the",
"the",
"destination",
"color",
"."
] | train | https://github.com/negusoft/holoaccent/blob/7121a02dde94834e770cb81174d0bdc596323324/HoloAccent/src/com/negusoft/holoaccent/util/BitmapUtils.java#L79-L112 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSetSpanner.java | UnicodeSetSpanner.countIn | public int countIn(CharSequence sequence, CountMethod countMethod, SpanCondition spanCondition) {
"""
Returns the number of matching characters found in a character sequence.
The code alternates spans; see the class doc for {@link UnicodeSetSpanner} for a note about boundary conditions.
@param sequence
the sequ... | java | public int countIn(CharSequence sequence, CountMethod countMethod, SpanCondition spanCondition) {
int count = 0;
int start = 0;
SpanCondition skipSpan = spanCondition == SpanCondition.NOT_CONTAINED ? SpanCondition.SIMPLE
: SpanCondition.NOT_CONTAINED;
final int length = s... | [
"public",
"int",
"countIn",
"(",
"CharSequence",
"sequence",
",",
"CountMethod",
"countMethod",
",",
"SpanCondition",
"spanCondition",
")",
"{",
"int",
"count",
"=",
"0",
";",
"int",
"start",
"=",
"0",
";",
"SpanCondition",
"skipSpan",
"=",
"spanCondition",
"=... | Returns the number of matching characters found in a character sequence.
The code alternates spans; see the class doc for {@link UnicodeSetSpanner} for a note about boundary conditions.
@param sequence
the sequence to count characters in
@param countMethod
whether to treat an entire span as a match, or individual eleme... | [
"Returns",
"the",
"number",
"of",
"matching",
"characters",
"found",
"in",
"a",
"character",
"sequence",
".",
"The",
"code",
"alternates",
"spans",
";",
"see",
"the",
"class",
"doc",
"for",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSetSpanner.java#L148-L172 |
spring-projects/spring-shell | spring-shell-core/src/main/java/org/springframework/shell/Utils.java | Utils.createMethodParameter | public static MethodParameter createMethodParameter(Executable executable, int i) {
"""
Return a properly initialized MethodParameter for the given executable and index.
"""
MethodParameter methodParameter;
if (executable instanceof Method) {
methodParameter = new MethodParameter((Method) executable, i)... | java | public static MethodParameter createMethodParameter(Executable executable, int i) {
MethodParameter methodParameter;
if (executable instanceof Method) {
methodParameter = new MethodParameter((Method) executable, i);
} else if (executable instanceof Constructor){
methodParameter = new MethodParameter((Constr... | [
"public",
"static",
"MethodParameter",
"createMethodParameter",
"(",
"Executable",
"executable",
",",
"int",
"i",
")",
"{",
"MethodParameter",
"methodParameter",
";",
"if",
"(",
"executable",
"instanceof",
"Method",
")",
"{",
"methodParameter",
"=",
"new",
"MethodPa... | Return a properly initialized MethodParameter for the given executable and index. | [
"Return",
"a",
"properly",
"initialized",
"MethodParameter",
"for",
"the",
"given",
"executable",
"and",
"index",
"."
] | train | https://github.com/spring-projects/spring-shell/blob/23d99f45eb8f487e31a1f080c837061313bbfafa/spring-shell-core/src/main/java/org/springframework/shell/Utils.java#L68-L79 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagEditable.java | CmsJspTagEditable.startDirectEdit | public static boolean startDirectEdit(PageContext context, CmsDirectEditParams params) throws JspException {
"""
Includes the "direct edit" start element that adds HTML for the editable area to
the output page.<p>
@param context the current JSP page context
@param params the direct edit parameters
@return ... | java | public static boolean startDirectEdit(PageContext context, CmsDirectEditParams params) throws JspException {
// get the direct edit bean from the context
I_CmsDirectEditProvider eb = getDirectEditProvider(context);
boolean result = false;
if (eb != null) {
// the direct edi... | [
"public",
"static",
"boolean",
"startDirectEdit",
"(",
"PageContext",
"context",
",",
"CmsDirectEditParams",
"params",
")",
"throws",
"JspException",
"{",
"// get the direct edit bean from the context",
"I_CmsDirectEditProvider",
"eb",
"=",
"getDirectEditProvider",
"(",
"cont... | Includes the "direct edit" start element that adds HTML for the editable area to
the output page.<p>
@param context the current JSP page context
@param params the direct edit parameters
@return <code>true</code> in case a direct edit element has been opened
@throws JspException in case something goes wrong | [
"Includes",
"the",
"direct",
"edit",
"start",
"element",
"that",
"adds",
"HTML",
"for",
"the",
"editable",
"area",
"to",
"the",
"output",
"page",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagEditable.java#L294-L312 |
phax/ph-oton | ph-oton-security/src/main/java/com/helger/photon/security/user/UserManager.java | UserManager.setUserPassword | @Nonnull
public EChange setUserPassword (@Nullable final String sUserID, @Nonnull final String sNewPlainTextPassword) {
"""
Change the modifiable data of a user
@param sUserID
The ID of the user to be modified. May be <code>null</code>.
@param sNewPlainTextPassword
The new password in plain text. May not b... | java | @Nonnull
public EChange setUserPassword (@Nullable final String sUserID, @Nonnull final String sNewPlainTextPassword)
{
// Resolve user
final User aUser = getOfID (sUserID);
if (aUser == null)
{
AuditHelper.onAuditModifyFailure (User.OT, sUserID, "no-such-user-id", "password");
return EC... | [
"@",
"Nonnull",
"public",
"EChange",
"setUserPassword",
"(",
"@",
"Nullable",
"final",
"String",
"sUserID",
",",
"@",
"Nonnull",
"final",
"String",
"sNewPlainTextPassword",
")",
"{",
"// Resolve user",
"final",
"User",
"aUser",
"=",
"getOfID",
"(",
"sUserID",
")... | Change the modifiable data of a user
@param sUserID
The ID of the user to be modified. May be <code>null</code>.
@param sNewPlainTextPassword
The new password in plain text. May not be <code>null</code>.
@return {@link EChange} | [
"Change",
"the",
"modifiable",
"data",
"of",
"a",
"user"
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-security/src/main/java/com/helger/photon/security/user/UserManager.java#L498-L532 |
jpelzer/pelzer-util | src/main/java/com/pelzer/util/PasswordCrypt.java | PasswordCrypt.computePasswordHash | public static String computePasswordHash(final String password, final String salt) {
"""
Converts the salt into a byte array using {@link #stringToSalt(String)} and
then calls {@link #computePasswordHash(String, byte[])}
"""
return computePasswordHash(password, stringToSalt(salt));
} | java | public static String computePasswordHash(final String password, final String salt) {
return computePasswordHash(password, stringToSalt(salt));
} | [
"public",
"static",
"String",
"computePasswordHash",
"(",
"final",
"String",
"password",
",",
"final",
"String",
"salt",
")",
"{",
"return",
"computePasswordHash",
"(",
"password",
",",
"stringToSalt",
"(",
"salt",
")",
")",
";",
"}"
] | Converts the salt into a byte array using {@link #stringToSalt(String)} and
then calls {@link #computePasswordHash(String, byte[])} | [
"Converts",
"the",
"salt",
"into",
"a",
"byte",
"array",
"using",
"{"
] | train | https://github.com/jpelzer/pelzer-util/blob/ec14f2573fd977d1442dba5d1507a264f5ea9aa6/src/main/java/com/pelzer/util/PasswordCrypt.java#L19-L21 |
jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/JsonParser.java | JsonParser.extractAndWriteExtensionsAsDirectChild | private void extractAndWriteExtensionsAsDirectChild(IBase theElement, JsonLikeWriter theEventWriter, BaseRuntimeElementDefinition<?> theElementDef, RuntimeResourceDefinition theResDef,
IBaseResource theResource, CompositeChildElement theChildElem, CompositeChildElement theParent, EncodeContext theEnc... | java | private void extractAndWriteExtensionsAsDirectChild(IBase theElement, JsonLikeWriter theEventWriter, BaseRuntimeElementDefinition<?> theElementDef, RuntimeResourceDefinition theResDef,
IBaseResource theResource, CompositeChildElement theChildElem, CompositeChildElement theParent, EncodeContext theEnc... | [
"private",
"void",
"extractAndWriteExtensionsAsDirectChild",
"(",
"IBase",
"theElement",
",",
"JsonLikeWriter",
"theEventWriter",
",",
"BaseRuntimeElementDefinition",
"<",
"?",
">",
"theElementDef",
",",
"RuntimeResourceDefinition",
"theResDef",
",",
"IBaseResource",
"theReso... | This is useful only for the two cases where extensions are encoded as direct children (e.g. not in some object
called _name): resource extensions, and extension extensions | [
"This",
"is",
"useful",
"only",
"for",
"the",
"two",
"cases",
"where",
"extensions",
"are",
"encoded",
"as",
"direct",
"children",
"(",
"e",
".",
"g",
".",
"not",
"in",
"some",
"object",
"called",
"_name",
")",
":",
"resource",
"extensions",
"and",
"exte... | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/JsonParser.java#L743-L758 |
haraldk/TwelveMonkeys | imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/PICTImageReader.java | PICTImageReader.readPoly | private Polygon readPoly(DataInput pStream, Rectangle pBounds) throws IOException {
"""
Read in a polygon. The input stream should be positioned at the first byte
of the polygon.
@param pStream the stream to read from
@param pBounds the bounds rectangle to read into
@return the polygon
@throws IOExcepti... | java | private Polygon readPoly(DataInput pStream, Rectangle pBounds) throws IOException {
// Get polygon data size
int size = pStream.readUnsignedShort();
// Get poly bounds
readRectangle(pStream, pBounds);
// Initialize the point array to the right size
int points = (size - ... | [
"private",
"Polygon",
"readPoly",
"(",
"DataInput",
"pStream",
",",
"Rectangle",
"pBounds",
")",
"throws",
"IOException",
"{",
"// Get polygon data size",
"int",
"size",
"=",
"pStream",
".",
"readUnsignedShort",
"(",
")",
";",
"// Get poly bounds",
"readRectangle",
... | Read in a polygon. The input stream should be positioned at the first byte
of the polygon.
@param pStream the stream to read from
@param pBounds the bounds rectangle to read into
@return the polygon
@throws IOException if an I/O error occurs while reading the image. | [
"Read",
"in",
"a",
"polygon",
".",
"The",
"input",
"stream",
"should",
"be",
"positioned",
"at",
"the",
"first",
"byte",
"of",
"the",
"polygon",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/PICTImageReader.java#L2452-L2476 |
PureSolTechnologies/parsers | parsers/src/main/java/com/puresoltechnologies/parsers/grammar/GrammarConverter.java | GrammarConverter.getTokenDefinition | private TokenDefinition getTokenDefinition(ParseTreeNode tokenDefinition,
Map<String, ParseTreeNode> helpers, Map<String, ParseTreeNode> tokens)
throws GrammarException, TreeException {
"""
This is the method which merges all tokens with their helpers.
@param tokenName
@param helpers
@param tokens
... | java | private TokenDefinition getTokenDefinition(ParseTreeNode tokenDefinition,
Map<String, ParseTreeNode> helpers, Map<String, ParseTreeNode> tokens)
throws GrammarException, TreeException {
String tokenName = tokenDefinition.getChild("IDENTIFIER").getText();
String pattern = createTokenDefinitionPattern(tokenDe... | [
"private",
"TokenDefinition",
"getTokenDefinition",
"(",
"ParseTreeNode",
"tokenDefinition",
",",
"Map",
"<",
"String",
",",
"ParseTreeNode",
">",
"helpers",
",",
"Map",
"<",
"String",
",",
"ParseTreeNode",
">",
"tokens",
")",
"throws",
"GrammarException",
",",
"T... | This is the method which merges all tokens with their helpers.
@param tokenName
@param helpers
@param tokens
@return
@throws GrammarException
@throws TreeException | [
"This",
"is",
"the",
"method",
"which",
"merges",
"all",
"tokens",
"with",
"their",
"helpers",
"."
] | train | https://github.com/PureSolTechnologies/parsers/blob/61077223b90d3768ff9445ae13036343c98b63cd/parsers/src/main/java/com/puresoltechnologies/parsers/grammar/GrammarConverter.java#L214-L228 |
tvesalainen/util | util/src/main/java/d3/env/TSAGeoMag.java | TSAGeoMag.getDipAngle | public double getDipAngle( double dlat, double dlong, double year, double altitude ) {
"""
Returns the magnetic field dip angle from the
Department of Defense geomagnetic model and data,
in degrees.
@param dlat Latitude in decimal degrees.
@param dlong Longitude in decimal degrees.
@param year Date of... | java | public double getDipAngle( double dlat, double dlong, double year, double altitude )
{
calcGeoMag( dlat, dlong, year, altitude );
return dip;
} | [
"public",
"double",
"getDipAngle",
"(",
"double",
"dlat",
",",
"double",
"dlong",
",",
"double",
"year",
",",
"double",
"altitude",
")",
"{",
"calcGeoMag",
"(",
"dlat",
",",
"dlong",
",",
"year",
",",
"altitude",
")",
";",
"return",
"dip",
";",
"}"
] | Returns the magnetic field dip angle from the
Department of Defense geomagnetic model and data,
in degrees.
@param dlat Latitude in decimal degrees.
@param dlong Longitude in decimal degrees.
@param year Date of the calculation in decimal years.
@param altitude Altitude of the calculation in kilometers.
@retur... | [
"Returns",
"the",
"magnetic",
"field",
"dip",
"angle",
"from",
"the",
"Department",
"of",
"Defense",
"geomagnetic",
"model",
"and",
"data",
"in",
"degrees",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/d3/env/TSAGeoMag.java#L1143-L1147 |
UrielCh/ovh-java-sdk | ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java | ApiOvhPrice.hpcspot_account_subscription_subscriptionName_GET | public OvhPrice hpcspot_account_subscription_subscriptionName_GET(net.minidev.ovh.api.price.hpcspot.account.OvhSubscriptionEnum subscriptionName) throws IOException {
"""
Get the price of a HPC Spot Account for 1 month
REST: GET /price/hpcspot/account/subscription/{subscriptionName}
@param subscriptionName [re... | java | public OvhPrice hpcspot_account_subscription_subscriptionName_GET(net.minidev.ovh.api.price.hpcspot.account.OvhSubscriptionEnum subscriptionName) throws IOException {
String qPath = "/price/hpcspot/account/subscription/{subscriptionName}";
StringBuilder sb = path(qPath, subscriptionName);
String resp = exec(qPath... | [
"public",
"OvhPrice",
"hpcspot_account_subscription_subscriptionName_GET",
"(",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"price",
".",
"hpcspot",
".",
"account",
".",
"OvhSubscriptionEnum",
"subscriptionName",
")",
"throws",
"IOException",
"{",
"String",
... | Get the price of a HPC Spot Account for 1 month
REST: GET /price/hpcspot/account/subscription/{subscriptionName}
@param subscriptionName [required] Subscription | [
"Get",
"the",
"price",
"of",
"a",
"HPC",
"Spot",
"Account",
"for",
"1",
"month"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java#L219-L224 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FileSystem.java | FileSystem.moveFromLocalFile | public void moveFromLocalFile(Path src, Path dst)
throws IOException {
"""
The src file is on the local disk. Add it to FS at
the given dst name, removing the source afterwards.
"""
copyFromLocalFile(true, true, false, src, dst);
} | java | public void moveFromLocalFile(Path src, Path dst)
throws IOException {
copyFromLocalFile(true, true, false, src, dst);
} | [
"public",
"void",
"moveFromLocalFile",
"(",
"Path",
"src",
",",
"Path",
"dst",
")",
"throws",
"IOException",
"{",
"copyFromLocalFile",
"(",
"true",
",",
"true",
",",
"false",
",",
"src",
",",
"dst",
")",
";",
"}"
] | The src file is on the local disk. Add it to FS at
the given dst name, removing the source afterwards. | [
"The",
"src",
"file",
"is",
"on",
"the",
"local",
"disk",
".",
"Add",
"it",
"to",
"FS",
"at",
"the",
"given",
"dst",
"name",
"removing",
"the",
"source",
"afterwards",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileSystem.java#L1641-L1644 |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection.core/src/com/ibm/wsspi/injectionengine/InjectionBinding.java | InjectionBinding.addOrRemoveProperty | protected static <K, V> void addOrRemoveProperty(Map<K, V> props, K key, V value) {
"""
Add the specified property if the value is non-null, or remove it from
the map if it is null.
@param props the properties to update
@param key the key
@param value the value
"""
if (value == null) {
... | java | protected static <K, V> void addOrRemoveProperty(Map<K, V> props, K key, V value)
{
if (value == null) {
// Generic properties have already been added to the map. Remove them
// so they aren't confused with the builtin properties.
props.remove(key);
} else {
... | [
"protected",
"static",
"<",
"K",
",",
"V",
">",
"void",
"addOrRemoveProperty",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"props",
",",
"K",
"key",
",",
"V",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"// Generic properties have already b... | Add the specified property if the value is non-null, or remove it from
the map if it is null.
@param props the properties to update
@param key the key
@param value the value | [
"Add",
"the",
"specified",
"property",
"if",
"the",
"value",
"is",
"non",
"-",
"null",
"or",
"remove",
"it",
"from",
"the",
"map",
"if",
"it",
"is",
"null",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/wsspi/injectionengine/InjectionBinding.java#L1203-L1212 |
wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/states/Http2StateUtil.java | Http2StateUtil.sendRstFrame | public static void sendRstFrame(ChannelHandlerContext ctx, Http2ConnectionEncoder encoder, int streamId)
throws Http2Exception {
"""
Sends {@link org.wso2.transport.http.netty.message.Http2Reset} frame with `NO_ERROR` error code.
@param ctx the channel handler context
@param encoder the HTTP2... | java | public static void sendRstFrame(ChannelHandlerContext ctx, Http2ConnectionEncoder encoder, int streamId)
throws Http2Exception {
encoder.writeRstStream(ctx, streamId, Http2Error.NO_ERROR.code(), ctx.newPromise());
encoder.flowController().writePendingBytes();
ctx.flush();
} | [
"public",
"static",
"void",
"sendRstFrame",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Http2ConnectionEncoder",
"encoder",
",",
"int",
"streamId",
")",
"throws",
"Http2Exception",
"{",
"encoder",
".",
"writeRstStream",
"(",
"ctx",
",",
"streamId",
",",
"Http2Error",... | Sends {@link org.wso2.transport.http.netty.message.Http2Reset} frame with `NO_ERROR` error code.
@param ctx the channel handler context
@param encoder the HTTP2 connection encoder
@param streamId id of the stream need to be send RST_FRAME
@throws Http2Exception if a protocol-related error occurred | [
"Sends",
"{",
"@link",
"org",
".",
"wso2",
".",
"transport",
".",
"http",
".",
"netty",
".",
"message",
".",
"Http2Reset",
"}",
"frame",
"with",
"NO_ERROR",
"error",
"code",
"."
] | train | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/states/Http2StateUtil.java#L247-L252 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java | PlanNode.findAllAtOrBelow | public List<PlanNode> findAllAtOrBelow( Traversal order,
Type typeToFind ) {
"""
Find all of the nodes of the specified type that are at or below this node.
@param order the order to traverse; may not be null
@param typeToFind the type of node to find; may not be nul... | java | public List<PlanNode> findAllAtOrBelow( Traversal order,
Type typeToFind ) {
return findAllAtOrBelow(order, EnumSet.of(typeToFind));
} | [
"public",
"List",
"<",
"PlanNode",
">",
"findAllAtOrBelow",
"(",
"Traversal",
"order",
",",
"Type",
"typeToFind",
")",
"{",
"return",
"findAllAtOrBelow",
"(",
"order",
",",
"EnumSet",
".",
"of",
"(",
"typeToFind",
")",
")",
";",
"}"
] | Find all of the nodes of the specified type that are at or below this node.
@param order the order to traverse; may not be null
@param typeToFind the type of node to find; may not be null
@return the collection of nodes that are at or below this node that all have the supplied type; never null but possibly
empty | [
"Find",
"all",
"of",
"the",
"nodes",
"of",
"the",
"specified",
"type",
"that",
"are",
"at",
"or",
"below",
"this",
"node",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L1385-L1388 |
feedzai/pdb | src/main/java/com/feedzai/commons/sql/abstraction/engine/AbstractDatabaseEngine.java | AbstractDatabaseEngine.handleOperation | protected void handleOperation(OperationFault op, Exception e) throws DatabaseEngineException {
"""
Controls if the given faulty operation must be silenced or not. The decision can be controlled by an external party
using for that matter the {@link #setExceptionHandler(ExceptionHandler)} method to provide a
spec... | java | protected void handleOperation(OperationFault op, Exception e) throws DatabaseEngineException {
if (!eh.proceed(op, e)) {
throw new DatabaseEngineException("An error occurred adding the entity.", e);
}
} | [
"protected",
"void",
"handleOperation",
"(",
"OperationFault",
"op",
",",
"Exception",
"e",
")",
"throws",
"DatabaseEngineException",
"{",
"if",
"(",
"!",
"eh",
".",
"proceed",
"(",
"op",
",",
"e",
")",
")",
"{",
"throw",
"new",
"DatabaseEngineException",
"(... | Controls if the given faulty operation must be silenced or not. The decision can be controlled by an external party
using for that matter the {@link #setExceptionHandler(ExceptionHandler)} method to provide a
specific implementation.
@param op The operation that originated the exception.
@param e The exception.
@thro... | [
"Controls",
"if",
"the",
"given",
"faulty",
"operation",
"must",
"be",
"silenced",
"or",
"not",
".",
"The",
"decision",
"can",
"be",
"controlled",
"by",
"an",
"external",
"party",
"using",
"for",
"that",
"matter",
"the",
"{",
"@link",
"#setExceptionHandler",
... | train | https://github.com/feedzai/pdb/blob/fe07ca08417e0ddcd620a36aa1fdbca7f338be98/src/main/java/com/feedzai/commons/sql/abstraction/engine/AbstractDatabaseEngine.java#L1886-L1890 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.