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 |
|---|---|---|---|---|---|---|---|---|---|---|
micronaut-projects/micronaut-core | cli/src/main/groovy/io/micronaut/cli/io/support/AntPathMatcher.java | AntPathMatcher.extractPathWithinPattern | public String extractPathWithinPattern(String pattern, String path) {
"""
Given a pattern and a full path, determine the pattern-mapped part. <p>For example: <ul>
<li>'<code>/docs/cvs/commit.html</code>' and '<code>/docs/cvs/commit.html</code> -> ''</li>
<li>'<code>/docs/*</code>' and '<code>/docs/cvs/commit</co... | java | public String extractPathWithinPattern(String pattern, String path) {
String[] patternParts = tokenize(pattern);
String[] pathParts = tokenize(path);
StringBuilder builder = new StringBuilder();
// Add any path parts that have a wildcarded pattern part.
int puts = 0;
fo... | [
"public",
"String",
"extractPathWithinPattern",
"(",
"String",
"pattern",
",",
"String",
"path",
")",
"{",
"String",
"[",
"]",
"patternParts",
"=",
"tokenize",
"(",
"pattern",
")",
";",
"String",
"[",
"]",
"pathParts",
"=",
"tokenize",
"(",
"path",
")",
";... | Given a pattern and a full path, determine the pattern-mapped part. <p>For example: <ul>
<li>'<code>/docs/cvs/commit.html</code>' and '<code>/docs/cvs/commit.html</code> -> ''</li>
<li>'<code>/docs/*</code>' and '<code>/docs/cvs/commit</code> -> '<code>cvs/commit</code>'</li>
<li>'<code>/docs/cvs/*.html</code>' and '<c... | [
"Given",
"a",
"pattern",
"and",
"a",
"full",
"path",
"determine",
"the",
"pattern",
"-",
"mapped",
"part",
".",
"<p",
">",
"For",
"example",
":",
"<ul",
">",
"<li",
">",
"<code",
">",
"/",
"docs",
"/",
"cvs",
"/",
"commit",
".",
"html<",
"/",
"code... | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/io/support/AntPathMatcher.java#L265-L293 |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/kernel/KernelResolverRepository.java | KernelResolverRepository.getPreferredVersion | private ProvisioningFeatureDefinition getPreferredVersion(String symbolicName, List<ProvisioningFeatureDefinition> featureList) {
"""
Find the preferred version of a feature from the list of features
<p>
The decision is made by consulting {@link #symbolicNameToPreferredVersion} to find out whether the user has c... | java | private ProvisioningFeatureDefinition getPreferredVersion(String symbolicName, List<ProvisioningFeatureDefinition> featureList) {
Version preferredVersion = symbolicNameToPreferredVersion.get(symbolicName);
ProvisioningFeatureDefinition result = null;
if (preferredVersion != null) {
... | [
"private",
"ProvisioningFeatureDefinition",
"getPreferredVersion",
"(",
"String",
"symbolicName",
",",
"List",
"<",
"ProvisioningFeatureDefinition",
">",
"featureList",
")",
"{",
"Version",
"preferredVersion",
"=",
"symbolicNameToPreferredVersion",
".",
"get",
"(",
"symboli... | Find the preferred version of a feature from the list of features
<p>
The decision is made by consulting {@link #symbolicNameToPreferredVersion} to find out whether the user has configured a preferred version. If so, look for a feature with
that version.
<p>
If no preferred version has been configured for this symbolic... | [
"Find",
"the",
"preferred",
"version",
"of",
"a",
"feature",
"from",
"the",
"list",
"of",
"features",
"<p",
">",
"The",
"decision",
"is",
"made",
"by",
"consulting",
"{",
"@link",
"#symbolicNameToPreferredVersion",
"}",
"to",
"find",
"out",
"whether",
"the",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/kernel/KernelResolverRepository.java#L352-L370 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/web/JavaScriptUtils.java | JavaScriptUtils.getUnencodedHtmlCookieString | public String getUnencodedHtmlCookieString(String name, String value) {
"""
Creates and returns a JavaScript line for setting a cookie with the specified name, value, and cookie properties. Note: The
name and value will not be HTML encoded.
"""
return getUnencodedHtmlCookieString(name, value, null);
... | java | public String getUnencodedHtmlCookieString(String name, String value) {
return getUnencodedHtmlCookieString(name, value, null);
} | [
"public",
"String",
"getUnencodedHtmlCookieString",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"return",
"getUnencodedHtmlCookieString",
"(",
"name",
",",
"value",
",",
"null",
")",
";",
"}"
] | Creates and returns a JavaScript line for setting a cookie with the specified name, value, and cookie properties. Note: The
name and value will not be HTML encoded. | [
"Creates",
"and",
"returns",
"a",
"JavaScript",
"line",
"for",
"setting",
"a",
"cookie",
"with",
"the",
"specified",
"name",
"value",
"and",
"cookie",
"properties",
".",
"Note",
":",
"The",
"name",
"and",
"value",
"will",
"not",
"be",
"HTML",
"encoded",
".... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/web/JavaScriptUtils.java#L91-L93 |
JetBrains/xodus | utils/src/main/java/jetbrains/exodus/core/execution/JobProcessorAdapter.java | JobProcessorAdapter.queueIn | @Override
public final Job queueIn(final Job job, final long millis) {
"""
Queues a job for execution in specified time.
@param job the job.
@param millis execute the job in this time.
"""
return pushAt(job, System.currentTimeMillis() + millis);
} | java | @Override
public final Job queueIn(final Job job, final long millis) {
return pushAt(job, System.currentTimeMillis() + millis);
} | [
"@",
"Override",
"public",
"final",
"Job",
"queueIn",
"(",
"final",
"Job",
"job",
",",
"final",
"long",
"millis",
")",
"{",
"return",
"pushAt",
"(",
"job",
",",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"millis",
")",
";",
"}"
] | Queues a job for execution in specified time.
@param job the job.
@param millis execute the job in this time. | [
"Queues",
"a",
"job",
"for",
"execution",
"in",
"specified",
"time",
"."
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/utils/src/main/java/jetbrains/exodus/core/execution/JobProcessorAdapter.java#L116-L119 |
alkacon/opencms-core | src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageHandler.java | CmsContainerpageHandler.checkNewWidgetsAvailable | public void checkNewWidgetsAvailable(CmsUUID structureId, AsyncCallback<Boolean> asyncCallback) {
"""
Checks whether GWT widgets are available for all fields of a content.<p>
@param structureId the structure id of the content
@param asyncCallback the callback for the result
"""
m_controller.chec... | java | public void checkNewWidgetsAvailable(CmsUUID structureId, AsyncCallback<Boolean> asyncCallback) {
m_controller.checkNewWidgetsAvailable(structureId, asyncCallback);
} | [
"public",
"void",
"checkNewWidgetsAvailable",
"(",
"CmsUUID",
"structureId",
",",
"AsyncCallback",
"<",
"Boolean",
">",
"asyncCallback",
")",
"{",
"m_controller",
".",
"checkNewWidgetsAvailable",
"(",
"structureId",
",",
"asyncCallback",
")",
";",
"}"
] | Checks whether GWT widgets are available for all fields of a content.<p>
@param structureId the structure id of the content
@param asyncCallback the callback for the result | [
"Checks",
"whether",
"GWT",
"widgets",
"are",
"available",
"for",
"all",
"fields",
"of",
"a",
"content",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageHandler.java#L274-L277 |
alkacon/opencms-core | src/org/opencms/main/CmsShellCommands.java | CmsShellCommands.importModule | public void importModule(String importFile) throws Exception {
"""
Imports a module.<p>
@param importFile the absolute path of the import module file
@throws Exception if something goes wrong
@see org.opencms.importexport.CmsImportExportManager#importData(CmsObject, I_CmsReport, CmsImportParameters)
"... | java | public void importModule(String importFile) throws Exception {
CmsImportParameters params = new CmsImportParameters(importFile, "/", true);
OpenCms.getImportExportManager().importData(
m_cms,
new CmsShellReport(m_cms.getRequestContext().getLocale()),
params);
} | [
"public",
"void",
"importModule",
"(",
"String",
"importFile",
")",
"throws",
"Exception",
"{",
"CmsImportParameters",
"params",
"=",
"new",
"CmsImportParameters",
"(",
"importFile",
",",
"\"/\"",
",",
"true",
")",
";",
"OpenCms",
".",
"getImportExportManager",
"(... | Imports a module.<p>
@param importFile the absolute path of the import module file
@throws Exception if something goes wrong
@see org.opencms.importexport.CmsImportExportManager#importData(CmsObject, I_CmsReport, CmsImportParameters) | [
"Imports",
"a",
"module",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsShellCommands.java#L862-L870 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java | NetworkConfig.getPeerAdmin | public UserInfo getPeerAdmin(String orgName) throws NetworkConfigurationException {
"""
Returns the admin user associated with the specified organization
@param orgName The name of the organization
@return The admin user details
@throws NetworkConfigurationException
"""
OrgInfo org = getOrganizat... | java | public UserInfo getPeerAdmin(String orgName) throws NetworkConfigurationException {
OrgInfo org = getOrganizationInfo(orgName);
if (org == null) {
throw new NetworkConfigurationException(format("Organization %s is not defined", orgName));
}
return org.getPeerAdmin();
} | [
"public",
"UserInfo",
"getPeerAdmin",
"(",
"String",
"orgName",
")",
"throws",
"NetworkConfigurationException",
"{",
"OrgInfo",
"org",
"=",
"getOrganizationInfo",
"(",
"orgName",
")",
";",
"if",
"(",
"org",
"==",
"null",
")",
"{",
"throw",
"new",
"NetworkConfigu... | Returns the admin user associated with the specified organization
@param orgName The name of the organization
@return The admin user details
@throws NetworkConfigurationException | [
"Returns",
"the",
"admin",
"user",
"associated",
"with",
"the",
"specified",
"organization"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L427-L435 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/MapView.java | MapView.setCurrentScale | public void setCurrentScale(final double newScale, final ZoomOption option, final Coordinate rescalePoint) {
"""
Apply a new scale level on the map. In case the are fixed resolutions defined on this MapView, it will
automatically snap to the nearest resolution. In case the maximum extents are exceeded, it will pa... | java | public void setCurrentScale(final double newScale, final ZoomOption option, final Coordinate rescalePoint) {
saveState();
// calculate theoretical new bounds
Bbox newBbox = new Bbox(0, 0, getWidth() / newScale, getHeight() / newScale);
double factor = newScale / getCurrentScale();
// Calculate translate vec... | [
"public",
"void",
"setCurrentScale",
"(",
"final",
"double",
"newScale",
",",
"final",
"ZoomOption",
"option",
",",
"final",
"Coordinate",
"rescalePoint",
")",
"{",
"saveState",
"(",
")",
";",
"// calculate theoretical new bounds",
"Bbox",
"newBbox",
"=",
"new",
"... | Apply a new scale level on the map. In case the are fixed resolutions defined on this MapView, it will
automatically snap to the nearest resolution. In case the maximum extents are exceeded, it will pan to avoid
this.
@param newScale
The preferred new scale.
@param option
zoom option, {@link org.geomajas.gwt.client.ma... | [
"Apply",
"a",
"new",
"scale",
"level",
"on",
"the",
"map",
".",
"In",
"case",
"the",
"are",
"fixed",
"resolutions",
"defined",
"on",
"this",
"MapView",
"it",
"will",
"automatically",
"snap",
"to",
"the",
"nearest",
"resolution",
".",
"In",
"case",
"the",
... | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/MapView.java#L260-L276 |
bramp/unsafe | unsafe-unroller/src/main/java/net/bramp/unsafe/CopierImplementation.java | CopierImplementation.buildByteCopyStack | private void buildByteCopyStack(List<StackManipulation> stack, int iterations) throws NoSuchFieldException, NoSuchMethodException {
"""
Creates iterations copies of the equivalent java code
<pre>
unsafe.putByte(dest, destOffset, unsafe.getByte(src));
destOffset += 1; src += 1
</pre>
@param iterations
@thro... | java | private void buildByteCopyStack(List<StackManipulation> stack, int iterations) throws NoSuchFieldException, NoSuchMethodException {
final Method getByteMethod = Unsafe.class.getMethod("getByte", long.class);
final Method putByteMethod = Unsafe.class.getMethod("putByte", Object.class, long.class, byte.class);
... | [
"private",
"void",
"buildByteCopyStack",
"(",
"List",
"<",
"StackManipulation",
">",
"stack",
",",
"int",
"iterations",
")",
"throws",
"NoSuchFieldException",
",",
"NoSuchMethodException",
"{",
"final",
"Method",
"getByteMethod",
"=",
"Unsafe",
".",
"class",
".",
... | Creates iterations copies of the equivalent java code
<pre>
unsafe.putByte(dest, destOffset, unsafe.getByte(src));
destOffset += 1; src += 1
</pre>
@param iterations
@throws NoSuchFieldException
@throws NoSuchMethodException | [
"Creates",
"iterations",
"copies",
"of",
"the",
"equivalent",
"java",
"code",
"<pre",
">",
"unsafe",
".",
"putByte",
"(",
"dest",
"destOffset",
"unsafe",
".",
"getByte",
"(",
"src",
"))",
";",
"destOffset",
"+",
"=",
"1",
";",
"src",
"+",
"=",
"1",
"<"... | train | https://github.com/bramp/unsafe/blob/805f54e2a8aee905003329556135b6c4059b4418/unsafe-unroller/src/main/java/net/bramp/unsafe/CopierImplementation.java#L146-L151 |
JOML-CI/JOML | src/org/joml/Matrix3f.java | Matrix3f.lookAlong | public Matrix3f lookAlong(float dirX, float dirY, float dirZ,
float upX, float upY, float upZ) {
"""
Apply a rotation transformation to this matrix to make <code>-z</code> point along <code>dir</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>L</code> the lookalon... | java | public Matrix3f lookAlong(float dirX, float dirY, float dirZ,
float upX, float upY, float upZ) {
return lookAlong(dirX, dirY, dirZ, upX, upY, upZ, this);
} | [
"public",
"Matrix3f",
"lookAlong",
"(",
"float",
"dirX",
",",
"float",
"dirY",
",",
"float",
"dirZ",
",",
"float",
"upX",
",",
"float",
"upY",
",",
"float",
"upZ",
")",
"{",
"return",
"lookAlong",
"(",
"dirX",
",",
"dirY",
",",
"dirZ",
",",
"upX",
",... | Apply a rotation transformation to this matrix to make <code>-z</code> point along <code>dir</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>L</code> the lookalong rotation matrix,
then the new matrix will be <code>M * L</code>. So when transforming a
vector <code>v</code> with the new matrix by usi... | [
"Apply",
"a",
"rotation",
"transformation",
"to",
"this",
"matrix",
"to",
"make",
"<code",
">",
"-",
"z<",
"/",
"code",
">",
"point",
"along",
"<code",
">",
"dir<",
"/",
"code",
">",
".",
"<p",
">",
"If",
"<code",
">",
"M<",
"/",
"code",
">",
"is",... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3f.java#L3127-L3130 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceAccess.java | SyntheticStorableReferenceAccess.isConsistent | public boolean isConsistent(Storable reference, S master) throws FetchException {
"""
Returns true if the properties of the given reference match those
contained in the master, excluding any version property. This will
always return true after a call to copyFromMaster.
@param reference reference whose propert... | java | public boolean isConsistent(Storable reference, S master) throws FetchException {
try {
return (Boolean) mIsConsistentMethod.invoke(reference, master);
} catch (Exception e) {
ThrowUnchecked.fireFirstDeclaredCause(e, FetchException.class);
// Not reached.
... | [
"public",
"boolean",
"isConsistent",
"(",
"Storable",
"reference",
",",
"S",
"master",
")",
"throws",
"FetchException",
"{",
"try",
"{",
"return",
"(",
"Boolean",
")",
"mIsConsistentMethod",
".",
"invoke",
"(",
"reference",
",",
"master",
")",
";",
"}",
"cat... | Returns true if the properties of the given reference match those
contained in the master, excluding any version property. This will
always return true after a call to copyFromMaster.
@param reference reference whose properties will be tested
@param master source of property values | [
"Returns",
"true",
"if",
"the",
"properties",
"of",
"the",
"given",
"reference",
"match",
"those",
"contained",
"in",
"the",
"master",
"excluding",
"any",
"version",
"property",
".",
"This",
"will",
"always",
"return",
"true",
"after",
"a",
"call",
"to",
"co... | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceAccess.java#L144-L152 |
jenkinsci/jenkins | core/src/main/java/hudson/tasks/BuildWrapper.java | BuildWrapper.setUp | public Environment setUp( AbstractBuild build, Launcher launcher, BuildListener listener ) throws IOException, InterruptedException {
"""
Runs before the {@link Builder} runs (but after the checkout has occurred), and performs a set up.
@param build
The build in progress for which an {@link Environment} object... | java | public Environment setUp( AbstractBuild build, Launcher launcher, BuildListener listener ) throws IOException, InterruptedException {
if (build instanceof Build)
return setUp((Build)build,launcher,listener);
else
throw new AssertionError("The plugin '" + this.getClass().getName()... | [
"public",
"Environment",
"setUp",
"(",
"AbstractBuild",
"build",
",",
"Launcher",
"launcher",
",",
"BuildListener",
"listener",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"if",
"(",
"build",
"instanceof",
"Build",
")",
"return",
"setUp",
"(",
... | Runs before the {@link Builder} runs (but after the checkout has occurred), and performs a set up.
@param build
The build in progress for which an {@link Environment} object is created.
Never null.
@param launcher
This launcher can be used to launch processes for this build.
If the build runs remotely, launcher will a... | [
"Runs",
"before",
"the",
"{",
"@link",
"Builder",
"}",
"runs",
"(",
"but",
"after",
"the",
"checkout",
"has",
"occurred",
")",
"and",
"performs",
"a",
"set",
"up",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/tasks/BuildWrapper.java#L140-L147 |
couchbase/java-dcp-client | src/main/java/com/couchbase/client/dcp/DefaultConnectionNameGenerator.java | DefaultConnectionNameGenerator.truncateAsJson | private static String truncateAsJson(String s, int maxSerializedLength) {
"""
Returns the given string truncated so its JSON representation does not exceed the given length.
<p>
Assumes the input contains only printable characters, with whitespace restricted to spaces and horizontal tabs.
"""
int resultL... | java | private static String truncateAsJson(String s, int maxSerializedLength) {
int resultLength = 0;
int spaceLeft = maxSerializedLength - 2; // enclosing quotes always consume 2 slots
for (char c : s.toCharArray()) {
final boolean charNeedsEscape = c == '\\' || c == '"' || c == '\t';
spaceLeft -= ... | [
"private",
"static",
"String",
"truncateAsJson",
"(",
"String",
"s",
",",
"int",
"maxSerializedLength",
")",
"{",
"int",
"resultLength",
"=",
"0",
";",
"int",
"spaceLeft",
"=",
"maxSerializedLength",
"-",
"2",
";",
"// enclosing quotes always consume 2 slots",
"for"... | Returns the given string truncated so its JSON representation does not exceed the given length.
<p>
Assumes the input contains only printable characters, with whitespace restricted to spaces and horizontal tabs. | [
"Returns",
"the",
"given",
"string",
"truncated",
"so",
"its",
"JSON",
"representation",
"does",
"not",
"exceed",
"the",
"given",
"length",
".",
"<p",
">",
"Assumes",
"the",
"input",
"contains",
"only",
"printable",
"characters",
"with",
"whitespace",
"restricte... | train | https://github.com/couchbase/java-dcp-client/blob/75359d8c081d6c575f8087cf7c28d24ab24c6421/src/main/java/com/couchbase/client/dcp/DefaultConnectionNameGenerator.java#L92-L107 |
MGunlogson/CuckooFilter4J | src/main/java/com/github/mgunlogson/cuckoofilter4j/FilterTable.java | FilterTable.readTagAndSet | long readTagAndSet(long bucketIndex, int posInBucket, long newTag) {
"""
Reads a tag and sets the bits to a new tag at same time for max
speedification
"""
long tagStartIdx = getTagOffset(bucketIndex, posInBucket);
long tag = 0;
long tagEndIdx = tagStartIdx + bitsPerTag;
int tagPos = 0;
for (lo... | java | long readTagAndSet(long bucketIndex, int posInBucket, long newTag) {
long tagStartIdx = getTagOffset(bucketIndex, posInBucket);
long tag = 0;
long tagEndIdx = tagStartIdx + bitsPerTag;
int tagPos = 0;
for (long i = tagStartIdx; i < tagEndIdx; i++) {
if ((newTag & (1L << tagPos)) != 0) {
if (memB... | [
"long",
"readTagAndSet",
"(",
"long",
"bucketIndex",
",",
"int",
"posInBucket",
",",
"long",
"newTag",
")",
"{",
"long",
"tagStartIdx",
"=",
"getTagOffset",
"(",
"bucketIndex",
",",
"posInBucket",
")",
";",
"long",
"tag",
"=",
"0",
";",
"long",
"tagEndIdx",
... | Reads a tag and sets the bits to a new tag at same time for max
speedification | [
"Reads",
"a",
"tag",
"and",
"sets",
"the",
"bits",
"to",
"a",
"new",
"tag",
"at",
"same",
"time",
"for",
"max",
"speedification"
] | train | https://github.com/MGunlogson/CuckooFilter4J/blob/e8472aa150b201f05046d1c81cac5a5ca4348db8/src/main/java/com/github/mgunlogson/cuckoofilter4j/FilterTable.java#L182-L200 |
JOML-CI/JOML | src/org/joml/Intersectionf.java | Intersectionf.intersectRaySphere | public static boolean intersectRaySphere(Vector3fc origin, Vector3fc dir, Vector3fc center, float radiusSquared, Vector2f result) {
"""
Test whether the ray with the given <code>origin</code> and normalized direction <code>dir</code>
intersects the sphere with the given <code>center</code> and square radius <code... | java | public static boolean intersectRaySphere(Vector3fc origin, Vector3fc dir, Vector3fc center, float radiusSquared, Vector2f result) {
return intersectRaySphere(origin.x(), origin.y(), origin.z(), dir.x(), dir.y(), dir.z(), center.x(), center.y(), center.z(), radiusSquared, result);
} | [
"public",
"static",
"boolean",
"intersectRaySphere",
"(",
"Vector3fc",
"origin",
",",
"Vector3fc",
"dir",
",",
"Vector3fc",
"center",
",",
"float",
"radiusSquared",
",",
"Vector2f",
"result",
")",
"{",
"return",
"intersectRaySphere",
"(",
"origin",
".",
"x",
"("... | Test whether the ray with the given <code>origin</code> and normalized direction <code>dir</code>
intersects the sphere with the given <code>center</code> and square radius <code>radiusSquared</code>,
and store the values of the parameter <i>t</i> in the ray equation <i>p(t) = origin + t * dir</i> for both points (near... | [
"Test",
"whether",
"the",
"ray",
"with",
"the",
"given",
"<code",
">",
"origin<",
"/",
"code",
">",
"and",
"normalized",
"direction",
"<code",
">",
"dir<",
"/",
"code",
">",
"intersects",
"the",
"sphere",
"with",
"the",
"given",
"<code",
">",
"center<",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L2112-L2114 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/MonetizationApi.java | MonetizationApi.getUpgradePath | public UpgradePathEnvelope getUpgradePath(String did, String action) throws ApiException {
"""
Get upgrade path
Get upgrade path
@param did Device ID (required)
@param action Action to perform (required)
@return UpgradePathEnvelope
@throws ApiException If fail to call the API, e.g. server error or cannot dese... | java | public UpgradePathEnvelope getUpgradePath(String did, String action) throws ApiException {
ApiResponse<UpgradePathEnvelope> resp = getUpgradePathWithHttpInfo(did, action);
return resp.getData();
} | [
"public",
"UpgradePathEnvelope",
"getUpgradePath",
"(",
"String",
"did",
",",
"String",
"action",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"UpgradePathEnvelope",
">",
"resp",
"=",
"getUpgradePathWithHttpInfo",
"(",
"did",
",",
"action",
")",
";",
"r... | Get upgrade path
Get upgrade path
@param did Device ID (required)
@param action Action to perform (required)
@return UpgradePathEnvelope
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Get",
"upgrade",
"path",
"Get",
"upgrade",
"path"
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/MonetizationApi.java#L515-L518 |
skuzzle/semantic-version | src/main/java/de/skuzzle/semantic/Version.java | Version.min | public static Version min(Version v1, Version v2) {
"""
Returns the lower of the two given versions by comparing them using their natural
ordering. If both versions are equal, then the first argument is returned.
@param v1 The first version.
@param v2 The second version.
@return The lower version.
@throws I... | java | public static Version min(Version v1, Version v2) {
require(v1 != null, "v1 is null");
require(v2 != null, "v2 is null");
return compare(v1, v2, false) <= 0
? v1
: v2;
} | [
"public",
"static",
"Version",
"min",
"(",
"Version",
"v1",
",",
"Version",
"v2",
")",
"{",
"require",
"(",
"v1",
"!=",
"null",
",",
"\"v1 is null\"",
")",
";",
"require",
"(",
"v2",
"!=",
"null",
",",
"\"v2 is null\"",
")",
";",
"return",
"compare",
"... | Returns the lower of the two given versions by comparing them using their natural
ordering. If both versions are equal, then the first argument is returned.
@param v1 The first version.
@param v2 The second version.
@return The lower version.
@throws IllegalArgumentException If either argument is <code>null</code>.
@s... | [
"Returns",
"the",
"lower",
"of",
"the",
"two",
"given",
"versions",
"by",
"comparing",
"them",
"using",
"their",
"natural",
"ordering",
".",
"If",
"both",
"versions",
"are",
"equal",
"then",
"the",
"first",
"argument",
"is",
"returned",
"."
] | train | https://github.com/skuzzle/semantic-version/blob/2ddb66fb80244cd7f67c77ed5f8072d1132ad933/src/main/java/de/skuzzle/semantic/Version.java#L1066-L1072 |
WASdev/standards.jsr352.jbatch | com.ibm.jbatch.container/src/main/java/com/ibm/jbatch/container/services/impl/JDBCPersistenceManagerImpl.java | JDBCPersistenceManagerImpl.getMostRecentZerothPartitionSubJobInstanceId | private long getMostRecentZerothPartitionSubJobInstanceId(long rootJobInstanceId, String stepName) {
"""
/*
Because of how we implement partition restart after override as well as partitions after a restart
after completion (we simply create a new "subjob" job instance id entry), we have to have a way
to only l... | java | private long getMostRecentZerothPartitionSubJobInstanceId(long rootJobInstanceId, String stepName) {
StringBuilder sb = new StringBuilder(":");
sb.append(Long.toString(rootJobInstanceId));
sb.append(":");
sb.append(stepName);
sb.append(":0");
String zerothPartitionSubJobName = sb.toString();
... | [
"private",
"long",
"getMostRecentZerothPartitionSubJobInstanceId",
"(",
"long",
"rootJobInstanceId",
",",
"String",
"stepName",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"\":\"",
")",
";",
"sb",
".",
"append",
"(",
"Long",
".",
"toString",... | /*
Because of how we implement partition restart after override as well as partitions after a restart
after completion (we simply create a new "subjob" job instance id entry), we have to have a way
to only look at the most recent one.
There may be gaps in doing it this way, e.g. what if the previous execution blew up ... | [
"/",
"*",
"Because",
"of",
"how",
"we",
"implement",
"partition",
"restart",
"after",
"override",
"as",
"well",
"as",
"partitions",
"after",
"a",
"restart",
"after",
"completion",
"(",
"we",
"simply",
"create",
"a",
"new",
"subjob",
"job",
"instance",
"id",
... | train | https://github.com/WASdev/standards.jsr352.jbatch/blob/e267e79dccd4f0bd4bf9c2abc41a8a47b65be28f/com.ibm.jbatch.container/src/main/java/com/ibm/jbatch/container/services/impl/JDBCPersistenceManagerImpl.java#L1938-L1972 |
mapsforge/mapsforge | mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java | MapFile.readPoiData | @Override
public MapReadResult readPoiData(Tile tile) {
"""
Reads only POI data for tile.
@param tile tile for which data is requested.
@return POI data for the tile.
"""
return readMapData(tile, tile, Selector.POIS);
} | java | @Override
public MapReadResult readPoiData(Tile tile) {
return readMapData(tile, tile, Selector.POIS);
} | [
"@",
"Override",
"public",
"MapReadResult",
"readPoiData",
"(",
"Tile",
"tile",
")",
"{",
"return",
"readMapData",
"(",
"tile",
",",
"tile",
",",
"Selector",
".",
"POIS",
")",
";",
"}"
] | Reads only POI data for tile.
@param tile tile for which data is requested.
@return POI data for the tile. | [
"Reads",
"only",
"POI",
"data",
"for",
"tile",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java#L937-L940 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/format/DateTimeFormatter.java | DateTimeFormatter.ofLocalizedDateTime | public static DateTimeFormatter ofLocalizedDateTime(FormatStyle dateStyle, FormatStyle timeStyle) {
"""
Returns a locale specific date and time format.
<p>
This returns a formatter that will print/parse a date-time.
The exact format pattern used varies by locale.
<p>
The locale is determined from the formatte... | java | public static DateTimeFormatter ofLocalizedDateTime(FormatStyle dateStyle, FormatStyle timeStyle) {
Jdk8Methods.requireNonNull(dateStyle, "dateStyle");
Jdk8Methods.requireNonNull(timeStyle, "timeStyle");
return new DateTimeFormatterBuilder().appendLocalized(dateStyle, timeStyle)
... | [
"public",
"static",
"DateTimeFormatter",
"ofLocalizedDateTime",
"(",
"FormatStyle",
"dateStyle",
",",
"FormatStyle",
"timeStyle",
")",
"{",
"Jdk8Methods",
".",
"requireNonNull",
"(",
"dateStyle",
",",
"\"dateStyle\"",
")",
";",
"Jdk8Methods",
".",
"requireNonNull",
"(... | Returns a locale specific date and time format.
<p>
This returns a formatter that will print/parse a date-time.
The exact format pattern used varies by locale.
<p>
The locale is determined from the formatter. The formatter returned directly by
this method will use the {@link Locale#getDefault() default locale}.
The loc... | [
"Returns",
"a",
"locale",
"specific",
"date",
"and",
"time",
"format",
".",
"<p",
">",
"This",
"returns",
"a",
"formatter",
"that",
"will",
"print",
"/",
"parse",
"a",
"date",
"-",
"time",
".",
"The",
"exact",
"format",
"pattern",
"used",
"varies",
"by",... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/format/DateTimeFormatter.java#L883-L888 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java | ChunkedIntArray.writeEntry | void writeEntry(int position, int offset, int value) throws ArrayIndexOutOfBoundsException {
"""
Overwrite the integer found at a specific record and column.
Used to back-patch existing records, most often changing their
"next sibling" reference from 0 (unknown) to something meaningful
@param position int Recor... | java | void writeEntry(int position, int offset, int value) throws ArrayIndexOutOfBoundsException
{
/*
try
{
fastArray[( position*slotsize)+offset] = value;
}
catch(ArrayIndexOutOfBoundsException aioobe)
*/
{
if (offset >= slotsize)
throw new ArrayIndexOutOfBoundsException(XML... | [
"void",
"writeEntry",
"(",
"int",
"position",
",",
"int",
"offset",
",",
"int",
"value",
")",
"throws",
"ArrayIndexOutOfBoundsException",
"{",
"/*\n try\n {\n fastArray[( position*slotsize)+offset] = value;\n }\n catch(ArrayIndexOutOfBoundsException aioobe)\n */",
... | Overwrite the integer found at a specific record and column.
Used to back-patch existing records, most often changing their
"next sibling" reference from 0 (unknown) to something meaningful
@param position int Record number
@param offset int Column number
@param value int New contents | [
"Overwrite",
"the",
"integer",
"found",
"at",
"a",
"specific",
"record",
"and",
"column",
".",
"Used",
"to",
"back",
"-",
"patch",
"existing",
"records",
"most",
"often",
"changing",
"their",
"next",
"sibling",
"reference",
"from",
"0",
"(",
"unknown",
")",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java#L192-L210 |
ozimov/cirneco | hamcrest/hamcrest-matchers/src/main/java/it/ozimov/cirneco/hamcrest/date/IsDate.java | IsDate.hasYearMonthAndDay | public static Matcher<Date> hasYearMonthAndDay(final int year, final int month, final int day) {
"""
Creates a matcher that matches when the examined {@linkplain Date} has the given values <code>year</code>, <code>
id</code> and <code>day</code>.
"""
return new IsDate(year, month, day);
} | java | public static Matcher<Date> hasYearMonthAndDay(final int year, final int month, final int day) {
return new IsDate(year, month, day);
} | [
"public",
"static",
"Matcher",
"<",
"Date",
">",
"hasYearMonthAndDay",
"(",
"final",
"int",
"year",
",",
"final",
"int",
"month",
",",
"final",
"int",
"day",
")",
"{",
"return",
"new",
"IsDate",
"(",
"year",
",",
"month",
",",
"day",
")",
";",
"}"
] | Creates a matcher that matches when the examined {@linkplain Date} has the given values <code>year</code>, <code>
id</code> and <code>day</code>. | [
"Creates",
"a",
"matcher",
"that",
"matches",
"when",
"the",
"examined",
"{"
] | train | https://github.com/ozimov/cirneco/blob/78ad782da0a2256634cfbebb2f97ed78c993b999/hamcrest/hamcrest-matchers/src/main/java/it/ozimov/cirneco/hamcrest/date/IsDate.java#L71-L73 |
j256/simplejmx | src/main/java/com/j256/simplejmx/client/JmxClient.java | JmxClient.invokeOperation | public Object invokeOperation(String domain, String beanName, String operName, String... paramStrings)
throws Exception {
"""
Invoke a JMX method with a domain/object-name as an array of parameter strings.
@return The value returned by the method or null if none.
"""
if (paramStrings.length == 0) {
... | java | public Object invokeOperation(String domain, String beanName, String operName, String... paramStrings)
throws Exception {
if (paramStrings.length == 0) {
return invokeOperation(ObjectNameUtil.makeObjectName(domain, beanName), operName, null, null);
} else {
return invokeOperation(ObjectNameUtil.makeObjectN... | [
"public",
"Object",
"invokeOperation",
"(",
"String",
"domain",
",",
"String",
"beanName",
",",
"String",
"operName",
",",
"String",
"...",
"paramStrings",
")",
"throws",
"Exception",
"{",
"if",
"(",
"paramStrings",
".",
"length",
"==",
"0",
")",
"{",
"retur... | Invoke a JMX method with a domain/object-name as an array of parameter strings.
@return The value returned by the method or null if none. | [
"Invoke",
"a",
"JMX",
"method",
"with",
"a",
"domain",
"/",
"object",
"-",
"name",
"as",
"an",
"array",
"of",
"parameter",
"strings",
"."
] | train | https://github.com/j256/simplejmx/blob/1a04f52512dfa0a711ba0cc7023c604dbc82a352/src/main/java/com/j256/simplejmx/client/JmxClient.java#L407-L414 |
iorga-group/iraj | iraj/src/main/java/com/iorga/iraj/servlet/CacheAwareServlet.java | CacheAwareServlet.checkIfMatch | protected boolean checkIfMatch(final HttpServletRequest request, final HttpServletResponse response, final Attributes resourceAttributes)
throws IOException {
"""
Check if the if-match condition is satisfied.
@param request
The servlet request we are processing
@param response
The servlet response we are ... | java | protected boolean checkIfMatch(final HttpServletRequest request, final HttpServletResponse response, final Attributes resourceAttributes)
throws IOException {
final String eTag = resourceAttributes.getETag();
final String headerValue = request.getHeader("If-Match");
if (headerValue != null) {
if (headerVal... | [
"protected",
"boolean",
"checkIfMatch",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"HttpServletResponse",
"response",
",",
"final",
"Attributes",
"resourceAttributes",
")",
"throws",
"IOException",
"{",
"final",
"String",
"eTag",
"=",
"resourceAttribut... | Check if the if-match condition is satisfied.
@param request
The servlet request we are processing
@param response
The servlet response we are creating
@param resourceAttributes
File object
@return boolean true if the resource meets the specified condition, and
false if the condition is not satisfied, in which case re... | [
"Check",
"if",
"the",
"if",
"-",
"match",
"condition",
"is",
"satisfied",
"."
] | train | https://github.com/iorga-group/iraj/blob/5fdee26464248f29833610de402275eb64505542/iraj/src/main/java/com/iorga/iraj/servlet/CacheAwareServlet.java#L658-L685 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDRNN.java | SDRNN.lstmCell | public SDVariable lstmCell(String baseName, LSTMCellConfiguration configuration) {
"""
LSTM unit
@param baseName the base name for outputs
@param configuration the configuration to use
@return
"""
return new LSTMCell(sd, configuration).outputVariables(baseName)[0];
} | java | public SDVariable lstmCell(String baseName, LSTMCellConfiguration configuration) {
return new LSTMCell(sd, configuration).outputVariables(baseName)[0];
} | [
"public",
"SDVariable",
"lstmCell",
"(",
"String",
"baseName",
",",
"LSTMCellConfiguration",
"configuration",
")",
"{",
"return",
"new",
"LSTMCell",
"(",
"sd",
",",
"configuration",
")",
".",
"outputVariables",
"(",
"baseName",
")",
"[",
"0",
"]",
";",
"}"
] | LSTM unit
@param baseName the base name for outputs
@param configuration the configuration to use
@return | [
"LSTM",
"unit"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDRNN.java#L56-L58 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfDocument.java | PdfDocument.remoteGoto | void remoteGoto(String filename, String name, float llx, float lly, float urx, float ury) {
"""
Implements a link to another document.
@param filename the filename for the remote document
@param name the name to jump to
@param llx the lower left x corner of the activation area
@param lly the lower left y corne... | java | void remoteGoto(String filename, String name, float llx, float lly, float urx, float ury) {
annotationsImp.addPlainAnnotation(new PdfAnnotation(writer, llx, lly, urx, ury, new PdfAction(filename, name)));
} | [
"void",
"remoteGoto",
"(",
"String",
"filename",
",",
"String",
"name",
",",
"float",
"llx",
",",
"float",
"lly",
",",
"float",
"urx",
",",
"float",
"ury",
")",
"{",
"annotationsImp",
".",
"addPlainAnnotation",
"(",
"new",
"PdfAnnotation",
"(",
"writer",
"... | Implements a link to another document.
@param filename the filename for the remote document
@param name the name to jump to
@param llx the lower left x corner of the activation area
@param lly the lower left y corner of the activation area
@param urx the upper right x corner of the activation area
@param ury the upper ... | [
"Implements",
"a",
"link",
"to",
"another",
"document",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfDocument.java#L2027-L2029 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/BackupLongTermRetentionVaultsInner.java | BackupLongTermRetentionVaultsInner.getAsync | public Observable<BackupLongTermRetentionVaultInner> getAsync(String resourceGroupName, String serverName) {
"""
Gets a server backup long term retention vault.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or th... | java | public Observable<BackupLongTermRetentionVaultInner> getAsync(String resourceGroupName, String serverName) {
return getWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<BackupLongTermRetentionVaultInner>, BackupLongTermRetentionVaultInner>() {
@Override
... | [
"public",
"Observable",
"<",
"BackupLongTermRetentionVaultInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
")",
".",
"map",
"(",
"n... | Gets a server backup long term retention vault.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@throws IllegalArgumentException thrown if parameters fail the valid... | [
"Gets",
"a",
"server",
"backup",
"long",
"term",
"retention",
"vault",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/BackupLongTermRetentionVaultsInner.java#L110-L117 |
jamesagnew/hapi-fhir | hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java | RestfulServer.getRequestPath | protected String getRequestPath(String requestFullPath, String servletContextPath, String servletPath) {
"""
NOTE: Don't make this a static method!! People want to override it
"""
return requestFullPath.substring(escapedLength(servletContextPath) + escapedLength(servletPath));
} | java | protected String getRequestPath(String requestFullPath, String servletContextPath, String servletPath) {
return requestFullPath.substring(escapedLength(servletContextPath) + escapedLength(servletPath));
} | [
"protected",
"String",
"getRequestPath",
"(",
"String",
"requestFullPath",
",",
"String",
"servletContextPath",
",",
"String",
"servletPath",
")",
"{",
"return",
"requestFullPath",
".",
"substring",
"(",
"escapedLength",
"(",
"servletContextPath",
")",
"+",
"escapedLe... | NOTE: Don't make this a static method!! People want to override it | [
"NOTE",
":",
"Don",
"t",
"make",
"this",
"a",
"static",
"method!!",
"People",
"want",
"to",
"override",
"it"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java#L679-L681 |
haifengl/smile | plot/src/main/java/smile/plot/Graphics.java | Graphics.drawText | public void drawText(String label, double horizontalReference, double verticalReference, double[] coord) {
"""
Draw a string with given reference point. (0.5, 0.5) is center, (0, 0) is
lower left, (0, 1) is upper left, etc. The coordinates are logical coordinates.
"""
drawText(label, horizontalReferen... | java | public void drawText(String label, double horizontalReference, double verticalReference, double[] coord) {
drawText(label, horizontalReference, verticalReference, 0.0, coord);
} | [
"public",
"void",
"drawText",
"(",
"String",
"label",
",",
"double",
"horizontalReference",
",",
"double",
"verticalReference",
",",
"double",
"[",
"]",
"coord",
")",
"{",
"drawText",
"(",
"label",
",",
"horizontalReference",
",",
"verticalReference",
",",
"0.0"... | Draw a string with given reference point. (0.5, 0.5) is center, (0, 0) is
lower left, (0, 1) is upper left, etc. The coordinates are logical coordinates. | [
"Draw",
"a",
"string",
"with",
"given",
"reference",
"point",
".",
"(",
"0",
".",
"5",
"0",
".",
"5",
")",
"is",
"center",
"(",
"0",
"0",
")",
"is",
"lower",
"left",
"(",
"0",
"1",
")",
"is",
"upper",
"left",
"etc",
".",
"The",
"coordinates",
"... | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/plot/src/main/java/smile/plot/Graphics.java#L208-L210 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/utils/BtcFormat.java | BtcFormat.getMilliInstance | public static BtcFormat getMilliInstance(Locale locale, int scale, int... groups) {
"""
Return a new millicoin-denominated formatter for the given locale with the specified
fractional decimal placing. The returned object will format the fractional part of
numbers with the given minimum number of fractional deci... | java | public static BtcFormat getMilliInstance(Locale locale, int scale, int... groups) {
return getInstance(MILLICOIN_SCALE, locale, scale, boxAsList(groups));
} | [
"public",
"static",
"BtcFormat",
"getMilliInstance",
"(",
"Locale",
"locale",
",",
"int",
"scale",
",",
"int",
"...",
"groups",
")",
"{",
"return",
"getInstance",
"(",
"MILLICOIN_SCALE",
",",
"locale",
",",
"scale",
",",
"boxAsList",
"(",
"groups",
")",
")",... | Return a new millicoin-denominated formatter for the given locale with the specified
fractional decimal placing. The returned object will format the fractional part of
numbers with the given minimum number of fractional decimal places. Optionally,
repeating integer arguments can be passed, each indicating the size of... | [
"Return",
"a",
"new",
"millicoin",
"-",
"denominated",
"formatter",
"for",
"the",
"given",
"locale",
"with",
"the",
"specified",
"fractional",
"decimal",
"placing",
".",
"The",
"returned",
"object",
"will",
"format",
"the",
"fractional",
"part",
"of",
"numbers",... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/utils/BtcFormat.java#L1008-L1010 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/AhoCorasick/AhoCorasickDoubleArrayTrie.java | AhoCorasickDoubleArrayTrie.load | public void load(ObjectInputStream in, V[] value) throws IOException, ClassNotFoundException {
"""
载入
@param in 一个ObjectInputStream
@param value 值(持久化的时候并没有持久化值,现在需要额外提供)
@throws IOException
@throws ClassNotFoundException
"""
base = (int[]) in.readObject();
check = (int[]) in.readObjec... | java | public void load(ObjectInputStream in, V[] value) throws IOException, ClassNotFoundException
{
base = (int[]) in.readObject();
check = (int[]) in.readObject();
fail = (int[]) in.readObject();
output = (int[][]) in.readObject();
l = (int[]) in.readObject();
v = value;
... | [
"public",
"void",
"load",
"(",
"ObjectInputStream",
"in",
",",
"V",
"[",
"]",
"value",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"base",
"=",
"(",
"int",
"[",
"]",
")",
"in",
".",
"readObject",
"(",
")",
";",
"check",
"=",
"(",
... | 载入
@param in 一个ObjectInputStream
@param value 值(持久化的时候并没有持久化值,现在需要额外提供)
@throws IOException
@throws ClassNotFoundException | [
"载入"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/AhoCorasick/AhoCorasickDoubleArrayTrie.java#L230-L238 |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/time/APSPSolver.java | APSPSolver.getDistanceBounds | public Bounds getDistanceBounds(TimePoint tpFrom, TimePoint tpTo) {
"""
Gets the effective bounds between a pair of {@link TimePoint}s.
(After propagation, considering all constraints in the network)
"""
final long max = distance[tpFrom.getID()][tpTo.getID()];
final long min = -distance[tpTo.getID()][tp... | java | public Bounds getDistanceBounds(TimePoint tpFrom, TimePoint tpTo) {
final long max = distance[tpFrom.getID()][tpTo.getID()];
final long min = -distance[tpTo.getID()][tpFrom.getID()];
return new Bounds(min, max);
} | [
"public",
"Bounds",
"getDistanceBounds",
"(",
"TimePoint",
"tpFrom",
",",
"TimePoint",
"tpTo",
")",
"{",
"final",
"long",
"max",
"=",
"distance",
"[",
"tpFrom",
".",
"getID",
"(",
")",
"]",
"[",
"tpTo",
".",
"getID",
"(",
")",
"]",
";",
"final",
"long"... | Gets the effective bounds between a pair of {@link TimePoint}s.
(After propagation, considering all constraints in the network) | [
"Gets",
"the",
"effective",
"bounds",
"between",
"a",
"pair",
"of",
"{"
] | train | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/time/APSPSolver.java#L1033-L1037 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java | ZipUtil.unzip | public static File unzip(File zipFile, Charset charset) throws UtilException {
"""
解压到文件名相同的目录中
@param zipFile 压缩文件
@param charset 编码
@return 解压的目录
@throws UtilException IO异常
@since 3.2.2
"""
return unzip(zipFile, FileUtil.file(zipFile.getParentFile(), FileUtil.mainName(zipFile)), charset);
} | java | public static File unzip(File zipFile, Charset charset) throws UtilException {
return unzip(zipFile, FileUtil.file(zipFile.getParentFile(), FileUtil.mainName(zipFile)), charset);
} | [
"public",
"static",
"File",
"unzip",
"(",
"File",
"zipFile",
",",
"Charset",
"charset",
")",
"throws",
"UtilException",
"{",
"return",
"unzip",
"(",
"zipFile",
",",
"FileUtil",
".",
"file",
"(",
"zipFile",
".",
"getParentFile",
"(",
")",
",",
"FileUtil",
"... | 解压到文件名相同的目录中
@param zipFile 压缩文件
@param charset 编码
@return 解压的目录
@throws UtilException IO异常
@since 3.2.2 | [
"解压到文件名相同的目录中"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java#L333-L335 |
logic-ng/LogicNG | src/main/java/org/logicng/formulas/FormulaFactory.java | FormulaFactory.naryOperator | public Formula naryOperator(final FType type, final Formula... operands) {
"""
Creates a new n-ary operator with a given type and a list of operands.
@param type the type of the formula
@param operands the list of operands
@return the newly generated formula
@throws IllegalArgumentException if a wrong form... | java | public Formula naryOperator(final FType type, final Formula... operands) {
switch (type) {
case OR:
return this.or(operands);
case AND:
return this.and(operands);
default:
throw new IllegalArgumentException("Cannot create an n-ary formula with operator: " + type);
}
} | [
"public",
"Formula",
"naryOperator",
"(",
"final",
"FType",
"type",
",",
"final",
"Formula",
"...",
"operands",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"OR",
":",
"return",
"this",
".",
"or",
"(",
"operands",
")",
";",
"case",
"AND",
":",
... | Creates a new n-ary operator with a given type and a list of operands.
@param type the type of the formula
@param operands the list of operands
@return the newly generated formula
@throws IllegalArgumentException if a wrong formula type is passed | [
"Creates",
"a",
"new",
"n",
"-",
"ary",
"operator",
"with",
"a",
"given",
"type",
"and",
"a",
"list",
"of",
"operands",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/formulas/FormulaFactory.java#L378-L387 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/AdditionalNamespaceResolver.java | AdditionalNamespaceResolver.addNamespace | private void addNamespace(String prefix, String uri) {
"""
Adds the given namespace declaration to this resolver.
@param prefix namespace prefix
@param uri namespace URI
"""
prefixToURI.put(prefix, uri);
uriToPrefix.put(uri, prefix);
} | java | private void addNamespace(String prefix, String uri) {
prefixToURI.put(prefix, uri);
uriToPrefix.put(uri, prefix);
} | [
"private",
"void",
"addNamespace",
"(",
"String",
"prefix",
",",
"String",
"uri",
")",
"{",
"prefixToURI",
".",
"put",
"(",
"prefix",
",",
"uri",
")",
";",
"uriToPrefix",
".",
"put",
"(",
"uri",
",",
"prefix",
")",
";",
"}"
] | Adds the given namespace declaration to this resolver.
@param prefix namespace prefix
@param uri namespace URI | [
"Adds",
"the",
"given",
"namespace",
"declaration",
"to",
"this",
"resolver",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/AdditionalNamespaceResolver.java#L79-L82 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICULocaleService.java | ICULocaleService.registerObject | public Factory registerObject(Object obj, ULocale locale, int kind, boolean visible) {
"""
Convenience function for callers using locales. This instantiates
a SimpleLocaleKeyFactory, and registers the factory.
"""
Factory factory = new SimpleLocaleKeyFactory(obj, locale, kind, visible);
retu... | java | public Factory registerObject(Object obj, ULocale locale, int kind, boolean visible) {
Factory factory = new SimpleLocaleKeyFactory(obj, locale, kind, visible);
return registerFactory(factory);
} | [
"public",
"Factory",
"registerObject",
"(",
"Object",
"obj",
",",
"ULocale",
"locale",
",",
"int",
"kind",
",",
"boolean",
"visible",
")",
"{",
"Factory",
"factory",
"=",
"new",
"SimpleLocaleKeyFactory",
"(",
"obj",
",",
"locale",
",",
"kind",
",",
"visible"... | Convenience function for callers using locales. This instantiates
a SimpleLocaleKeyFactory, and registers the factory. | [
"Convenience",
"function",
"for",
"callers",
"using",
"locales",
".",
"This",
"instantiates",
"a",
"SimpleLocaleKeyFactory",
"and",
"registers",
"the",
"factory",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICULocaleService.java#L119-L122 |
infinispan/infinispan | core/src/main/java/org/infinispan/io/GridFilesystem.java | GridFilesystem.getReadableChannel | public ReadableGridFileChannel getReadableChannel(String pathname) throws FileNotFoundException {
"""
Opens a ReadableGridFileChannel for reading from the file denoted by the given file path. One of the benefits
of using a channel over an InputStream is the possibility to randomly seek to any position in the file... | java | public ReadableGridFileChannel getReadableChannel(String pathname) throws FileNotFoundException {
GridFile file = (GridFile) getFile(pathname);
checkFileIsReadable(file);
return new ReadableGridFileChannel(file, data);
} | [
"public",
"ReadableGridFileChannel",
"getReadableChannel",
"(",
"String",
"pathname",
")",
"throws",
"FileNotFoundException",
"{",
"GridFile",
"file",
"=",
"(",
"GridFile",
")",
"getFile",
"(",
"pathname",
")",
";",
"checkFileIsReadable",
"(",
"file",
")",
";",
"r... | Opens a ReadableGridFileChannel for reading from the file denoted by the given file path. One of the benefits
of using a channel over an InputStream is the possibility to randomly seek to any position in the file (see
#ReadableGridChannel.position()).
@param pathname path of the file to open for reading
@return a Reada... | [
"Opens",
"a",
"ReadableGridFileChannel",
"for",
"reading",
"from",
"the",
"file",
"denoted",
"by",
"the",
"given",
"file",
"path",
".",
"One",
"of",
"the",
"benefits",
"of",
"using",
"a",
"channel",
"over",
"an",
"InputStream",
"is",
"the",
"possibility",
"t... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/io/GridFilesystem.java#L189-L193 |
jbundle/osgi | core/src/main/java/org/jbundle/util/osgi/finder/BaseClassFinderService.java | BaseClassFinderService.findConvertStringToObject | public Object findConvertStringToObject(String className, String versionRange, String string) {
"""
Convert this encoded string back to a Java Object.
@param string The string to convert.
@return The java object.
"""
Object object = this.convertStringToObject(null, className, versionRange, string);
... | java | public Object findConvertStringToObject(String className, String versionRange, String string)
{
Object object = this.convertStringToObject(null, className, versionRange, string);
if (object == null) {
Object resource = this.deployThisResource(ClassFinderActivator.getPackageName(className, ... | [
"public",
"Object",
"findConvertStringToObject",
"(",
"String",
"className",
",",
"String",
"versionRange",
",",
"String",
"string",
")",
"{",
"Object",
"object",
"=",
"this",
".",
"convertStringToObject",
"(",
"null",
",",
"className",
",",
"versionRange",
",",
... | Convert this encoded string back to a Java Object.
@param string The string to convert.
@return The java object. | [
"Convert",
"this",
"encoded",
"string",
"back",
"to",
"a",
"Java",
"Object",
"."
] | train | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/core/src/main/java/org/jbundle/util/osgi/finder/BaseClassFinderService.java#L173-L188 |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/endian/EndianNumbers.java | EndianNumbers.toLEFloat | @Pure
@Inline(value = "Float.intBitsToFloat(EndianNumbers.toLEInt($1, $2, $3, $4))",
imported = {
"""
Converting four bytes to a Little Endian float.
@param b1 the first byte.
@param b2 the second byte.
@param b3 the third byte.
@param b4 the fourth byte.
@return the conversion result
"""EndianNumbe... | java | @Pure
@Inline(value = "Float.intBitsToFloat(EndianNumbers.toLEInt($1, $2, $3, $4))",
imported = {EndianNumbers.class})
public static float toLEFloat(int b1, int b2, int b3, int b4) {
return Float.intBitsToFloat(toLEInt(b1, b2, b3, b4));
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"Float.intBitsToFloat(EndianNumbers.toLEInt($1, $2, $3, $4))\"",
",",
"imported",
"=",
"{",
"EndianNumbers",
".",
"class",
"}",
")",
"public",
"static",
"float",
"toLEFloat",
"(",
"int",
"b1",
",",
"int",
"b2",
",... | Converting four bytes to a Little Endian float.
@param b1 the first byte.
@param b2 the second byte.
@param b3 the third byte.
@param b4 the fourth byte.
@return the conversion result | [
"Converting",
"four",
"bytes",
"to",
"a",
"Little",
"Endian",
"float",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/endian/EndianNumbers.java#L181-L186 |
akquinet/needle | src/main/java/de/akquinet/jbosscc/needle/reflection/ReflectionUtil.java | ReflectionUtil.getFieldValue | public static Object getFieldValue(final Object object, final Field field) {
"""
Get the value of a given field on a given object via reflection.
@param object
-- target object of field access
@param field
-- target field
@return -- the value of the represented field in object; primitive values
are wrapped... | java | public static Object getFieldValue(final Object object, final Field field) {
try {
if (!field.isAccessible()) {
field.setAccessible(true);
}
return field.get(object);
} catch (final Exception e) {
throw new IllegalArgumentException("Could ... | [
"public",
"static",
"Object",
"getFieldValue",
"(",
"final",
"Object",
"object",
",",
"final",
"Field",
"field",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"field",
".",
"isAccessible",
"(",
")",
")",
"{",
"field",
".",
"setAccessible",
"(",
"true",
")",
";... | Get the value of a given field on a given object via reflection.
@param object
-- target object of field access
@param field
-- target field
@return -- the value of the represented field in object; primitive values
are wrapped in an appropriate object before being returned | [
"Get",
"the",
"value",
"of",
"a",
"given",
"field",
"on",
"a",
"given",
"object",
"via",
"reflection",
"."
] | train | https://github.com/akquinet/needle/blob/8b411c521246b8212882485edc01644f9aac7e24/src/main/java/de/akquinet/jbosscc/needle/reflection/ReflectionUtil.java#L254-L264 |
SonarSource/sonarqube | server/sonar-db-dao/src/main/java/org/sonar/db/permission/GroupPermissionDao.java | GroupPermissionDao.selectByGroupIds | public List<GroupPermissionDto> selectByGroupIds(DbSession dbSession, String organizationUuid, List<Integer> groupIds, @Nullable Long projectId) {
"""
Select global or project permission of given groups and organization. Anyone virtual group is supported
through the value "zero" (0L) in {@code groupIds}.
"""
... | java | public List<GroupPermissionDto> selectByGroupIds(DbSession dbSession, String organizationUuid, List<Integer> groupIds, @Nullable Long projectId) {
return executeLargeInputs(groupIds, groups -> mapper(dbSession).selectByGroupIds(organizationUuid, groups, projectId));
} | [
"public",
"List",
"<",
"GroupPermissionDto",
">",
"selectByGroupIds",
"(",
"DbSession",
"dbSession",
",",
"String",
"organizationUuid",
",",
"List",
"<",
"Integer",
">",
"groupIds",
",",
"@",
"Nullable",
"Long",
"projectId",
")",
"{",
"return",
"executeLargeInputs... | Select global or project permission of given groups and organization. Anyone virtual group is supported
through the value "zero" (0L) in {@code groupIds}. | [
"Select",
"global",
"or",
"project",
"permission",
"of",
"given",
"groups",
"and",
"organization",
".",
"Anyone",
"virtual",
"group",
"is",
"supported",
"through",
"the",
"value",
"zero",
"(",
"0L",
")",
"in",
"{"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-dao/src/main/java/org/sonar/db/permission/GroupPermissionDao.java#L64-L66 |
WiQuery/wiquery | wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/AjaxSlider.java | AjaxSlider.setAjaxSlideEvent | public void setAjaxSlideEvent(ISliderAjaxEvent ajaxSlideEvent) {
"""
Sets the call-back for the AJAX Slide Event.
@param ajaxSlideEvent
The ISliderAjaxEvent.
"""
this.ajaxEvents.put(SliderAjaxEvent.ajaxSlideEvent, ajaxSlideEvent);
setSlideEvent(new SliderAjaxJsScopeUiEvent(this, SliderAjaxEvent.ajaxSli... | java | public void setAjaxSlideEvent(ISliderAjaxEvent ajaxSlideEvent)
{
this.ajaxEvents.put(SliderAjaxEvent.ajaxSlideEvent, ajaxSlideEvent);
setSlideEvent(new SliderAjaxJsScopeUiEvent(this, SliderAjaxEvent.ajaxSlideEvent));
} | [
"public",
"void",
"setAjaxSlideEvent",
"(",
"ISliderAjaxEvent",
"ajaxSlideEvent",
")",
"{",
"this",
".",
"ajaxEvents",
".",
"put",
"(",
"SliderAjaxEvent",
".",
"ajaxSlideEvent",
",",
"ajaxSlideEvent",
")",
";",
"setSlideEvent",
"(",
"new",
"SliderAjaxJsScopeUiEvent",
... | Sets the call-back for the AJAX Slide Event.
@param ajaxSlideEvent
The ISliderAjaxEvent. | [
"Sets",
"the",
"call",
"-",
"back",
"for",
"the",
"AJAX",
"Slide",
"Event",
"."
] | train | https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/AjaxSlider.java#L306-L310 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/wallet/SendRequest.java | SendRequest.childPaysForParent | public static SendRequest childPaysForParent(Wallet wallet, Transaction parentTransaction, Coin feeRaise) {
"""
Construct a SendRequest for a CPFP (child-pays-for-parent) transaction. The resulting transaction is already
completed, so you should directly proceed to signing and broadcasting/committing the transact... | java | public static SendRequest childPaysForParent(Wallet wallet, Transaction parentTransaction, Coin feeRaise) {
TransactionOutput outputToSpend = null;
for (final TransactionOutput output : parentTransaction.getOutputs()) {
if (output.isMine(wallet) && output.isAvailableForSpending()
... | [
"public",
"static",
"SendRequest",
"childPaysForParent",
"(",
"Wallet",
"wallet",
",",
"Transaction",
"parentTransaction",
",",
"Coin",
"feeRaise",
")",
"{",
"TransactionOutput",
"outputToSpend",
"=",
"null",
";",
"for",
"(",
"final",
"TransactionOutput",
"output",
... | Construct a SendRequest for a CPFP (child-pays-for-parent) transaction. The resulting transaction is already
completed, so you should directly proceed to signing and broadcasting/committing the transaction. CPFP is
currently only supported by a few miners, so use with care. | [
"Construct",
"a",
"SendRequest",
"for",
"a",
"CPFP",
"(",
"child",
"-",
"pays",
"-",
"for",
"-",
"parent",
")",
"transaction",
".",
"The",
"resulting",
"transaction",
"is",
"already",
"completed",
"so",
"you",
"should",
"directly",
"proceed",
"to",
"signing"... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/wallet/SendRequest.java#L217-L236 |
goldmansachs/reladomo | reladomo/src/main/java/com/gs/fw/common/mithra/util/MithraConfigurationManager.java | MithraConfigurationManager.loadMithraCache | public void loadMithraCache(List<MithraObjectPortal> portals, int threads) throws MithraBusinessException {
"""
This method will load the cache of the object already initialized. A Collection is used
to keep track of the objects to load.
@param portals list of portals to load caches for
@param threads number of... | java | public void loadMithraCache(List<MithraObjectPortal> portals, int threads) throws MithraBusinessException
{
ThreadConservingExecutor executor = new ThreadConservingExecutor(threads);
for(int i=0;i<portals.size();i++)
{
final MithraObjectPortal portal = portals.get(i);
... | [
"public",
"void",
"loadMithraCache",
"(",
"List",
"<",
"MithraObjectPortal",
">",
"portals",
",",
"int",
"threads",
")",
"throws",
"MithraBusinessException",
"{",
"ThreadConservingExecutor",
"executor",
"=",
"new",
"ThreadConservingExecutor",
"(",
"threads",
")",
";",... | This method will load the cache of the object already initialized. A Collection is used
to keep track of the objects to load.
@param portals list of portals to load caches for
@param threads number of parallel threads to load
@throws MithraBusinessException if something goes wrong during the load | [
"This",
"method",
"will",
"load",
"the",
"cache",
"of",
"the",
"object",
"already",
"initialized",
".",
"A",
"Collection",
"is",
"used",
"to",
"keep",
"track",
"of",
"the",
"objects",
"to",
"load",
"."
] | train | https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/util/MithraConfigurationManager.java#L267-L276 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.email_pro_email_PUT | public void email_pro_email_PUT(String email, OvhXdslEmailPro body) throws IOException {
"""
Alter this object properties
REST: PUT /xdsl/email/pro/{email}
@param body [required] New object properties
@param email [required] The email address if the XDSL Email Pro
"""
String qPath = "/xdsl/email/pro/{em... | java | public void email_pro_email_PUT(String email, OvhXdslEmailPro body) throws IOException {
String qPath = "/xdsl/email/pro/{email}";
StringBuilder sb = path(qPath, email);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"email_pro_email_PUT",
"(",
"String",
"email",
",",
"OvhXdslEmailPro",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/email/pro/{email}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"email",
")",
"... | Alter this object properties
REST: PUT /xdsl/email/pro/{email}
@param body [required] New object properties
@param email [required] The email address if the XDSL Email Pro | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L1924-L1928 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/thread/ThreadUtil.java | ThreadUtil.newNamedThreadFactory | public static ThreadFactory newNamedThreadFactory(String prefix, ThreadGroup threadGroup, boolean isDeamon) {
"""
创建线程工厂
@param prefix 线程名前缀
@param threadGroup 线程组,可以为null
@param isDeamon 是否守护线程
@since 4.0.0
"""
return new NamedThreadFactory(prefix, threadGroup, isDeamon);
} | java | public static ThreadFactory newNamedThreadFactory(String prefix, ThreadGroup threadGroup, boolean isDeamon) {
return new NamedThreadFactory(prefix, threadGroup, isDeamon);
} | [
"public",
"static",
"ThreadFactory",
"newNamedThreadFactory",
"(",
"String",
"prefix",
",",
"ThreadGroup",
"threadGroup",
",",
"boolean",
"isDeamon",
")",
"{",
"return",
"new",
"NamedThreadFactory",
"(",
"prefix",
",",
"threadGroup",
",",
"isDeamon",
")",
";",
"}"... | 创建线程工厂
@param prefix 线程名前缀
@param threadGroup 线程组,可以为null
@param isDeamon 是否守护线程
@since 4.0.0 | [
"创建线程工厂"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/thread/ThreadUtil.java#L407-L409 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/AbstractDefinitionDeployer.java | AbstractDefinitionDeployer.getNextVersion | protected int getNextVersion(DeploymentEntity deployment, DefinitionEntity newDefinition, DefinitionEntity latestDefinition) {
"""
per default we increment the latest definition version by one - but you
might want to hook in some own logic here, e.g. to align definition
versions with deployment / build versions.... | java | protected int getNextVersion(DeploymentEntity deployment, DefinitionEntity newDefinition, DefinitionEntity latestDefinition) {
int result = 1;
if (latestDefinition != null) {
int latestVersion = latestDefinition.getVersion();
result = latestVersion + 1;
}
return result;
} | [
"protected",
"int",
"getNextVersion",
"(",
"DeploymentEntity",
"deployment",
",",
"DefinitionEntity",
"newDefinition",
",",
"DefinitionEntity",
"latestDefinition",
")",
"{",
"int",
"result",
"=",
"1",
";",
"if",
"(",
"latestDefinition",
"!=",
"null",
")",
"{",
"in... | per default we increment the latest definition version by one - but you
might want to hook in some own logic here, e.g. to align definition
versions with deployment / build versions. | [
"per",
"default",
"we",
"increment",
"the",
"latest",
"definition",
"version",
"by",
"one",
"-",
"but",
"you",
"might",
"want",
"to",
"hook",
"in",
"some",
"own",
"logic",
"here",
"e",
".",
"g",
".",
"to",
"align",
"definition",
"versions",
"with",
"depl... | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/AbstractDefinitionDeployer.java#L322-L329 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java | FileSystemView.lockBoth | private static void lockBoth(Lock sourceWriteLock, Lock destWriteLock) {
"""
Acquires both write locks in a way that attempts to avoid the possibility of deadlock. Note
that typically (when only one file system instance is involved), both locks will be the same
lock and there will be no issue at all.
"""
... | java | private static void lockBoth(Lock sourceWriteLock, Lock destWriteLock) {
while (true) {
sourceWriteLock.lock();
if (destWriteLock.tryLock()) {
return;
} else {
sourceWriteLock.unlock();
}
destWriteLock.lock();
if (sourceWriteLock.tryLock()) {
return;
... | [
"private",
"static",
"void",
"lockBoth",
"(",
"Lock",
"sourceWriteLock",
",",
"Lock",
"destWriteLock",
")",
"{",
"while",
"(",
"true",
")",
"{",
"sourceWriteLock",
".",
"lock",
"(",
")",
";",
"if",
"(",
"destWriteLock",
".",
"tryLock",
"(",
")",
")",
"{"... | Acquires both write locks in a way that attempts to avoid the possibility of deadlock. Note
that typically (when only one file system instance is involved), both locks will be the same
lock and there will be no issue at all. | [
"Acquires",
"both",
"write",
"locks",
"in",
"a",
"way",
"that",
"attempts",
"to",
"avoid",
"the",
"possibility",
"of",
"deadlock",
".",
"Note",
"that",
"typically",
"(",
"when",
"only",
"one",
"file",
"system",
"instance",
"is",
"involved",
")",
"both",
"l... | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L621-L637 |
OpenLiberty/open-liberty | dev/com.ibm.websphere.security.wim.base/src/com/ibm/wsspi/security/wim/model/PersonAccount.java | PersonAccount.addExtendedProperty | public static void addExtendedProperty(String propName, String dataType, boolean multiValued, Object defaultValue) {
"""
Allows for an extended property, or a property not pre-defined as part of this PersonAccount entity type, to be
added to the PersonAccount entity
@param propName: name of property
<ul><li>a... | java | public static void addExtendedProperty(String propName, String dataType, boolean multiValued, Object defaultValue) {
if (dataType == null || "null".equalsIgnoreCase(dataType))
return;
if (extendedPropertiesDataType.containsKey(propName)) {
Tr.warning(tc, WIMMessageKey.DUPLICATE_... | [
"public",
"static",
"void",
"addExtendedProperty",
"(",
"String",
"propName",
",",
"String",
"dataType",
",",
"boolean",
"multiValued",
",",
"Object",
"defaultValue",
")",
"{",
"if",
"(",
"dataType",
"==",
"null",
"||",
"\"null\"",
".",
"equalsIgnoreCase",
"(",
... | Allows for an extended property, or a property not pre-defined as part of this PersonAccount entity type, to be
added to the PersonAccount entity
@param propName: name of property
<ul><li>allowed object is a {@link String}</li></ul>
@param dataType: Java type of property
<ul><li>allowed object is a {@link String}</li>... | [
"Allows",
"for",
"an",
"extended",
"property",
"or",
"a",
"property",
"not",
"pre",
"-",
"defined",
"as",
"part",
"of",
"this",
"PersonAccount",
"entity",
"type",
"to",
"be",
"added",
"to",
"the",
"PersonAccount",
"entity"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.security.wim.base/src/com/ibm/wsspi/security/wim/model/PersonAccount.java#L3239-L3258 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java | MapUtil.getAny | @SuppressWarnings("unchecked")
public static <K, V> Map<K, V> getAny(Map<K, V> map, final K... keys) {
"""
获取Map的部分key生成新的Map
@param <K> Key类型
@param <V> Value类型
@param map Map
@param keys 键列表
@return 新Map,只包含指定的key
@since 4.0.6
"""
return filter(map, new Filter<Entry<K, V>>() {
@Override
... | java | @SuppressWarnings("unchecked")
public static <K, V> Map<K, V> getAny(Map<K, V> map, final K... keys) {
return filter(map, new Filter<Entry<K, V>>() {
@Override
public boolean accept(Entry<K, V> entry) {
return ArrayUtil.contains(keys, entry.getKey());
}
});
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"getAny",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"final",
"K",
"...",
"keys",
")",
"{",
"return",
"filter",... | 获取Map的部分key生成新的Map
@param <K> Key类型
@param <V> Value类型
@param map Map
@param keys 键列表
@return 新Map,只包含指定的key
@since 4.0.6 | [
"获取Map的部分key生成新的Map"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java#L737-L746 |
netty/netty-tcnative | openssl-dynamic/src/main/java/io/netty/internal/tcnative/SSL.java | SSL.setCipherSuites | @Deprecated
public static boolean setCipherSuites(long ssl, String ciphers)
throws Exception {
"""
Returns the cipher suites available for negotiation in SSL handshake.
<p>
This complex directive uses a colon-separated cipher-spec string consisting
of OpenSSL cipher specifications to configure t... | java | @Deprecated
public static boolean setCipherSuites(long ssl, String ciphers)
throws Exception {
return setCipherSuites(ssl, ciphers, false);
} | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"setCipherSuites",
"(",
"long",
"ssl",
",",
"String",
"ciphers",
")",
"throws",
"Exception",
"{",
"return",
"setCipherSuites",
"(",
"ssl",
",",
"ciphers",
",",
"false",
")",
";",
"}"
] | Returns the cipher suites available for negotiation in SSL handshake.
<p>
This complex directive uses a colon-separated cipher-spec string consisting
of OpenSSL cipher specifications to configure the Cipher Suite the client
is permitted to negotiate in the SSL handshake phase. Notice that this
directive can be used bot... | [
"Returns",
"the",
"cipher",
"suites",
"available",
"for",
"negotiation",
"in",
"SSL",
"handshake",
".",
"<p",
">",
"This",
"complex",
"directive",
"uses",
"a",
"colon",
"-",
"separated",
"cipher",
"-",
"spec",
"string",
"consisting",
"of",
"OpenSSL",
"cipher",... | train | https://github.com/netty/netty-tcnative/blob/4a5d7330c6c36cff2bebbb465571cab1cf7a4063/openssl-dynamic/src/main/java/io/netty/internal/tcnative/SSL.java#L512-L516 |
rhuss/jolokia | agent/osgi/src/main/java/org/jolokia/osgi/util/LogHelper.java | LogHelper.logError | public static void logError(BundleContext pBundleContext, String pMessage, Throwable pThrowable) {
"""
Log error to a logging service (if available), otherwise log to std error
@param pBundleContext bundle context to lookup LogService
@param pMessage message to log
@param pThrowable an exception to log
""... | java | public static void logError(BundleContext pBundleContext, String pMessage, Throwable pThrowable) {
final ServiceReference lRef = pBundleContext.getServiceReference(LogService.class.getName());
if (lRef != null) {
try {
final LogService logService = (LogService) pBundleContex... | [
"public",
"static",
"void",
"logError",
"(",
"BundleContext",
"pBundleContext",
",",
"String",
"pMessage",
",",
"Throwable",
"pThrowable",
")",
"{",
"final",
"ServiceReference",
"lRef",
"=",
"pBundleContext",
".",
"getServiceReference",
"(",
"LogService",
".",
"clas... | Log error to a logging service (if available), otherwise log to std error
@param pBundleContext bundle context to lookup LogService
@param pMessage message to log
@param pThrowable an exception to log | [
"Log",
"error",
"to",
"a",
"logging",
"service",
"(",
"if",
"available",
")",
"otherwise",
"log",
"to",
"std",
"error"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/osgi/src/main/java/org/jolokia/osgi/util/LogHelper.java#L39-L54 |
imsweb/naaccr-xml | src/main/java/com/imsweb/naaccrxml/NaaccrXmlUtils.java | NaaccrXmlUtils.readFlatFile | public static NaaccrData readFlatFile(File flatFile, NaaccrOptions options, List<NaaccrDictionary> userDictionaries, NaaccrObserver observer) throws NaaccrIOException {
"""
Reads an NAACCR flat file data file and returns the corresponding data.
<br/>
ATTENTION: THIS METHOD WILL RETURN THE FULL CONTENT OF THE FIL... | java | public static NaaccrData readFlatFile(File flatFile, NaaccrOptions options, List<NaaccrDictionary> userDictionaries, NaaccrObserver observer) throws NaaccrIOException {
if (flatFile == null)
throw new NaaccrIOException("Source flat file is required");
if (!flatFile.exists())
thro... | [
"public",
"static",
"NaaccrData",
"readFlatFile",
"(",
"File",
"flatFile",
",",
"NaaccrOptions",
"options",
",",
"List",
"<",
"NaaccrDictionary",
">",
"userDictionaries",
",",
"NaaccrObserver",
"observer",
")",
"throws",
"NaaccrIOException",
"{",
"if",
"(",
"flatFil... | Reads an NAACCR flat file data file and returns the corresponding data.
<br/>
ATTENTION: THIS METHOD WILL RETURN THE FULL CONTENT OF THE FILE AND IS NOT SUITABLE FOR LARGE FILE; CONSIDER USING A STREAM INSTEAD.
@param flatFile source flat file, must exists
@param options optional validating options
@param userDictionar... | [
"Reads",
"an",
"NAACCR",
"flat",
"file",
"data",
"file",
"and",
"returns",
"the",
"corresponding",
"data",
".",
"<br",
"/",
">",
"ATTENTION",
":",
"THIS",
"METHOD",
"WILL",
"RETURN",
"THE",
"FULL",
"CONTENT",
"OF",
"THE",
"FILE",
"AND",
"IS",
"NOT",
"SUI... | train | https://github.com/imsweb/naaccr-xml/blob/a3a501faa2a0c3411dd5248b2c1379f279131696/src/main/java/com/imsweb/naaccrxml/NaaccrXmlUtils.java#L202-L219 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/ocr/AipOcr.java | AipOcr.basicGeneralUrl | public JSONObject basicGeneralUrl(String url, HashMap<String, String> options) {
"""
通用文字识别接口
用户向服务请求识别某张图中的所有文字
@param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
@param options - 可选参数对象,key: value都为string类型
options - options列表:
language_ty... | java | public JSONObject basicGeneralUrl(String url, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("url", url);
if (options != null) {
request.addBody(options);
}
request.setUri(OcrConsts.GEN... | [
"public",
"JSONObject",
"basicGeneralUrl",
"(",
"String",
"url",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"request",
... | 通用文字识别接口
用户向服务请求识别某张图中的所有文字
@param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
@param options - 可选参数对象,key: value都为string类型
options - options列表:
language_type 识别语言类型,默认为CHN_ENG。可选值包括:<br>- CHN_ENG:中英文混合;<br>- ENG:英文;<br>- POR:葡萄牙语;<br>- FRE:法语;<br>- GE... | [
"通用文字识别接口",
"用户向服务请求识别某张图中的所有文字"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/ocr/AipOcr.java#L96-L107 |
Sciss/abc4j | abc/src/main/java/abc/ui/swing/ScoreMetrics.java | ScoreMetrics.getBounds | protected Rectangle2D getBounds(char[] glyph, int notationContext) {
"""
Get the bounds of a glyph in the given notation context
@param glyph {@link abc.notation.Accidental#SHARP}, {@link abc.notation.Accidental#FLAT}...
@param notationContext {@link #NOTATION_CONTEXT_NOTE} or {@link #NOTATION_CONTEXT_GRACENOTE}... | java | protected Rectangle2D getBounds(char[] glyph, int notationContext) {
String key = String.valueOf(notationContext)
+ "-" + String.valueOf(glyph)
+ "-" + getMusicalFont().getName();
try {
if (bounds.get(key) == null) {
FontRenderContext frc = g2.getFontRenderContext();
bounds.put(key, new Text... | [
"protected",
"Rectangle2D",
"getBounds",
"(",
"char",
"[",
"]",
"glyph",
",",
"int",
"notationContext",
")",
"{",
"String",
"key",
"=",
"String",
".",
"valueOf",
"(",
"notationContext",
")",
"+",
"\"-\"",
"+",
"String",
".",
"valueOf",
"(",
"glyph",
")",
... | Get the bounds of a glyph in the given notation context
@param glyph {@link abc.notation.Accidental#SHARP}, {@link abc.notation.Accidental#FLAT}...
@param notationContext {@link #NOTATION_CONTEXT_NOTE} or {@link #NOTATION_CONTEXT_GRACENOTE} | [
"Get",
"the",
"bounds",
"of",
"a",
"glyph",
"in",
"the",
"given",
"notation",
"context"
] | train | https://github.com/Sciss/abc4j/blob/117b405642c84a7bfca4e3e13668838258b90ca7/abc/src/main/java/abc/ui/swing/ScoreMetrics.java#L99-L116 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/script/ExtensionScript.java | ExtensionScript.addScriptsFromDir | private int addScriptsFromDir(File dir, ScriptType type, String targetEngineName) {
"""
Adds the scripts from the given directory of the given script type and, optionally, for the engine with the given name.
@param dir the directory from where to add the scripts.
@param type the script type, must not be {@code... | java | private int addScriptsFromDir(File dir, ScriptType type, String targetEngineName) {
int addedScripts = 0;
File typeDir = new File(dir, type.getName());
if (typeDir.exists()) {
for (File f : typeDir.listFiles()) {
String ext = f.getName().substring(f.getName().lastIndexOf(".") + 1);
String engineN... | [
"private",
"int",
"addScriptsFromDir",
"(",
"File",
"dir",
",",
"ScriptType",
"type",
",",
"String",
"targetEngineName",
")",
"{",
"int",
"addedScripts",
"=",
"0",
";",
"File",
"typeDir",
"=",
"new",
"File",
"(",
"dir",
",",
"type",
".",
"getName",
"(",
... | Adds the scripts from the given directory of the given script type and, optionally, for the engine with the given name.
@param dir the directory from where to add the scripts.
@param type the script type, must not be {@code null}.
@param targetEngineName the engine that the scripts must be of, {@code null} for all eng... | [
"Adds",
"the",
"scripts",
"from",
"the",
"given",
"directory",
"of",
"the",
"given",
"script",
"type",
"and",
"optionally",
"for",
"the",
"engine",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/script/ExtensionScript.java#L883-L919 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Base.java | Base.setAttribute | public void setAttribute(String name, String value, String facet)
throws JspException {
"""
Base support for the attribute tag. The <code>href</code> may not bet set.
@param name The name of the attribute. This value may not be null or the empty string.
@param value The value of the attribute. Th... | java | public void setAttribute(String name, String value, String facet)
throws JspException
{
boolean error = false;
// validate the name attribute, in the case of an error simply return.
if (name == null || name.length() <= 0) {
String s = Bundle.getString("Tags_Attribute... | [
"public",
"void",
"setAttribute",
"(",
"String",
"name",
",",
"String",
"value",
",",
"String",
"facet",
")",
"throws",
"JspException",
"{",
"boolean",
"error",
"=",
"false",
";",
"// validate the name attribute, in the case of an error simply return.",
"if",
"(",
"na... | Base support for the attribute tag. The <code>href</code> may not bet set.
@param name The name of the attribute. This value may not be null or the empty string.
@param value The value of the attribute. This may contain an expression.
@param facet The name of a facet to which the attribute will be applied. This is... | [
"Base",
"support",
"for",
"the",
"attribute",
"tag",
".",
"The",
"<code",
">",
"href<",
"/",
"code",
">",
"may",
"not",
"bet",
"set",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/Base.java#L84-L117 |
FaritorKang/unmz-common-util | src/main/java/net/unmz/java/util/security/MD5Utils.java | MD5Utils.verify | public static boolean verify(String text, String sign, String key, String input_charset) {
"""
签名字符串
@param text 需要签名的字符串
@param sign 签名结果
@param key 密钥
@param input_charset 编码格式
@return 签名结果
"""
text = text + key;
String mysign = DigestUtils.md5Hex(getContent... | java | public static boolean verify(String text, String sign, String key, String input_charset) {
text = text + key;
String mysign = DigestUtils.md5Hex(getContentBytes(text, input_charset));
if (mysign.equals(sign)) {
return true;
} else {
return false;
}
} | [
"public",
"static",
"boolean",
"verify",
"(",
"String",
"text",
",",
"String",
"sign",
",",
"String",
"key",
",",
"String",
"input_charset",
")",
"{",
"text",
"=",
"text",
"+",
"key",
";",
"String",
"mysign",
"=",
"DigestUtils",
".",
"md5Hex",
"(",
"getC... | 签名字符串
@param text 需要签名的字符串
@param sign 签名结果
@param key 密钥
@param input_charset 编码格式
@return 签名结果 | [
"签名字符串"
] | train | https://github.com/FaritorKang/unmz-common-util/blob/2912b8889b85ed910d536f85b24b6fa68035814a/src/main/java/net/unmz/java/util/security/MD5Utils.java#L149-L157 |
Red5/red5-io | src/main/java/org/red5/io/utils/XMLUtils.java | XMLUtils.stringToDoc | public static Document stringToDoc(String str) throws IOException {
"""
Converts string representation of XML into Document
@param str
String representation of XML
@return DOM object
@throws IOException
I/O exception
"""
if (StringUtils.isNotEmpty(str)) {
try (Reader reader = new Str... | java | public static Document stringToDoc(String str) throws IOException {
if (StringUtils.isNotEmpty(str)) {
try (Reader reader = new StringReader(str)) {
DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = db.parse(new InputSource... | [
"public",
"static",
"Document",
"stringToDoc",
"(",
"String",
"str",
")",
"throws",
"IOException",
"{",
"if",
"(",
"StringUtils",
".",
"isNotEmpty",
"(",
"str",
")",
")",
"{",
"try",
"(",
"Reader",
"reader",
"=",
"new",
"StringReader",
"(",
"str",
")",
"... | Converts string representation of XML into Document
@param str
String representation of XML
@return DOM object
@throws IOException
I/O exception | [
"Converts",
"string",
"representation",
"of",
"XML",
"into",
"Document"
] | train | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/utils/XMLUtils.java#L63-L77 |
Erudika/para | para-core/src/main/java/com/erudika/para/core/App.java | App.revokeResourcePermission | public boolean revokeResourcePermission(String subjectid, String resourcePath) {
"""
Revokes a permission for given subject.
@param subjectid subject id
@param resourcePath resource path or object type
@return true if successful
"""
if (!StringUtils.isBlank(subjectid) && getResourcePermissions().containsK... | java | public boolean revokeResourcePermission(String subjectid, String resourcePath) {
if (!StringUtils.isBlank(subjectid) && getResourcePermissions().containsKey(subjectid) &&
!StringUtils.isBlank(resourcePath)) {
// urlDecode resource path
resourcePath = Utils.urlDecode(resourcePath);
getResourcePermissions(... | [
"public",
"boolean",
"revokeResourcePermission",
"(",
"String",
"subjectid",
",",
"String",
"resourcePath",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"isBlank",
"(",
"subjectid",
")",
"&&",
"getResourcePermissions",
"(",
")",
".",
"containsKey",
"(",
"subjec... | Revokes a permission for given subject.
@param subjectid subject id
@param resourcePath resource path or object type
@return true if successful | [
"Revokes",
"a",
"permission",
"for",
"given",
"subject",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/core/App.java#L676-L688 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabAccountsInner.java | LabAccountsInner.createOrUpdateAsync | public Observable<LabAccountInner> createOrUpdateAsync(String resourceGroupName, String labAccountName, LabAccountInner labAccount) {
"""
Create or replace an existing Lab Account.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labAccount Rep... | java | public Observable<LabAccountInner> createOrUpdateAsync(String resourceGroupName, String labAccountName, LabAccountInner labAccount) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labAccount).map(new Func1<ServiceResponse<LabAccountInner>, LabAccountInner>() {
@Ove... | [
"public",
"Observable",
"<",
"LabAccountInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"LabAccountInner",
"labAccount",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
","... | Create or replace an existing Lab Account.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labAccount Represents a lab account.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the LabAccountInner obje... | [
"Create",
"or",
"replace",
"an",
"existing",
"Lab",
"Account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabAccountsInner.java#L803-L810 |
alkacon/opencms-core | src/org/opencms/ui/login/CmsTokenValidator.java | CmsTokenValidator.clearToken | public static void clearToken(CmsObject cms, CmsUser user) throws CmsException {
"""
Removes an authorization token from the user's additional information.<p>
@param cms the CMS context
@param user the user
@throws CmsException if something goes wrong
"""
user.getAdditionalInfo().remove(ADDINFO_K... | java | public static void clearToken(CmsObject cms, CmsUser user) throws CmsException {
user.getAdditionalInfo().remove(ADDINFO_KEY);
cms.writeUser(user);
} | [
"public",
"static",
"void",
"clearToken",
"(",
"CmsObject",
"cms",
",",
"CmsUser",
"user",
")",
"throws",
"CmsException",
"{",
"user",
".",
"getAdditionalInfo",
"(",
")",
".",
"remove",
"(",
"ADDINFO_KEY",
")",
";",
"cms",
".",
"writeUser",
"(",
"user",
")... | Removes an authorization token from the user's additional information.<p>
@param cms the CMS context
@param user the user
@throws CmsException if something goes wrong | [
"Removes",
"an",
"authorization",
"token",
"from",
"the",
"user",
"s",
"additional",
"information",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/login/CmsTokenValidator.java#L65-L69 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/model/many2many/M2MEntity.java | M2MEntity.extractEntityManagedByDAO | public static M2MEntity extractEntityManagedByDAO(TypeElement daoElement) {
"""
Works with @BindDaoMany2Many and @BindDao to extract entity name.
@param schema
@param daoElement the dao element
@return the m 2 M entity
"""
ClassName entity1 = null;
ClassName entity2 = null;
String prefixId = null;
... | java | public static M2MEntity extractEntityManagedByDAO(TypeElement daoElement) {
ClassName entity1 = null;
ClassName entity2 = null;
String prefixId = null;
String tableName = null;
String entityName = null;
PackageElement pkg = null;
String packageName = null;
boolean needToCreate = true;
boolean generate... | [
"public",
"static",
"M2MEntity",
"extractEntityManagedByDAO",
"(",
"TypeElement",
"daoElement",
")",
"{",
"ClassName",
"entity1",
"=",
"null",
";",
"ClassName",
"entity2",
"=",
"null",
";",
"String",
"prefixId",
"=",
"null",
";",
"String",
"tableName",
"=",
"nul... | Works with @BindDaoMany2Many and @BindDao to extract entity name.
@param schema
@param daoElement the dao element
@return the m 2 M entity | [
"Works",
"with",
"@BindDaoMany2Many",
"and",
"@BindDao",
"to",
"extract",
"entity",
"name",
".",
"@param",
"schema"
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/model/many2many/M2MEntity.java#L145-L192 |
ios-driver/ios-driver | client/src/main/java/org/uiautomation/ios/client/uiamodels/impl/RemoteIOSObject.java | RemoteIOSObject.createObject | public static WebElement createObject(RemoteWebDriver driver, Map<String, Object> ro) {
"""
Uses reflection to instanciate a remote object implementing the correct interface.
@return the object. If the object is UIAElementNil, return null for a simple object, an empty
list for a UIAElementArray.
"""
St... | java | public static WebElement createObject(RemoteWebDriver driver, Map<String, Object> ro) {
String ref = ro.get("ELEMENT").toString();
String type = (String) ro.get("type");
if (type != null) {
String remoteObjectName = "org.uiautomation.ios.client.uiamodels.impl.Remote" + type;
if ("UIAElementNil... | [
"public",
"static",
"WebElement",
"createObject",
"(",
"RemoteWebDriver",
"driver",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"ro",
")",
"{",
"String",
"ref",
"=",
"ro",
".",
"get",
"(",
"\"ELEMENT\"",
")",
".",
"toString",
"(",
")",
";",
"String",
... | Uses reflection to instanciate a remote object implementing the correct interface.
@return the object. If the object is UIAElementNil, return null for a simple object, an empty
list for a UIAElementArray. | [
"Uses",
"reflection",
"to",
"instanciate",
"a",
"remote",
"object",
"implementing",
"the",
"correct",
"interface",
"."
] | train | https://github.com/ios-driver/ios-driver/blob/a9744419508d970fbb1ce18e4326cc624b237c8b/client/src/main/java/org/uiautomation/ios/client/uiamodels/impl/RemoteIOSObject.java#L55-L100 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLOperationHelper.java | SARLOperationHelper._hasSideEffects | protected Boolean _hasSideEffects(XFeatureCall expression, ISideEffectContext context) {
"""
Test if the given expression has side effects.
@param expression the expression.
@param context the list of context expressions.
@return {@code true} if the expression has side effects.
"""
return internalHasOpe... | java | protected Boolean _hasSideEffects(XFeatureCall expression, ISideEffectContext context) {
return internalHasOperationSideEffects(expression, context, false);
} | [
"protected",
"Boolean",
"_hasSideEffects",
"(",
"XFeatureCall",
"expression",
",",
"ISideEffectContext",
"context",
")",
"{",
"return",
"internalHasOperationSideEffects",
"(",
"expression",
",",
"context",
",",
"false",
")",
";",
"}"
] | Test if the given expression has side effects.
@param expression the expression.
@param context the list of context expressions.
@return {@code true} if the expression has side effects. | [
"Test",
"if",
"the",
"given",
"expression",
"has",
"side",
"effects",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLOperationHelper.java#L548-L550 |
Red5/red5-websocket | src/main/java/org/red5/net/websocket/WebSocketScopeManager.java | WebSocketScopeManager.removeListener | public void removeListener(IWebSocketDataListener listener, String path) {
"""
Remove listener from scope via its path.
@param listener
IWebSocketDataListener
@param path
"""
log.trace("removeListener: {}", listener);
WebSocketScope scope = getScope(path);
if (scope != null) {
... | java | public void removeListener(IWebSocketDataListener listener, String path) {
log.trace("removeListener: {}", listener);
WebSocketScope scope = getScope(path);
if (scope != null) {
scope.removeListener(listener);
if (!scope.isValid()) {
// scope is not valid.... | [
"public",
"void",
"removeListener",
"(",
"IWebSocketDataListener",
"listener",
",",
"String",
"path",
")",
"{",
"log",
".",
"trace",
"(",
"\"removeListener: {}\"",
",",
"listener",
")",
";",
"WebSocketScope",
"scope",
"=",
"getScope",
"(",
"path",
")",
";",
"i... | Remove listener from scope via its path.
@param listener
IWebSocketDataListener
@param path | [
"Remove",
"listener",
"from",
"scope",
"via",
"its",
"path",
"."
] | train | https://github.com/Red5/red5-websocket/blob/24b53f2f3875624fb01f0a2604f4117583aeab40/src/main/java/org/red5/net/websocket/WebSocketScopeManager.java#L229-L241 |
phax/ph-oton | ph-oton-html/src/main/java/com/helger/html/hc/html/HC_Target.java | HC_Target.getFromName | @Nullable
public static HC_Target getFromName (@Nonnull final String sName, @Nullable final HC_Target aDefault) {
"""
Try to find one of the default targets by name. The name comparison is
performed case insensitive.
@param sName
The name to check. May not be <code>null</code>.
@param aDefault
The default... | java | @Nullable
public static HC_Target getFromName (@Nonnull final String sName, @Nullable final HC_Target aDefault)
{
if (BLANK.getAttrValue ().equalsIgnoreCase (sName))
return BLANK;
if (SELF.getAttrValue ().equalsIgnoreCase (sName))
return SELF;
if (PARENT.getAttrValue ().equalsIgnoreCase (sNa... | [
"@",
"Nullable",
"public",
"static",
"HC_Target",
"getFromName",
"(",
"@",
"Nonnull",
"final",
"String",
"sName",
",",
"@",
"Nullable",
"final",
"HC_Target",
"aDefault",
")",
"{",
"if",
"(",
"BLANK",
".",
"getAttrValue",
"(",
")",
".",
"equalsIgnoreCase",
"(... | Try to find one of the default targets by name. The name comparison is
performed case insensitive.
@param sName
The name to check. May not be <code>null</code>.
@param aDefault
The default value to be returned in case the name was never found.
May be <code>null</code>.
@return The constant link target representing the... | [
"Try",
"to",
"find",
"one",
"of",
"the",
"default",
"targets",
"by",
"name",
".",
"The",
"name",
"comparison",
"is",
"performed",
"case",
"insensitive",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/hc/html/HC_Target.java#L102-L114 |
m-m-m/util | resource/src/main/java/net/sf/mmm/util/resource/base/AbstractBrowsableResourceFactory.java | AbstractBrowsableResourceFactory.createBrowsableResource | protected BrowsableResource createBrowsableResource(ResourceUri resourceUri) throws ResourceUriUndefinedException {
"""
This method {@link #createBrowsableResource(String) creates} the actual raw {@link BrowsableResource}.
@param resourceUri is the parsed and qualified {@link ResourceUriImpl}.
@return the crea... | java | protected BrowsableResource createBrowsableResource(ResourceUri resourceUri) throws ResourceUriUndefinedException {
DataResourceProvider<? extends DataResource> provider = getProvider(resourceUri);
if (!BrowsableResource.class.isAssignableFrom(provider.getResourceType())) {
Exception cause = new IllegalA... | [
"protected",
"BrowsableResource",
"createBrowsableResource",
"(",
"ResourceUri",
"resourceUri",
")",
"throws",
"ResourceUriUndefinedException",
"{",
"DataResourceProvider",
"<",
"?",
"extends",
"DataResource",
">",
"provider",
"=",
"getProvider",
"(",
"resourceUri",
")",
... | This method {@link #createBrowsableResource(String) creates} the actual raw {@link BrowsableResource}.
@param resourceUri is the parsed and qualified {@link ResourceUriImpl}.
@return the created {@link BrowsableResource}.
@throws ResourceUriUndefinedException if the given {@code resourceUri} is undefined, e.g. the
{@l... | [
"This",
"method",
"{",
"@link",
"#createBrowsableResource",
"(",
"String",
")",
"creates",
"}",
"the",
"actual",
"raw",
"{",
"@link",
"BrowsableResource",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/resource/src/main/java/net/sf/mmm/util/resource/base/AbstractBrowsableResourceFactory.java#L112-L120 |
alkacon/opencms-core | src/org/opencms/util/CmsDateUtil.java | CmsDateUtil.getDate | public static String getDate(Date date, int format, Locale locale) {
"""
Returns a formated date String from a Date value,
the formatting based on the provided options.<p>
@param date the Date object to format as String
@param format the format to use, see {@link DateFormat} for possible values
@param locale... | java | public static String getDate(Date date, int format, Locale locale) {
DateFormat df = DateFormat.getDateInstance(format, locale);
return df.format(date);
} | [
"public",
"static",
"String",
"getDate",
"(",
"Date",
"date",
",",
"int",
"format",
",",
"Locale",
"locale",
")",
"{",
"DateFormat",
"df",
"=",
"DateFormat",
".",
"getDateInstance",
"(",
"format",
",",
"locale",
")",
";",
"return",
"df",
".",
"format",
"... | Returns a formated date String from a Date value,
the formatting based on the provided options.<p>
@param date the Date object to format as String
@param format the format to use, see {@link DateFormat} for possible values
@param locale the locale to use
@return the formatted date | [
"Returns",
"a",
"formated",
"date",
"String",
"from",
"a",
"Date",
"value",
"the",
"formatting",
"based",
"on",
"the",
"provided",
"options",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsDateUtil.java#L75-L79 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/sms_server.java | sms_server.count_filtered | public static long count_filtered(nitro_service service, String filter) throws Exception {
"""
Use this API to count the filtered set of sms_server resources.
filter string should be in JSON format.eg: "vm_state:DOWN,name:[a-z]+"
"""
sms_server obj = new sms_server();
options option = new options();
... | java | public static long count_filtered(nitro_service service, String filter) throws Exception
{
sms_server obj = new sms_server();
options option = new options();
option.set_count(true);
option.set_filter(filter);
sms_server[] response = (sms_server[])obj.get_resources(service, option);
if (response != n... | [
"public",
"static",
"long",
"count_filtered",
"(",
"nitro_service",
"service",
",",
"String",
"filter",
")",
"throws",
"Exception",
"{",
"sms_server",
"obj",
"=",
"new",
"sms_server",
"(",
")",
";",
"options",
"option",
"=",
"new",
"options",
"(",
")",
";",
... | Use this API to count the filtered set of sms_server resources.
filter string should be in JSON format.eg: "vm_state:DOWN,name:[a-z]+" | [
"Use",
"this",
"API",
"to",
"count",
"the",
"filtered",
"set",
"of",
"sms_server",
"resources",
".",
"filter",
"string",
"should",
"be",
"in",
"JSON",
"format",
".",
"eg",
":",
"vm_state",
":",
"DOWN",
"name",
":",
"[",
"a",
"-",
"z",
"]",
"+"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/sms_server.java#L625-L635 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/RsaKey.java | RsaKey.fromJsonWebKey | public static RsaKey fromJsonWebKey(JsonWebKey jwk, boolean includePrivateParameters, Provider provider) {
"""
Converts JSON web key to RsaKey and include the private key if set to true.
@param provider the Java security provider.
@param includePrivateParameters true if the RSA key pair should include the privat... | java | public static RsaKey fromJsonWebKey(JsonWebKey jwk, boolean includePrivateParameters, Provider provider) {
if (jwk.kid() != null) {
return new RsaKey(jwk.kid(), jwk.toRSA(includePrivateParameters, provider));
} else {
throw new IllegalArgumentException("Json Web Key must have a k... | [
"public",
"static",
"RsaKey",
"fromJsonWebKey",
"(",
"JsonWebKey",
"jwk",
",",
"boolean",
"includePrivateParameters",
",",
"Provider",
"provider",
")",
"{",
"if",
"(",
"jwk",
".",
"kid",
"(",
")",
"!=",
"null",
")",
"{",
"return",
"new",
"RsaKey",
"(",
"jw... | Converts JSON web key to RsaKey and include the private key if set to true.
@param provider the Java security provider.
@param includePrivateParameters true if the RSA key pair should include the private key. False otherwise.
@return RsaKey | [
"Converts",
"JSON",
"web",
"key",
"to",
"RsaKey",
"and",
"include",
"the",
"private",
"key",
"if",
"set",
"to",
"true",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/RsaKey.java#L165-L171 |
fuinorg/units4j | src/main/java/org/fuin/units4j/AssertDependencies.java | AssertDependencies.assertRules | public static final void assertRules(final File file, final File classesDir) {
"""
Asserts that a set of dependency rules is kept.
@param file
The XML rules file - Cannot be <code>null</code> and must be a valid file.
@param classesDir
Directory with the ".class" files to check - Cannot be <code>null</code> ... | java | public static final void assertRules(final File file, final File classesDir) {
Utils4J.checkNotNull("file", file);
Utils4J.checkNotNull("classesDir", classesDir);
Utils4J.checkValidFile(file);
Utils4J.checkValidDir(classesDir);
try {
final DependencyAnalyzer ana... | [
"public",
"static",
"final",
"void",
"assertRules",
"(",
"final",
"File",
"file",
",",
"final",
"File",
"classesDir",
")",
"{",
"Utils4J",
".",
"checkNotNull",
"(",
"\"file\"",
",",
"file",
")",
";",
"Utils4J",
".",
"checkNotNull",
"(",
"\"classesDir\"",
","... | Asserts that a set of dependency rules is kept.
@param file
The XML rules file - Cannot be <code>null</code> and must be a valid file.
@param classesDir
Directory with the ".class" files to check - Cannot be <code>null</code> and must be a valid directory. | [
"Asserts",
"that",
"a",
"set",
"of",
"dependency",
"rules",
"is",
"kept",
"."
] | train | https://github.com/fuinorg/units4j/blob/29383e30b0f9c246b309e734df9cc63dc5d5499e/src/main/java/org/fuin/units4j/AssertDependencies.java#L83-L94 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-integrations/valkyrie-rcp-jidedocking/src/main/java/org/valkyriercp/application/perspective/Perspective.java | Perspective.switchPerspective | public void switchPerspective(JideApplicationWindow window, String pageId, boolean saveCurrent) {
"""
/*
To switch a perspective is a three stage process:
i) Possibly save the layout of the current perspective
ii) Change the layout to that of the new perspective using an
existing layout if it exists or the dis... | java | public void switchPerspective(JideApplicationWindow window, String pageId, boolean saveCurrent){
DockingManager manager = window.getDockingManager();
PerspectiveManager perspectiveManager =
((JideApplicationPage)window.getPage()).getPerspectiveManager();
if(saveCurrent){
LayoutManager.savePageLayoutData(ma... | [
"public",
"void",
"switchPerspective",
"(",
"JideApplicationWindow",
"window",
",",
"String",
"pageId",
",",
"boolean",
"saveCurrent",
")",
"{",
"DockingManager",
"manager",
"=",
"window",
".",
"getDockingManager",
"(",
")",
";",
"PerspectiveManager",
"perspectiveMana... | /*
To switch a perspective is a three stage process:
i) Possibly save the layout of the current perspective
ii) Change the layout to that of the new perspective using an
existing layout if it exists or the display definition if not
iii) Set the current perspective in the perspective manager to
the new one. | [
"/",
"*",
"To",
"switch",
"a",
"perspective",
"is",
"a",
"three",
"stage",
"process",
":",
"i",
")",
"Possibly",
"save",
"the",
"layout",
"of",
"the",
"current",
"perspective",
"ii",
")",
"Change",
"the",
"layout",
"to",
"that",
"of",
"the",
"new",
"pe... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-integrations/valkyrie-rcp-jidedocking/src/main/java/org/valkyriercp/application/perspective/Perspective.java#L90-L101 |
xiancloud/xian | xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/gelf/intern/GelfMessage.java | GelfMessage.addFields | public GelfMessage addFields(Map<String, String> fields) {
"""
Add multiple fields (key/value pairs)
@param fields map of fields
@return the current GelfMessage.
"""
if (fields == null) {
throw new IllegalArgumentException("fields is null");
}
getAdditonalFields().putA... | java | public GelfMessage addFields(Map<String, String> fields) {
if (fields == null) {
throw new IllegalArgumentException("fields is null");
}
getAdditonalFields().putAll(fields);
return this;
} | [
"public",
"GelfMessage",
"addFields",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"fields",
")",
"{",
"if",
"(",
"fields",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"fields is null\"",
")",
";",
"}",
"getAdditonalFields",
... | Add multiple fields (key/value pairs)
@param fields map of fields
@return the current GelfMessage. | [
"Add",
"multiple",
"fields",
"(",
"key",
"/",
"value",
"pairs",
")"
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/gelf/intern/GelfMessage.java#L504-L512 |
Sonoport/freesound-java | src/main/java/com/sonoport/freesound/FreesoundClient.java | FreesoundClient.buildHTTPRequest | private HttpRequest buildHTTPRequest(final Query<?, ?> query) {
"""
Build the Unirest {@link HttpRequest} that will be used to make the call to the API.
@param query The query to be made
@return Properly configured {@link HttpRequest} representing query
"""
final String url = API_ENDPOINT + query.getPath... | java | private HttpRequest buildHTTPRequest(final Query<?, ?> query) {
final String url = API_ENDPOINT + query.getPath();
HttpRequest request;
switch (query.getHttpRequestMethod()) {
case GET:
request = Unirest.get(url);
if ((query.getQueryParameters() != null) && !query.getQueryParameters().isEmpty()) {
... | [
"private",
"HttpRequest",
"buildHTTPRequest",
"(",
"final",
"Query",
"<",
"?",
",",
"?",
">",
"query",
")",
"{",
"final",
"String",
"url",
"=",
"API_ENDPOINT",
"+",
"query",
".",
"getPath",
"(",
")",
";",
"HttpRequest",
"request",
";",
"switch",
"(",
"qu... | Build the Unirest {@link HttpRequest} that will be used to make the call to the API.
@param query The query to be made
@return Properly configured {@link HttpRequest} representing query | [
"Build",
"the",
"Unirest",
"{",
"@link",
"HttpRequest",
"}",
"that",
"will",
"be",
"used",
"to",
"make",
"the",
"call",
"to",
"the",
"API",
"."
] | train | https://github.com/Sonoport/freesound-java/blob/ab029e25de068c6f8cc028bc7f916938fd97c036/src/main/java/com/sonoport/freesound/FreesoundClient.java#L142-L180 |
netty/netty | handler/src/main/java/io/netty/handler/ssl/SslHandler.java | SslHandler.setHandshakeFailure | private void setHandshakeFailure(ChannelHandlerContext ctx, Throwable cause) {
"""
Notify all the handshake futures about the failure during the handshake.
"""
setHandshakeFailure(ctx, cause, true, true, false);
} | java | private void setHandshakeFailure(ChannelHandlerContext ctx, Throwable cause) {
setHandshakeFailure(ctx, cause, true, true, false);
} | [
"private",
"void",
"setHandshakeFailure",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Throwable",
"cause",
")",
"{",
"setHandshakeFailure",
"(",
"ctx",
",",
"cause",
",",
"true",
",",
"true",
",",
"false",
")",
";",
"}"
] | Notify all the handshake futures about the failure during the handshake. | [
"Notify",
"all",
"the",
"handshake",
"futures",
"about",
"the",
"failure",
"during",
"the",
"handshake",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslHandler.java#L1759-L1761 |
samskivert/pythagoras | src/main/java/pythagoras/d/Vectors.java | Vectors.epsilonEquals | public static boolean epsilonEquals (IVector v1, IVector v2) {
"""
Returns true if the supplied vectors' x and y components are equal to one another within
{@link MathUtil#EPSILON}.
"""
return epsilonEquals(v1, v2, MathUtil.EPSILON);
} | java | public static boolean epsilonEquals (IVector v1, IVector v2) {
return epsilonEquals(v1, v2, MathUtil.EPSILON);
} | [
"public",
"static",
"boolean",
"epsilonEquals",
"(",
"IVector",
"v1",
",",
"IVector",
"v2",
")",
"{",
"return",
"epsilonEquals",
"(",
"v1",
",",
"v2",
",",
"MathUtil",
".",
"EPSILON",
")",
";",
"}"
] | Returns true if the supplied vectors' x and y components are equal to one another within
{@link MathUtil#EPSILON}. | [
"Returns",
"true",
"if",
"the",
"supplied",
"vectors",
"x",
"and",
"y",
"components",
"are",
"equal",
"to",
"one",
"another",
"within",
"{"
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/Vectors.java#L83-L85 |
kohsuke/args4j | args4j/src/org/kohsuke/args4j/CmdLineParser.java | CmdLineParser.addOption | public void addOption(Setter setter, Option o) {
"""
Programmatically defines an option (instead of reading it from annotations as normal).
@param setter the setter for the type
@param o the {@code Option}
@throws NullPointerException if {@code setter} or {@code o} is {@code null}.
@throws IllegalAnnotationE... | java | public void addOption(Setter setter, Option o) {
checkNonNull(setter, "Setter");
checkNonNull(o, "Option");
checkOptionNotInMap(o.name());
for (String alias : o.aliases()) {
checkOptionNotInMap(alias);
}
options.add(createOptionHandler(new NamedOptionDef(o),... | [
"public",
"void",
"addOption",
"(",
"Setter",
"setter",
",",
"Option",
"o",
")",
"{",
"checkNonNull",
"(",
"setter",
",",
"\"Setter\"",
")",
";",
"checkNonNull",
"(",
"o",
",",
"\"Option\"",
")",
";",
"checkOptionNotInMap",
"(",
"o",
".",
"name",
"(",
")... | Programmatically defines an option (instead of reading it from annotations as normal).
@param setter the setter for the type
@param o the {@code Option}
@throws NullPointerException if {@code setter} or {@code o} is {@code null}.
@throws IllegalAnnotationError if the option name or one of the aliases is already taken. | [
"Programmatically",
"defines",
"an",
"option",
"(",
"instead",
"of",
"reading",
"it",
"from",
"annotations",
"as",
"normal",
")",
"."
] | train | https://github.com/kohsuke/args4j/blob/dc2e7e265caf15a1a146e3389c1f16a8781f06cf/args4j/src/org/kohsuke/args4j/CmdLineParser.java#L138-L147 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-talent/src/main/java/com/google/cloud/talent/v4beta1/ApplicationServiceClient.java | ApplicationServiceClient.createApplication | public final Application createApplication(ProfileName parent, Application application) {
"""
Creates a new application entity.
<p>Sample code:
<pre><code>
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
ProfileName parent = ProfileName.of("[PROJECT]", "[TENANT... | java | public final Application createApplication(ProfileName parent, Application application) {
CreateApplicationRequest request =
CreateApplicationRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setApplication(application)
.build();
return crea... | [
"public",
"final",
"Application",
"createApplication",
"(",
"ProfileName",
"parent",
",",
"Application",
"application",
")",
"{",
"CreateApplicationRequest",
"request",
"=",
"CreateApplicationRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
"parent",
"=="... | Creates a new application entity.
<p>Sample code:
<pre><code>
try (ApplicationServiceClient applicationServiceClient = ApplicationServiceClient.create()) {
ProfileName parent = ProfileName.of("[PROJECT]", "[TENANT]", "[PROFILE]");
Application application = Application.newBuilder().build();
Application response = appl... | [
"Creates",
"a",
"new",
"application",
"entity",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-talent/src/main/java/com/google/cloud/talent/v4beta1/ApplicationServiceClient.java#L182-L190 |
aws/aws-sdk-java | aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/FailureDetails.java | FailureDetails.withDetails | public FailureDetails withDetails(java.util.Map<String, java.util.List<String>> details) {
"""
<p>
Detailed information about the Automation step failure.
</p>
@param details
Detailed information about the Automation step failure.
@return Returns a reference to this object so that method calls can be chaine... | java | public FailureDetails withDetails(java.util.Map<String, java.util.List<String>> details) {
setDetails(details);
return this;
} | [
"public",
"FailureDetails",
"withDetails",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
">",
"details",
")",
"{",
"setDetails",
"(",
"details",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Detailed information about the Automation step failure.
</p>
@param details
Detailed information about the Automation step failure.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Detailed",
"information",
"about",
"the",
"Automation",
"step",
"failure",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/FailureDetails.java#L179-L182 |
ManfredTremmel/gwt-bean-validators | mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/AgeLimitCheckValidator.java | AgeLimitCheckValidator.isValid | @Override
public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
"""
{@inheritDoc} check if given object is valid.
@see javax.validation.ConstraintValidator#isValid(Object,
javax.validation.ConstraintValidatorContext)
"""
if (pvalue == null) {
return true... | java | @Override
public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
if (pvalue == null) {
return true;
}
final Date value;
if (pvalue instanceof Date) {
value = (Date) pvalue;
} else if (pvalue instanceof Calendar) {
value = ((Calendar) pvalue... | [
"@",
"Override",
"public",
"final",
"boolean",
"isValid",
"(",
"final",
"Object",
"pvalue",
",",
"final",
"ConstraintValidatorContext",
"pcontext",
")",
"{",
"if",
"(",
"pvalue",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"final",
"Date",
"value",
... | {@inheritDoc} check if given object is valid.
@see javax.validation.ConstraintValidator#isValid(Object,
javax.validation.ConstraintValidatorContext) | [
"{",
"@inheritDoc",
"}",
"check",
"if",
"given",
"object",
"is",
"valid",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/AgeLimitCheckValidator.java#L58-L79 |
lucee/Lucee | core/src/main/java/lucee/runtime/type/scope/client/ClientCache.java | ClientCache.getInstance | public static Client getInstance(String cacheName, String appName, PageContext pc, Client existing, Log log) throws PageException {
"""
load an new instance of the client datasource scope
@param cacheName
@param appName
@param pc
@param log
@return client datasource scope
@throws PageException
"""
if ... | java | public static Client getInstance(String cacheName, String appName, PageContext pc, Client existing, Log log) throws PageException {
if (appName != null && appName.startsWith("no-in-memory-cache-")) existing = null;
synchronized (token) {
StorageValue sv = _loadData(pc, cacheName, appName, "client", log);
if... | [
"public",
"static",
"Client",
"getInstance",
"(",
"String",
"cacheName",
",",
"String",
"appName",
",",
"PageContext",
"pc",
",",
"Client",
"existing",
",",
"Log",
"log",
")",
"throws",
"PageException",
"{",
"if",
"(",
"appName",
"!=",
"null",
"&&",
"appName... | load an new instance of the client datasource scope
@param cacheName
@param appName
@param pc
@param log
@return client datasource scope
@throws PageException | [
"load",
"an",
"new",
"instance",
"of",
"the",
"client",
"datasource",
"scope"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/scope/client/ClientCache.java#L65-L83 |
mongodb/stitch-android-sdk | core/sdk/src/main/java/com/mongodb/stitch/core/internal/common/StitchError.java | StitchError.handleRequestError | public static void handleRequestError(final Response response) {
"""
Static utility method that accepts an HTTP response object, and throws the {@link
StitchServiceException} representing the the error in the response. If the error cannot be
recognized, this will throw a {@link StitchServiceException} with the "... | java | public static void handleRequestError(final Response response) {
if (response.getBody() == null) {
throw new StitchServiceException(
String.format(
Locale.ENGLISH, "received unexpected status code %d", response.getStatusCode()),
StitchServiceErrorCode.UNKNOWN);
}
fin... | [
"public",
"static",
"void",
"handleRequestError",
"(",
"final",
"Response",
"response",
")",
"{",
"if",
"(",
"response",
".",
"getBody",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"StitchServiceException",
"(",
"String",
".",
"format",
"(",
"Locale",
... | Static utility method that accepts an HTTP response object, and throws the {@link
StitchServiceException} representing the the error in the response. If the error cannot be
recognized, this will throw a {@link StitchServiceException} with the "UNKNOWN" error code.
@param response the network response. | [
"Static",
"utility",
"method",
"that",
"accepts",
"an",
"HTTP",
"response",
"object",
"and",
"throws",
"the",
"{",
"@link",
"StitchServiceException",
"}",
"representing",
"the",
"the",
"error",
"in",
"the",
"response",
".",
"If",
"the",
"error",
"cannot",
"be"... | train | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/sdk/src/main/java/com/mongodb/stitch/core/internal/common/StitchError.java#L43-L63 |
grpc/grpc-java | okhttp/src/main/java/io/grpc/okhttp/OutboundFlowController.java | OutboundFlowController.initialOutboundWindowSize | boolean initialOutboundWindowSize(int newWindowSize) {
"""
Adjusts outbound window size requested by peer. When window size is increased, it does not send
any pending frames. If this method returns {@code true}, the caller should call {@link
#writeStreams()} after settings ack.
<p>Must be called with holding ... | java | boolean initialOutboundWindowSize(int newWindowSize) {
if (newWindowSize < 0) {
throw new IllegalArgumentException("Invalid initial window size: " + newWindowSize);
}
int delta = newWindowSize - initialWindowSize;
initialWindowSize = newWindowSize;
for (OkHttpClientStream stream : transport.g... | [
"boolean",
"initialOutboundWindowSize",
"(",
"int",
"newWindowSize",
")",
"{",
"if",
"(",
"newWindowSize",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid initial window size: \"",
"+",
"newWindowSize",
")",
";",
"}",
"int",
"delta",
... | Adjusts outbound window size requested by peer. When window size is increased, it does not send
any pending frames. If this method returns {@code true}, the caller should call {@link
#writeStreams()} after settings ack.
<p>Must be called with holding transport lock.
@return true, if new window size is increased, fals... | [
"Adjusts",
"outbound",
"window",
"size",
"requested",
"by",
"peer",
".",
"When",
"window",
"size",
"is",
"increased",
"it",
"does",
"not",
"send",
"any",
"pending",
"frames",
".",
"If",
"this",
"method",
"returns",
"{",
"@code",
"true",
"}",
"the",
"caller... | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/okhttp/src/main/java/io/grpc/okhttp/OutboundFlowController.java#L57-L76 |
Metatavu/edelphi | edelphi/src/main/java/fi/metatavu/edelphi/query/thesis/AbstractScaleThesisQueryPageHandler.java | AbstractScaleThesisQueryPageHandler.synchronizeField | protected void synchronizeField(QueryPage queryPage, List<String> options, String fieldName, String fieldCaption, Boolean mandatory) {
"""
Synchronizes field meta. Should not be used when field already contains replies
@param queryPage query page
@param options field options
@param fieldName field name
@par... | java | protected void synchronizeField(QueryPage queryPage, List<String> options, String fieldName, String fieldCaption, Boolean mandatory) {
QueryFieldDAO queryFieldDAO = new QueryFieldDAO();
QueryOptionFieldDAO queryOptionFieldDAO = new QueryOptionFieldDAO();
QueryOptionField queryField = (QueryOptionField) que... | [
"protected",
"void",
"synchronizeField",
"(",
"QueryPage",
"queryPage",
",",
"List",
"<",
"String",
">",
"options",
",",
"String",
"fieldName",
",",
"String",
"fieldCaption",
",",
"Boolean",
"mandatory",
")",
"{",
"QueryFieldDAO",
"queryFieldDAO",
"=",
"new",
"Q... | Synchronizes field meta. Should not be used when field already contains replies
@param queryPage query page
@param options field options
@param fieldName field name
@param fieldCaption field caption
@param mandatory whether field is mandatory | [
"Synchronizes",
"field",
"meta",
".",
"Should",
"not",
"be",
"used",
"when",
"field",
"already",
"contains",
"replies"
] | train | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/query/thesis/AbstractScaleThesisQueryPageHandler.java#L145-L158 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCBlobClient.java | JDBCBlobClient.setBytes | public synchronized int setBytes(long pos, byte[] bytes, int offset,
int len) throws SQLException {
"""
Writes all or part of the given <code>byte</code> array to the
<code>BLOB</code> value that this <code>Blob</code> object represents
and returns the number of bytes written... | java | public synchronized int setBytes(long pos, byte[] bytes, int offset,
int len) throws SQLException {
if (!isInLimits(bytes.length, offset, len)) {
throw Util.outOfRangeArgument();
}
if (offset != 0 || len != bytes.length) {
byte[] new... | [
"public",
"synchronized",
"int",
"setBytes",
"(",
"long",
"pos",
",",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
",",
"int",
"len",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"!",
"isInLimits",
"(",
"bytes",
".",
"length",
",",
"offset",
",",... | Writes all or part of the given <code>byte</code> array to the
<code>BLOB</code> value that this <code>Blob</code> object represents
and returns the number of bytes written.
@param pos the position in the <code>BLOB</code> object at which to
start writing
@param bytes the array of bytes to be written to this
<code>BLO... | [
"Writes",
"all",
"or",
"part",
"of",
"the",
"given",
"<code",
">",
"byte<",
"/",
"code",
">",
"array",
"to",
"the",
"<code",
">",
"BLOB<",
"/",
"code",
">",
"value",
"that",
"this",
"<code",
">",
"Blob<",
"/",
"code",
">",
"object",
"represents",
"an... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCBlobClient.java#L205-L221 |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/Utils.java | Utils.getReturnTypeDescriptor | public static ReturnType getReturnTypeDescriptor(String methodDescriptor) {
"""
Discover the descriptor for the return type. It may be a primitive (so one char) or a reference type (so a/b/c,
with no 'L' or ';') or it may be an array descriptor ([Ljava/lang/String;).
@param methodDescriptor method descriptor
... | java | public static ReturnType getReturnTypeDescriptor(String methodDescriptor) {
int index = methodDescriptor.indexOf(')') + 1;
if (methodDescriptor.charAt(index) == 'L') {
return new ReturnType(methodDescriptor.substring(index + 1, methodDescriptor.length() - 1), Kind.REFERENCE);
}
else {
return new ReturnTyp... | [
"public",
"static",
"ReturnType",
"getReturnTypeDescriptor",
"(",
"String",
"methodDescriptor",
")",
"{",
"int",
"index",
"=",
"methodDescriptor",
".",
"indexOf",
"(",
"'",
"'",
")",
"+",
"1",
";",
"if",
"(",
"methodDescriptor",
".",
"charAt",
"(",
"index",
... | Discover the descriptor for the return type. It may be a primitive (so one char) or a reference type (so a/b/c,
with no 'L' or ';') or it may be an array descriptor ([Ljava/lang/String;).
@param methodDescriptor method descriptor
@return return type descriptor (with any 'L' or ';' trimmed off) | [
"Discover",
"the",
"descriptor",
"for",
"the",
"return",
"type",
".",
"It",
"may",
"be",
"a",
"primitive",
"(",
"so",
"one",
"char",
")",
"or",
"a",
"reference",
"type",
"(",
"so",
"a",
"/",
"b",
"/",
"c",
"with",
"no",
"L",
"or",
";",
")",
"or",... | train | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/Utils.java#L919-L928 |
teatrove/teatrove | teaapps/src/main/java/org/teatrove/teaapps/contexts/HttpContext.java | HttpContext.doPost | public String doPost(String host, String path, String postData,
int port, Map<String, String> headers, int timeout)
throws UnknownHostException, ConnectException, IOException {
"""
Perform an HTTP POST at the given path sending in the given post data
returning the results of the ... | java | public String doPost(String host, String path, String postData,
int port, Map<String, String> headers, int timeout)
throws UnknownHostException, ConnectException, IOException {
return doHttpCall(host, path, postData, port, headers, timeout, false);
} | [
"public",
"String",
"doPost",
"(",
"String",
"host",
",",
"String",
"path",
",",
"String",
"postData",
",",
"int",
"port",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
",",
"int",
"timeout",
")",
"throws",
"UnknownHostException",
",",
"Connect... | Perform an HTTP POST at the given path sending in the given post data
returning the results of the response.
@param host The hostname of the request
@param path The path of the request
@param postData The POST data to send in the request
@param port The port of the request
@param headers The headers to pass in the req... | [
"Perform",
"an",
"HTTP",
"POST",
"at",
"the",
"given",
"path",
"sending",
"in",
"the",
"given",
"post",
"data",
"returning",
"the",
"results",
"of",
"the",
"response",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/HttpContext.java#L108-L113 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/cluster/clusternode_stats.java | clusternode_stats.get | public static clusternode_stats get(nitro_service service, Long nodeid) throws Exception {
"""
Use this API to fetch statistics of clusternode_stats resource of given name .
"""
clusternode_stats obj = new clusternode_stats();
obj.set_nodeid(nodeid);
clusternode_stats response = (clusternode_stats) obj.s... | java | public static clusternode_stats get(nitro_service service, Long nodeid) throws Exception{
clusternode_stats obj = new clusternode_stats();
obj.set_nodeid(nodeid);
clusternode_stats response = (clusternode_stats) obj.stat_resource(service);
return response;
} | [
"public",
"static",
"clusternode_stats",
"get",
"(",
"nitro_service",
"service",
",",
"Long",
"nodeid",
")",
"throws",
"Exception",
"{",
"clusternode_stats",
"obj",
"=",
"new",
"clusternode_stats",
"(",
")",
";",
"obj",
".",
"set_nodeid",
"(",
"nodeid",
")",
"... | Use this API to fetch statistics of clusternode_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"clusternode_stats",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/cluster/clusternode_stats.java#L271-L276 |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationQueueEntryPersistenceImpl.java | CommerceNotificationQueueEntryPersistenceImpl.findBySent | @Override
public List<CommerceNotificationQueueEntry> findBySent(boolean sent,
int start, int end,
OrderByComparator<CommerceNotificationQueueEntry> orderByComparator) {
"""
Returns an ordered range of all the commerce notification queue entries where sent = ?.
<p>
Useful when paginating results. Retu... | java | @Override
public List<CommerceNotificationQueueEntry> findBySent(boolean sent,
int start, int end,
OrderByComparator<CommerceNotificationQueueEntry> orderByComparator) {
return findBySent(sent, start, end, orderByComparator, true);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceNotificationQueueEntry",
">",
"findBySent",
"(",
"boolean",
"sent",
",",
"int",
"start",
",",
"int",
"end",
",",
"OrderByComparator",
"<",
"CommerceNotificationQueueEntry",
">",
"orderByComparator",
")",
"{",
"return"... | Returns an ordered range of all the commerce notification queue entries where sent = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the f... | [
"Returns",
"an",
"ordered",
"range",
"of",
"all",
"the",
"commerce",
"notification",
"queue",
"entries",
"where",
"sent",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationQueueEntryPersistenceImpl.java#L1215-L1220 |
thymeleaf/thymeleaf-spring | thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/dialect/SpringStandardDialect.java | SpringStandardDialect.createSpringStandardProcessorsSet | public static Set<IProcessor> createSpringStandardProcessorsSet(
final String dialectPrefix, final boolean renderHiddenMarkersBeforeCheckboxes) {
"""
<p>
Create a the set of SpringStandard processors, all of them freshly instanced.
</p>
@param dialectPrefix the prefix established for the Standard ... | java | public static Set<IProcessor> createSpringStandardProcessorsSet(
final String dialectPrefix, final boolean renderHiddenMarkersBeforeCheckboxes) {
/*
* It is important that we create new instances here because, if there are
* several dialects in the TemplateEngine that extend Standa... | [
"public",
"static",
"Set",
"<",
"IProcessor",
">",
"createSpringStandardProcessorsSet",
"(",
"final",
"String",
"dialectPrefix",
",",
"final",
"boolean",
"renderHiddenMarkersBeforeCheckboxes",
")",
"{",
"/*\n * It is important that we create new instances here because, if t... | <p>
Create a the set of SpringStandard processors, all of them freshly instanced.
</p>
@param dialectPrefix the prefix established for the Standard Dialect, needed for initialization
@param renderHiddenMarkersBeforeCheckboxes {@code true} if hidden markers should be rendered
before the checkboxes, {@code false} if not... | [
"<p",
">",
"Create",
"a",
"the",
"set",
"of",
"SpringStandard",
"processors",
"all",
"of",
"them",
"freshly",
"instanced",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/thymeleaf/thymeleaf-spring/blob/9aa15a19017a0938e57646e3deefb8a90ab78dcb/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/dialect/SpringStandardDialect.java#L360-L419 |
threerings/nenya | tools/src/main/java/com/threerings/cast/tools/xml/ClassRuleSet.java | ClassRuleSet.addRuleInstances | @Override
public void addRuleInstances (Digester digester) {
"""
Adds the necessary rules to the digester to parse our classes.
"""
// this creates the appropriate instance when we encounter a
// <class> tag
digester.addObjectCreate(_prefix + CLASS_PATH,
... | java | @Override
public void addRuleInstances (Digester digester)
{
// this creates the appropriate instance when we encounter a
// <class> tag
digester.addObjectCreate(_prefix + CLASS_PATH,
ComponentClass.class.getName());
// grab the attributes from t... | [
"@",
"Override",
"public",
"void",
"addRuleInstances",
"(",
"Digester",
"digester",
")",
"{",
"// this creates the appropriate instance when we encounter a",
"// <class> tag",
"digester",
".",
"addObjectCreate",
"(",
"_prefix",
"+",
"CLASS_PATH",
",",
"ComponentClass",
".",... | Adds the necessary rules to the digester to parse our classes. | [
"Adds",
"the",
"necessary",
"rules",
"to",
"the",
"digester",
"to",
"parse",
"our",
"classes",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/tools/src/main/java/com/threerings/cast/tools/xml/ClassRuleSet.java#L70-L106 |
xerial/larray | larray-mmap/src/main/java/xerial/larray/impl/LArrayLoader.java | LArrayLoader.md5sum | public static String md5sum(InputStream input) throws IOException {
"""
Computes the MD5 value of the input stream
@param input
@return
@throws IOException
@throws IllegalStateException
"""
InputStream in = new BufferedInputStream(input);
try {
MessageDigest digest = java.s... | java | public static String md5sum(InputStream input) throws IOException {
InputStream in = new BufferedInputStream(input);
try {
MessageDigest digest = java.security.MessageDigest.getInstance("MD5");
DigestInputStream digestInputStream = new DigestInputStream(in, digest);
... | [
"public",
"static",
"String",
"md5sum",
"(",
"InputStream",
"input",
")",
"throws",
"IOException",
"{",
"InputStream",
"in",
"=",
"new",
"BufferedInputStream",
"(",
"input",
")",
";",
"try",
"{",
"MessageDigest",
"digest",
"=",
"java",
".",
"security",
".",
... | Computes the MD5 value of the input stream
@param input
@return
@throws IOException
@throws IllegalStateException | [
"Computes",
"the",
"MD5",
"value",
"of",
"the",
"input",
"stream"
] | train | https://github.com/xerial/larray/blob/9a1462623c0e56ca67c5341ea29832963c29479f/larray-mmap/src/main/java/xerial/larray/impl/LArrayLoader.java#L103-L120 |
Azure/azure-sdk-for-java | kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java | ClustersInner.beginStart | public void beginStart(String resourceGroupName, String clusterName) {
"""
Starts a Kusto cluster.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto cluster.
@throws IllegalArgumentException thrown if parameters fail the validation
... | java | public void beginStart(String resourceGroupName, String clusterName) {
beginStartWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body();
} | [
"public",
"void",
"beginStart",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
")",
"{",
"beginStartWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"body",
... | Starts a Kusto cluster.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto cluster.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeExc... | [
"Starts",
"a",
"Kusto",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java#L950-L952 |
auth0/java-jwt | lib/src/main/java/com/auth0/jwt/algorithms/Algorithm.java | Algorithm.RSA512 | @Deprecated
public static Algorithm RSA512(RSAKey key) throws IllegalArgumentException {
"""
Creates a new Algorithm instance using SHA512withRSA. Tokens specify this as "RS512".
@param key the key to use in the verify or signing instance.
@return a valid RSA512 Algorithm.
@throws IllegalArgumentException... | java | @Deprecated
public static Algorithm RSA512(RSAKey key) throws IllegalArgumentException {
RSAPublicKey publicKey = key instanceof RSAPublicKey ? (RSAPublicKey) key : null;
RSAPrivateKey privateKey = key instanceof RSAPrivateKey ? (RSAPrivateKey) key : null;
return RSA512(publicKey, privateKey... | [
"@",
"Deprecated",
"public",
"static",
"Algorithm",
"RSA512",
"(",
"RSAKey",
"key",
")",
"throws",
"IllegalArgumentException",
"{",
"RSAPublicKey",
"publicKey",
"=",
"key",
"instanceof",
"RSAPublicKey",
"?",
"(",
"RSAPublicKey",
")",
"key",
":",
"null",
";",
"RS... | Creates a new Algorithm instance using SHA512withRSA. Tokens specify this as "RS512".
@param key the key to use in the verify or signing instance.
@return a valid RSA512 Algorithm.
@throws IllegalArgumentException if the provided Key is null.
@deprecated use {@link #RSA512(RSAPublicKey, RSAPrivateKey)} or {@link #RSA5... | [
"Creates",
"a",
"new",
"Algorithm",
"instance",
"using",
"SHA512withRSA",
".",
"Tokens",
"specify",
"this",
"as",
"RS512",
"."
] | train | https://github.com/auth0/java-jwt/blob/890538970a9699b7251a4bfe4f26e8d7605ad530/lib/src/main/java/com/auth0/jwt/algorithms/Algorithm.java#L128-L133 |
strator-dev/greenpepper | greenpepper/core/src/main/java/com/greenpepper/util/BOMUtil.java | BOMUtil.getBOMType | public static int getBOMType(File file)
throws IOException {
"""
<p>getBOMType.</p>
@param file a {@link java.io.File} object.
@return a int.
@throws java.io.IOException if any.
"""
FileInputStream fIn = null;
try
{
fIn = new FileInputStream( file );
... | java | public static int getBOMType(File file)
throws IOException
{
FileInputStream fIn = null;
try
{
fIn = new FileInputStream( file );
byte[] buff = new byte[MAXBOMBYTES];
int read = fIn.read( buff );
return getBOMType( buff, read );
... | [
"public",
"static",
"int",
"getBOMType",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"FileInputStream",
"fIn",
"=",
"null",
";",
"try",
"{",
"fIn",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
";",
"byte",
"[",
"]",
"buff",
"=",
"new",
... | <p>getBOMType.</p>
@param file a {@link java.io.File} object.
@return a int.
@throws java.io.IOException if any. | [
"<p",
">",
"getBOMType",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/core/src/main/java/com/greenpepper/util/BOMUtil.java#L104-L120 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/security/impl/BasicEvaluationCtx.java | BasicEvaluationCtx.getActionAttribute | public EvaluationResult getActionAttribute(URI type, URI id, URI issuer) {
"""
Returns attribute value(s) from the action section of the request.
@param type the type of the attribute value(s) to find
@param id the id of the attribute value(s) to find
@param issuer the issuer of the attribute value(s) to find... | java | public EvaluationResult getActionAttribute(URI type, URI id, URI issuer) {
return getGenericAttributes(type, id, issuer, actionMap, null,
AttributeDesignator.ACTION_TARGET);
} | [
"public",
"EvaluationResult",
"getActionAttribute",
"(",
"URI",
"type",
",",
"URI",
"id",
",",
"URI",
"issuer",
")",
"{",
"return",
"getGenericAttributes",
"(",
"type",
",",
"id",
",",
"issuer",
",",
"actionMap",
",",
"null",
",",
"AttributeDesignator",
".",
... | Returns attribute value(s) from the action section of the request.
@param type the type of the attribute value(s) to find
@param id the id of the attribute value(s) to find
@param issuer the issuer of the attribute value(s) to find or null
@return a result containing a bag either empty because no values were
found or... | [
"Returns",
"attribute",
"value",
"(",
"s",
")",
"from",
"the",
"action",
"section",
"of",
"the",
"request",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/security/impl/BasicEvaluationCtx.java#L603-L606 |
pedrovgs/DraggablePanel | draggablepanel/src/main/java/com/github/pedrovgs/DraggableView.java | DraggableView.addFragmentToView | private void addFragmentToView(final int viewId, final Fragment fragment) {
"""
Use FragmentManager to attach one fragment to one view using the viewId.
@param viewId used to obtain the view.
@param fragment to be attached.
"""
fragmentManager.beginTransaction().replace(viewId, fragment).commit();
} | java | private void addFragmentToView(final int viewId, final Fragment fragment) {
fragmentManager.beginTransaction().replace(viewId, fragment).commit();
} | [
"private",
"void",
"addFragmentToView",
"(",
"final",
"int",
"viewId",
",",
"final",
"Fragment",
"fragment",
")",
"{",
"fragmentManager",
".",
"beginTransaction",
"(",
")",
".",
"replace",
"(",
"viewId",
",",
"fragment",
")",
".",
"commit",
"(",
")",
";",
... | Use FragmentManager to attach one fragment to one view using the viewId.
@param viewId used to obtain the view.
@param fragment to be attached. | [
"Use",
"FragmentManager",
"to",
"attach",
"one",
"fragment",
"to",
"one",
"view",
"using",
"the",
"viewId",
"."
] | train | https://github.com/pedrovgs/DraggablePanel/blob/6b6d1806fa4140113f31307a2571bf02435aa53a/draggablepanel/src/main/java/com/github/pedrovgs/DraggableView.java#L630-L632 |
census-instrumentation/opencensus-java | api/src/main/java/io/opencensus/trace/BigendianEncoding.java | BigendianEncoding.longToBase16String | static void longToBase16String(long value, char[] dest, int destOffset) {
"""
Appends the base16 encoding of the specified {@code value} to the {@code dest}.
@param value the value to be converted.
@param dest the destination char array.
@param destOffset the starting offset in the destination char array.
... | java | static void longToBase16String(long value, char[] dest, int destOffset) {
byteToBase16((byte) (value >> 56 & 0xFFL), dest, destOffset);
byteToBase16((byte) (value >> 48 & 0xFFL), dest, destOffset + BYTE_BASE16);
byteToBase16((byte) (value >> 40 & 0xFFL), dest, destOffset + 2 * BYTE_BASE16);
byteToBase16... | [
"static",
"void",
"longToBase16String",
"(",
"long",
"value",
",",
"char",
"[",
"]",
"dest",
",",
"int",
"destOffset",
")",
"{",
"byteToBase16",
"(",
"(",
"byte",
")",
"(",
"value",
">>",
"56",
"&",
"0xFF",
"L",
")",
",",
"dest",
",",
"destOffset",
"... | Appends the base16 encoding of the specified {@code value} to the {@code dest}.
@param value the value to be converted.
@param dest the destination char array.
@param destOffset the starting offset in the destination char array. | [
"Appends",
"the",
"base16",
"encoding",
"of",
"the",
"specified",
"{",
"@code",
"value",
"}",
"to",
"the",
"{",
"@code",
"dest",
"}",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/trace/BigendianEncoding.java#L117-L126 |
fernandospr/java-wns | src/main/java/ar/com/fernandospr/wns/WnsService.java | WnsService.pushTile | public WnsNotificationResponse pushTile(String channelUri, WnsTile tile) throws WnsException {
"""
Pushes a tile to channelUri
@param channelUri
@param tile which should be built with {@link ar.com.fernandospr.wns.model.builders.WnsTileBuilder}
@return WnsNotificationResponse please see response headers from <a... | java | public WnsNotificationResponse pushTile(String channelUri, WnsTile tile) throws WnsException {
return this.pushTile(channelUri, null, tile);
} | [
"public",
"WnsNotificationResponse",
"pushTile",
"(",
"String",
"channelUri",
",",
"WnsTile",
"tile",
")",
"throws",
"WnsException",
"{",
"return",
"this",
".",
"pushTile",
"(",
"channelUri",
",",
"null",
",",
"tile",
")",
";",
"}"
] | Pushes a tile to channelUri
@param channelUri
@param tile which should be built with {@link ar.com.fernandospr.wns.model.builders.WnsTileBuilder}
@return WnsNotificationResponse please see response headers from <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465435.aspx#send_notification_response">http:... | [
"Pushes",
"a",
"tile",
"to",
"channelUri"
] | train | https://github.com/fernandospr/java-wns/blob/cd621b9c17d1e706f6284e0913531d834904a90d/src/main/java/ar/com/fernandospr/wns/WnsService.java#L76-L78 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.