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 |
|---|---|---|---|---|---|---|---|---|---|---|
m-m-m/util | exception/src/main/java/net/sf/mmm/util/exception/api/ThrowableHelper.java | ThrowableHelper.removeDetails | static void removeDetails(Throwable throwable, ExceptionTruncation truncation) {
"""
@see NlsThrowable#createCopy(ExceptionTruncation)
@param throwable is the {@link Throwable} to truncate.
@param truncation the {@link ExceptionTruncation} settings.
"""
if (truncation.isRemoveStacktrace()) {
thr... | java | static void removeDetails(Throwable throwable, ExceptionTruncation truncation) {
if (truncation.isRemoveStacktrace()) {
throwable.setStackTrace(ExceptionUtil.NO_STACKTRACE);
}
if (truncation.isRemoveCause()) {
getHelper().setCause(throwable, null);
}
if (truncation.isRemoveSuppressed())... | [
"static",
"void",
"removeDetails",
"(",
"Throwable",
"throwable",
",",
"ExceptionTruncation",
"truncation",
")",
"{",
"if",
"(",
"truncation",
".",
"isRemoveStacktrace",
"(",
")",
")",
"{",
"throwable",
".",
"setStackTrace",
"(",
"ExceptionUtil",
".",
"NO_STACKTRA... | @see NlsThrowable#createCopy(ExceptionTruncation)
@param throwable is the {@link Throwable} to truncate.
@param truncation the {@link ExceptionTruncation} settings. | [
"@see",
"NlsThrowable#createCopy",
"(",
"ExceptionTruncation",
")"
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/exception/src/main/java/net/sf/mmm/util/exception/api/ThrowableHelper.java#L48-L59 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/nvrtc/JNvrtc.java | JNvrtc.nvrtcCompileProgram | public static int nvrtcCompileProgram(nvrtcProgram prog,
int numOptions, String options[]) {
"""
Compiles the given program. See the
<a href="http://docs.nvidia.com/cuda/nvrtc/index.html#group__options"
target="_blank">Supported Compile Options (external site)</a>
@param prog CUDA Runtime Compilation... | java | public static int nvrtcCompileProgram(nvrtcProgram prog,
int numOptions, String options[])
{
return checkResult(nvrtcCompileProgramNative(
prog, numOptions, options));
} | [
"public",
"static",
"int",
"nvrtcCompileProgram",
"(",
"nvrtcProgram",
"prog",
",",
"int",
"numOptions",
",",
"String",
"options",
"[",
"]",
")",
"{",
"return",
"checkResult",
"(",
"nvrtcCompileProgramNative",
"(",
"prog",
",",
"numOptions",
",",
"options",
")",... | Compiles the given program. See the
<a href="http://docs.nvidia.com/cuda/nvrtc/index.html#group__options"
target="_blank">Supported Compile Options (external site)</a>
@param prog CUDA Runtime Compilation program.
@param numOptions The number of options
@param options The options
@return An error code | [
"Compiles",
"the",
"given",
"program",
".",
"See",
"the",
"<a",
"href",
"=",
"http",
":",
"//",
"docs",
".",
"nvidia",
".",
"com",
"/",
"cuda",
"/",
"nvrtc",
"/",
"index",
".",
"html#group__options",
"target",
"=",
"_blank",
">",
"Supported",
"Compile",
... | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/nvrtc/JNvrtc.java#L204-L209 |
SUSE/salt-netapi-client | src/main/java/com/suse/salt/netapi/calls/modules/File.java | File.getHash | public static LocalCall<String> getHash(String path) {
"""
Get the hash sum of a file
<p>
SHA256 algorithm is used by default
@param path Path to the file or directory
@return The {@link LocalCall} object to make the call
"""
return getHash(path, Optional.empty(), Optional.empty());... | java | public static LocalCall<String> getHash(String path) {
return getHash(path, Optional.empty(), Optional.empty());
} | [
"public",
"static",
"LocalCall",
"<",
"String",
">",
"getHash",
"(",
"String",
"path",
")",
"{",
"return",
"getHash",
"(",
"path",
",",
"Optional",
".",
"empty",
"(",
")",
",",
"Optional",
".",
"empty",
"(",
")",
")",
";",
"}"
] | Get the hash sum of a file
<p>
SHA256 algorithm is used by default
@param path Path to the file or directory
@return The {@link LocalCall} object to make the call | [
"Get",
"the",
"hash",
"sum",
"of",
"a",
"file",
"<p",
">",
"SHA256",
"algorithm",
"is",
"used",
"by",
"default"
] | train | https://github.com/SUSE/salt-netapi-client/blob/a0bdf643c8e34fa4def4b915366594c1491fdad5/src/main/java/com/suse/salt/netapi/calls/modules/File.java#L120-L122 |
cdk/cdk | base/core/src/main/java/org/openscience/cdk/atomtype/CDKAtomTypeMatcher.java | CDKAtomTypeMatcher.isSingleHeteroAtom | private boolean isSingleHeteroAtom(IAtom atom, IAtomContainer container) {
"""
Determines whether the bonds (up to two spheres away) are only to non
hetroatoms. Currently used in N.planar3 perception of (e.g. pyrrole).
@param atom an atom to test
@param container container of the atom
@return whether the a... | java | private boolean isSingleHeteroAtom(IAtom atom, IAtomContainer container) {
List<IAtom> connected = container.getConnectedAtomsList(atom);
for (IAtom atom1 : connected) {
boolean aromatic = container.getBond(atom, atom1).isAromatic();
// ignoring non-aromatic bonds
... | [
"private",
"boolean",
"isSingleHeteroAtom",
"(",
"IAtom",
"atom",
",",
"IAtomContainer",
"container",
")",
"{",
"List",
"<",
"IAtom",
">",
"connected",
"=",
"container",
".",
"getConnectedAtomsList",
"(",
"atom",
")",
";",
"for",
"(",
"IAtom",
"atom1",
":",
... | Determines whether the bonds (up to two spheres away) are only to non
hetroatoms. Currently used in N.planar3 perception of (e.g. pyrrole).
@param atom an atom to test
@param container container of the atom
@return whether the atom's only bonds are to heteroatoms
@see #perceiveNitrogens(IAtomContainer, IAtom, RingSea... | [
"Determines",
"whether",
"the",
"bonds",
"(",
"up",
"to",
"two",
"spheres",
"away",
")",
"are",
"only",
"to",
"non",
"hetroatoms",
".",
"Currently",
"used",
"in",
"N",
".",
"planar3",
"perception",
"of",
"(",
"e",
".",
"g",
".",
"pyrrole",
")",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/atomtype/CDKAtomTypeMatcher.java#L989-L1017 |
mbeiter/util | db/src/main/java/org/beiter/michael/db/ConnectionProperties.java | ConnectionProperties.setAdditionalProperties | public final void setAdditionalProperties(final Map<String, String> additionalProperties) {
"""
Any additional properties which have not been parsed, and for which no getter/setter exists, but are to be
stored in this object nevertheless.
<p>
This property is commonly used to preserve original properties from u... | java | public final void setAdditionalProperties(final Map<String, String> additionalProperties) {
// no need for validation, the method will create a new (empty) object if the provided parameter is null.
// create a defensive copy of the map and all its properties
if (additionalProperties == null) {... | [
"public",
"final",
"void",
"setAdditionalProperties",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"additionalProperties",
")",
"{",
"// no need for validation, the method will create a new (empty) object if the provided parameter is null.",
"// create a defensive copy of ... | Any additional properties which have not been parsed, and for which no getter/setter exists, but are to be
stored in this object nevertheless.
<p>
This property is commonly used to preserve original properties from upstream components that are to be passed
on to downstream components unchanged. This properties set may ... | [
"Any",
"additional",
"properties",
"which",
"have",
"not",
"been",
"parsed",
"and",
"for",
"which",
"no",
"getter",
"/",
"setter",
"exists",
"but",
"are",
"to",
"be",
"stored",
"in",
"this",
"object",
"nevertheless",
".",
"<p",
">",
"This",
"property",
"is... | train | https://github.com/mbeiter/util/blob/490fcebecb936e00c2f2ce2096b679b2fd10865e/db/src/main/java/org/beiter/michael/db/ConnectionProperties.java#L889-L912 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/CustomserviceAPI.java | CustomserviceAPI.kfsessionClose | public static BaseResult kfsessionClose(String access_token, String kf_account, String openid, String text) {
"""
关闭会话
@param access_token access_token
@param kf_account 完整客服账号
@param openid 客户openid
@param text 附加信息,非必须
@return BaseResult
"""
String postJsonData = String.format("{\"kf_account\":\"%1s\... | java | public static BaseResult kfsessionClose(String access_token, String kf_account, String openid, String text) {
String postJsonData = String.format("{\"kf_account\":\"%1s\",\"openid\":\"%2s\",\"text\":\"%3s\"}",
kf_account,
openid,
text);
HttpUriRequest httpUriRequest = RequestBuilder.post()
... | [
"public",
"static",
"BaseResult",
"kfsessionClose",
"(",
"String",
"access_token",
",",
"String",
"kf_account",
",",
"String",
"openid",
",",
"String",
"text",
")",
"{",
"String",
"postJsonData",
"=",
"String",
".",
"format",
"(",
"\"{\\\"kf_account\\\":\\\"%1s\\\",... | 关闭会话
@param access_token access_token
@param kf_account 完整客服账号
@param openid 客户openid
@param text 附加信息,非必须
@return BaseResult | [
"关闭会话"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/CustomserviceAPI.java#L166-L178 |
phax/ph-bdve | ph-bdve-ebinterface/src/main/java/com/helger/bdve/ebinterface/EbInterfaceValidation.java | EbInterfaceValidation.initEbInterface | public static void initEbInterface (@Nonnull final ValidationExecutorSetRegistry aRegistry) {
"""
Register all standard TEAPPS validation execution sets to the provided
registry.
@param aRegistry
The registry to add the artefacts. May not be <code>null</code>.
"""
ValueEnforcer.notNull (aRegistry, "Re... | java | public static void initEbInterface (@Nonnull final ValidationExecutorSetRegistry aRegistry)
{
ValueEnforcer.notNull (aRegistry, "Registry");
final boolean bNotDeprecated = false;
// No Schematrons here
for (final EEbInterfaceDocumentType e : EEbInterfaceDocumentType.values ())
{
final Stri... | [
"public",
"static",
"void",
"initEbInterface",
"(",
"@",
"Nonnull",
"final",
"ValidationExecutorSetRegistry",
"aRegistry",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aRegistry",
",",
"\"Registry\"",
")",
";",
"final",
"boolean",
"bNotDeprecated",
"=",
"false",... | Register all standard TEAPPS validation execution sets to the provided
registry.
@param aRegistry
The registry to add the artefacts. May not be <code>null</code>. | [
"Register",
"all",
"standard",
"TEAPPS",
"validation",
"execution",
"sets",
"to",
"the",
"provided",
"registry",
"."
] | train | https://github.com/phax/ph-bdve/blob/2438f491174cd8989567fcdf129b273bd217e89f/ph-bdve-ebinterface/src/main/java/com/helger/bdve/ebinterface/EbInterfaceValidation.java#L57-L75 |
JodaOrg/joda-time | src/main/java/org/joda/time/chrono/BasicChronology.java | BasicChronology.getDaysInMonthMax | int getDaysInMonthMax(long instant) {
"""
Gets the maximum number of days in the month specified by the instant.
@param instant millis from 1970-01-01T00:00:00Z
@return the maximum number of days in the month
"""
int thisYear = getYear(instant);
int thisMonth = getMonthOfYear(instant, this... | java | int getDaysInMonthMax(long instant) {
int thisYear = getYear(instant);
int thisMonth = getMonthOfYear(instant, thisYear);
return getDaysInYearMonth(thisYear, thisMonth);
} | [
"int",
"getDaysInMonthMax",
"(",
"long",
"instant",
")",
"{",
"int",
"thisYear",
"=",
"getYear",
"(",
"instant",
")",
";",
"int",
"thisMonth",
"=",
"getMonthOfYear",
"(",
"instant",
",",
"thisYear",
")",
";",
"return",
"getDaysInYearMonth",
"(",
"thisYear",
... | Gets the maximum number of days in the month specified by the instant.
@param instant millis from 1970-01-01T00:00:00Z
@return the maximum number of days in the month | [
"Gets",
"the",
"maximum",
"number",
"of",
"days",
"in",
"the",
"month",
"specified",
"by",
"the",
"instant",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/BasicChronology.java#L601-L605 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebGroup.java | WebGroup.stripURL | public static String stripURL(String url,boolean checkQuestionMark) {
"""
This method strips out the session identifier and the queryString (based on the boolean value)
from a request URI, and returns the resultant 'pure' URI
@param url
@param checkQuestionMark
@return
"""
if (url == null)
... | java | public static String stripURL(String url,boolean checkQuestionMark)
{
if (url == null)
return null;
int index1 = url.indexOf(sessUrlRewritePrefix);
if (checkQuestionMark){
int index2 = url.indexOf("?");
if (index2 != -1)
{
if ( index1 > index2 )
... | [
"public",
"static",
"String",
"stripURL",
"(",
"String",
"url",
",",
"boolean",
"checkQuestionMark",
")",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"return",
"null",
";",
"int",
"index1",
"=",
"url",
".",
"indexOf",
"(",
"sessUrlRewritePrefix",
")",
";",
... | This method strips out the session identifier and the queryString (based on the boolean value)
from a request URI, and returns the resultant 'pure' URI
@param url
@param checkQuestionMark
@return | [
"This",
"method",
"strips",
"out",
"the",
"session",
"identifier",
"and",
"the",
"queryString",
"(",
"based",
"on",
"the",
"boolean",
"value",
")",
"from",
"a",
"request",
"URI",
"and",
"returns",
"the",
"resultant",
"pure",
"URI"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/webapp/WebGroup.java#L361-L385 |
google/closure-compiler | src/com/google/javascript/jscomp/GlobalVarReferenceMap.java | GlobalVarReferenceMap.findSourceRefRange | private SourceRefRange findSourceRefRange(List<Reference> refList,
InputId inputId) {
"""
Finds the range of references associated to {@code sourceName}. Note that
even if there is no sourceName references the returned information can be
used to decide where to insert new sourceName refs.
"""
check... | java | private SourceRefRange findSourceRefRange(List<Reference> refList,
InputId inputId) {
checkNotNull(inputId);
// TODO(bashir): We can do binary search here, but since this is fast enough
// right now, we just do a linear search for simplicity.
int lastBefore = -1;
int firstAfter = refList.size... | [
"private",
"SourceRefRange",
"findSourceRefRange",
"(",
"List",
"<",
"Reference",
">",
"refList",
",",
"InputId",
"inputId",
")",
"{",
"checkNotNull",
"(",
"inputId",
")",
";",
"// TODO(bashir): We can do binary search here, but since this is fast enough",
"// right now, we j... | Finds the range of references associated to {@code sourceName}. Note that
even if there is no sourceName references the returned information can be
used to decide where to insert new sourceName refs. | [
"Finds",
"the",
"range",
"of",
"references",
"associated",
"to",
"{"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/GlobalVarReferenceMap.java#L161-L185 |
minio/minio-java | api/src/main/java/io/minio/MinioClient.java | MinioClient.listObjects | public Iterable<Result<Item>> listObjects(final String bucketName) throws XmlPullParserException {
"""
Lists object information in given bucket.
@param bucketName Bucket name.
@return an iterator of Result Items.
* @throws XmlPullParserException upon parsing response xml
"""
return listObject... | java | public Iterable<Result<Item>> listObjects(final String bucketName) throws XmlPullParserException {
return listObjects(bucketName, null);
} | [
"public",
"Iterable",
"<",
"Result",
"<",
"Item",
">",
">",
"listObjects",
"(",
"final",
"String",
"bucketName",
")",
"throws",
"XmlPullParserException",
"{",
"return",
"listObjects",
"(",
"bucketName",
",",
"null",
")",
";",
"}"
] | Lists object information in given bucket.
@param bucketName Bucket name.
@return an iterator of Result Items.
* @throws XmlPullParserException upon parsing response xml | [
"Lists",
"object",
"information",
"in",
"given",
"bucket",
"."
] | train | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L2797-L2799 |
ravendb/ravendb-jvm-client | src/main/java/net/ravendb/client/documents/subscriptions/DocumentSubscriptions.java | DocumentSubscriptions.getSubscriptionWorker | public SubscriptionWorker<ObjectNode> getSubscriptionWorker(String subscriptionName, String database) {
"""
It opens a subscription and starts pulling documents since a last processed document for that subscription.
The connection options determine client and server cooperation rules like document batch sizes or ... | java | public SubscriptionWorker<ObjectNode> getSubscriptionWorker(String subscriptionName, String database) {
return getSubscriptionWorker(ObjectNode.class, subscriptionName, database);
} | [
"public",
"SubscriptionWorker",
"<",
"ObjectNode",
">",
"getSubscriptionWorker",
"(",
"String",
"subscriptionName",
",",
"String",
"database",
")",
"{",
"return",
"getSubscriptionWorker",
"(",
"ObjectNode",
".",
"class",
",",
"subscriptionName",
",",
"database",
")",
... | It opens a subscription and starts pulling documents since a last processed document for that subscription.
The connection options determine client and server cooperation rules like document batch sizes or a timeout in a matter of which a client
needs to acknowledge that batch has been processed. The acknowledgment is ... | [
"It",
"opens",
"a",
"subscription",
"and",
"starts",
"pulling",
"documents",
"since",
"a",
"last",
"processed",
"document",
"for",
"that",
"subscription",
".",
"The",
"connection",
"options",
"determine",
"client",
"and",
"server",
"cooperation",
"rules",
"like",
... | train | https://github.com/ravendb/ravendb-jvm-client/blob/5a45727de507b541d1571e79ddd97c7d88bee787/src/main/java/net/ravendb/client/documents/subscriptions/DocumentSubscriptions.java#L194-L196 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java | AbstractRenderer.toScreenCoordinates | public Point2d toScreenCoordinates(double modelX, double modelY) {
"""
Convert a point in model space into a point in screen space.
@param modelX the model x-coordinate
@param modelY the model y-coordinate
@return the equivalent point in screen space
"""
double[] dest = new double[2];
tran... | java | public Point2d toScreenCoordinates(double modelX, double modelY) {
double[] dest = new double[2];
transform.transform(new double[]{modelX, modelY}, 0, dest, 0, 1);
return new Point2d(dest[0], dest[1]);
} | [
"public",
"Point2d",
"toScreenCoordinates",
"(",
"double",
"modelX",
",",
"double",
"modelY",
")",
"{",
"double",
"[",
"]",
"dest",
"=",
"new",
"double",
"[",
"2",
"]",
";",
"transform",
".",
"transform",
"(",
"new",
"double",
"[",
"]",
"{",
"modelX",
... | Convert a point in model space into a point in screen space.
@param modelX the model x-coordinate
@param modelY the model y-coordinate
@return the equivalent point in screen space | [
"Convert",
"a",
"point",
"in",
"model",
"space",
"into",
"a",
"point",
"in",
"screen",
"space",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java#L180-L184 |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/X509Credential.java | X509Credential.verify | public void verify() throws CredentialException {
"""
Verifies the validity of the credentials. All certificate path validation is performed using trusted
certificates in default locations.
@exception CredentialException
if one of the certificates in the chain expired or if path validiation fails.
"""
... | java | public void verify() throws CredentialException {
try {
String caCertsLocation = "file:" + CoGProperties.getDefault().getCaCertLocations();
KeyStore keyStore = Stores.getTrustStore(caCertsLocation + "/" + Stores.getDefaultCAFilesPattern());
CertStore crlStore = Stores.getCRL... | [
"public",
"void",
"verify",
"(",
")",
"throws",
"CredentialException",
"{",
"try",
"{",
"String",
"caCertsLocation",
"=",
"\"file:\"",
"+",
"CoGProperties",
".",
"getDefault",
"(",
")",
".",
"getCaCertLocations",
"(",
")",
";",
"KeyStore",
"keyStore",
"=",
"St... | Verifies the validity of the credentials. All certificate path validation is performed using trusted
certificates in default locations.
@exception CredentialException
if one of the certificates in the chain expired or if path validiation fails. | [
"Verifies",
"the",
"validity",
"of",
"the",
"credentials",
".",
"All",
"certificate",
"path",
"validation",
"is",
"performed",
"using",
"trusted",
"certificates",
"in",
"default",
"locations",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/X509Credential.java#L435-L449 |
dlemmermann/CalendarFX | CalendarFXGoogle/src/main/java/com/calendarfx/google/model/GoogleAccount.java | GoogleAccount.createCalendar | public final GoogleCalendar createCalendar(String name, Calendar.Style style) {
"""
Creates one single calendar with the given name and style.
@param name The name of the calendar.
@param style The style of the calendar.
@return The new google calendar.
"""
GoogleCalendar calendar = new GoogleCal... | java | public final GoogleCalendar createCalendar(String name, Calendar.Style style) {
GoogleCalendar calendar = new GoogleCalendar();
calendar.setName(name);
calendar.setStyle(style);
return calendar;
} | [
"public",
"final",
"GoogleCalendar",
"createCalendar",
"(",
"String",
"name",
",",
"Calendar",
".",
"Style",
"style",
")",
"{",
"GoogleCalendar",
"calendar",
"=",
"new",
"GoogleCalendar",
"(",
")",
";",
"calendar",
".",
"setName",
"(",
"name",
")",
";",
"cal... | Creates one single calendar with the given name and style.
@param name The name of the calendar.
@param style The style of the calendar.
@return The new google calendar. | [
"Creates",
"one",
"single",
"calendar",
"with",
"the",
"given",
"name",
"and",
"style",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXGoogle/src/main/java/com/calendarfx/google/model/GoogleAccount.java#L51-L56 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.toAsync | public static <T1, T2, T3, T4, T5, T6, T7, T8, T9> Func9<T1, T2, T3, T4, T5, T6, T7, T8, T9, Observable<Void>> toAsync(Action9<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9> action) {
"""
Convert a synchronous action call into an asynchronous function ca... | java | public static <T1, T2, T3, T4, T5, T6, T7, T8, T9> Func9<T1, T2, T3, T4, T5, T6, T7, T8, T9, Observable<Void>> toAsync(Action9<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9> action) {
return toAsync(action, Schedulers.computation());
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
",",
"T5",
",",
"T6",
",",
"T7",
",",
"T8",
",",
"T9",
">",
"Func9",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
",",
"T5",
",",
"T6",
",",
"T7",
",",
"T8",
",",
"T9",
",",... | Convert a synchronous action call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.an.png" alt="">
@param <T1> the first parameter type
@param <T2> the second parameter type
@param <T3> the third parameter type
... | [
"Convert",
"a",
"synchronous",
"action",
"call",
"into",
"an",
"asynchronous",
"function",
"call",
"through",
"an",
"Observable",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
"wiki",
... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L659-L661 |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.metrics/src/com/ibm/ws/microprofile/metrics/impl/MetricRegistryImpl.java | MetricRegistryImpl.getHistograms | @Override
public SortedMap<String, Histogram> getHistograms(MetricFilter filter) {
"""
Returns a map of all the histograms in the registry and their names which match the given
filter.
@param filter the metric filter to match
@return all the histograms in the registry
"""
return getMetrics(His... | java | @Override
public SortedMap<String, Histogram> getHistograms(MetricFilter filter) {
return getMetrics(Histogram.class, filter);
} | [
"@",
"Override",
"public",
"SortedMap",
"<",
"String",
",",
"Histogram",
">",
"getHistograms",
"(",
"MetricFilter",
"filter",
")",
"{",
"return",
"getMetrics",
"(",
"Histogram",
".",
"class",
",",
"filter",
")",
";",
"}"
] | Returns a map of all the histograms in the registry and their names which match the given
filter.
@param filter the metric filter to match
@return all the histograms in the registry | [
"Returns",
"a",
"map",
"of",
"all",
"the",
"histograms",
"in",
"the",
"registry",
"and",
"their",
"names",
"which",
"match",
"the",
"given",
"filter",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.metrics/src/com/ibm/ws/microprofile/metrics/impl/MetricRegistryImpl.java#L384-L387 |
foundation-runtime/service-directory | 2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/ServiceDirectoryThread.java | ServiceDirectoryThread.doThread | private static Thread doThread(Runnable runnable, String name, boolean deamon) {
"""
Generate the Thread.
@param runnable
the runnable task.
@param name
the thread name.
@param deamon
the deamon flag.
@return
the Thread.
"""
String realname = getThreadName(name);
Thread t = new Thread... | java | private static Thread doThread(Runnable runnable, String name, boolean deamon){
String realname = getThreadName(name);
Thread t = new Thread(runnable);
t.setName(realname);
t.setDaemon(deamon);
return t;
} | [
"private",
"static",
"Thread",
"doThread",
"(",
"Runnable",
"runnable",
",",
"String",
"name",
",",
"boolean",
"deamon",
")",
"{",
"String",
"realname",
"=",
"getThreadName",
"(",
"name",
")",
";",
"Thread",
"t",
"=",
"new",
"Thread",
"(",
"runnable",
")",... | Generate the Thread.
@param runnable
the runnable task.
@param name
the thread name.
@param deamon
the deamon flag.
@return
the Thread. | [
"Generate",
"the",
"Thread",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/ServiceDirectoryThread.java#L121-L127 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/util/ExceptionUtil.java | ExceptionUtil.fixAsyncStackTrace | public static void fixAsyncStackTrace(Throwable asyncCause, StackTraceElement[] localSideStackTrace,
String localExceptionMessage) {
"""
This method changes the given async cause, and it adds the also given local stacktrace separated by the
supplied exception message.<br/... | java | public static void fixAsyncStackTrace(Throwable asyncCause, StackTraceElement[] localSideStackTrace,
String localExceptionMessage) {
Throwable throwable = asyncCause;
if (asyncCause instanceof ExecutionException && throwable.getCause() != null) {
thr... | [
"public",
"static",
"void",
"fixAsyncStackTrace",
"(",
"Throwable",
"asyncCause",
",",
"StackTraceElement",
"[",
"]",
"localSideStackTrace",
",",
"String",
"localExceptionMessage",
")",
"{",
"Throwable",
"throwable",
"=",
"asyncCause",
";",
"if",
"(",
"asyncCause",
... | This method changes the given async cause, and it adds the also given local stacktrace separated by the
supplied exception message.<br/>
If the remoteCause is an {@link java.util.concurrent.ExecutionException} and it has a non-null inner
cause, this inner cause is unwrapped and the local stacktrace and exception messag... | [
"This",
"method",
"changes",
"the",
"given",
"async",
"cause",
"and",
"it",
"adds",
"the",
"also",
"given",
"local",
"stacktrace",
"separated",
"by",
"the",
"supplied",
"exception",
"message",
".",
"<br",
"/",
">",
"If",
"the",
"remoteCause",
"is",
"an",
"... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/ExceptionUtil.java#L213-L230 |
Microsoft/azure-maven-plugins | azure-maven-plugin-lib/src/main/java/com/microsoft/azure/maven/Utils.java | Utils.assureServerExist | public static void assureServerExist(final Server server, final String serverId) throws MojoExecutionException {
"""
Assure the server with specified id does exist in settings.xml.
It could be the server used for azure authentication.
Or, the server used for docker hub authentication of runtime configuration.
@... | java | public static void assureServerExist(final Server server, final String serverId) throws MojoExecutionException {
if (server == null) {
throw new MojoExecutionException(String.format("Server not found in settings.xml. ServerId=%s", serverId));
}
} | [
"public",
"static",
"void",
"assureServerExist",
"(",
"final",
"Server",
"server",
",",
"final",
"String",
"serverId",
")",
"throws",
"MojoExecutionException",
"{",
"if",
"(",
"server",
"==",
"null",
")",
"{",
"throw",
"new",
"MojoExecutionException",
"(",
"Stri... | Assure the server with specified id does exist in settings.xml.
It could be the server used for azure authentication.
Or, the server used for docker hub authentication of runtime configuration.
@param server
@param serverId
@throws MojoExecutionException | [
"Assure",
"the",
"server",
"with",
"specified",
"id",
"does",
"exist",
"in",
"settings",
".",
"xml",
".",
"It",
"could",
"be",
"the",
"server",
"used",
"for",
"azure",
"authentication",
".",
"Or",
"the",
"server",
"used",
"for",
"docker",
"hub",
"authentic... | train | https://github.com/Microsoft/azure-maven-plugins/blob/a254902e820185df1823b1d692c7c1d119490b1e/azure-maven-plugin-lib/src/main/java/com/microsoft/azure/maven/Utils.java#L54-L58 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/core/layout/Dj2JrCrosstabBuilder.java | Dj2JrCrosstabBuilder.registerRows | private void registerRows() {
"""
Register the Rowgroup buckets and places the header cells for the rows
"""
for (int i = 0; i < rows.length; i++) {
DJCrosstabRow crosstabRow = rows[i];
JRDesignCrosstabRowGroup ctRowGroup = new JRDesignCrosstabRowGroup();
ctRowGroup.setWidth(crosstabRow.getHeader... | java | private void registerRows() {
for (int i = 0; i < rows.length; i++) {
DJCrosstabRow crosstabRow = rows[i];
JRDesignCrosstabRowGroup ctRowGroup = new JRDesignCrosstabRowGroup();
ctRowGroup.setWidth(crosstabRow.getHeaderWidth());
ctRowGroup.setName(crosstabRow.getProperty().getProperty());
JRDesignC... | [
"private",
"void",
"registerRows",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"rows",
".",
"length",
";",
"i",
"++",
")",
"{",
"DJCrosstabRow",
"crosstabRow",
"=",
"rows",
"[",
"i",
"]",
";",
"JRDesignCrosstabRowGroup",
"ctRowGroup... | Register the Rowgroup buckets and places the header cells for the rows | [
"Register",
"the",
"Rowgroup",
"buckets",
"and",
"places",
"the",
"header",
"cells",
"for",
"the",
"rows"
] | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/core/layout/Dj2JrCrosstabBuilder.java#L773-L835 |
line/centraldogma | server/src/main/java/com/linecorp/centraldogma/server/internal/api/ProjectServiceV1.java | ProjectServiceV1.patchProject | @Consumes("application/json-patch+json")
@Patch("/projects/ {
"""
PATCH /projects/{projectName}
<p>Patches a project with the JSON_PATCH. Currently, only unremove project operation is supported.
"""projectName}")
@RequiresAdministrator
public CompletableFuture<ProjectDto> patchProject(@Param("pr... | java | @Consumes("application/json-patch+json")
@Patch("/projects/{projectName}")
@RequiresAdministrator
public CompletableFuture<ProjectDto> patchProject(@Param("projectName") String projectName,
JsonNode node,
... | [
"@",
"Consumes",
"(",
"\"application/json-patch+json\"",
")",
"@",
"Patch",
"(",
"\"/projects/{projectName}\"",
")",
"@",
"RequiresAdministrator",
"public",
"CompletableFuture",
"<",
"ProjectDto",
">",
"patchProject",
"(",
"@",
"Param",
"(",
"\"projectName\"",
")",
"S... | PATCH /projects/{projectName}
<p>Patches a project with the JSON_PATCH. Currently, only unremove project operation is supported. | [
"PATCH",
"/",
"projects",
"/",
"{",
"projectName",
"}"
] | train | https://github.com/line/centraldogma/blob/b9e46c67fbc26628c2186ce2f46e7fb303c831e9/server/src/main/java/com/linecorp/centraldogma/server/internal/api/ProjectServiceV1.java#L136-L147 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.setDatePicker | public void setDatePicker(int index, int year, int monthOfYear, int dayOfMonth) {
"""
Sets the date in a DatePicker matching the specified index.
@param index the index of the {@link DatePicker}. {@code 0} if only one is available
@param year the year e.g. 2011
@param monthOfYear the month which starts from z... | java | public void setDatePicker(int index, int year, int monthOfYear, int dayOfMonth) {
if(config.commandLogging){
Log.d(config.commandLoggingTag, "setDatePicker("+index+", "+year+", "+monthOfYear+", "+dayOfMonth+")");
}
setDatePicker(waiter.waitForAndGetView(index, DatePicker.class), year, monthOfYear, dayOfMont... | [
"public",
"void",
"setDatePicker",
"(",
"int",
"index",
",",
"int",
"year",
",",
"int",
"monthOfYear",
",",
"int",
"dayOfMonth",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
","... | Sets the date in a DatePicker matching the specified index.
@param index the index of the {@link DatePicker}. {@code 0} if only one is available
@param year the year e.g. 2011
@param monthOfYear the month which starts from zero e.g. 0 for January
@param dayOfMonth the day e.g. 10 | [
"Sets",
"the",
"date",
"in",
"a",
"DatePicker",
"matching",
"the",
"specified",
"index",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L2521-L2527 |
alkacon/opencms-core | src/org/opencms/workplace/editors/CmsEditor.java | CmsEditor.commitTempFile | protected void commitTempFile() throws CmsException {
"""
Writes the content of a temporary file back to the original file.<p>
@throws CmsException if something goes wrong
"""
CmsObject cms = getCms();
CmsFile tempFile;
List<CmsProperty> properties;
try {
switchT... | java | protected void commitTempFile() throws CmsException {
CmsObject cms = getCms();
CmsFile tempFile;
List<CmsProperty> properties;
try {
switchToTempProject();
tempFile = cms.readFile(getParamTempfile(), CmsResourceFilter.ALL);
properties = cms.readPrope... | [
"protected",
"void",
"commitTempFile",
"(",
")",
"throws",
"CmsException",
"{",
"CmsObject",
"cms",
"=",
"getCms",
"(",
")",
";",
"CmsFile",
"tempFile",
";",
"List",
"<",
"CmsProperty",
">",
"properties",
";",
"try",
"{",
"switchToTempProject",
"(",
")",
";"... | Writes the content of a temporary file back to the original file.<p>
@throws CmsException if something goes wrong | [
"Writes",
"the",
"content",
"of",
"a",
"temporary",
"file",
"back",
"to",
"the",
"original",
"file",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/editors/CmsEditor.java#L786-L838 |
baratine/baratine | web/src/main/java/com/caucho/v5/log/impl/EnvironmentStream.java | EnvironmentStream.logStderr | public static void logStderr(String msg, Throwable e) {
"""
Logs a message to the original stderr in cases where java.util.logging
is dangerous, e.g. in the logging code itself.
"""
try {
long now = CurrentTime.currentTime();
//msg = QDate.formatLocal(now, "[%Y-%m-%d %H:%M:%S] ") + msg;
... | java | public static void logStderr(String msg, Throwable e)
{
try {
long now = CurrentTime.currentTime();
//msg = QDate.formatLocal(now, "[%Y-%m-%d %H:%M:%S] ") + msg;
_origSystemErr.println(msg);
//e.printStackTrace(_origSystemErr.getPrintWriter());
_origSystemErr.flush();
} c... | [
"public",
"static",
"void",
"logStderr",
"(",
"String",
"msg",
",",
"Throwable",
"e",
")",
"{",
"try",
"{",
"long",
"now",
"=",
"CurrentTime",
".",
"currentTime",
"(",
")",
";",
"//msg = QDate.formatLocal(now, \"[%Y-%m-%d %H:%M:%S] \") + msg;",
"_origSystemErr",
"."... | Logs a message to the original stderr in cases where java.util.logging
is dangerous, e.g. in the logging code itself. | [
"Logs",
"a",
"message",
"to",
"the",
"original",
"stderr",
"in",
"cases",
"where",
"java",
".",
"util",
".",
"logging",
"is",
"dangerous",
"e",
".",
"g",
".",
"in",
"the",
"logging",
"code",
"itself",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/impl/EnvironmentStream.java#L345-L359 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policystringmap.java | policystringmap.get | public static policystringmap get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch policystringmap resource of given name .
"""
policystringmap obj = new policystringmap();
obj.set_name(name);
policystringmap response = (policystringmap) obj.get_resource(service);
return... | java | public static policystringmap get(nitro_service service, String name) throws Exception{
policystringmap obj = new policystringmap();
obj.set_name(name);
policystringmap response = (policystringmap) obj.get_resource(service);
return response;
} | [
"public",
"static",
"policystringmap",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"policystringmap",
"obj",
"=",
"new",
"policystringmap",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"pol... | Use this API to fetch policystringmap resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"policystringmap",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/policy/policystringmap.java#L276-L281 |
Asana/java-asana | src/main/java/com/asana/resources/Attachments.java | Attachments.createOnTask | public ItemRequest<Attachment> createOnTask(String task, InputStream fileContent, String fileName, String fileType) {
"""
Upload a file and attach it to a task
@param task Globally unique identifier for the task.
@param fileContent Content of the file to be uploaded
@param fileName Name of the file ... | java | public ItemRequest<Attachment> createOnTask(String task, InputStream fileContent, String fileName, String fileType) {
MultipartContent.Part part = new MultipartContent.Part()
.setContent(new InputStreamContent(fileType, fileContent))
.setHeaders(new HttpHeaders().set(
... | [
"public",
"ItemRequest",
"<",
"Attachment",
">",
"createOnTask",
"(",
"String",
"task",
",",
"InputStream",
"fileContent",
",",
"String",
"fileName",
",",
"String",
"fileType",
")",
"{",
"MultipartContent",
".",
"Part",
"part",
"=",
"new",
"MultipartContent",
".... | Upload a file and attach it to a task
@param task Globally unique identifier for the task.
@param fileContent Content of the file to be uploaded
@param fileName Name of the file to be uploaded
@param fileType MIME type of the file to be uploaded
@return Request object | [
"Upload",
"a",
"file",
"and",
"attach",
"it",
"to",
"a",
"task"
] | train | https://github.com/Asana/java-asana/blob/abeea92fd5a71260a5d804db4da94e52fd7a15a7/src/main/java/com/asana/resources/Attachments.java#L29-L43 |
op4j/op4j | src/main/java/org/op4j/functions/FnNumber.java | FnNumber.roundDouble | public static final Function<Double,Double> roundDouble(final int scale, final RoundingMode roundingMode) {
"""
<p>
It rounds the target object with the specified scale and rounding mode
</p>
@param scale the scale to be used
@param roundingMode the {@link RoundingMode} to round the input with
@return the... | java | public static final Function<Double,Double> roundDouble(final int scale, final RoundingMode roundingMode) {
return new RoundDouble(scale, roundingMode);
} | [
"public",
"static",
"final",
"Function",
"<",
"Double",
",",
"Double",
">",
"roundDouble",
"(",
"final",
"int",
"scale",
",",
"final",
"RoundingMode",
"roundingMode",
")",
"{",
"return",
"new",
"RoundDouble",
"(",
"scale",
",",
"roundingMode",
")",
";",
"}"
... | <p>
It rounds the target object with the specified scale and rounding mode
</p>
@param scale the scale to be used
@param roundingMode the {@link RoundingMode} to round the input with
@return the {@link Double} | [
"<p",
">",
"It",
"rounds",
"the",
"target",
"object",
"with",
"the",
"specified",
"scale",
"and",
"rounding",
"mode",
"<",
"/",
"p",
">"
] | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnNumber.java#L306-L308 |
virgo47/javasimon | core/src/main/java/org/javasimon/callback/logging/LoggingCallback.java | LoggingCallback.onStopwatchStop | @Override
public void onStopwatchStop(Split split, StopwatchSample sample) {
"""
{@inheritDoc}
Split and stopwatch are logger to log template is enabled.
@param split Split
@param sample Stopwatch sample
"""
getStopwatchLogTemplate(split.getStopwatch()).log(split, stopwatchLogMessageSource);
} | java | @Override
public void onStopwatchStop(Split split, StopwatchSample sample) {
getStopwatchLogTemplate(split.getStopwatch()).log(split, stopwatchLogMessageSource);
} | [
"@",
"Override",
"public",
"void",
"onStopwatchStop",
"(",
"Split",
"split",
",",
"StopwatchSample",
"sample",
")",
"{",
"getStopwatchLogTemplate",
"(",
"split",
".",
"getStopwatch",
"(",
")",
")",
".",
"log",
"(",
"split",
",",
"stopwatchLogMessageSource",
")",... | {@inheritDoc}
Split and stopwatch are logger to log template is enabled.
@param split Split
@param sample Stopwatch sample | [
"{",
"@inheritDoc",
"}",
"Split",
"and",
"stopwatch",
"are",
"logger",
"to",
"log",
"template",
"is",
"enabled",
"."
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/callback/logging/LoggingCallback.java#L97-L100 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java | SeleniumHelper.setHiddenInputValue | public boolean setHiddenInputValue(String idOrName, String value) {
"""
Sets value of hidden input field.
@param idOrName id or name of input field to set.
@param value value to set.
@return whether input field was found.
"""
T element = findElement(By.id(idOrName));
if (element == null) {
... | java | public boolean setHiddenInputValue(String idOrName, String value) {
T element = findElement(By.id(idOrName));
if (element == null) {
element = findElement(By.name(idOrName));
if (element != null) {
executeJavascript("document.getElementsByName('%s')[0].value='%s'"... | [
"public",
"boolean",
"setHiddenInputValue",
"(",
"String",
"idOrName",
",",
"String",
"value",
")",
"{",
"T",
"element",
"=",
"findElement",
"(",
"By",
".",
"id",
"(",
"idOrName",
")",
")",
";",
"if",
"(",
"element",
"==",
"null",
")",
"{",
"element",
... | Sets value of hidden input field.
@param idOrName id or name of input field to set.
@param value value to set.
@return whether input field was found. | [
"Sets",
"value",
"of",
"hidden",
"input",
"field",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java#L413-L424 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/AvroUtils.java | AvroUtils.getAvroUtils | public static AvroUtils getAvroUtils() {
"""
Returns either the default {@link AvroUtils} which throw an exception in cases where Avro
would be needed or loads the specific utils for Avro from flink-avro.
"""
// try and load the special AvroUtils from the flink-avro package
try {
Class<?> clazz = Class... | java | public static AvroUtils getAvroUtils() {
// try and load the special AvroUtils from the flink-avro package
try {
Class<?> clazz = Class.forName(AVRO_KRYO_UTILS, false, Thread.currentThread().getContextClassLoader());
return clazz.asSubclass(AvroUtils.class).getConstructor().newInstance();
} catch (ClassNotF... | [
"public",
"static",
"AvroUtils",
"getAvroUtils",
"(",
")",
"{",
"// try and load the special AvroUtils from the flink-avro package",
"try",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"Class",
".",
"forName",
"(",
"AVRO_KRYO_UTILS",
",",
"false",
",",
"Thread",
".",
... | Returns either the default {@link AvroUtils} which throw an exception in cases where Avro
would be needed or loads the specific utils for Avro from flink-avro. | [
"Returns",
"either",
"the",
"default",
"{"
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/AvroUtils.java#L44-L55 |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/ngmf/ui/TableListener.java | TableListener.parseString | private ArrayList<ArrayList<String>> parseString(String text) {
"""
turns the clipboard into a list of tokens
each array list is a line, each string in the list is a token in the line
@param text
@return
"""
ArrayList<ArrayList<String>> result = new ArrayList<ArrayList<String>>();
StringTok... | java | private ArrayList<ArrayList<String>> parseString(String text) {
ArrayList<ArrayList<String>> result = new ArrayList<ArrayList<String>>();
StringTokenizer linetoken = new StringTokenizer(text, "\n");
StringTokenizer token;
String current;
while (linetoken.hasMoreTokens()) {
... | [
"private",
"ArrayList",
"<",
"ArrayList",
"<",
"String",
">",
">",
"parseString",
"(",
"String",
"text",
")",
"{",
"ArrayList",
"<",
"ArrayList",
"<",
"String",
">>",
"result",
"=",
"new",
"ArrayList",
"<",
"ArrayList",
"<",
"String",
">",
">",
"(",
")",... | turns the clipboard into a list of tokens
each array list is a line, each string in the list is a token in the line
@param text
@return | [
"turns",
"the",
"clipboard",
"into",
"a",
"list",
"of",
"tokens",
"each",
"array",
"list",
"is",
"a",
"line",
"each",
"string",
"in",
"the",
"list",
"is",
"a",
"token",
"in",
"the",
"line"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/ngmf/ui/TableListener.java#L41-L61 |
hawtio/hawtio | hawtio-ide/src/main/java/io/hawt/ide/IdeFacade.java | IdeFacade.findInSourceFolders | protected String findInSourceFolders(File baseDir, String fileName) {
"""
Searches in this directory and in the source directories in src/main/* and src/test/* for the given file name path
@return the absolute file or null
"""
String answer = findInFolder(baseDir, fileName);
if (answer == nu... | java | protected String findInSourceFolders(File baseDir, String fileName) {
String answer = findInFolder(baseDir, fileName);
if (answer == null && baseDir.exists()) {
answer = findInChildFolders(new File(baseDir, "src/main"), fileName);
if (answer == null) {
answer = fi... | [
"protected",
"String",
"findInSourceFolders",
"(",
"File",
"baseDir",
",",
"String",
"fileName",
")",
"{",
"String",
"answer",
"=",
"findInFolder",
"(",
"baseDir",
",",
"fileName",
")",
";",
"if",
"(",
"answer",
"==",
"null",
"&&",
"baseDir",
".",
"exists",
... | Searches in this directory and in the source directories in src/main/* and src/test/* for the given file name path
@return the absolute file or null | [
"Searches",
"in",
"this",
"directory",
"and",
"in",
"the",
"source",
"directories",
"in",
"src",
"/",
"main",
"/",
"*",
"and",
"src",
"/",
"test",
"/",
"*",
"for",
"the",
"given",
"file",
"name",
"path"
] | train | https://github.com/hawtio/hawtio/blob/d8b1c8f246307c0313ba297a494106d0859f3ffd/hawtio-ide/src/main/java/io/hawt/ide/IdeFacade.java#L88-L97 |
Jasig/uPortal | uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/PositionManager.java | PositionManager.applyToNodes | static void applyToNodes(List<NodeInfo> order, Element compViewParent) {
"""
This method applies the ordering specified in the passed in order list to the child nodes of
the compViewParent. Nodes specified in the list but located elsewhere are pulled in.
"""
// first set up a bogus node to assist with... | java | static void applyToNodes(List<NodeInfo> order, Element compViewParent) {
// first set up a bogus node to assist with inserting
Node insertPoint = compViewParent.getOwnerDocument().createElement("bogus");
Node first = compViewParent.getFirstChild();
if (first != null) compViewParent.inse... | [
"static",
"void",
"applyToNodes",
"(",
"List",
"<",
"NodeInfo",
">",
"order",
",",
"Element",
"compViewParent",
")",
"{",
"// first set up a bogus node to assist with inserting",
"Node",
"insertPoint",
"=",
"compViewParent",
".",
"getOwnerDocument",
"(",
")",
".",
"cr... | This method applies the ordering specified in the passed in order list to the child nodes of
the compViewParent. Nodes specified in the list but located elsewhere are pulled in. | [
"This",
"method",
"applies",
"the",
"ordering",
"specified",
"in",
"the",
"passed",
"in",
"order",
"list",
"to",
"the",
"child",
"nodes",
"of",
"the",
"compViewParent",
".",
"Nodes",
"specified",
"in",
"the",
"list",
"but",
"located",
"elsewhere",
"are",
"pu... | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/PositionManager.java#L241-L254 |
JOML-CI/JOML | src/org/joml/Matrix3f.java | Matrix3f.setSkewSymmetric | public Matrix3f setSkewSymmetric(float a, float b, float c) {
"""
Set this matrix to a skew-symmetric matrix using the following layout:
<pre>
0, a, -b
-a, 0, c
b, -c, 0
</pre>
Reference: <a href="https://en.wikipedia.org/wiki/Skew-symmetric_matrix">https://en.wikipedia.org</a>
@param a
the value u... | java | public Matrix3f setSkewSymmetric(float a, float b, float c) {
m00 = m11 = m22 = 0;
m01 = -a;
m02 = b;
m10 = a;
m12 = -c;
m20 = -b;
m21 = c;
return this;
} | [
"public",
"Matrix3f",
"setSkewSymmetric",
"(",
"float",
"a",
",",
"float",
"b",
",",
"float",
"c",
")",
"{",
"m00",
"=",
"m11",
"=",
"m22",
"=",
"0",
";",
"m01",
"=",
"-",
"a",
";",
"m02",
"=",
"b",
";",
"m10",
"=",
"a",
";",
"m12",
"=",
"-",... | Set this matrix to a skew-symmetric matrix using the following layout:
<pre>
0, a, -b
-a, 0, c
b, -c, 0
</pre>
Reference: <a href="https://en.wikipedia.org/wiki/Skew-symmetric_matrix">https://en.wikipedia.org</a>
@param a
the value used for the matrix elements m01 and m10
@param b
the value used for the matrix el... | [
"Set",
"this",
"matrix",
"to",
"a",
"skew",
"-",
"symmetric",
"matrix",
"using",
"the",
"following",
"layout",
":",
"<pre",
">",
"0",
"a",
"-",
"b",
"-",
"a",
"0",
"c",
"b",
"-",
"c",
"0",
"<",
"/",
"pre",
">"
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3f.java#L3790-L3799 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/AoInterfaceCodeGen.java | AoInterfaceCodeGen.writeClassBody | @Override
public void writeClassBody(Definition def, Writer out) throws IOException {
"""
Output class
@param def definition
@param out Writer
@throws IOException ioException
"""
out.write("public interface " + getClassName(def));
if (def.isAdminObjectImplRaAssociation())
{
o... | java | @Override
public void writeClassBody(Definition def, Writer out) throws IOException
{
out.write("public interface " + getClassName(def));
if (def.isAdminObjectImplRaAssociation())
{
out.write(" extends Referenceable, Serializable");
}
writeLeftCurlyBracket(out, 0);
wri... | [
"@",
"Override",
"public",
"void",
"writeClassBody",
"(",
"Definition",
"def",
",",
"Writer",
"out",
")",
"throws",
"IOException",
"{",
"out",
".",
"write",
"(",
"\"public interface \"",
"+",
"getClassName",
"(",
"def",
")",
")",
";",
"if",
"(",
"def",
"."... | Output class
@param def definition
@param out Writer
@throws IOException ioException | [
"Output",
"class"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/AoInterfaceCodeGen.java#L87-L101 |
grails/grails-core | grails-core/src/main/groovy/grails/util/GrailsClassUtils.java | GrailsClassUtils.findPropertyNameForValue | public static String findPropertyNameForValue(Object target, Object obj) {
"""
Locates the name of a property for the given value on the target object using Groovy's meta APIs.
Note that this method uses the reference so the incorrect result could be returned for two properties
that refer to the same reference. ... | java | public static String findPropertyNameForValue(Object target, Object obj) {
MetaClass mc = GroovySystem.getMetaClassRegistry().getMetaClass(target.getClass());
List<MetaProperty> metaProperties = mc.getProperties();
for (MetaProperty metaProperty : metaProperties) {
if (isAssignableOr... | [
"public",
"static",
"String",
"findPropertyNameForValue",
"(",
"Object",
"target",
",",
"Object",
"obj",
")",
"{",
"MetaClass",
"mc",
"=",
"GroovySystem",
".",
"getMetaClassRegistry",
"(",
")",
".",
"getMetaClass",
"(",
"target",
".",
"getClass",
"(",
")",
")"... | Locates the name of a property for the given value on the target object using Groovy's meta APIs.
Note that this method uses the reference so the incorrect result could be returned for two properties
that refer to the same reference. Use with caution.
@param target The target
@param obj The property value
@return The ... | [
"Locates",
"the",
"name",
"of",
"a",
"property",
"for",
"the",
"given",
"value",
"on",
"the",
"target",
"object",
"using",
"Groovy",
"s",
"meta",
"APIs",
".",
"Note",
"that",
"this",
"method",
"uses",
"the",
"reference",
"so",
"the",
"incorrect",
"result",... | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L848-L860 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/ZoneRegion.java | ZoneRegion.ofId | static ZoneRegion ofId(String zoneId, boolean checkAvailable) {
"""
Obtains an instance of {@code ZoneId} from an identifier.
@param zoneId the time-zone ID, not null
@param checkAvailable whether to check if the zone ID is available
@return the zone ID, not null
@throws DateTimeException if the ID format ... | java | static ZoneRegion ofId(String zoneId, boolean checkAvailable) {
Jdk8Methods.requireNonNull(zoneId, "zoneId");
if (zoneId.length() < 2 || PATTERN.matcher(zoneId).matches() == false) {
throw new DateTimeException("Invalid ID for region-based ZoneId, invalid format: " + zoneId);
}
... | [
"static",
"ZoneRegion",
"ofId",
"(",
"String",
"zoneId",
",",
"boolean",
"checkAvailable",
")",
"{",
"Jdk8Methods",
".",
"requireNonNull",
"(",
"zoneId",
",",
"\"zoneId\"",
")",
";",
"if",
"(",
"zoneId",
".",
"length",
"(",
")",
"<",
"2",
"||",
"PATTERN",
... | Obtains an instance of {@code ZoneId} from an identifier.
@param zoneId the time-zone ID, not null
@param checkAvailable whether to check if the zone ID is available
@return the zone ID, not null
@throws DateTimeException if the ID format is invalid
@throws DateTimeException if checking availability and the ID canno... | [
"Obtains",
"an",
"instance",
"of",
"{",
"@code",
"ZoneId",
"}",
"from",
"an",
"identifier",
"."
] | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/ZoneRegion.java#L135-L153 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/parametrics/onesample/NormalOneSample.java | NormalOneSample.checkCriticalValue | private static boolean checkCriticalValue(double score, boolean is_twoTailed, double aLevel) {
"""
Checks the Critical Value to determine if the Hypothesis should be rejected
@param score
@param is_twoTailed
@param aLevel
@return
"""
double probability = ContinuousDistributions.gaussCdf(score);
... | java | private static boolean checkCriticalValue(double score, boolean is_twoTailed, double aLevel) {
double probability = ContinuousDistributions.gaussCdf(score);
boolean rejectH0=false;
double a=aLevel;
if(is_twoTailed) { //if to tailed test then split the statistical signif... | [
"private",
"static",
"boolean",
"checkCriticalValue",
"(",
"double",
"score",
",",
"boolean",
"is_twoTailed",
",",
"double",
"aLevel",
")",
"{",
"double",
"probability",
"=",
"ContinuousDistributions",
".",
"gaussCdf",
"(",
"score",
")",
";",
"boolean",
"rejectH0"... | Checks the Critical Value to determine if the Hypothesis should be rejected
@param score
@param is_twoTailed
@param aLevel
@return | [
"Checks",
"the",
"Critical",
"Value",
"to",
"determine",
"if",
"the",
"Hypothesis",
"should",
"be",
"rejected"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/parametrics/onesample/NormalOneSample.java#L106-L120 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/AccountsImpl.java | AccountsImpl.listNodeAgentSkusNextAsync | public ServiceFuture<List<NodeAgentSku>> listNodeAgentSkusNextAsync(final String nextPageLink, final AccountListNodeAgentSkusNextOptions accountListNodeAgentSkusNextOptions, final ServiceFuture<List<NodeAgentSku>> serviceFuture, final ListOperationCallback<NodeAgentSku> serviceCallback) {
"""
Lists all node agent ... | java | public ServiceFuture<List<NodeAgentSku>> listNodeAgentSkusNextAsync(final String nextPageLink, final AccountListNodeAgentSkusNextOptions accountListNodeAgentSkusNextOptions, final ServiceFuture<List<NodeAgentSku>> serviceFuture, final ListOperationCallback<NodeAgentSku> serviceCallback) {
return AzureServiceFut... | [
"public",
"ServiceFuture",
"<",
"List",
"<",
"NodeAgentSku",
">",
">",
"listNodeAgentSkusNextAsync",
"(",
"final",
"String",
"nextPageLink",
",",
"final",
"AccountListNodeAgentSkusNextOptions",
"accountListNodeAgentSkusNextOptions",
",",
"final",
"ServiceFuture",
"<",
"List... | Lists all node agent SKUs supported by the Azure Batch service.
@param nextPageLink The NextLink from the previous successful call to List operation.
@param accountListNodeAgentSkusNextOptions Additional parameters for the operation
@param serviceFuture the ServiceFuture object tracking the Retrofit calls
@param servi... | [
"Lists",
"all",
"node",
"agent",
"SKUs",
"supported",
"by",
"the",
"Azure",
"Batch",
"service",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/AccountsImpl.java#L779-L789 |
dustin/java-memcached-client | src/main/java/net/spy/memcached/MemcachedConnection.java | MemcachedConnection.addOperations | public void addOperations(final Map<MemcachedNode, Operation> ops) {
"""
Enqueue the given list of operations on each handling node.
@param ops the operations for each node.
"""
for (Map.Entry<MemcachedNode, Operation> me : ops.entrySet()) {
addOperation(me.getKey(), me.getValue());
}
} | java | public void addOperations(final Map<MemcachedNode, Operation> ops) {
for (Map.Entry<MemcachedNode, Operation> me : ops.entrySet()) {
addOperation(me.getKey(), me.getValue());
}
} | [
"public",
"void",
"addOperations",
"(",
"final",
"Map",
"<",
"MemcachedNode",
",",
"Operation",
">",
"ops",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"MemcachedNode",
",",
"Operation",
">",
"me",
":",
"ops",
".",
"entrySet",
"(",
")",
")",
"{",
... | Enqueue the given list of operations on each handling node.
@param ops the operations for each node. | [
"Enqueue",
"the",
"given",
"list",
"of",
"operations",
"on",
"each",
"handling",
"node",
"."
] | train | https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/MemcachedConnection.java#L1295-L1299 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/idemix/IdemixUtils.java | IdemixUtils.modAdd | static BIG modAdd(BIG a, BIG b, BIG m) {
"""
Takes input BIGs a, b, m and returns a+b modulo m
@param a the first BIG to add
@param b the second BIG to add
@param m the modulus
@return Returns a+b (mod m)
"""
BIG c = a.plus(b);
c.mod(m);
return c;
} | java | static BIG modAdd(BIG a, BIG b, BIG m) {
BIG c = a.plus(b);
c.mod(m);
return c;
} | [
"static",
"BIG",
"modAdd",
"(",
"BIG",
"a",
",",
"BIG",
"b",
",",
"BIG",
"m",
")",
"{",
"BIG",
"c",
"=",
"a",
".",
"plus",
"(",
"b",
")",
";",
"c",
".",
"mod",
"(",
"m",
")",
";",
"return",
"c",
";",
"}"
] | Takes input BIGs a, b, m and returns a+b modulo m
@param a the first BIG to add
@param b the second BIG to add
@param m the modulus
@return Returns a+b (mod m) | [
"Takes",
"input",
"BIGs",
"a",
"b",
"m",
"and",
"returns",
"a",
"+",
"b",
"modulo",
"m"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/idemix/IdemixUtils.java#L258-L262 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java | CPInstancePersistenceImpl.countByLtD_S | @Override
public int countByLtD_S(Date displayDate, int status) {
"""
Returns the number of cp instances where displayDate < ? and status = ?.
@param displayDate the display date
@param status the status
@return the number of matching cp instances
"""
FinderPath finderPath = FINDER_PATH_WITH... | java | @Override
public int countByLtD_S(Date displayDate, int status) {
FinderPath finderPath = FINDER_PATH_WITH_PAGINATION_COUNT_BY_LTD_S;
Object[] finderArgs = new Object[] { _getTime(displayDate), status };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
StringBu... | [
"@",
"Override",
"public",
"int",
"countByLtD_S",
"(",
"Date",
"displayDate",
",",
"int",
"status",
")",
"{",
"FinderPath",
"finderPath",
"=",
"FINDER_PATH_WITH_PAGINATION_COUNT_BY_LTD_S",
";",
"Object",
"[",
"]",
"finderArgs",
"=",
"new",
"Object",
"[",
"]",
"{... | Returns the number of cp instances where displayDate < ? and status = ?.
@param displayDate the display date
@param status the status
@return the number of matching cp instances | [
"Returns",
"the",
"number",
"of",
"cp",
"instances",
"where",
"displayDate",
"<",
";",
"?",
";",
"and",
"status",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java#L6134-L6192 |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/PhoneIntents.java | PhoneIntents.newCallNumberIntent | public static Intent newCallNumberIntent(String phoneNumber) {
"""
Creates an intent that will immediately dispatch a call to the given number. NOTE that unlike
{@link #newDialNumberIntent(String)}, this intent requires the {@link android.Manifest.permission#CALL_PHONE}
permission to be set.
@param phoneNumbe... | java | public static Intent newCallNumberIntent(String phoneNumber) {
final Intent intent;
if (phoneNumber == null || phoneNumber.trim().length() <= 0) {
intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:"));
} else {
intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:"... | [
"public",
"static",
"Intent",
"newCallNumberIntent",
"(",
"String",
"phoneNumber",
")",
"{",
"final",
"Intent",
"intent",
";",
"if",
"(",
"phoneNumber",
"==",
"null",
"||",
"phoneNumber",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
"<=",
"0",
")",
"{... | Creates an intent that will immediately dispatch a call to the given number. NOTE that unlike
{@link #newDialNumberIntent(String)}, this intent requires the {@link android.Manifest.permission#CALL_PHONE}
permission to be set.
@param phoneNumber the number to call
@return the intent | [
"Creates",
"an",
"intent",
"that",
"will",
"immediately",
"dispatch",
"a",
"call",
"to",
"the",
"given",
"number",
".",
"NOTE",
"that",
"unlike",
"{",
"@link",
"#newDialNumberIntent",
"(",
"String",
")",
"}",
"this",
"intent",
"requires",
"the",
"{",
"@link"... | train | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/PhoneIntents.java#L143-L151 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java | EscapedFunctions2.sqllog10 | public static void sqllog10(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
"""
log10 to log translation
@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens
"""
singleArgumentFunctionCall(buf, "log(", "log10... | java | public static void sqllog10(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
singleArgumentFunctionCall(buf, "log(", "log10", parsedArgs);
} | [
"public",
"static",
"void",
"sqllog10",
"(",
"StringBuilder",
"buf",
",",
"List",
"<",
"?",
"extends",
"CharSequence",
">",
"parsedArgs",
")",
"throws",
"SQLException",
"{",
"singleArgumentFunctionCall",
"(",
"buf",
",",
"\"log(\"",
",",
"\"log10\"",
",",
"parse... | log10 to log translation
@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens | [
"log10",
"to",
"log",
"translation"
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L109-L111 |
hdbeukel/james-core | src/main/java/org/jamesframework/core/subset/neigh/adv/MultiSwapNeighbourhood.java | MultiSwapNeighbourhood.maxSwaps | private int maxSwaps(Set<Integer> addCandidates, Set<Integer> deleteCandidates) {
"""
Computes the maximum number of swaps that can be performed, given the set of candidate IDs
for addition and deletion. Takes into account the desired maximum number of swaps \(k\) specified
at construction (if set). The maximum ... | java | private int maxSwaps(Set<Integer> addCandidates, Set<Integer> deleteCandidates){
return Math.min(maxSwaps, Math.min(addCandidates.size(), deleteCandidates.size()));
} | [
"private",
"int",
"maxSwaps",
"(",
"Set",
"<",
"Integer",
">",
"addCandidates",
",",
"Set",
"<",
"Integer",
">",
"deleteCandidates",
")",
"{",
"return",
"Math",
".",
"min",
"(",
"maxSwaps",
",",
"Math",
".",
"min",
"(",
"addCandidates",
".",
"size",
"(",... | Computes the maximum number of swaps that can be performed, given the set of candidate IDs
for addition and deletion. Takes into account the desired maximum number of swaps \(k\) specified
at construction (if set). The maximum number of swaps is equal to the minimum of \(k\) and the
size of both candidate sets. Thus, i... | [
"Computes",
"the",
"maximum",
"number",
"of",
"swaps",
"that",
"can",
"be",
"performed",
"given",
"the",
"set",
"of",
"candidate",
"IDs",
"for",
"addition",
"and",
"deletion",
".",
"Takes",
"into",
"account",
"the",
"desired",
"maximum",
"number",
"of",
"swa... | train | https://github.com/hdbeukel/james-core/blob/4e85c20c142902373e5b5e8b5d12a2558650f66d/src/main/java/org/jamesframework/core/subset/neigh/adv/MultiSwapNeighbourhood.java#L215-L217 |
otto-de/edison-hal | src/main/java/de/otto/edison/hal/HalRepresentation.java | HalRepresentation.withEmbedded | protected HalRepresentation withEmbedded(final String rel, final List<? extends HalRepresentation> embeddedItems) {
"""
Adds embedded items for a link-relation type to the HalRepresentation.
<p>
If {@code rel} is already present, it is replaced by the new embedded items.
</p>
@param rel the link-relation typ... | java | protected HalRepresentation withEmbedded(final String rel, final List<? extends HalRepresentation> embeddedItems) {
embedded = copyOf(embedded).with(rel, embeddedItems).using(curies).build();
return this;
} | [
"protected",
"HalRepresentation",
"withEmbedded",
"(",
"final",
"String",
"rel",
",",
"final",
"List",
"<",
"?",
"extends",
"HalRepresentation",
">",
"embeddedItems",
")",
"{",
"embedded",
"=",
"copyOf",
"(",
"embedded",
")",
".",
"with",
"(",
"rel",
",",
"e... | Adds embedded items for a link-relation type to the HalRepresentation.
<p>
If {@code rel} is already present, it is replaced by the new embedded items.
</p>
@param rel the link-relation type of the embedded items that are added or replaced
@param embeddedItems the new values for the specified link-relation type
@retur... | [
"Adds",
"embedded",
"items",
"for",
"a",
"link",
"-",
"relation",
"type",
"to",
"the",
"HalRepresentation",
".",
"<p",
">",
"If",
"{",
"@code",
"rel",
"}",
"is",
"already",
"present",
"it",
"is",
"replaced",
"by",
"the",
"new",
"embedded",
"items",
".",
... | train | https://github.com/otto-de/edison-hal/blob/1582d2b49d1f0d9103e03bf742f18afa9d166992/src/main/java/de/otto/edison/hal/HalRepresentation.java#L206-L209 |
logic-ng/LogicNG | src/main/java/org/logicng/backbones/BackboneGeneration.java | BackboneGeneration.computePositive | public static Backbone computePositive(final Formula formula) {
"""
Computes the positive backbone variables for a given formula.
@param formula the given formula
@return the positive backbone or {@code null} if the formula is UNSAT
"""
return compute(formula, formula.variables(), BackboneType.ONLY_P... | java | public static Backbone computePositive(final Formula formula) {
return compute(formula, formula.variables(), BackboneType.ONLY_POSITIVE);
} | [
"public",
"static",
"Backbone",
"computePositive",
"(",
"final",
"Formula",
"formula",
")",
"{",
"return",
"compute",
"(",
"formula",
",",
"formula",
".",
"variables",
"(",
")",
",",
"BackboneType",
".",
"ONLY_POSITIVE",
")",
";",
"}"
] | Computes the positive backbone variables for a given formula.
@param formula the given formula
@return the positive backbone or {@code null} if the formula is UNSAT | [
"Computes",
"the",
"positive",
"backbone",
"variables",
"for",
"a",
"given",
"formula",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/backbones/BackboneGeneration.java#L192-L194 |
zaproxy/zaproxy | src/org/zaproxy/zap/utils/ApiUtils.java | ApiUtils.getOptionalStringParam | public static String getOptionalStringParam(JSONObject params, String paramName) {
"""
Gets an optional string param, returning null if the parameter was not found.
@param params the params
@param paramName the param name
@return the optional string param
"""
if (params.containsKey(paramName)) {
retu... | java | public static String getOptionalStringParam(JSONObject params, String paramName) {
if (params.containsKey(paramName)) {
return params.getString(paramName);
}
return null;
} | [
"public",
"static",
"String",
"getOptionalStringParam",
"(",
"JSONObject",
"params",
",",
"String",
"paramName",
")",
"{",
"if",
"(",
"params",
".",
"containsKey",
"(",
"paramName",
")",
")",
"{",
"return",
"params",
".",
"getString",
"(",
"paramName",
")",
... | Gets an optional string param, returning null if the parameter was not found.
@param params the params
@param paramName the param name
@return the optional string param | [
"Gets",
"an",
"optional",
"string",
"param",
"returning",
"null",
"if",
"the",
"parameter",
"was",
"not",
"found",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/utils/ApiUtils.java#L88-L93 |
sebastiangraf/jSCSI | bundles/commons/src/main/java/org/jscsi/parser/scsi/SCSICommandParser.java | SCSICommandParser.setCommandDescriptorBlock | public final void setCommandDescriptorBlock (final ByteBuffer newCDB) {
"""
Sets the new Command Descriptor Block.
@param newCDB The new Command Descriptor Block.
"""
if (newCDB.limit() - newCDB.position() > CDB_SIZE) { throw new IllegalArgumentException("Buffer cannot be longer than 16 bytes, beca... | java | public final void setCommandDescriptorBlock (final ByteBuffer newCDB) {
if (newCDB.limit() - newCDB.position() > CDB_SIZE) { throw new IllegalArgumentException("Buffer cannot be longer than 16 bytes, because AHS-support is not implemented."); }
commandDescriptorBlock = newCDB;
} | [
"public",
"final",
"void",
"setCommandDescriptorBlock",
"(",
"final",
"ByteBuffer",
"newCDB",
")",
"{",
"if",
"(",
"newCDB",
".",
"limit",
"(",
")",
"-",
"newCDB",
".",
"position",
"(",
")",
">",
"CDB_SIZE",
")",
"{",
"throw",
"new",
"IllegalArgumentExceptio... | Sets the new Command Descriptor Block.
@param newCDB The new Command Descriptor Block. | [
"Sets",
"the",
"new",
"Command",
"Descriptor",
"Block",
"."
] | train | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/scsi/SCSICommandParser.java#L355-L359 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAEMPool.java | JPAEMPool.getEntityManager | public EntityManager getEntityManager(boolean jtaTxExists, boolean unsynchronized) {
"""
Returns an EntityManager instance from the pool, or a newly created
instance if the pool is empty. <p>
If a global JTA transaction is present, the EntityManager will have
joined that transaction. <p>
@param jtaTxExists... | java | public EntityManager getEntityManager(boolean jtaTxExists, boolean unsynchronized)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.entry(tc, "getEntityManager : [" + ivPoolSize + "] tx = " +
jtaTxExists + " unsynchronized = " + unsynchronized);
... | [
"public",
"EntityManager",
"getEntityManager",
"(",
"boolean",
"jtaTxExists",
",",
"boolean",
"unsynchronized",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"... | Returns an EntityManager instance from the pool, or a newly created
instance if the pool is empty. <p>
If a global JTA transaction is present, the EntityManager will have
joined that transaction. <p>
@param jtaTxExists
true if a global jta transaction exists; otherwise false.
@param unsynchronized
true if Synchroniza... | [
"Returns",
"an",
"EntityManager",
"instance",
"from",
"the",
"pool",
"or",
"a",
"newly",
"created",
"instance",
"if",
"the",
"pool",
"is",
"empty",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JPAEMPool.java#L133-L162 |
google/gson | gson/src/main/java/com/google/gson/JsonParser.java | JsonParser.parseReader | public static JsonElement parseReader(JsonReader reader)
throws JsonIOException, JsonSyntaxException {
"""
Returns the next value from the JSON stream as a parse tree.
@throws JsonParseException if there is an IOException or if the specified
text is not valid JSON
"""
boolean lenient = reader.i... | java | public static JsonElement parseReader(JsonReader reader)
throws JsonIOException, JsonSyntaxException {
boolean lenient = reader.isLenient();
reader.setLenient(true);
try {
return Streams.parse(reader);
} catch (StackOverflowError e) {
throw new JsonParseException("Failed parsing... | [
"public",
"static",
"JsonElement",
"parseReader",
"(",
"JsonReader",
"reader",
")",
"throws",
"JsonIOException",
",",
"JsonSyntaxException",
"{",
"boolean",
"lenient",
"=",
"reader",
".",
"isLenient",
"(",
")",
";",
"reader",
".",
"setLenient",
"(",
"true",
")",... | Returns the next value from the JSON stream as a parse tree.
@throws JsonParseException if there is an IOException or if the specified
text is not valid JSON | [
"Returns",
"the",
"next",
"value",
"from",
"the",
"JSON",
"stream",
"as",
"a",
"parse",
"tree",
"."
] | train | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/JsonParser.java#L80-L93 |
petergeneric/stdlib | stdlib/src/main/java/com/peterphi/std/system/exec/Exec.java | Exec.appAs | public static Execed appAs(String as, String... command) throws IOException {
"""
Runs a command, optionally executing as a different user (eg root)
@param as
@param command
@return
@throws IOException
"""
return appAs(as, Arrays.asList(command));
} | java | public static Execed appAs(String as, String... command) throws IOException
{
return appAs(as, Arrays.asList(command));
} | [
"public",
"static",
"Execed",
"appAs",
"(",
"String",
"as",
",",
"String",
"...",
"command",
")",
"throws",
"IOException",
"{",
"return",
"appAs",
"(",
"as",
",",
"Arrays",
".",
"asList",
"(",
"command",
")",
")",
";",
"}"
] | Runs a command, optionally executing as a different user (eg root)
@param as
@param command
@return
@throws IOException | [
"Runs",
"a",
"command",
"optionally",
"executing",
"as",
"a",
"different",
"user",
"(",
"eg",
"root",
")"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/system/exec/Exec.java#L389-L392 |
mangstadt/biweekly | src/main/java/biweekly/component/ICalComponent.java | ICalComponent.removeComponents | public <T extends ICalComponent> List<T> removeComponents(Class<T> clazz) {
"""
Removes all sub-components of the given class from this component.
@param clazz the class of the components to remove (e.g. "VEvent.class")
@param <T> the component class
@return the removed components (this list is immutable)
"... | java | public <T extends ICalComponent> List<T> removeComponents(Class<T> clazz) {
List<ICalComponent> removed = components.removeAll(clazz);
return castList(removed, clazz);
} | [
"public",
"<",
"T",
"extends",
"ICalComponent",
">",
"List",
"<",
"T",
">",
"removeComponents",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"List",
"<",
"ICalComponent",
">",
"removed",
"=",
"components",
".",
"removeAll",
"(",
"clazz",
")",
";",
"... | Removes all sub-components of the given class from this component.
@param clazz the class of the components to remove (e.g. "VEvent.class")
@param <T> the component class
@return the removed components (this list is immutable) | [
"Removes",
"all",
"sub",
"-",
"components",
"of",
"the",
"given",
"class",
"from",
"this",
"component",
"."
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L175-L178 |
datumbox/datumbox-framework | datumbox-framework-common/src/main/java/com/datumbox/framework/common/storage/abstracts/AbstractFileStorageEngine.java | AbstractFileStorageEngine.moveDirectory | protected boolean moveDirectory(Path src, Path target) throws IOException {
"""
Moves a directory in the target location.
@param src
@param target
@return
@throws IOException
"""
if(Files.exists(src)) {
createDirectoryIfNotExists(target.getParent());
deleteDirectory(target... | java | protected boolean moveDirectory(Path src, Path target) throws IOException {
if(Files.exists(src)) {
createDirectoryIfNotExists(target.getParent());
deleteDirectory(target, false);
Files.move(src, target);
cleanEmptyParentDirectory(src.getParent());
ret... | [
"protected",
"boolean",
"moveDirectory",
"(",
"Path",
"src",
",",
"Path",
"target",
")",
"throws",
"IOException",
"{",
"if",
"(",
"Files",
".",
"exists",
"(",
"src",
")",
")",
"{",
"createDirectoryIfNotExists",
"(",
"target",
".",
"getParent",
"(",
")",
")... | Moves a directory in the target location.
@param src
@param target
@return
@throws IOException | [
"Moves",
"a",
"directory",
"in",
"the",
"target",
"location",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-common/src/main/java/com/datumbox/framework/common/storage/abstracts/AbstractFileStorageEngine.java#L143-L154 |
LearnLib/automatalib | commons/util/src/main/java/net/automatalib/commons/util/comparison/CmpUtil.java | CmpUtil.lexCompare | public static <U> int lexCompare(Iterable<? extends U> o1, Iterable<? extends U> o2, Comparator<U> elemComparator) {
"""
Lexicographically compares two {@link Iterable}s. Comparison of the elements is done using the specified
comparator.
@param o1
the first iterable.
@param o2
the second iterable.
@param e... | java | public static <U> int lexCompare(Iterable<? extends U> o1, Iterable<? extends U> o2, Comparator<U> elemComparator) {
Iterator<? extends U> it1 = o1.iterator(), it2 = o2.iterator();
while (it1.hasNext() && it2.hasNext()) {
int cmp = elemComparator.compare(it1.next(), it2.next());
... | [
"public",
"static",
"<",
"U",
">",
"int",
"lexCompare",
"(",
"Iterable",
"<",
"?",
"extends",
"U",
">",
"o1",
",",
"Iterable",
"<",
"?",
"extends",
"U",
">",
"o2",
",",
"Comparator",
"<",
"U",
">",
"elemComparator",
")",
"{",
"Iterator",
"<",
"?",
... | Lexicographically compares two {@link Iterable}s. Comparison of the elements is done using the specified
comparator.
@param o1
the first iterable.
@param o2
the second iterable.
@param elemComparator
the comparator.
@return <code>< 0</code> iff o1 is lexicographically smaller, <code>0</code> if o1 equals o2 and <c... | [
"Lexicographically",
"compares",
"two",
"{",
"@link",
"Iterable",
"}",
"s",
".",
"Comparison",
"of",
"the",
"elements",
"is",
"done",
"using",
"the",
"specified",
"comparator",
"."
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/commons/util/src/main/java/net/automatalib/commons/util/comparison/CmpUtil.java#L103-L119 |
JOML-CI/JOML | src/org/joml/Intersectiond.java | Intersectiond.intersectRayCircle | public static boolean intersectRayCircle(Vector2dc origin, Vector2dc dir, Vector2dc center, double radiusSquared, Vector2d result) {
"""
Test whether the ray with the given <code>origin</code> and direction <code>dir</code>
intersects the circle with the given <code>center</code> and square radius <code>radiusSqu... | java | public static boolean intersectRayCircle(Vector2dc origin, Vector2dc dir, Vector2dc center, double radiusSquared, Vector2d result) {
return intersectRayCircle(origin.x(), origin.y(), dir.x(), dir.y(), center.x(), center.y(), radiusSquared, result);
} | [
"public",
"static",
"boolean",
"intersectRayCircle",
"(",
"Vector2dc",
"origin",
",",
"Vector2dc",
"dir",
",",
"Vector2dc",
"center",
",",
"double",
"radiusSquared",
",",
"Vector2d",
"result",
")",
"{",
"return",
"intersectRayCircle",
"(",
"origin",
".",
"x",
"(... | Test whether the ray with the given <code>origin</code> and direction <code>dir</code>
intersects the circle 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
and far) o... | [
"Test",
"whether",
"the",
"ray",
"with",
"the",
"given",
"<code",
">",
"origin<",
"/",
"code",
">",
"and",
"direction",
"<code",
">",
"dir<",
"/",
"code",
">",
"intersects",
"the",
"circle",
"with",
"the",
"given",
"<code",
">",
"center<",
"/",
"code",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectiond.java#L4267-L4269 |
haifengl/smile | nlp/src/main/java/smile/nlp/collocation/BigramCollocationFinder.java | BigramCollocationFinder.likelihoodRatio | private double likelihoodRatio(int c1, int c2, int c12, long N) {
"""
Returns the likelihood ratio test statistic -2 log λ
@param c1 the number of occurrences of w1.
@param c2 the number of occurrences of w2.
@param c12 the number of occurrences of w1 w2.
@param N the number of tokens in the corpus.
... | java | private double likelihoodRatio(int c1, int c2, int c12, long N) {
double p = (double) c2 / N;
double p1 = (double) c12 / c1;
double p2 = (double) (c2 - c12) / (N - c1);
double logLambda = logL(c12, c1, p) + logL(c2-c12, N-c1, p) - logL(c12, c1, p1) - logL(c2-c12, N-c1, p2);
retu... | [
"private",
"double",
"likelihoodRatio",
"(",
"int",
"c1",
",",
"int",
"c2",
",",
"int",
"c12",
",",
"long",
"N",
")",
"{",
"double",
"p",
"=",
"(",
"double",
")",
"c2",
"/",
"N",
";",
"double",
"p1",
"=",
"(",
"double",
")",
"c12",
"/",
"c1",
"... | Returns the likelihood ratio test statistic -2 log λ
@param c1 the number of occurrences of w1.
@param c2 the number of occurrences of w2.
@param c12 the number of occurrences of w1 w2.
@param N the number of tokens in the corpus. | [
"Returns",
"the",
"likelihood",
"ratio",
"test",
"statistic",
"-",
"2",
"log",
"&lambda",
";"
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/nlp/src/main/java/smile/nlp/collocation/BigramCollocationFinder.java#L151-L158 |
mgledi/DRUMS | src/main/java/com/unister/semweb/drums/storable/GeneralStorable.java | GeneralStorable.setKey | public void setKey(int index, byte[] key) throws IOException {
"""
Sets the key belonging to the given field.
@param index
the index of the requested field
@param key
the key to set
@throws IOException
"""
if (index >= structure.keySizes.size()) {
throw new IOException("Index " + ind... | java | public void setKey(int index, byte[] key) throws IOException {
if (index >= structure.keySizes.size()) {
throw new IOException("Index " + index + " is out of range.");
}
int length = structure.keySizes.get(index);
if (key.length != length) {
throw new IOException(... | [
"public",
"void",
"setKey",
"(",
"int",
"index",
",",
"byte",
"[",
"]",
"key",
")",
"throws",
"IOException",
"{",
"if",
"(",
"index",
">=",
"structure",
".",
"keySizes",
".",
"size",
"(",
")",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Index \"",... | Sets the key belonging to the given field.
@param index
the index of the requested field
@param key
the key to set
@throws IOException | [
"Sets",
"the",
"key",
"belonging",
"to",
"the",
"given",
"field",
"."
] | train | https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/storable/GeneralStorable.java#L537-L547 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/IssuesApi.java | IssuesApi.deleteIssue | public void deleteIssue(Object projectIdOrPath, Integer issueIid) throws GitLabApiException {
"""
Delete an issue.
<pre><code>GitLab Endpoint: DELETE /projects/:id/issues/:issue_iid</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
@pa... | java | public void deleteIssue(Object projectIdOrPath, Integer issueIid) throws GitLabApiException {
if (issueIid == null) {
throw new RuntimeException("issue IID cannot be null");
}
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CO... | [
"public",
"void",
"deleteIssue",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"issueIid",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"issueIid",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"issue IID cannot be null\"",
")",
";... | Delete an issue.
<pre><code>GitLab Endpoint: DELETE /projects/:id/issues/:issue_iid</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
@param issueIid the internal ID of a project's issue
@throws GitLabApiException if any exception occurs | [
"Delete",
"an",
"issue",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/IssuesApi.java#L440-L448 |
aws/aws-sdk-java | aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/GetRouteResponseResult.java | GetRouteResponseResult.withResponseModels | public GetRouteResponseResult withResponseModels(java.util.Map<String, String> responseModels) {
"""
<p>
Represents the response models of a route response.
</p>
@param responseModels
Represents the response models of a route response.
@return Returns a reference to this object so that method calls can be c... | java | public GetRouteResponseResult withResponseModels(java.util.Map<String, String> responseModels) {
setResponseModels(responseModels);
return this;
} | [
"public",
"GetRouteResponseResult",
"withResponseModels",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"responseModels",
")",
"{",
"setResponseModels",
"(",
"responseModels",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Represents the response models of a route response.
</p>
@param responseModels
Represents the response models of a route response.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Represents",
"the",
"response",
"models",
"of",
"a",
"route",
"response",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/GetRouteResponseResult.java#L127-L130 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStreamUtils.java | DataStreamUtils.collect | public static <OUT> Iterator<OUT> collect(DataStream<OUT> stream) throws IOException {
"""
Returns an iterator to iterate over the elements of the DataStream.
@return The iterator
"""
TypeSerializer<OUT> serializer = stream.getType().createSerializer(
stream.getExecutionEnvironment().getConfig());
S... | java | public static <OUT> Iterator<OUT> collect(DataStream<OUT> stream) throws IOException {
TypeSerializer<OUT> serializer = stream.getType().createSerializer(
stream.getExecutionEnvironment().getConfig());
SocketStreamIterator<OUT> iter = new SocketStreamIterator<OUT>(serializer);
//Find out what IP of us shou... | [
"public",
"static",
"<",
"OUT",
">",
"Iterator",
"<",
"OUT",
">",
"collect",
"(",
"DataStream",
"<",
"OUT",
">",
"stream",
")",
"throws",
"IOException",
"{",
"TypeSerializer",
"<",
"OUT",
">",
"serializer",
"=",
"stream",
".",
"getType",
"(",
")",
".",
... | Returns an iterator to iterate over the elements of the DataStream.
@return The iterator | [
"Returns",
"an",
"iterator",
"to",
"iterate",
"over",
"the",
"elements",
"of",
"the",
"DataStream",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStreamUtils.java#L50-L88 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/WildcardImport.java | WildcardImport.qualifiedNameFix | private static void qualifiedNameFix(
final SuggestedFix.Builder fix, final Symbol owner, VisitorState state) {
"""
Add an import for {@code owner}, and qualify all on demand imported references to members of
owner by owner's simple name.
"""
fix.addImport(owner.getQualifiedName().toString());
f... | java | private static void qualifiedNameFix(
final SuggestedFix.Builder fix, final Symbol owner, VisitorState state) {
fix.addImport(owner.getQualifiedName().toString());
final JCCompilationUnit unit = (JCCompilationUnit) state.getPath().getCompilationUnit();
new TreePathScanner<Void, Void>() {
@Overri... | [
"private",
"static",
"void",
"qualifiedNameFix",
"(",
"final",
"SuggestedFix",
".",
"Builder",
"fix",
",",
"final",
"Symbol",
"owner",
",",
"VisitorState",
"state",
")",
"{",
"fix",
".",
"addImport",
"(",
"owner",
".",
"getQualifiedName",
"(",
")",
".",
"toS... | Add an import for {@code owner}, and qualify all on demand imported references to members of
owner by owner's simple name. | [
"Add",
"an",
"import",
"for",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/WildcardImport.java#L222-L246 |
WiQuery/wiquery | wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java | Tabs.setAjaxActivateEvent | public Tabs setAjaxActivateEvent(ITabsAjaxEvent activateEvent) {
"""
Sets the call-back for the AJAX activate event.
@param activateEvent
The ITabsAjaxEvent.
"""
this.ajaxEvents.put(TabEvent.activate, activateEvent);
setActivateEvent(new TabsAjaxJsScopeUiEvent(this, TabEvent.activate));
return this;
... | java | public Tabs setAjaxActivateEvent(ITabsAjaxEvent activateEvent)
{
this.ajaxEvents.put(TabEvent.activate, activateEvent);
setActivateEvent(new TabsAjaxJsScopeUiEvent(this, TabEvent.activate));
return this;
} | [
"public",
"Tabs",
"setAjaxActivateEvent",
"(",
"ITabsAjaxEvent",
"activateEvent",
")",
"{",
"this",
".",
"ajaxEvents",
".",
"put",
"(",
"TabEvent",
".",
"activate",
",",
"activateEvent",
")",
";",
"setActivateEvent",
"(",
"new",
"TabsAjaxJsScopeUiEvent",
"(",
"thi... | Sets the call-back for the AJAX activate event.
@param activateEvent
The ITabsAjaxEvent. | [
"Sets",
"the",
"call",
"-",
"back",
"for",
"the",
"AJAX",
"activate",
"event",
"."
] | train | https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java#L654-L659 |
qatools/properties | src/main/java/ru/qatools/properties/PropertyLoader.java | PropertyLoader.setValueToField | protected void setValueToField(Field field, Object bean, Object value) {
"""
Set given value to specified field of given object.
@throws PropertyLoaderException if some exceptions occurs during reflection calls.
@see Field#setAccessible(boolean)
@see Field#set(Object, Object)
"""
try {
... | java | protected void setValueToField(Field field, Object bean, Object value) {
try {
field.setAccessible(true);
field.set(bean, value);
} catch (Exception e) {
throw new PropertyLoaderException(
String.format("Can not set bean <%s> field <%s> value", bea... | [
"protected",
"void",
"setValueToField",
"(",
"Field",
"field",
",",
"Object",
"bean",
",",
"Object",
"value",
")",
"{",
"try",
"{",
"field",
".",
"setAccessible",
"(",
"true",
")",
";",
"field",
".",
"set",
"(",
"bean",
",",
"value",
")",
";",
"}",
"... | Set given value to specified field of given object.
@throws PropertyLoaderException if some exceptions occurs during reflection calls.
@see Field#setAccessible(boolean)
@see Field#set(Object, Object) | [
"Set",
"given",
"value",
"to",
"specified",
"field",
"of",
"given",
"object",
"."
] | train | https://github.com/qatools/properties/blob/ae50b460a6bb4fcb21afe888b2e86a7613cd2115/src/main/java/ru/qatools/properties/PropertyLoader.java#L104-L113 |
Azure/azure-sdk-for-java | resources/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/resources/v2016_09_01/implementation/ResourceGroupsInner.java | ResourceGroupsInner.listAsync | public Observable<Page<ResourceGroupInner>> listAsync(final String filter, final Integer top) {
"""
Gets all the resource groups for a subscription.
@param filter The filter to apply on the operation.
@param top The number of results to return. If null is passed, returns all resource groups.
@throws IllegalAr... | java | public Observable<Page<ResourceGroupInner>> listAsync(final String filter, final Integer top) {
return listWithServiceResponseAsync(filter, top)
.map(new Func1<ServiceResponse<Page<ResourceGroupInner>>, Page<ResourceGroupInner>>() {
@Override
public Page<ResourceGroup... | [
"public",
"Observable",
"<",
"Page",
"<",
"ResourceGroupInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"filter",
",",
"final",
"Integer",
"top",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"filter",
",",
"top",
")",
".",
"map",
"(",
"new... | Gets all the resource groups for a subscription.
@param filter The filter to apply on the operation.
@param top The number of results to return. If null is passed, returns all resource groups.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<ResourceG... | [
"Gets",
"all",
"the",
"resource",
"groups",
"for",
"a",
"subscription",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/resources/v2016_09_01/implementation/ResourceGroupsInner.java#L1079-L1087 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/tiles/user/TileDaoUtils.java | TileDaoUtils.getMaxLength | public static double getMaxLength(double[] widths, double[] heights) {
"""
Get the max distance length that matches the tile widths and heights
@param widths
sorted tile matrix widths
@param heights
sorted tile matrix heights
@return max length
@since 1.2.0
"""
double maxWidth = getMaxLength(widths);... | java | public static double getMaxLength(double[] widths, double[] heights) {
double maxWidth = getMaxLength(widths);
double maxHeight = getMaxLength(heights);
double maxLength = Math.min(maxWidth, maxHeight);
return maxLength;
} | [
"public",
"static",
"double",
"getMaxLength",
"(",
"double",
"[",
"]",
"widths",
",",
"double",
"[",
"]",
"heights",
")",
"{",
"double",
"maxWidth",
"=",
"getMaxLength",
"(",
"widths",
")",
";",
"double",
"maxHeight",
"=",
"getMaxLength",
"(",
"heights",
"... | Get the max distance length that matches the tile widths and heights
@param widths
sorted tile matrix widths
@param heights
sorted tile matrix heights
@return max length
@since 1.2.0 | [
"Get",
"the",
"max",
"distance",
"length",
"that",
"matches",
"the",
"tile",
"widths",
"and",
"heights"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/tiles/user/TileDaoUtils.java#L415-L420 |
jbossws/jbossws-cxf | modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/BeanCustomizer.java | BeanCustomizer.configureClientProxyFactoryBean | protected void configureClientProxyFactoryBean(ClientProxyFactoryBean factory) {
"""
Configure the client proxy factory; currently set the binding customization in the databinding (Client Side).
@param factory
"""
//Configure binding customization
if (customization != null)
{
//cu... | java | protected void configureClientProxyFactoryBean(ClientProxyFactoryBean factory)
{
//Configure binding customization
if (customization != null)
{
//customize default databinding (early pulls in ServiceFactory default databinding and configure it, as it's lazily loaded)
ReflectionSer... | [
"protected",
"void",
"configureClientProxyFactoryBean",
"(",
"ClientProxyFactoryBean",
"factory",
")",
"{",
"//Configure binding customization",
"if",
"(",
"customization",
"!=",
"null",
")",
"{",
"//customize default databinding (early pulls in ServiceFactory default databinding and... | Configure the client proxy factory; currently set the binding customization in the databinding (Client Side).
@param factory | [
"Configure",
"the",
"client",
"proxy",
"factory",
";",
"currently",
"set",
"the",
"binding",
"customization",
"in",
"the",
"databinding",
"(",
"Client",
"Side",
")",
"."
] | train | https://github.com/jbossws/jbossws-cxf/blob/e1d5df3664cbc2482ebc83cafd355a4d60d12150/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/BeanCustomizer.java#L89-L112 |
threerings/narya | tools/src/main/java/com/threerings/presents/tools/InvocationTask.java | InvocationTask.createAndGatherImports | public ServiceMethod createAndGatherImports (Method method, ImportSet imports) {
"""
Creates a new service method and adds its basic imports to a set.
@param method the method to create
@param imports will be filled with the types required by the method
"""
ServiceMethod sm = new ServiceMethod(method... | java | public ServiceMethod createAndGatherImports (Method method, ImportSet imports)
{
ServiceMethod sm = new ServiceMethod(method);
sm.gatherImports(imports);
return sm;
} | [
"public",
"ServiceMethod",
"createAndGatherImports",
"(",
"Method",
"method",
",",
"ImportSet",
"imports",
")",
"{",
"ServiceMethod",
"sm",
"=",
"new",
"ServiceMethod",
"(",
"method",
")",
";",
"sm",
".",
"gatherImports",
"(",
"imports",
")",
";",
"return",
"s... | Creates a new service method and adds its basic imports to a set.
@param method the method to create
@param imports will be filled with the types required by the method | [
"Creates",
"a",
"new",
"service",
"method",
"and",
"adds",
"its",
"basic",
"imports",
"to",
"a",
"set",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/InvocationTask.java#L95-L100 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.suspendWithServiceResponseAsync | public Observable<ServiceResponse<Page<SiteInner>>> suspendWithServiceResponseAsync(final String resourceGroupName, final String name) {
"""
Suspend an App Service Environment.
Suspend an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Na... | java | public Observable<ServiceResponse<Page<SiteInner>>> suspendWithServiceResponseAsync(final String resourceGroupName, final String name) {
return suspendSinglePageAsync(resourceGroupName, name)
.concatMap(new Func1<ServiceResponse<Page<SiteInner>>, Observable<ServiceResponse<Page<SiteInner>>>>() {
... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"SiteInner",
">",
">",
">",
"suspendWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
")",
"{",
"return",
"suspendSinglePageAsync",
"(",
"resource... | Suspend an App Service Environment.
Suspend an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList&l... | [
"Suspend",
"an",
"App",
"Service",
"Environment",
".",
"Suspend",
"an",
"App",
"Service",
"Environment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L4510-L4522 |
pressgang-ccms/PressGangCCMSContentSpecProcessor | src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java | ContentSpecParser.changeCurrentLevel | protected void changeCurrentLevel(ParserData parserData, final Level newLevel, int newIndentationLevel) {
"""
Changes the current level that content is being processed for to a new level.
@param parserData
@param newLevel The new level to process for,
@param newIndentationLevel The new indentation ... | java | protected void changeCurrentLevel(ParserData parserData, final Level newLevel, int newIndentationLevel) {
parserData.setIndentationLevel(newIndentationLevel);
parserData.setCurrentLevel(newLevel);
} | [
"protected",
"void",
"changeCurrentLevel",
"(",
"ParserData",
"parserData",
",",
"final",
"Level",
"newLevel",
",",
"int",
"newIndentationLevel",
")",
"{",
"parserData",
".",
"setIndentationLevel",
"(",
"newIndentationLevel",
")",
";",
"parserData",
".",
"setCurrentLe... | Changes the current level that content is being processed for to a new level.
@param parserData
@param newLevel The new level to process for,
@param newIndentationLevel The new indentation level of the level in the Content Specification. | [
"Changes",
"the",
"current",
"level",
"that",
"content",
"is",
"being",
"processed",
"for",
"to",
"a",
"new",
"level",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java#L946-L949 |
javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/i/IntTuples.java | IntTuples.of | public static MutableIntTuple of(int x, int y, int z, int w) {
"""
Creates a new {@link MutableIntTuple} with the given values.
@param x The x coordinate
@param y The y coordinate
@param z The z coordinate
@param w The w coordinate
@return The new tuple
"""
return new DefaultIntTuple(new int[]{... | java | public static MutableIntTuple of(int x, int y, int z, int w)
{
return new DefaultIntTuple(new int[]{ x, y, z, w });
} | [
"public",
"static",
"MutableIntTuple",
"of",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"z",
",",
"int",
"w",
")",
"{",
"return",
"new",
"DefaultIntTuple",
"(",
"new",
"int",
"[",
"]",
"{",
"x",
",",
"y",
",",
"z",
",",
"w",
"}",
")",
";",
... | Creates a new {@link MutableIntTuple} with the given values.
@param x The x coordinate
@param y The y coordinate
@param z The z coordinate
@param w The w coordinate
@return The new tuple | [
"Creates",
"a",
"new",
"{",
"@link",
"MutableIntTuple",
"}",
"with",
"the",
"given",
"values",
"."
] | train | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/i/IntTuples.java#L1510-L1513 |
andrehertwig/admintool | admin-tools-filebrowser/src/main/java/de/chandre/admintool/filebrowser/AdminToolFilebrowserServiceImpl.java | AdminToolFilebrowserServiceImpl.formatFileSize | protected String formatFileSize(BigInteger fileLength, BigInteger divisor, String unit) {
"""
calculates the and formats files size
@see #getFileSize(long)
@param fileLength
@param divisor
@param unit the Unit for the divisor
@return
"""
BigDecimal size = new BigDecimal(fileLength);
size = size.setS... | java | protected String formatFileSize(BigInteger fileLength, BigInteger divisor, String unit) {
BigDecimal size = new BigDecimal(fileLength);
size = size.setScale(config.getFileSizeDisplayScale()).divide(new BigDecimal(divisor), BigDecimal.ROUND_HALF_EVEN);
return String.format("%s %s", size.doubleValue(), unit);
... | [
"protected",
"String",
"formatFileSize",
"(",
"BigInteger",
"fileLength",
",",
"BigInteger",
"divisor",
",",
"String",
"unit",
")",
"{",
"BigDecimal",
"size",
"=",
"new",
"BigDecimal",
"(",
"fileLength",
")",
";",
"size",
"=",
"size",
".",
"setScale",
"(",
"... | calculates the and formats files size
@see #getFileSize(long)
@param fileLength
@param divisor
@param unit the Unit for the divisor
@return | [
"calculates",
"the",
"and",
"formats",
"files",
"size"
] | train | https://github.com/andrehertwig/admintool/blob/6d391e2d26969b70e3ccabfc34202abe8d915080/admin-tools-filebrowser/src/main/java/de/chandre/admintool/filebrowser/AdminToolFilebrowserServiceImpl.java#L341-L345 |
Kurento/kurento-module-creator | src/main/java/com/github/zafarkhaja/semver/expr/ExpressionParser.java | ExpressionParser.parseTildeExpression | private Expression parseTildeExpression() {
"""
Parses the {@literal <tilde-expr>} non-terminal.
<pre>
{@literal
<tilde-expr> ::= "~" <version>
}
</pre>
@return the expression AST
"""
consumeNextToken(TILDE);
int major = intOf(consumeNextToken(NUMERIC).lexeme);
if (!tokens.positiveLookahe... | java | private Expression parseTildeExpression() {
consumeNextToken(TILDE);
int major = intOf(consumeNextToken(NUMERIC).lexeme);
if (!tokens.positiveLookahead(DOT)) {
return new GreaterOrEqual(versionOf(major, 0, 0));
}
consumeNextToken(DOT);
int minor = intOf(consumeNextToken(NUMERIC).lexeme);
... | [
"private",
"Expression",
"parseTildeExpression",
"(",
")",
"{",
"consumeNextToken",
"(",
"TILDE",
")",
";",
"int",
"major",
"=",
"intOf",
"(",
"consumeNextToken",
"(",
"NUMERIC",
")",
".",
"lexeme",
")",
";",
"if",
"(",
"!",
"tokens",
".",
"positiveLookahead... | Parses the {@literal <tilde-expr>} non-terminal.
<pre>
{@literal
<tilde-expr> ::= "~" <version>
}
</pre>
@return the expression AST | [
"Parses",
"the",
"{",
"@literal",
"<tilde",
"-",
"expr",
">",
"}",
"non",
"-",
"terminal",
"."
] | train | https://github.com/Kurento/kurento-module-creator/blob/c371516c665b902b5476433496a5aefcbca86d64/src/main/java/com/github/zafarkhaja/semver/expr/ExpressionParser.java#L247-L263 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsUtils.java | CommsUtils.getRuntimeIntProperty | public static int getRuntimeIntProperty(String property, String defaultValue) {
"""
This method will get a runtime property from the sib.properties file and will convert the
value (if set) to an int. If the property in the file was set to something that was not
parseable as an integer, then the default value wil... | java | public static int getRuntimeIntProperty(String property, String defaultValue)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getRuntimeIntProperty", new Object[] {property, defaultValue});
// Note that we parse the default value outside of the try / catch so th... | [
"public",
"static",
"int",
"getRuntimeIntProperty",
"(",
"String",
"property",
",",
"String",
"defaultValue",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
... | This method will get a runtime property from the sib.properties file and will convert the
value (if set) to an int. If the property in the file was set to something that was not
parseable as an integer, then the default value will be returned.
@param property The property key used to look up in the file.
@param defaul... | [
"This",
"method",
"will",
"get",
"a",
"runtime",
"property",
"from",
"the",
"sib",
".",
"properties",
"file",
"and",
"will",
"convert",
"the",
"value",
"(",
"if",
"set",
")",
"to",
"an",
"int",
".",
"If",
"the",
"property",
"in",
"the",
"file",
"was",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsUtils.java#L97-L120 |
weld/core | impl/src/main/java/org/jboss/weld/util/bytecode/BytecodeUtils.java | BytecodeUtils.addLoadInstruction | public static void addLoadInstruction(CodeAttribute code, String type, int variable) {
"""
Adds the correct load instruction based on the type descriptor
@param code the bytecode to add the instruction to
@param type the type of the variable
@param variable the variable number
"""
char tp ... | java | public static void addLoadInstruction(CodeAttribute code, String type, int variable) {
char tp = type.charAt(0);
if (tp != 'L' && tp != '[') {
// we have a primitive type
switch (tp) {
case 'J':
code.lload(variable);
break;
... | [
"public",
"static",
"void",
"addLoadInstruction",
"(",
"CodeAttribute",
"code",
",",
"String",
"type",
",",
"int",
"variable",
")",
"{",
"char",
"tp",
"=",
"type",
".",
"charAt",
"(",
"0",
")",
";",
"if",
"(",
"tp",
"!=",
"'",
"'",
"&&",
"tp",
"!=",
... | Adds the correct load instruction based on the type descriptor
@param code the bytecode to add the instruction to
@param type the type of the variable
@param variable the variable number | [
"Adds",
"the",
"correct",
"load",
"instruction",
"based",
"on",
"the",
"type",
"descriptor"
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/bytecode/BytecodeUtils.java#L54-L74 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/inline/InlineRendition.java | InlineRendition.buildScaledMediaUrl | private String buildScaledMediaUrl(Dimension dimension, CropDimension cropDimension) {
"""
Builds URL to rescaled version of the binary image.
@return Media URL
"""
String resourcePath = this.resource.getPath();
// if parent resource is a nt:file resource, use this one as path for scaled image
Re... | java | private String buildScaledMediaUrl(Dimension dimension, CropDimension cropDimension) {
String resourcePath = this.resource.getPath();
// if parent resource is a nt:file resource, use this one as path for scaled image
Resource parentResource = this.resource.getParent();
if (JcrBinary.isNtFile(parentReso... | [
"private",
"String",
"buildScaledMediaUrl",
"(",
"Dimension",
"dimension",
",",
"CropDimension",
"cropDimension",
")",
"{",
"String",
"resourcePath",
"=",
"this",
".",
"resource",
".",
"getPath",
"(",
")",
";",
"// if parent resource is a nt:file resource, use this one as... | Builds URL to rescaled version of the binary image.
@return Media URL | [
"Builds",
"URL",
"to",
"rescaled",
"version",
"of",
"the",
"binary",
"image",
"."
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/inline/InlineRendition.java#L259-L280 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/PagedWidget.java | PagedWidget.removeItem | public void removeItem (T item) {
"""
Removes the specified item from the panel. If the item is currently being displayed, its
interface element will be removed as well.
"""
if (_model == null) {
return; // if we have no model, stop here
}
// remove the item from our data m... | java | public void removeItem (T item)
{
if (_model == null) {
return; // if we have no model, stop here
}
// remove the item from our data model
_model.removeItem(item);
// force a relayout of this page
displayPage(_page, true);
} | [
"public",
"void",
"removeItem",
"(",
"T",
"item",
")",
"{",
"if",
"(",
"_model",
"==",
"null",
")",
"{",
"return",
";",
"// if we have no model, stop here",
"}",
"// remove the item from our data model",
"_model",
".",
"removeItem",
"(",
"item",
")",
";",
"// fo... | Removes the specified item from the panel. If the item is currently being displayed, its
interface element will be removed as well. | [
"Removes",
"the",
"specified",
"item",
"from",
"the",
"panel",
".",
"If",
"the",
"item",
"is",
"currently",
"being",
"displayed",
"its",
"interface",
"element",
"will",
"be",
"removed",
"as",
"well",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/PagedWidget.java#L202-L211 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/execution/workflow/steps/node/impl/DefaultScriptFileNodeStepUtils.java | DefaultScriptFileNodeStepUtils.executeRemoteScript | @Override
public NodeStepResult executeRemoteScript(
final ExecutionContext context,
final Framework framework,
final INodeEntry node,
final String[] args,
final String filepath
) throws NodeStepException {
"""
Execute a scriptfile already copied ... | java | @Override
public NodeStepResult executeRemoteScript(
final ExecutionContext context,
final Framework framework,
final INodeEntry node,
final String[] args,
final String filepath
) throws NodeStepException
{
return executeRemoteScript(contex... | [
"@",
"Override",
"public",
"NodeStepResult",
"executeRemoteScript",
"(",
"final",
"ExecutionContext",
"context",
",",
"final",
"Framework",
"framework",
",",
"final",
"INodeEntry",
"node",
",",
"final",
"String",
"[",
"]",
"args",
",",
"final",
"String",
"filepath... | Execute a scriptfile already copied to a remote node with the given args
@param context context
@param framework framework
@param node the node
@param args arguments to script
@param filepath the remote path for the script
@return the result
@throws NodeStepException on error | [
"Execute",
"a",
"scriptfile",
"already",
"copied",
"to",
"a",
"remote",
"node",
"with",
"the",
"given",
"args"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/execution/workflow/steps/node/impl/DefaultScriptFileNodeStepUtils.java#L210-L220 |
square/javapoet | src/main/java/com/squareup/javapoet/ParameterizedTypeName.java | ParameterizedTypeName.get | public static ParameterizedTypeName get(Class<?> rawType, Type... typeArguments) {
"""
Returns a parameterized type, applying {@code typeArguments} to {@code rawType}.
"""
return new ParameterizedTypeName(null, ClassName.get(rawType), list(typeArguments));
} | java | public static ParameterizedTypeName get(Class<?> rawType, Type... typeArguments) {
return new ParameterizedTypeName(null, ClassName.get(rawType), list(typeArguments));
} | [
"public",
"static",
"ParameterizedTypeName",
"get",
"(",
"Class",
"<",
"?",
">",
"rawType",
",",
"Type",
"...",
"typeArguments",
")",
"{",
"return",
"new",
"ParameterizedTypeName",
"(",
"null",
",",
"ClassName",
".",
"get",
"(",
"rawType",
")",
",",
"list",
... | Returns a parameterized type, applying {@code typeArguments} to {@code rawType}. | [
"Returns",
"a",
"parameterized",
"type",
"applying",
"{"
] | train | https://github.com/square/javapoet/blob/0f93da9a3d9a1da8d29fc993409fcf83d40452bc/src/main/java/com/squareup/javapoet/ParameterizedTypeName.java#L118-L120 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/util/JmxUtil.java | JmxUtil.newObjectName | public static ObjectName newObjectName(String pName) {
"""
Factory method for creating a new object name, mapping any checked {@link MalformedObjectNameException} to
a runtime exception ({@link IllegalArgumentException})
@param pName name to convert
@return the created object name
"""
try {
... | java | public static ObjectName newObjectName(String pName) {
try {
return new ObjectName(pName);
} catch (MalformedObjectNameException e) {
throw new IllegalArgumentException("Invalid object name " + pName,e);
}
} | [
"public",
"static",
"ObjectName",
"newObjectName",
"(",
"String",
"pName",
")",
"{",
"try",
"{",
"return",
"new",
"ObjectName",
"(",
"pName",
")",
";",
"}",
"catch",
"(",
"MalformedObjectNameException",
"e",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Factory method for creating a new object name, mapping any checked {@link MalformedObjectNameException} to
a runtime exception ({@link IllegalArgumentException})
@param pName name to convert
@return the created object name | [
"Factory",
"method",
"for",
"creating",
"a",
"new",
"object",
"name",
"mapping",
"any",
"checked",
"{"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/util/JmxUtil.java#L25-L31 |
hawkular/hawkular-agent | hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/inventory/InventoryIdUtil.java | InventoryIdUtil.parseResourceId | public static ResourceIdParts parseResourceId(String resourceId) {
"""
Given a resource ID generated via {@link InventoryIdUtil#generateResourceId}
this returns the different parts that make up that resource ID.
@param resourceId the full resource ID to be parsed
@return the parts of the resource ID
"""
... | java | public static ResourceIdParts parseResourceId(String resourceId) {
if (resourceId == null) {
throw new IllegalArgumentException("Invalid resource ID - cannot be null");
}
String[] parts = resourceId.split("~", 3);
if (parts.length != 3) {
throw new IllegalArgumen... | [
"public",
"static",
"ResourceIdParts",
"parseResourceId",
"(",
"String",
"resourceId",
")",
"{",
"if",
"(",
"resourceId",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid resource ID - cannot be null\"",
")",
";",
"}",
"String",
"[... | Given a resource ID generated via {@link InventoryIdUtil#generateResourceId}
this returns the different parts that make up that resource ID.
@param resourceId the full resource ID to be parsed
@return the parts of the resource ID | [
"Given",
"a",
"resource",
"ID",
"generated",
"via",
"{",
"@link",
"InventoryIdUtil#generateResourceId",
"}",
"this",
"returns",
"the",
"different",
"parts",
"that",
"make",
"up",
"that",
"resource",
"ID",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/inventory/InventoryIdUtil.java#L59-L69 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/journal/readerwriter/multicast/LocalDirectoryTransport.java | LocalDirectoryTransport.openFile | @Override
public void openFile(String repositoryHash,
String filename,
Date currentDate) throws JournalException {
"""
On a request to open the file,
<ul>
<li>check that we are in a valid state,</li>
<li>create the file,</li>
<li>create the {@link XMLEventW... | java | @Override
public void openFile(String repositoryHash,
String filename,
Date currentDate) throws JournalException {
try {
super.testStateChange(State.FILE_OPEN);
journalFile = new TransportOutputFile(directory, filename);
... | [
"@",
"Override",
"public",
"void",
"openFile",
"(",
"String",
"repositoryHash",
",",
"String",
"filename",
",",
"Date",
"currentDate",
")",
"throws",
"JournalException",
"{",
"try",
"{",
"super",
".",
"testStateChange",
"(",
"State",
".",
"FILE_OPEN",
")",
";"... | On a request to open the file,
<ul>
<li>check that we are in a valid state,</li>
<li>create the file,</li>
<li>create the {@link XMLEventWriter} for use on the file,</li>
<li>ask the parent to write the header to the file,</li>
<li>set the state.</li>
</ul> | [
"On",
"a",
"request",
"to",
"open",
"the",
"file",
"<ul",
">",
"<li",
">",
"check",
"that",
"we",
"are",
"in",
"a",
"valid",
"state",
"<",
"/",
"li",
">",
"<li",
">",
"create",
"the",
"file",
"<",
"/",
"li",
">",
"<li",
">",
"create",
"the",
"{... | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/readerwriter/multicast/LocalDirectoryTransport.java#L73-L96 |
google/closure-compiler | src/com/google/javascript/refactoring/Matchers.java | Matchers.assignmentWithRhs | public static Matcher assignmentWithRhs(final Matcher rhsMatcher) {
"""
Returns a Matcher that matches an ASSIGN node where the RHS of the assignment matches the given
rhsMatcher.
"""
return new Matcher() {
@Override public boolean matches(Node node, NodeMetadata metadata) {
return node.isAs... | java | public static Matcher assignmentWithRhs(final Matcher rhsMatcher) {
return new Matcher() {
@Override public boolean matches(Node node, NodeMetadata metadata) {
return node.isAssign() && rhsMatcher.matches(node.getLastChild(), metadata);
}
};
} | [
"public",
"static",
"Matcher",
"assignmentWithRhs",
"(",
"final",
"Matcher",
"rhsMatcher",
")",
"{",
"return",
"new",
"Matcher",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"matches",
"(",
"Node",
"node",
",",
"NodeMetadata",
"metadata",
")",
"{",
"... | Returns a Matcher that matches an ASSIGN node where the RHS of the assignment matches the given
rhsMatcher. | [
"Returns",
"a",
"Matcher",
"that",
"matches",
"an",
"ASSIGN",
"node",
"where",
"the",
"RHS",
"of",
"the",
"assignment",
"matches",
"the",
"given",
"rhsMatcher",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/refactoring/Matchers.java#L306-L312 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/ReferenceStream.java | ReferenceStream.removeFirstMatching | public final ItemReference removeFirstMatching(final Filter filter, final Transaction transaction)
throws MessageStoreException {
"""
removeFirstMatching (aka DestructiveGet).
@param filter
@param transaction
must not be null.
@return Item may be null.
@throws {@link MessageStoreExcept... | java | public final ItemReference removeFirstMatching(final Filter filter, final Transaction transaction)
throws MessageStoreException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "removeFirstMatching", new Object[] { filter, transaction }... | [
"public",
"final",
"ItemReference",
"removeFirstMatching",
"(",
"final",
"Filter",
"filter",
",",
"final",
"Transaction",
"transaction",
")",
"throws",
"MessageStoreException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
... | removeFirstMatching (aka DestructiveGet).
@param filter
@param transaction
must not be null.
@return Item may be null.
@throws {@link MessageStoreException} if the item was spilled and could not
be unspilled. Or if item not found in backing store.
@throws {@link MessageStoreException} indicates that an unrecoverable ... | [
"removeFirstMatching",
"(",
"aka",
"DestructiveGet",
")",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/ReferenceStream.java#L549-L565 |
threerings/nenya | core/src/main/java/com/threerings/media/image/ColorPository.java | ColorPository.getRandomStartingColor | public ColorRecord getRandomStartingColor (String className, Random rand) {
"""
Returns a random starting color from the specified color class.
"""
// make sure the class exists
ClassRecord record = getClassRecord(className);
return (record == null) ? null : record.randomStartingColor(... | java | public ColorRecord getRandomStartingColor (String className, Random rand)
{
// make sure the class exists
ClassRecord record = getClassRecord(className);
return (record == null) ? null : record.randomStartingColor(rand);
} | [
"public",
"ColorRecord",
"getRandomStartingColor",
"(",
"String",
"className",
",",
"Random",
"rand",
")",
"{",
"// make sure the class exists",
"ClassRecord",
"record",
"=",
"getClassRecord",
"(",
"className",
")",
";",
"return",
"(",
"record",
"==",
"null",
")",
... | Returns a random starting color from the specified color class. | [
"Returns",
"a",
"random",
"starting",
"color",
"from",
"the",
"specified",
"color",
"class",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ColorPository.java#L354-L359 |
apache/groovy | src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java | BytecodeHelper.visitClassLiteral | public static void visitClassLiteral(MethodVisitor mv, ClassNode classNode) {
"""
Visits a class literal. If the type of the classnode is a primitive type,
the generated bytecode will be a GETSTATIC Integer.TYPE.
If the classnode is not a primitive type, we will generate a LDC instruction.
"""
if (Cl... | java | public static void visitClassLiteral(MethodVisitor mv, ClassNode classNode) {
if (ClassHelper.isPrimitiveType(classNode)) {
mv.visitFieldInsn(
GETSTATIC,
getClassInternalName(ClassHelper.getWrapper(classNode)),
"TYPE",
"... | [
"public",
"static",
"void",
"visitClassLiteral",
"(",
"MethodVisitor",
"mv",
",",
"ClassNode",
"classNode",
")",
"{",
"if",
"(",
"ClassHelper",
".",
"isPrimitiveType",
"(",
"classNode",
")",
")",
"{",
"mv",
".",
"visitFieldInsn",
"(",
"GETSTATIC",
",",
"getCla... | Visits a class literal. If the type of the classnode is a primitive type,
the generated bytecode will be a GETSTATIC Integer.TYPE.
If the classnode is not a primitive type, we will generate a LDC instruction. | [
"Visits",
"a",
"class",
"literal",
".",
"If",
"the",
"type",
"of",
"the",
"classnode",
"is",
"a",
"primitive",
"type",
"the",
"generated",
"bytecode",
"will",
"be",
"a",
"GETSTATIC",
"Integer",
".",
"TYPE",
".",
"If",
"the",
"classnode",
"is",
"not",
"a"... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/asm/BytecodeHelper.java#L532-L542 |
springfox/springfox | springfox-core/src/main/java/springfox/documentation/schema/AlternateTypeRules.java | AlternateTypeRules.newRule | public static AlternateTypeRule newRule(Type original, Type alternate, int order) {
"""
Helper method to create a new alternate rule.
@param original the original
@param alternate the alternate
@param order the order in which the rule is applied. {@link org.springframework.core.Ordered}
@return the alternat... | java | public static AlternateTypeRule newRule(Type original, Type alternate, int order) {
TypeResolver resolver = new TypeResolver();
return new AlternateTypeRule(resolver.resolve(original), resolver.resolve(alternate), order);
} | [
"public",
"static",
"AlternateTypeRule",
"newRule",
"(",
"Type",
"original",
",",
"Type",
"alternate",
",",
"int",
"order",
")",
"{",
"TypeResolver",
"resolver",
"=",
"new",
"TypeResolver",
"(",
")",
";",
"return",
"new",
"AlternateTypeRule",
"(",
"resolver",
... | Helper method to create a new alternate rule.
@param original the original
@param alternate the alternate
@param order the order in which the rule is applied. {@link org.springframework.core.Ordered}
@return the alternate type rule | [
"Helper",
"method",
"to",
"create",
"a",
"new",
"alternate",
"rule",
"."
] | train | https://github.com/springfox/springfox/blob/e40e2d6f4b345ffa35cd5c0ca7a12589036acaf7/springfox-core/src/main/java/springfox/documentation/schema/AlternateTypeRules.java#L56-L59 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/ParallelRunner.java | ParallelRunner.deletePath | public void deletePath(final Path path, final boolean recursive) {
"""
Delete a {@link Path}.
<p>
This method submits a task to delete a {@link Path} and returns immediately
after the task is submitted.
</p>
@param path path to be deleted.
"""
this.futures.add(new NamedFuture(this.executor.submit(... | java | public void deletePath(final Path path, final boolean recursive) {
this.futures.add(new NamedFuture(this.executor.submit(new Callable<Void>() {
@Override
public Void call() throws Exception {
Lock lock = ParallelRunner.this.locks.get(path.toString());
lock.lock();
try {
... | [
"public",
"void",
"deletePath",
"(",
"final",
"Path",
"path",
",",
"final",
"boolean",
"recursive",
")",
"{",
"this",
".",
"futures",
".",
"add",
"(",
"new",
"NamedFuture",
"(",
"this",
".",
"executor",
".",
"submit",
"(",
"new",
"Callable",
"<",
"Void",... | Delete a {@link Path}.
<p>
This method submits a task to delete a {@link Path} and returns immediately
after the task is submitted.
</p>
@param path path to be deleted. | [
"Delete",
"a",
"{",
"@link",
"Path",
"}",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/ParallelRunner.java#L231-L245 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/core/contents/ContentsDao.java | ContentsDao.deleteByIdCascade | public int deleteByIdCascade(String id, boolean userTable)
throws SQLException {
"""
Delete a Contents by id, cascading optionally including the user table
@param id
id
@param userTable
true if a user table
@return deleted count
@throws SQLException
upon deletion error
"""
int count = 0;
if (id... | java | public int deleteByIdCascade(String id, boolean userTable)
throws SQLException {
int count = 0;
if (id != null) {
Contents contents = queryForId(id);
if (contents != null) {
count = deleteCascade(contents, userTable);
} else if (userTable) {
dropTable(id);
}
}
return count;
} | [
"public",
"int",
"deleteByIdCascade",
"(",
"String",
"id",
",",
"boolean",
"userTable",
")",
"throws",
"SQLException",
"{",
"int",
"count",
"=",
"0",
";",
"if",
"(",
"id",
"!=",
"null",
")",
"{",
"Contents",
"contents",
"=",
"queryForId",
"(",
"id",
")",... | Delete a Contents by id, cascading optionally including the user table
@param id
id
@param userTable
true if a user table
@return deleted count
@throws SQLException
upon deletion error | [
"Delete",
"a",
"Contents",
"by",
"id",
"cascading",
"optionally",
"including",
"the",
"user",
"table"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/core/contents/ContentsDao.java#L463-L475 |
jenkinsci/java-client-api | jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildWithDetails.java | BuildWithDetails.updateDisplayNameAndDescription | public BuildWithDetails updateDisplayNameAndDescription(String displayName, String description, boolean crumbFlag)
throws IOException {
"""
Update <code>displayName</code> and the <code>description</code> of a
build.
@param displayName The new displayName which should be set.
@param description Th... | java | public BuildWithDetails updateDisplayNameAndDescription(String displayName, String description, boolean crumbFlag)
throws IOException {
Objects.requireNonNull(displayName, "displayName is not allowed to be null.");
Objects.requireNonNull(description, "description is not allowed to be null.")... | [
"public",
"BuildWithDetails",
"updateDisplayNameAndDescription",
"(",
"String",
"displayName",
",",
"String",
"description",
",",
"boolean",
"crumbFlag",
")",
"throws",
"IOException",
"{",
"Objects",
".",
"requireNonNull",
"(",
"displayName",
",",
"\"displayName is not al... | Update <code>displayName</code> and the <code>description</code> of a
build.
@param displayName The new displayName which should be set.
@param description The description which should be set.
@param crumbFlag <code>true</code> or <code>false</code>.
@throws IOException in case of errors. | [
"Update",
"<code",
">",
"displayName<",
"/",
"code",
">",
"and",
"the",
"<code",
">",
"description<",
"/",
"code",
">",
"of",
"a",
"build",
"."
] | train | https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/model/BuildWithDetails.java#L181-L194 |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/db/PersistentContext.java | PersistentContext.doWithoutTransaction | public <T> T doWithoutTransaction(final SpecificTxAction<T, C> action) {
"""
Execute action without transaction.
<p>
NOTE: If normal transaction already started, error will be thrown to prevent confusion
(direct call to template will ignore notx config in case of ongoing transaction, so this call is safer)
@... | java | public <T> T doWithoutTransaction(final SpecificTxAction<T, C> action) {
checkNotx();
return template.doInTransaction(new TxConfig(OTransaction.TXTYPE.NOTX), action);
} | [
"public",
"<",
"T",
">",
"T",
"doWithoutTransaction",
"(",
"final",
"SpecificTxAction",
"<",
"T",
",",
"C",
">",
"action",
")",
"{",
"checkNotx",
"(",
")",
";",
"return",
"template",
".",
"doInTransaction",
"(",
"new",
"TxConfig",
"(",
"OTransaction",
".",... | Execute action without transaction.
<p>
NOTE: If normal transaction already started, error will be thrown to prevent confusion
(direct call to template will ignore notx config in case of ongoing transaction, so this call is safer)
@param action action to execute within transaction (new or ongoing)
@param <T> expect... | [
"Execute",
"action",
"without",
"transaction",
".",
"<p",
">",
"NOTE",
":",
"If",
"normal",
"transaction",
"already",
"started",
"error",
"will",
"be",
"thrown",
"to",
"prevent",
"confusion",
"(",
"direct",
"call",
"to",
"template",
"will",
"ignore",
"notx",
... | train | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/db/PersistentContext.java#L161-L164 |
czyzby/gdx-lml | lml/src/main/java/com/github/czyzby/lml/util/LmlUtilities.java | LmlUtilities.toRangeArrayArgument | public static String toRangeArrayArgument(final Object base, final int rangeStart, final int rangeEnd) {
"""
Warning: uses default LML syntax. Will not work if you modified any LML markers.
@param base base of the range. Can be null - range will not have a base and will iterate solely over numbers.
@param rang... | java | public static String toRangeArrayArgument(final Object base, final int rangeStart, final int rangeEnd) {
return Nullables.toString(base, Strings.EMPTY_STRING) + '[' + rangeStart + ',' + rangeEnd + ']';
} | [
"public",
"static",
"String",
"toRangeArrayArgument",
"(",
"final",
"Object",
"base",
",",
"final",
"int",
"rangeStart",
",",
"final",
"int",
"rangeEnd",
")",
"{",
"return",
"Nullables",
".",
"toString",
"(",
"base",
",",
"Strings",
".",
"EMPTY_STRING",
")",
... | Warning: uses default LML syntax. Will not work if you modified any LML markers.
@param base base of the range. Can be null - range will not have a base and will iterate solely over numbers.
@param rangeStart start of range. Can be negative. Does not have to be lower than end - if start is bigger, range
is iterating f... | [
"Warning",
":",
"uses",
"default",
"LML",
"syntax",
".",
"Will",
"not",
"work",
"if",
"you",
"modified",
"any",
"LML",
"markers",
"."
] | train | https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/lml/src/main/java/com/github/czyzby/lml/util/LmlUtilities.java#L483-L485 |
threerings/narya | core/src/main/java/com/threerings/presents/peer/server/PeerManager.java | PeerManager.performWithLock | public void performWithLock (final NodeObject.Lock lock, final LockedOperation operation) {
"""
Tries to acquire the resource lock and, if successful, performs the operation and releases
the lock; if unsuccessful, calls the operation's failure handler. Please note: the lock will
be released immediately after the... | java | public void performWithLock (final NodeObject.Lock lock, final LockedOperation operation)
{
acquireLock(lock, new ResultListener<String>() {
public void requestCompleted (String nodeName) {
if (getNodeObject().nodeName.equals(nodeName)) {
// lock acquired succ... | [
"public",
"void",
"performWithLock",
"(",
"final",
"NodeObject",
".",
"Lock",
"lock",
",",
"final",
"LockedOperation",
"operation",
")",
"{",
"acquireLock",
"(",
"lock",
",",
"new",
"ResultListener",
"<",
"String",
">",
"(",
")",
"{",
"public",
"void",
"requ... | Tries to acquire the resource lock and, if successful, performs the operation and releases
the lock; if unsuccessful, calls the operation's failure handler. Please note: the lock will
be released immediately after the operation. | [
"Tries",
"to",
"acquire",
"the",
"resource",
"lock",
"and",
"if",
"successful",
"performs",
"the",
"operation",
"and",
"releases",
"the",
"lock",
";",
"if",
"unsuccessful",
"calls",
"the",
"operation",
"s",
"failure",
"handler",
".",
"Please",
"note",
":",
"... | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L908-L932 |
kaazing/gateway | transport/spi/src/main/java/org/kaazing/gateway/transport/LoggingUtils.java | LoggingUtils.addSession | public static String addSession(String message, IoSession session) {
"""
Prepends short session details (result of getId) for the session in square brackets to the message.
@param message the message to be logged
@param session an instance of IoSessionEx
@return example: "[wsn#34 127.0.0.0.1:41234] this is ... | java | public static String addSession(String message, IoSession session) {
return format("[%s] %s", getId(session), message);
} | [
"public",
"static",
"String",
"addSession",
"(",
"String",
"message",
",",
"IoSession",
"session",
")",
"{",
"return",
"format",
"(",
"\"[%s] %s\"",
",",
"getId",
"(",
"session",
")",
",",
"message",
")",
";",
"}"
] | Prepends short session details (result of getId) for the session in square brackets to the message.
@param message the message to be logged
@param session an instance of IoSessionEx
@return example: "[wsn#34 127.0.0.0.1:41234] this is the log message" | [
"Prepends",
"short",
"session",
"details",
"(",
"result",
"of",
"getId",
")",
"for",
"the",
"session",
"in",
"square",
"brackets",
"to",
"the",
"message",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/spi/src/main/java/org/kaazing/gateway/transport/LoggingUtils.java#L55-L57 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/denoise/wavelet/SubbandShrink.java | SubbandShrink.performShrinkage | protected void performShrinkage( I transform , int numLevels ) {
"""
Performs wavelet shrinking using the specified rule and by computing a threshold
for each subband.
@param transform The image being transformed.
@param numLevels Number of levels in the transform.
"""
// step through each layer in the... | java | protected void performShrinkage( I transform , int numLevels ) {
// step through each layer in the pyramid.
for( int i = 0; i < numLevels; i++ ) {
int w = transform.width;
int h = transform.height;
int ww = w/2;
int hh = h/2;
Number threshold;
I subband;
// HL
subband = transform.subimage(... | [
"protected",
"void",
"performShrinkage",
"(",
"I",
"transform",
",",
"int",
"numLevels",
")",
"{",
"// step through each layer in the pyramid.",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numLevels",
";",
"i",
"++",
")",
"{",
"int",
"w",
"=",
"trans... | Performs wavelet shrinking using the specified rule and by computing a threshold
for each subband.
@param transform The image being transformed.
@param numLevels Number of levels in the transform. | [
"Performs",
"wavelet",
"shrinking",
"using",
"the",
"specified",
"rule",
"and",
"by",
"computing",
"a",
"threshold",
"for",
"each",
"subband",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/denoise/wavelet/SubbandShrink.java#L56-L91 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Model.java | Model.dateFormat | protected static void dateFormat(DateFormat format, String... attributeNames) {
"""
Registers date format for specified attributes. This format will be used to convert between
Date -> String -> java.sql.Date when using the appropriate getters and setters.
<p>See example in {@link #dateFormat(String, String...)... | java | protected static void dateFormat(DateFormat format, String... attributeNames) {
ModelDelegate.dateFormat(modelClass(), format, attributeNames);
} | [
"protected",
"static",
"void",
"dateFormat",
"(",
"DateFormat",
"format",
",",
"String",
"...",
"attributeNames",
")",
"{",
"ModelDelegate",
".",
"dateFormat",
"(",
"modelClass",
"(",
")",
",",
"format",
",",
"attributeNames",
")",
";",
"}"
] | Registers date format for specified attributes. This format will be used to convert between
Date -> String -> java.sql.Date when using the appropriate getters and setters.
<p>See example in {@link #dateFormat(String, String...)}.
@param format format to use for conversion
@param attributeNames attribute names | [
"Registers",
"date",
"format",
"for",
"specified",
"attributes",
".",
"This",
"format",
"will",
"be",
"used",
"to",
"convert",
"between",
"Date",
"-",
">",
"String",
"-",
">",
"java",
".",
"sql",
".",
"Date",
"when",
"using",
"the",
"appropriate",
"getters... | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Model.java#L2139-L2141 |
aalmiray/Json-lib | src/main/java/net/sf/json/JsonConfig.java | JsonConfig.registerJsonPropertyNameProcessor | public void registerJsonPropertyNameProcessor( Class target, PropertyNameProcessor propertyNameProcessor ) {
"""
Registers a PropertyNameProcessor.<br>
[Java -> JSON]
@param target the class to use as key
@param propertyNameProcessor the processor to register
"""
if( target != null && propertyNam... | java | public void registerJsonPropertyNameProcessor( Class target, PropertyNameProcessor propertyNameProcessor ) {
if( target != null && propertyNameProcessor != null ) {
jsonPropertyNameProcessorMap.put( target, propertyNameProcessor );
}
} | [
"public",
"void",
"registerJsonPropertyNameProcessor",
"(",
"Class",
"target",
",",
"PropertyNameProcessor",
"propertyNameProcessor",
")",
"{",
"if",
"(",
"target",
"!=",
"null",
"&&",
"propertyNameProcessor",
"!=",
"null",
")",
"{",
"jsonPropertyNameProcessorMap",
".",... | Registers a PropertyNameProcessor.<br>
[Java -> JSON]
@param target the class to use as key
@param propertyNameProcessor the processor to register | [
"Registers",
"a",
"PropertyNameProcessor",
".",
"<br",
">",
"[",
"Java",
"-",
">",
";",
"JSON",
"]"
] | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JsonConfig.java#L799-L803 |
Bedework/bw-util | bw-util-misc/src/main/java/org/bedework/util/misc/Util.java | Util.fmtMsg | public static String fmtMsg(final String fmt, final String arg1, final String arg2) {
"""
Format a message consisting of a format string plus two string parameters
@param fmt
@param arg1
@param arg2
@return String formatted message
"""
Object[] o = new Object[2];
o[0] = arg1;
o[1] = arg2;
... | java | public static String fmtMsg(final String fmt, final String arg1, final String arg2) {
Object[] o = new Object[2];
o[0] = arg1;
o[1] = arg2;
return MessageFormat.format(fmt, o);
} | [
"public",
"static",
"String",
"fmtMsg",
"(",
"final",
"String",
"fmt",
",",
"final",
"String",
"arg1",
",",
"final",
"String",
"arg2",
")",
"{",
"Object",
"[",
"]",
"o",
"=",
"new",
"Object",
"[",
"2",
"]",
";",
"o",
"[",
"0",
"]",
"=",
"arg1",
"... | Format a message consisting of a format string plus two string parameters
@param fmt
@param arg1
@param arg2
@return String formatted message | [
"Format",
"a",
"message",
"consisting",
"of",
"a",
"format",
"string",
"plus",
"two",
"string",
"parameters"
] | train | https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-misc/src/main/java/org/bedework/util/misc/Util.java#L422-L428 |
j256/ormlite-core | src/main/java/com/j256/ormlite/table/TableUtils.java | TableUtils.getCreateTableStatements | public static <T, ID> List<String> getCreateTableStatements(ConnectionSource connectionSource,
DatabaseTableConfig<T> tableConfig) throws SQLException {
"""
Return an list of SQL statements that need to be run to create a table. To do the work of creating, you should
call {@link #createTable}.
@param connec... | java | public static <T, ID> List<String> getCreateTableStatements(ConnectionSource connectionSource,
DatabaseTableConfig<T> tableConfig) throws SQLException {
Dao<T, ID> dao = DaoManager.createDao(connectionSource, tableConfig);
DatabaseType databaseType = connectionSource.getDatabaseType();
if (dao instanceof BaseD... | [
"public",
"static",
"<",
"T",
",",
"ID",
">",
"List",
"<",
"String",
">",
"getCreateTableStatements",
"(",
"ConnectionSource",
"connectionSource",
",",
"DatabaseTableConfig",
"<",
"T",
">",
"tableConfig",
")",
"throws",
"SQLException",
"{",
"Dao",
"<",
"T",
",... | Return an list of SQL statements that need to be run to create a table. To do the work of creating, you should
call {@link #createTable}.
@param connectionSource
Our connect source which is used to get the database type, not to apply the creates.
@param tableConfig
Hand or spring wired table configuration. If null the... | [
"Return",
"an",
"list",
"of",
"SQL",
"statements",
"that",
"need",
"to",
"be",
"run",
"to",
"create",
"a",
"table",
".",
"To",
"do",
"the",
"work",
"of",
"creating",
"you",
"should",
"call",
"{",
"@link",
"#createTable",
"}",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/TableUtils.java#L123-L134 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.