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 |
|---|---|---|---|---|---|---|---|---|---|---|
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/Months.java | Months.ofYears | public static Months ofYears(int years) {
"""
Obtains a {@code Months} representing the number of months
equivalent to a number of years.
<p>
The resulting amount will be month-based, with the number of months
equal to the number of years multiplied by 12.
@param years the number of years, positive or nega... | java | public static Months ofYears(int years) {
if (years == 0) {
return ZERO;
}
return new Months(Math.multiplyExact(years, MONTHS_PER_YEAR));
} | [
"public",
"static",
"Months",
"ofYears",
"(",
"int",
"years",
")",
"{",
"if",
"(",
"years",
"==",
"0",
")",
"{",
"return",
"ZERO",
";",
"}",
"return",
"new",
"Months",
"(",
"Math",
".",
"multiplyExact",
"(",
"years",
",",
"MONTHS_PER_YEAR",
")",
")",
... | Obtains a {@code Months} representing the number of months
equivalent to a number of years.
<p>
The resulting amount will be month-based, with the number of months
equal to the number of years multiplied by 12.
@param years the number of years, positive or negative
@return the amount with the input years converted to... | [
"Obtains",
"a",
"{",
"@code",
"Months",
"}",
"representing",
"the",
"number",
"of",
"months",
"equivalent",
"to",
"a",
"number",
"of",
"years",
".",
"<p",
">",
"The",
"resulting",
"amount",
"will",
"be",
"month",
"-",
"based",
"with",
"the",
"number",
"o... | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/Months.java#L129-L134 |
stephanenicolas/robospice | robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java | SpiceManager.getFromCacheAndLoadFromNetworkIfExpired | public <T> void getFromCacheAndLoadFromNetworkIfExpired(final SpiceRequest<T> request, final Object requestCacheKey, final long cacheExpiryDuration, final RequestListener<T> requestListener) {
"""
Gets data from cache, expired or not, and executes a request normaly.
Before invoking the method {@link SpiceRequest#... | java | public <T> void getFromCacheAndLoadFromNetworkIfExpired(final SpiceRequest<T> request, final Object requestCacheKey, final long cacheExpiryDuration, final RequestListener<T> requestListener) {
final CachedSpiceRequest<T> cachedSpiceRequest = new CachedSpiceRequest<T>(request, requestCacheKey, cacheExpiryDuratio... | [
"public",
"<",
"T",
">",
"void",
"getFromCacheAndLoadFromNetworkIfExpired",
"(",
"final",
"SpiceRequest",
"<",
"T",
">",
"request",
",",
"final",
"Object",
"requestCacheKey",
",",
"final",
"long",
"cacheExpiryDuration",
",",
"final",
"RequestListener",
"<",
"T",
"... | Gets data from cache, expired or not, and executes a request normaly.
Before invoking the method {@link SpiceRequest#loadDataFromNetwork()},
the cache will be checked : if a result has been cached with the cache
key <i>requestCacheKey</i>, RoboSpice will consider the parameter
<i>cacheExpiryDuration</i> to determine wh... | [
"Gets",
"data",
"from",
"cache",
"expired",
"or",
"not",
"and",
"executes",
"a",
"request",
"normaly",
".",
"Before",
"invoking",
"the",
"method",
"{"
] | train | https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java#L518-L522 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.telephony_billingAccount_numberNogeographic_GET | public OvhOrder telephony_billingAccount_numberNogeographic_GET(String billingAccount, String ape, String city, OvhNumberCountryEnum country, Boolean displayUniversalDirectory, String email, String firstname, OvhLegalFormEnum legalform, String name, OvhNumberOffer offer, String organisation, String phone, OvhNumberPool... | java | public OvhOrder telephony_billingAccount_numberNogeographic_GET(String billingAccount, String ape, String city, OvhNumberCountryEnum country, Boolean displayUniversalDirectory, String email, String firstname, OvhLegalFormEnum legalform, String name, OvhNumberOffer offer, String organisation, String phone, OvhNumberPool... | [
"public",
"OvhOrder",
"telephony_billingAccount_numberNogeographic_GET",
"(",
"String",
"billingAccount",
",",
"String",
"ape",
",",
"String",
"city",
",",
"OvhNumberCountryEnum",
"country",
",",
"Boolean",
"displayUniversalDirectory",
",",
"String",
"email",
",",
"String... | Get prices and contracts information
REST: GET /order/telephony/{billingAccount}/numberNogeographic
@param firstname [required] Contact firstname
@param streetName [required] Street name
@param email [required]
@param organisation [required] Contact organisation
@param pool [required] Number of alias in case of pool
@... | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L6240-L6264 |
aalmiray/Json-lib | src/main/java/net/sf/json/JsonConfig.java | JsonConfig.registerPropertyExclusion | public void registerPropertyExclusion( Class target, String propertyName ) {
"""
Registers a exclusion for a target class.<br>
[Java -> JSON]
@param target the class to use as key
@param propertyName the property to be excluded
"""
if( target != null && propertyName != null ) {
Set set =... | java | public void registerPropertyExclusion( Class target, String propertyName ) {
if( target != null && propertyName != null ) {
Set set = (Set) exclusionMap.get( target );
if( set == null ){
set = new HashSet();
exclusionMap.put( target, set );
}
if( !set.c... | [
"public",
"void",
"registerPropertyExclusion",
"(",
"Class",
"target",
",",
"String",
"propertyName",
")",
"{",
"if",
"(",
"target",
"!=",
"null",
"&&",
"propertyName",
"!=",
"null",
")",
"{",
"Set",
"set",
"=",
"(",
"Set",
")",
"exclusionMap",
".",
"get",... | Registers a exclusion for a target class.<br>
[Java -> JSON]
@param target the class to use as key
@param propertyName the property to be excluded | [
"Registers",
"a",
"exclusion",
"for",
"a",
"target",
"class",
".",
"<br",
">",
"[",
"Java",
"-",
">",
";",
"JSON",
"]"
] | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JsonConfig.java#L866-L877 |
VueGWT/vue-gwt | core/src/main/java/com/axellience/vuegwt/core/client/tools/VueGWTTools.java | VueGWTTools.getDeepValue | public static <T> T getDeepValue(Object object, String path) {
"""
Return a "deep" value in a given object by following an expression in the form:
"parent.child.property". This only works if all the chain is exposed using JsInterop.
@param object The root object to get on
@param path The path to follow
@para... | java | public static <T> T getDeepValue(Object object, String path) {
JsPropertyMap objectMap = (JsPropertyMap) object;
String[] pathSplit = path.split("\\.");
for (String s : pathSplit) {
objectMap = (JsPropertyMap) objectMap.get(s);
}
return (T) objectMap;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getDeepValue",
"(",
"Object",
"object",
",",
"String",
"path",
")",
"{",
"JsPropertyMap",
"objectMap",
"=",
"(",
"JsPropertyMap",
")",
"object",
";",
"String",
"[",
"]",
"pathSplit",
"=",
"path",
".",
"split",
"("... | Return a "deep" value in a given object by following an expression in the form:
"parent.child.property". This only works if all the chain is exposed using JsInterop.
@param object The root object to get on
@param path The path to follow
@param <T> The type of object we get in return
@return The object at the end of th... | [
"Return",
"a",
"deep",
"value",
"in",
"a",
"given",
"object",
"by",
"following",
"an",
"expression",
"in",
"the",
"form",
":",
"parent",
".",
"child",
".",
"property",
".",
"This",
"only",
"works",
"if",
"all",
"the",
"chain",
"is",
"exposed",
"using",
... | train | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/core/src/main/java/com/axellience/vuegwt/core/client/tools/VueGWTTools.java#L98-L105 |
jenkinsci/java-client-api | jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java | JenkinsServer.createJob | public JenkinsServer createJob(String jobName, String jobXml) throws IOException {
"""
Create a job on the server using the provided xml
@param jobName name of the job to be created.
@param jobXml the <code>config.xml</code> which should be used to create
the job.
@throws IOException in case of an error.
... | java | public JenkinsServer createJob(String jobName, String jobXml) throws IOException {
return createJob(null, jobName, jobXml, false);
} | [
"public",
"JenkinsServer",
"createJob",
"(",
"String",
"jobName",
",",
"String",
"jobXml",
")",
"throws",
"IOException",
"{",
"return",
"createJob",
"(",
"null",
",",
"jobName",
",",
"jobXml",
",",
"false",
")",
";",
"}"
] | Create a job on the server using the provided xml
@param jobName name of the job to be created.
@param jobXml the <code>config.xml</code> which should be used to create
the job.
@throws IOException in case of an error. | [
"Create",
"a",
"job",
"on",
"the",
"server",
"using",
"the",
"provided",
"xml"
] | train | https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java#L344-L346 |
etnetera/seb | src/main/java/cz/etnetera/seb/SebContextWait.java | SebContextWait.untilValid | public <V> V untilValid(Function<SebContext, V> isTrue) {
"""
Until method using function functional interface. It solves ambiguity
when using basic until method without typed parameter.
Repeatedly applies this instance's input value to the given function
until one of the following occurs:
<ol>
<li>the func... | java | public <V> V untilValid(Function<SebContext, V> isTrue) {
return super.until(new com.google.common.base.Function<SebContext, V>() {
@Override
public V apply(SebContext input) {
return isTrue.apply(input);
}
});
} | [
"public",
"<",
"V",
">",
"V",
"untilValid",
"(",
"Function",
"<",
"SebContext",
",",
"V",
">",
"isTrue",
")",
"{",
"return",
"super",
".",
"until",
"(",
"new",
"com",
".",
"google",
".",
"common",
".",
"base",
".",
"Function",
"<",
"SebContext",
",",... | Until method using function functional interface. It solves ambiguity
when using basic until method without typed parameter.
Repeatedly applies this instance's input value to the given function
until one of the following occurs:
<ol>
<li>the function returns neither null nor false,</li>
<li>the function throws an unig... | [
"Until",
"method",
"using",
"function",
"functional",
"interface",
".",
"It",
"solves",
"ambiguity",
"when",
"using",
"basic",
"until",
"method",
"without",
"typed",
"parameter",
"."
] | train | https://github.com/etnetera/seb/blob/6aed29c7726db12f440c60cfd253de229064ed04/src/main/java/cz/etnetera/seb/SebContextWait.java#L125-L132 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/RelativeDateFormat.java | RelativeDateFormat.initializeCalendar | private Calendar initializeCalendar(TimeZone zone, ULocale locale) {
"""
initializes fCalendar from parameters. Returns fCalendar as a convenience.
@param zone Zone to be adopted, or NULL for TimeZone::createDefault().
@param locale Locale of the calendar
@param status Error code
@return the newly constructe... | java | private Calendar initializeCalendar(TimeZone zone, ULocale locale) {
if (calendar == null) {
if(zone == null) {
calendar = Calendar.getInstance(locale);
} else {
calendar = Calendar.getInstance(zone, locale);
}
}
return calendar... | [
"private",
"Calendar",
"initializeCalendar",
"(",
"TimeZone",
"zone",
",",
"ULocale",
"locale",
")",
"{",
"if",
"(",
"calendar",
"==",
"null",
")",
"{",
"if",
"(",
"zone",
"==",
"null",
")",
"{",
"calendar",
"=",
"Calendar",
".",
"getInstance",
"(",
"loc... | initializes fCalendar from parameters. Returns fCalendar as a convenience.
@param zone Zone to be adopted, or NULL for TimeZone::createDefault().
@param locale Locale of the calendar
@param status Error code
@return the newly constructed fCalendar | [
"initializes",
"fCalendar",
"from",
"parameters",
".",
"Returns",
"fCalendar",
"as",
"a",
"convenience",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/RelativeDateFormat.java#L326-L335 |
augustd/burp-suite-utils | src/main/java/com/codemagi/burp/Utils.java | Utils.getFileAsString | public static String getFileAsString(File file) throws FileNotFoundException, IOException {
"""
Returns the <code>String</code> contents of an ASCII file.
<p>
This method throws any fileIO errors.
@param file File to read.
@return String The contents of the file as a String.
@throws java.io.FileNotFoundExce... | java | public static String getFileAsString(File file) throws FileNotFoundException, IOException {
byte[] inputbytes;
try (RandomAccessFile inputFile = new RandomAccessFile(file, "r")) {
int length = (int) inputFile.length();
inputbytes = new byte[length];
int numread = inp... | [
"public",
"static",
"String",
"getFileAsString",
"(",
"File",
"file",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"byte",
"[",
"]",
"inputbytes",
";",
"try",
"(",
"RandomAccessFile",
"inputFile",
"=",
"new",
"RandomAccessFile",
"(",
"file",
... | Returns the <code>String</code> contents of an ASCII file.
<p>
This method throws any fileIO errors.
@param file File to read.
@return String The contents of the file as a String.
@throws java.io.FileNotFoundException If the input file cannot be found
@throws java.io.IOException If other I/O errors occur | [
"Returns",
"the",
"<code",
">",
"String<",
"/",
"code",
">",
"contents",
"of",
"an",
"ASCII",
"file",
".",
"<p",
">",
"This",
"method",
"throws",
"any",
"fileIO",
"errors",
"."
] | train | https://github.com/augustd/burp-suite-utils/blob/5e34a6b9147f5705382f98049dd9e4f387b78629/src/main/java/com/codemagi/burp/Utils.java#L288-L296 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/HpelFormatter.java | HpelFormatter.addCustomLevel | public static Level addCustomLevel(String name, int intValue, String id, String resourceBundleName) {
"""
Adds extra level recognizable by this formatter and Level.parse()
@param name name of the level
@param intValue integer value of the level
@param id one character id to use for this level. If it's <code>n... | java | public static Level addCustomLevel(String name, int intValue, String id, String resourceBundleName) {
if (name == null) {
throw new IllegalArgumentException("Parameter name can not be 'null' in this call.");
}
// Don't add duplicate entries but allow different names for the same leve... | [
"public",
"static",
"Level",
"addCustomLevel",
"(",
"String",
"name",
",",
"int",
"intValue",
",",
"String",
"id",
",",
"String",
"resourceBundleName",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"P... | Adds extra level recognizable by this formatter and Level.parse()
@param name name of the level
@param intValue integer value of the level
@param id one character id to use for this level. If it's <code>null</code> first character of the level name will be used
@param resourceBundleName resource bundle to use for leve... | [
"Adds",
"extra",
"level",
"recognizable",
"by",
"this",
"formatter",
"and",
"Level",
".",
"parse",
"()"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/HpelFormatter.java#L139-L156 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/PippoSettings.java | PippoSettings.getDurationInSeconds | public long getDurationInSeconds(String name, long defaultValue) {
"""
Gets the duration setting and converts it to seconds.
<p/>
The setting must be use one of the following conventions:
<ul>
<li>n MILLISECONDS
<li>n SECONDS
<li>n MINUTES
<li>n HOURS
<li>n DAYS
</ul>
@param name
@param defaultValue i... | java | public long getDurationInSeconds(String name, long defaultValue) {
TimeUnit timeUnit = extractTimeUnit(name, defaultValue + " SECONDS");
long duration = getLong(name, defaultValue);
return timeUnit.toSeconds(duration);
} | [
"public",
"long",
"getDurationInSeconds",
"(",
"String",
"name",
",",
"long",
"defaultValue",
")",
"{",
"TimeUnit",
"timeUnit",
"=",
"extractTimeUnit",
"(",
"name",
",",
"defaultValue",
"+",
"\" SECONDS\"",
")",
";",
"long",
"duration",
"=",
"getLong",
"(",
"n... | Gets the duration setting and converts it to seconds.
<p/>
The setting must be use one of the following conventions:
<ul>
<li>n MILLISECONDS
<li>n SECONDS
<li>n MINUTES
<li>n HOURS
<li>n DAYS
</ul>
@param name
@param defaultValue in seconds
@return seconds | [
"Gets",
"the",
"duration",
"setting",
"and",
"converts",
"it",
"to",
"seconds",
".",
"<p",
"/",
">",
"The",
"setting",
"must",
"be",
"use",
"one",
"of",
"the",
"following",
"conventions",
":",
"<ul",
">",
"<li",
">",
"n",
"MILLISECONDS",
"<li",
">",
"n... | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/PippoSettings.java#L845-L850 |
ZieIony/Carbon | carbon/src/main/java/carbon/shadow/ShapeAppearanceModel.java | ShapeAppearanceModel.setBottomRightCorner | public void setBottomRightCorner(@CornerFamily int cornerFamily, @Dimension int cornerSize) {
"""
Sets the corner treatment for the bottom-right corner.
@param cornerFamily the family to use to create the corner treatment
@param cornerSize the size to use to create the corner treatment
"""
setBot... | java | public void setBottomRightCorner(@CornerFamily int cornerFamily, @Dimension int cornerSize) {
setBottomRightCorner(MaterialShapeUtils.createCornerTreatment(cornerFamily, cornerSize));
} | [
"public",
"void",
"setBottomRightCorner",
"(",
"@",
"CornerFamily",
"int",
"cornerFamily",
",",
"@",
"Dimension",
"int",
"cornerSize",
")",
"{",
"setBottomRightCorner",
"(",
"MaterialShapeUtils",
".",
"createCornerTreatment",
"(",
"cornerFamily",
",",
"cornerSize",
")... | Sets the corner treatment for the bottom-right corner.
@param cornerFamily the family to use to create the corner treatment
@param cornerSize the size to use to create the corner treatment | [
"Sets",
"the",
"corner",
"treatment",
"for",
"the",
"bottom",
"-",
"right",
"corner",
"."
] | train | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/shadow/ShapeAppearanceModel.java#L288-L290 |
eclipse/xtext-core | org.eclipse.xtext/src/org/eclipse/xtext/resource/SaveOptions.java | SaveOptions.getOptions | @SuppressWarnings("deprecation")
public static SaveOptions getOptions(Map<?, ?> saveOptions) {
"""
Transparently handles the deprecated options that could be passed as
map-entries to {@link org.eclipse.emf.ecore.resource.Resource#save(Map)}
and converts them to semantically equal {@link SaveOptions}.
@param ... | java | @SuppressWarnings("deprecation")
public static SaveOptions getOptions(Map<?, ?> saveOptions) {
if (saveOptions == null || saveOptions.isEmpty())
return defaultOptions();
if (saveOptions.containsKey(KEY))
return (SaveOptions) saveOptions.get(KEY);
if (saveOptions.containsKey(XtextResource.OPTION_SERIALIZATI... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"static",
"SaveOptions",
"getOptions",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"saveOptions",
")",
"{",
"if",
"(",
"saveOptions",
"==",
"null",
"||",
"saveOptions",
".",
"isEmpty",
"(",
")",
")",... | Transparently handles the deprecated options that could be passed as
map-entries to {@link org.eclipse.emf.ecore.resource.Resource#save(Map)}
and converts them to semantically equal {@link SaveOptions}.
@param saveOptions the options-map or <code>null</code> if none.
@return the options to use. Will never return <code... | [
"Transparently",
"handles",
"the",
"deprecated",
"options",
"that",
"could",
"be",
"passed",
"as",
"map",
"-",
"entries",
"to",
"{",
"@link",
"org",
".",
"eclipse",
".",
"emf",
".",
"ecore",
".",
"resource",
".",
"Resource#save",
"(",
"Map",
")",
"}",
"a... | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext/src/org/eclipse/xtext/resource/SaveOptions.java#L47-L60 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/style/stylers/Image.java | Image.addToCanvas | public void addToCanvas(float[] tf, com.itextpdf.text.Image img, PdfContentByte canvas) throws DocumentException {
"""
Adds an image to a canvas applying the transform if it is not null. Calls {@link DebugHelper#debugAnnotation(com.itextpdf.text.Rectangle, java.lang.String, com.itextpdf.text.pdf.PdfWriter)
}.
... | java | public void addToCanvas(float[] tf, com.itextpdf.text.Image img, PdfContentByte canvas) throws DocumentException {
if (tf == null) {
canvas.addImage(img);
} else {
canvas.addImage(img,
img.getWidth() * tf[TRANSFORMMATRIX.SCALEX.getIndex()],
tf[TRANSFORMMATRIX.SHEA... | [
"public",
"void",
"addToCanvas",
"(",
"float",
"[",
"]",
"tf",
",",
"com",
".",
"itextpdf",
".",
"text",
".",
"Image",
"img",
",",
"PdfContentByte",
"canvas",
")",
"throws",
"DocumentException",
"{",
"if",
"(",
"tf",
"==",
"null",
")",
"{",
"canvas",
"... | Adds an image to a canvas applying the transform if it is not null. Calls {@link DebugHelper#debugAnnotation(com.itextpdf.text.Rectangle, java.lang.String, com.itextpdf.text.pdf.PdfWriter)
}.
@param tf may be null, the transform matrix to apply to the image
@param img
@param canvas
@throws DocumentException | [
"Adds",
"an",
"image",
"to",
"a",
"canvas",
"applying",
"the",
"transform",
"if",
"it",
"is",
"not",
"null",
".",
"Calls",
"{",
"@link",
"DebugHelper#debugAnnotation",
"(",
"com",
".",
"itextpdf",
".",
"text",
".",
"Rectangle",
"java",
".",
"lang",
".",
... | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/style/stylers/Image.java#L134-L160 |
VoltDB/voltdb | src/frontend/org/voltdb/SQLStmt.java | SQLStmt.getText | public String getText() {
"""
Get the text of the SQL statement represented.
@return String containing the text of the SQL statement represented.
"""
if (sqlTextStr == null) {
sqlTextStr = new String(sqlText, Constants.UTF8ENCODING);
}
return sqlTextStr;
} | java | public String getText() {
if (sqlTextStr == null) {
sqlTextStr = new String(sqlText, Constants.UTF8ENCODING);
}
return sqlTextStr;
} | [
"public",
"String",
"getText",
"(",
")",
"{",
"if",
"(",
"sqlTextStr",
"==",
"null",
")",
"{",
"sqlTextStr",
"=",
"new",
"String",
"(",
"sqlText",
",",
"Constants",
".",
"UTF8ENCODING",
")",
";",
"}",
"return",
"sqlTextStr",
";",
"}"
] | Get the text of the SQL statement represented.
@return String containing the text of the SQL statement represented. | [
"Get",
"the",
"text",
"of",
"the",
"SQL",
"statement",
"represented",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/SQLStmt.java#L201-L206 |
facebookarchive/swift | swift-codec/src/main/java/com/facebook/swift/codec/internal/compiler/ThriftCodecByteCodeGenerator.java | ThriftCodecByteCodeGenerator.injectStructFields | private void injectStructFields(MethodDefinition read, LocalVariableDefinition instance, Map<Short, LocalVariableDefinition> structData) {
"""
Defines the code to inject data into the struct public fields.
"""
for (ThriftFieldMetadata field : metadata.getFields(THRIFT_FIELD)) {
injectField(... | java | private void injectStructFields(MethodDefinition read, LocalVariableDefinition instance, Map<Short, LocalVariableDefinition> structData)
{
for (ThriftFieldMetadata field : metadata.getFields(THRIFT_FIELD)) {
injectField(read, field, instance, structData.get(field.getId()));
}
} | [
"private",
"void",
"injectStructFields",
"(",
"MethodDefinition",
"read",
",",
"LocalVariableDefinition",
"instance",
",",
"Map",
"<",
"Short",
",",
"LocalVariableDefinition",
">",
"structData",
")",
"{",
"for",
"(",
"ThriftFieldMetadata",
"field",
":",
"metadata",
... | Defines the code to inject data into the struct public fields. | [
"Defines",
"the",
"code",
"to",
"inject",
"data",
"into",
"the",
"struct",
"public",
"fields",
"."
] | train | https://github.com/facebookarchive/swift/blob/3f1f098a50d6106f50cd6fe1c361dd373ede0197/swift-codec/src/main/java/com/facebook/swift/codec/internal/compiler/ThriftCodecByteCodeGenerator.java#L452-L457 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/item/MalisisItemBlock.java | MalisisItemBlock.onItemUse | @Override
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
"""
onItemUse needs to be overriden to be able to handle merged blocks and components.
"""
ItemStack itemStack = player.getHeldItem(hand);
if (i... | java | @Override
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
{
ItemStack itemStack = player.getHeldItem(hand);
if (itemStack.isEmpty())
return EnumActionResult.FAIL;
if (!player.canPlayerEdit(pos.offset(side), ... | [
"@",
"Override",
"public",
"EnumActionResult",
"onItemUse",
"(",
"EntityPlayer",
"player",
",",
"World",
"world",
",",
"BlockPos",
"pos",
",",
"EnumHand",
"hand",
",",
"EnumFacing",
"side",
",",
"float",
"hitX",
",",
"float",
"hitY",
",",
"float",
"hitZ",
")... | onItemUse needs to be overriden to be able to handle merged blocks and components. | [
"onItemUse",
"needs",
"to",
"be",
"overriden",
"to",
"be",
"able",
"to",
"handle",
"merged",
"blocks",
"and",
"components",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/item/MalisisItemBlock.java#L92-L133 |
google/closure-compiler | src/com/google/javascript/jscomp/NodeUtil.java | NodeUtil.visitPostOrder | public static void visitPostOrder(Node node, Visitor visitor) {
"""
A post-order traversal, calling Visitor.visit for each decendent.
"""
visitPostOrder(node, visitor, Predicates.alwaysTrue());
} | java | public static void visitPostOrder(Node node, Visitor visitor) {
visitPostOrder(node, visitor, Predicates.alwaysTrue());
} | [
"public",
"static",
"void",
"visitPostOrder",
"(",
"Node",
"node",
",",
"Visitor",
"visitor",
")",
"{",
"visitPostOrder",
"(",
"node",
",",
"visitor",
",",
"Predicates",
".",
"alwaysTrue",
"(",
")",
")",
";",
"}"
] | A post-order traversal, calling Visitor.visit for each decendent. | [
"A",
"post",
"-",
"order",
"traversal",
"calling",
"Visitor",
".",
"visit",
"for",
"each",
"decendent",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/NodeUtil.java#L4737-L4739 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/model/VarTensor.java | VarTensor.getMarginal | public VarTensor getMarginal(VarSet vars, boolean normalize) {
"""
Gets the marginal distribution over a subset of the variables in this
factor, optionally normalized.
@param vars The subset of variables for the marginal distribution. This will sum over all variables not in this set.
@param normalize Whether ... | java | public VarTensor getMarginal(VarSet vars, boolean normalize) {
VarSet margVars = new VarSet(this.vars);
margVars.retainAll(vars);
VarTensor marg = new VarTensor(s, margVars, s.zero());
if (margVars.size() == 0) {
return marg;
}
IntIter iter =... | [
"public",
"VarTensor",
"getMarginal",
"(",
"VarSet",
"vars",
",",
"boolean",
"normalize",
")",
"{",
"VarSet",
"margVars",
"=",
"new",
"VarSet",
"(",
"this",
".",
"vars",
")",
";",
"margVars",
".",
"retainAll",
"(",
"vars",
")",
";",
"VarTensor",
"marg",
... | Gets the marginal distribution over a subset of the variables in this
factor, optionally normalized.
@param vars The subset of variables for the marginal distribution. This will sum over all variables not in this set.
@param normalize Whether to normalize the resulting distribution.
@return The marginal distribution. | [
"Gets",
"the",
"marginal",
"distribution",
"over",
"a",
"subset",
"of",
"the",
"variables",
"in",
"this",
"factor",
"optionally",
"normalized",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/model/VarTensor.java#L65-L85 |
nats-io/java-nats | src/main/java/io/nats/client/NKey.java | NKey.createServer | public static NKey createServer(SecureRandom random)
throws IOException, NoSuchProviderException, NoSuchAlgorithmException {
"""
Create a Server NKey from the provided random number generator.
If no random is provided, SecureRandom.getInstance("SHA1PRNG", "SUN") will be used to creat eone.
The ne... | java | public static NKey createServer(SecureRandom random)
throws IOException, NoSuchProviderException, NoSuchAlgorithmException {
return createPair(Type.SERVER, random);
} | [
"public",
"static",
"NKey",
"createServer",
"(",
"SecureRandom",
"random",
")",
"throws",
"IOException",
",",
"NoSuchProviderException",
",",
"NoSuchAlgorithmException",
"{",
"return",
"createPair",
"(",
"Type",
".",
"SERVER",
",",
"random",
")",
";",
"}"
] | Create a Server NKey from the provided random number generator.
If no random is provided, SecureRandom.getInstance("SHA1PRNG", "SUN") will be used to creat eone.
The new NKey contains the private seed, which should be saved in a secure location.
@param random A secure random provider
@return the new Nkey
@throws IOE... | [
"Create",
"a",
"Server",
"NKey",
"from",
"the",
"provided",
"random",
"number",
"generator",
"."
] | train | https://github.com/nats-io/java-nats/blob/5f291048fd30192ba39b3fe2925ecd60aaad6b48/src/main/java/io/nats/client/NKey.java#L533-L536 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/data/AnyValueMap.java | AnyValueMap.getAsDateTimeWithDefault | public ZonedDateTime getAsDateTimeWithDefault(String key, ZonedDateTime defaultValue) {
"""
Converts map element into a Date or returns default value if conversion is
not possible.
@param key a key of element to get.
@param defaultValue the default value
@return ZonedDateTime value of the element or... | java | public ZonedDateTime getAsDateTimeWithDefault(String key, ZonedDateTime defaultValue) {
Object value = getAsObject(key);
return DateTimeConverter.toDateTimeWithDefault(value, defaultValue);
} | [
"public",
"ZonedDateTime",
"getAsDateTimeWithDefault",
"(",
"String",
"key",
",",
"ZonedDateTime",
"defaultValue",
")",
"{",
"Object",
"value",
"=",
"getAsObject",
"(",
"key",
")",
";",
"return",
"DateTimeConverter",
".",
"toDateTimeWithDefault",
"(",
"value",
",",
... | Converts map element into a Date or returns default value if conversion is
not possible.
@param key a key of element to get.
@param defaultValue the default value
@return ZonedDateTime value of the element or default value if conversion is not
supported.
@see DateTimeConverter#toDateTimeWithDefault(Object, Z... | [
"Converts",
"map",
"element",
"into",
"a",
"Date",
"or",
"returns",
"default",
"value",
"if",
"conversion",
"is",
"not",
"possible",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/data/AnyValueMap.java#L419-L422 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java | SynchronousRequest.getEventDetailedInfo | public EventDetail getEventDetailedInfo(String id) throws GuildWars2Exception {
"""
For more info on event detail API go <a href="https://wiki.guildwars2.com/wiki/API:1/event_details">here</a><br/>
@param id event id
@return event details
@throws GuildWars2Exception see {@link ErrorCode} for detail
@see Even... | java | public EventDetail getEventDetailedInfo(String id) throws GuildWars2Exception {
isParamValid(new ParamChecker(ParamType.ID, id));
try {
Response<EventDetail> response = gw2API.getEventDetailedInfo(id, GuildWars2.lang.getValue()).execute();
if (!response.isSuccessful()) throwError(response.code(), response.err... | [
"public",
"EventDetail",
"getEventDetailedInfo",
"(",
"String",
"id",
")",
"throws",
"GuildWars2Exception",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"ParamType",
".",
"ID",
",",
"id",
")",
")",
";",
"try",
"{",
"Response",
"<",
"EventDetail",
">",... | For more info on event detail API go <a href="https://wiki.guildwars2.com/wiki/API:1/event_details">here</a><br/>
@param id event id
@return event details
@throws GuildWars2Exception see {@link ErrorCode} for detail
@see EventDetail event detail | [
"For",
"more",
"info",
"on",
"event",
"detail",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"1",
"/",
"event_details",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">"
] | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java#L79-L88 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobExecutionsInner.java | JobExecutionsInner.listByAgentAsync | public Observable<Page<JobExecutionInner>> listByAgentAsync(final String resourceGroupName, final String serverName, final String jobAgentName) {
"""
Lists all executions in a job agent.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure ... | java | public Observable<Page<JobExecutionInner>> listByAgentAsync(final String resourceGroupName, final String serverName, final String jobAgentName) {
return listByAgentWithServiceResponseAsync(resourceGroupName, serverName, jobAgentName)
.map(new Func1<ServiceResponse<Page<JobExecutionInner>>, Page<JobE... | [
"public",
"Observable",
"<",
"Page",
"<",
"JobExecutionInner",
">",
">",
"listByAgentAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"serverName",
",",
"final",
"String",
"jobAgentName",
")",
"{",
"return",
"listByAgentWithServiceResponseA... | Lists all executions in a job agent.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param jobAgentName The name of the job agent.
@throws IllegalArgumentException... | [
"Lists",
"all",
"executions",
"in",
"a",
"job",
"agent",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobExecutionsInner.java#L158-L166 |
segmentio/analytics-android | analytics/src/main/java/com/segment/analytics/ValueMap.java | ValueMap.getEnum | public <T extends Enum<T>> T getEnum(Class<T> enumType, String key) {
"""
Returns the value mapped by {@code key} if it exists and is a enum or can be coerced to an
enum. Returns null otherwise.
"""
if (enumType == null) {
throw new IllegalArgumentException("enumType may not be null");
}
Obj... | java | public <T extends Enum<T>> T getEnum(Class<T> enumType, String key) {
if (enumType == null) {
throw new IllegalArgumentException("enumType may not be null");
}
Object value = get(key);
if (enumType.isInstance(value)) {
//noinspection unchecked
return (T) value;
} else if (value ins... | [
"public",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"T",
"getEnum",
"(",
"Class",
"<",
"T",
">",
"enumType",
",",
"String",
"key",
")",
"{",
"if",
"(",
"enumType",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"enu... | Returns the value mapped by {@code key} if it exists and is a enum or can be coerced to an
enum. Returns null otherwise. | [
"Returns",
"the",
"value",
"mapped",
"by",
"{"
] | train | https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/ValueMap.java#L292-L305 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.addAll | public static <T> boolean addAll(Collection<T> self, T[] items) {
"""
Modifies the collection by adding all of the elements in the specified array to the collection.
The behavior of this operation is undefined if
the specified array is modified while the operation is in progress.
See also <code>plus</code> or... | java | public static <T> boolean addAll(Collection<T> self, T[] items) {
return self.addAll(Arrays.asList(items));
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"addAll",
"(",
"Collection",
"<",
"T",
">",
"self",
",",
"T",
"[",
"]",
"items",
")",
"{",
"return",
"self",
".",
"addAll",
"(",
"Arrays",
".",
"asList",
"(",
"items",
")",
")",
";",
"}"
] | Modifies the collection by adding all of the elements in the specified array to the collection.
The behavior of this operation is undefined if
the specified array is modified while the operation is in progress.
See also <code>plus</code> or the '+' operator if wanting to produce a new collection
containing additional ... | [
"Modifies",
"the",
"collection",
"by",
"adding",
"all",
"of",
"the",
"elements",
"in",
"the",
"specified",
"array",
"to",
"the",
"collection",
".",
"The",
"behavior",
"of",
"this",
"operation",
"is",
"undefined",
"if",
"the",
"specified",
"array",
"is",
"mod... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L5136-L5138 |
ivanceras/orm | src/main/java/com/ivanceras/db/server/util/DAOGenerator.java | DAOGenerator.start | public void start() throws Exception {
"""
Curated will correct The ModelDef
@param curated
@throws Exception
"""
if(cleanupDirectory){
CleanUp.start(conf);
}
IDatabaseDev db = (IDatabaseDev) em.getDB();//TODO make sure DB platform can be used for development
ModelDefinitionProvider provider = new... | java | public void start() throws Exception{
if(cleanupDirectory){
CleanUp.start(conf);
}
IDatabaseDev db = (IDatabaseDev) em.getDB();//TODO make sure DB platform can be used for development
ModelDefinitionProvider provider = new ModelDefinitionProvider(db, conf.dbUser, null, conf.includeSchema);
ModelDef[] origM... | [
"public",
"void",
"start",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"cleanupDirectory",
")",
"{",
"CleanUp",
".",
"start",
"(",
"conf",
")",
";",
"}",
"IDatabaseDev",
"db",
"=",
"(",
"IDatabaseDev",
")",
"em",
".",
"getDB",
"(",
")",
";",
"//... | Curated will correct The ModelDef
@param curated
@throws Exception | [
"Curated",
"will",
"correct",
"The",
"ModelDef"
] | train | https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/server/util/DAOGenerator.java#L79-L107 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/Interval.java | Interval.isIntervalComparable | public boolean isIntervalComparable(Interval<E> other) {
"""
Checks whether this interval is comparable with another interval
comes before or after
@param other interval to compare with
"""
int flags = getRelationFlags(other);
if (checkMultipleBitSet(flags & REL_FLAGS_INTERVAL_UNKNOWN)) {
re... | java | public boolean isIntervalComparable(Interval<E> other)
{
int flags = getRelationFlags(other);
if (checkMultipleBitSet(flags & REL_FLAGS_INTERVAL_UNKNOWN)) {
return false;
}
return checkFlagSet(flags, REL_FLAGS_INTERVAL_BEFORE) || checkFlagSet(flags, REL_FLAGS_INTERVAL_AFTER);
} | [
"public",
"boolean",
"isIntervalComparable",
"(",
"Interval",
"<",
"E",
">",
"other",
")",
"{",
"int",
"flags",
"=",
"getRelationFlags",
"(",
"other",
")",
";",
"if",
"(",
"checkMultipleBitSet",
"(",
"flags",
"&",
"REL_FLAGS_INTERVAL_UNKNOWN",
")",
")",
"{",
... | Checks whether this interval is comparable with another interval
comes before or after
@param other interval to compare with | [
"Checks",
"whether",
"this",
"interval",
"is",
"comparable",
"with",
"another",
"interval",
"comes",
"before",
"or",
"after"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/Interval.java#L590-L597 |
Azure/azure-sdk-for-java | recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobsInner.java | JobsInner.exportAsync | public Observable<Void> exportAsync(String vaultName, String resourceGroupName) {
"""
Exports all jobs for a given Shared Access Signatures (SAS) URL. The SAS URL expires within 15 minutes of its creation.
@param vaultName The name of the Recovery Services vault.
@param resourceGroupName The name of the resour... | java | public Observable<Void> exportAsync(String vaultName, String resourceGroupName) {
return exportWithServiceResponseAsync(vaultName, resourceGroupName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return respons... | [
"public",
"Observable",
"<",
"Void",
">",
"exportAsync",
"(",
"String",
"vaultName",
",",
"String",
"resourceGroupName",
")",
"{",
"return",
"exportWithServiceResponseAsync",
"(",
"vaultName",
",",
"resourceGroupName",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
... | Exports all jobs for a given Shared Access Signatures (SAS) URL. The SAS URL expires within 15 minutes of its creation.
@param vaultName The name of the Recovery Services vault.
@param resourceGroupName The name of the resource group associated with the Recovery Services vault.
@throws IllegalArgumentException thrown ... | [
"Exports",
"all",
"jobs",
"for",
"a",
"given",
"Shared",
"Access",
"Signatures",
"(",
"SAS",
")",
"URL",
".",
"The",
"SAS",
"URL",
"expires",
"within",
"15",
"minutes",
"of",
"its",
"creation",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/JobsInner.java#L109-L116 |
perwendel/spark | src/main/java/spark/embeddedserver/jetty/SocketConnectorFactory.java | SocketConnectorFactory.createSocketConnector | public static ServerConnector createSocketConnector(Server server, String host, int port) {
"""
Creates an ordinary, non-secured Jetty server jetty.
@param server Jetty server
@param host host
@param port port
@return - a server jetty
"""
Assert.notNull(server, "'server' must not be null");
... | java | public static ServerConnector createSocketConnector(Server server, String host, int port) {
Assert.notNull(server, "'server' must not be null");
Assert.notNull(host, "'host' must not be null");
HttpConnectionFactory httpConnectionFactory = createHttpConnectionFactory();
ServerConnector ... | [
"public",
"static",
"ServerConnector",
"createSocketConnector",
"(",
"Server",
"server",
",",
"String",
"host",
",",
"int",
"port",
")",
"{",
"Assert",
".",
"notNull",
"(",
"server",
",",
"\"'server' must not be null\"",
")",
";",
"Assert",
".",
"notNull",
"(",
... | Creates an ordinary, non-secured Jetty server jetty.
@param server Jetty server
@param host host
@param port port
@return - a server jetty | [
"Creates",
"an",
"ordinary",
"non",
"-",
"secured",
"Jetty",
"server",
"jetty",
"."
] | train | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/embeddedserver/jetty/SocketConnectorFactory.java#L44-L52 |
Whiley/WhileyCompiler | src/main/java/wyil/transform/VerificationConditionGenerator.java | VerificationConditionGenerator.freeVariables | public void freeVariables(SyntacticItem e, Set<WyalFile.VariableDeclaration> freeVars) {
"""
Determine all free variables which are used within the given expression. A
free variable is one which is not bound within the expression itself.
@param e
@param freeVars
"""
if (e instanceof Expr.VariableAccess)... | java | public void freeVariables(SyntacticItem e, Set<WyalFile.VariableDeclaration> freeVars) {
if (e instanceof Expr.VariableAccess) {
Expr.VariableAccess va = (Expr.VariableAccess) e;
freeVars.add(va.getVariableDeclaration());
} else if (e instanceof Expr.Quantifier) {
Expr.Quantifier q = (Expr.Quantifier) e;
... | [
"public",
"void",
"freeVariables",
"(",
"SyntacticItem",
"e",
",",
"Set",
"<",
"WyalFile",
".",
"VariableDeclaration",
">",
"freeVars",
")",
"{",
"if",
"(",
"e",
"instanceof",
"Expr",
".",
"VariableAccess",
")",
"{",
"Expr",
".",
"VariableAccess",
"va",
"=",... | Determine all free variables which are used within the given expression. A
free variable is one which is not bound within the expression itself.
@param e
@param freeVars | [
"Determine",
"all",
"free",
"variables",
"which",
"are",
"used",
"within",
"the",
"given",
"expression",
".",
"A",
"free",
"variable",
"is",
"one",
"which",
"is",
"not",
"bound",
"within",
"the",
"expression",
"itself",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/transform/VerificationConditionGenerator.java#L2500-L2519 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Start.java | Start.setOption | private void setOption(String opt, List<String> arguments) {
"""
indicate an option with the specified list of arguments was given.
"""
String[] args = new String[arguments.length() + 1];
int k = 0;
args[k++] = opt;
for (List<String> i = arguments; i.nonEmpty(); i=i.tail) {
... | java | private void setOption(String opt, List<String> arguments) {
String[] args = new String[arguments.length() + 1];
int k = 0;
args[k++] = opt;
for (List<String> i = arguments; i.nonEmpty(); i=i.tail) {
args[k++] = i.head;
}
options.append(args);
} | [
"private",
"void",
"setOption",
"(",
"String",
"opt",
",",
"List",
"<",
"String",
">",
"arguments",
")",
"{",
"String",
"[",
"]",
"args",
"=",
"new",
"String",
"[",
"arguments",
".",
"length",
"(",
")",
"+",
"1",
"]",
";",
"int",
"k",
"=",
"0",
"... | indicate an option with the specified list of arguments was given. | [
"indicate",
"an",
"option",
"with",
"the",
"specified",
"list",
"of",
"arguments",
"was",
"given",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Start.java#L561-L569 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.fromAction | public static <R> Observable<R> fromAction(Action0 action, R result) {
"""
Return an Observable that calls the given action and emits the given result when an Observer subscribes.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/fromAction.png" alt="">
<p>
The action i... | java | public static <R> Observable<R> fromAction(Action0 action, R result) {
return fromAction(action, result, Schedulers.computation());
} | [
"public",
"static",
"<",
"R",
">",
"Observable",
"<",
"R",
">",
"fromAction",
"(",
"Action0",
"action",
",",
"R",
"result",
")",
"{",
"return",
"fromAction",
"(",
"action",
",",
"result",
",",
"Schedulers",
".",
"computation",
"(",
")",
")",
";",
"}"
] | Return an Observable that calls the given action and emits the given result when an Observer subscribes.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/fromAction.png" alt="">
<p>
The action is run on the default thread pool for computation.
@param <R> the return type
@param... | [
"Return",
"an",
"Observable",
"that",
"calls",
"the",
"given",
"action",
"and",
"emits",
"the",
"given",
"result",
"when",
"an",
"Observer",
"subscribes",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L1987-L1989 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/stereo/StereoElementFactory.java | StereoElementFactory.using3DCoordinates | public static StereoElementFactory using3DCoordinates(IAtomContainer container) {
"""
Create a stereo element factory for creating stereo elements using 3D
coordinates and depiction labels (up/down, wedge/hatch).
@param container the structure to create the factory for
@return the factory instance
"""
... | java | public static StereoElementFactory using3DCoordinates(IAtomContainer container) {
EdgeToBondMap bondMap = EdgeToBondMap.withSpaceFor(container);
int[][] graph = GraphUtil.toAdjList(container, bondMap);
return new StereoElementFactory3D(container, graph, bondMap).checkSymmetry(true);
} | [
"public",
"static",
"StereoElementFactory",
"using3DCoordinates",
"(",
"IAtomContainer",
"container",
")",
"{",
"EdgeToBondMap",
"bondMap",
"=",
"EdgeToBondMap",
".",
"withSpaceFor",
"(",
"container",
")",
";",
"int",
"[",
"]",
"[",
"]",
"graph",
"=",
"GraphUtil",... | Create a stereo element factory for creating stereo elements using 3D
coordinates and depiction labels (up/down, wedge/hatch).
@param container the structure to create the factory for
@return the factory instance | [
"Create",
"a",
"stereo",
"element",
"factory",
"for",
"creating",
"stereo",
"elements",
"using",
"3D",
"coordinates",
"and",
"depiction",
"labels",
"(",
"up",
"/",
"down",
"wedge",
"/",
"hatch",
")",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/stereo/StereoElementFactory.java#L496-L500 |
medallia/Word2VecJava | src/main/java/com/medallia/word2vec/util/ProfilingTimer.java | ProfilingTimer.createSubtasksAndSerialization | public static ProfilingTimer createSubtasksAndSerialization(ByteArrayOutputStream serializationOutput, final String processName, final Object... args) {
"""
Same as {@link #create(Log, String, Object...)} but includes subtasks, and instead of writing to a log, it outputs the tree in serialized form
"""
retur... | java | public static ProfilingTimer createSubtasksAndSerialization(ByteArrayOutputStream serializationOutput, final String processName, final Object... args) {
return create(null, false, serializationOutput, processName, args);
} | [
"public",
"static",
"ProfilingTimer",
"createSubtasksAndSerialization",
"(",
"ByteArrayOutputStream",
"serializationOutput",
",",
"final",
"String",
"processName",
",",
"final",
"Object",
"...",
"args",
")",
"{",
"return",
"create",
"(",
"null",
",",
"false",
",",
"... | Same as {@link #create(Log, String, Object...)} but includes subtasks, and instead of writing to a log, it outputs the tree in serialized form | [
"Same",
"as",
"{"
] | train | https://github.com/medallia/Word2VecJava/blob/eb31fbb99ac6bbab82d7f807b3e2240edca50eb7/src/main/java/com/medallia/word2vec/util/ProfilingTimer.java#L182-L184 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java | DiagnosticsInner.getSiteDetectorSlotAsync | public Observable<Page<DetectorDefinitionInner>> getSiteDetectorSlotAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final String detectorName, final String slot) {
"""
Get Detector.
Get Detector.
@param resourceGroupName Name of the resource group to which the reso... | java | public Observable<Page<DetectorDefinitionInner>> getSiteDetectorSlotAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final String detectorName, final String slot) {
return getSiteDetectorSlotWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, de... | [
"public",
"Observable",
"<",
"Page",
"<",
"DetectorDefinitionInner",
">",
">",
"getSiteDetectorSlotAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"siteName",
",",
"final",
"String",
"diagnosticCategory",
",",
"final",
"String",
"detectorN... | Get Detector.
Get Detector.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param diagnosticCategory Diagnostic Category
@param detectorName Detector Name
@param slot Slot Name
@throws IllegalArgumentException thrown if parameters fail the validation
@retur... | [
"Get",
"Detector",
".",
"Get",
"Detector",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L2267-L2275 |
apache/spark | common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleBlockResolver.java | ExternalShuffleBlockResolver.applicationRemoved | public void applicationRemoved(String appId, boolean cleanupLocalDirs) {
"""
Removes our metadata of all executors registered for the given application, and optionally
also deletes the local directories associated with the executors of that application in a
separate thread.
It is not valid to call registerExe... | java | public void applicationRemoved(String appId, boolean cleanupLocalDirs) {
logger.info("Application {} removed, cleanupLocalDirs = {}", appId, cleanupLocalDirs);
Iterator<Map.Entry<AppExecId, ExecutorShuffleInfo>> it = executors.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<AppExecId, Executor... | [
"public",
"void",
"applicationRemoved",
"(",
"String",
"appId",
",",
"boolean",
"cleanupLocalDirs",
")",
"{",
"logger",
".",
"info",
"(",
"\"Application {} removed, cleanupLocalDirs = {}\"",
",",
"appId",
",",
"cleanupLocalDirs",
")",
";",
"Iterator",
"<",
"Map",
".... | Removes our metadata of all executors registered for the given application, and optionally
also deletes the local directories associated with the executors of that application in a
separate thread.
It is not valid to call registerExecutor() for an executor with this appId after invoking
this method. | [
"Removes",
"our",
"metadata",
"of",
"all",
"executors",
"registered",
"for",
"the",
"given",
"application",
"and",
"optionally",
"also",
"deletes",
"the",
"local",
"directories",
"associated",
"with",
"the",
"executors",
"of",
"that",
"application",
"in",
"a",
"... | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleBlockResolver.java#L190-L217 |
DataArt/CalculationEngine | calculation-engine/engine-converters/src/main/java/com/dataart/spreadsheetanalytics/engine/DataModelConverters.java | DataModelConverters.toXlsxFile | static OutputStream toXlsxFile(final IDataModel dataModel, final InputStream formatting) {
"""
Uses {@link DataModelConverters#toWorkbook(IDataModel, InputStream)} with {@link ByteArrayOutputStream} as out stream
and new {@link XSSFWorkbook} as {@link InputStream} wrapper.
"""
ByteArrayOutputStream xl... | java | static OutputStream toXlsxFile(final IDataModel dataModel, final InputStream formatting) {
ByteArrayOutputStream xlsx = new ByteArrayOutputStream();
try { toWorkbook(dataModel, ConverterUtils.newWorkbook(formatting)).write(xlsx); }
catch (IOException e) { throw new CalculationEngineExce... | [
"static",
"OutputStream",
"toXlsxFile",
"(",
"final",
"IDataModel",
"dataModel",
",",
"final",
"InputStream",
"formatting",
")",
"{",
"ByteArrayOutputStream",
"xlsx",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"try",
"{",
"toWorkbook",
"(",
"dataModel",
"... | Uses {@link DataModelConverters#toWorkbook(IDataModel, InputStream)} with {@link ByteArrayOutputStream} as out stream
and new {@link XSSFWorkbook} as {@link InputStream} wrapper. | [
"Uses",
"{"
] | train | https://github.com/DataArt/CalculationEngine/blob/34ce1d9c1f9b57a502906b274311d28580b134e5/calculation-engine/engine-converters/src/main/java/com/dataart/spreadsheetanalytics/engine/DataModelConverters.java#L154-L161 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/SnapToEllipseEdge.java | SnapToEllipseEdge.process | public boolean process(EllipseRotated_F64 input, EllipseRotated_F64 refined) {
"""
Refines provided list by snapping it to edges found in the image
@param input (Output) Close approximation of the ellipse in the image
@param refined (Output) Storage for refined estimate. Can be same instance as input
@return... | java | public boolean process(EllipseRotated_F64 input, EllipseRotated_F64 refined) {
refined.set(input);
previous.set(input);
for (int iteration = 0; iteration < maxIterations; iteration++) {
refined.set(previous);
computePointsAndWeights(refined);
if( fitter.process(samplePts.toList(),weights.data) ) {
... | [
"public",
"boolean",
"process",
"(",
"EllipseRotated_F64",
"input",
",",
"EllipseRotated_F64",
"refined",
")",
"{",
"refined",
".",
"set",
"(",
"input",
")",
";",
"previous",
".",
"set",
"(",
"input",
")",
";",
"for",
"(",
"int",
"iteration",
"=",
"0",
"... | Refines provided list by snapping it to edges found in the image
@param input (Output) Close approximation of the ellipse in the image
@param refined (Output) Storage for refined estimate. Can be same instance as input
@return True if a refined estimate could be found, false if it failed | [
"Refines",
"provided",
"list",
"by",
"snapping",
"it",
"to",
"edges",
"found",
"in",
"the",
"image"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/ellipse/SnapToEllipseEdge.java#L81-L111 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/colorpicker/CmsColor.java | CmsColor.HSVtoRGB | private void HSVtoRGB(float hue, float sat, float bri) {
"""
Converts the HSV into the RGB.<p>
@param hue value
@param sat the saturation value
@param bri the brightness value
"""
int i;
float f;
float p;
float q;
float t;
if (sat == 0) {
... | java | private void HSVtoRGB(float hue, float sat, float bri) {
int i;
float f;
float p;
float q;
float t;
if (sat == 0) {
m_red = bri;
m_green = bri;
m_blue = bri;
return;
}
hue /= 60;
i = (i... | [
"private",
"void",
"HSVtoRGB",
"(",
"float",
"hue",
",",
"float",
"sat",
",",
"float",
"bri",
")",
"{",
"int",
"i",
";",
"float",
"f",
";",
"float",
"p",
";",
"float",
"q",
";",
"float",
"t",
";",
"if",
"(",
"sat",
"==",
"0",
")",
"{",
"m_red",... | Converts the HSV into the RGB.<p>
@param hue value
@param sat the saturation value
@param bri the brightness value | [
"Converts",
"the",
"HSV",
"into",
"the",
"RGB",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/colorpicker/CmsColor.java#L199-L250 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/shape/Shape.java | Shape.assertShapeLessThan | public static void assertShapeLessThan(int[] shape, int[] lessThan) {
"""
Assert the both shapes are the same length
and shape[i] < lessThan[i]
@param shape the shape to check
@param lessThan the shape to assert against
"""
if (shape.length != lessThan.length) {
throw new IllegalArgument... | java | public static void assertShapeLessThan(int[] shape, int[] lessThan) {
if (shape.length != lessThan.length) {
throw new IllegalArgumentException("Shape length must be == less than length");
}
for (int i = 0; i < shape.length; i++) {
if (shape[i] >= lessThan[i])
... | [
"public",
"static",
"void",
"assertShapeLessThan",
"(",
"int",
"[",
"]",
"shape",
",",
"int",
"[",
"]",
"lessThan",
")",
"{",
"if",
"(",
"shape",
".",
"length",
"!=",
"lessThan",
".",
"length",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"... | Assert the both shapes are the same length
and shape[i] < lessThan[i]
@param shape the shape to check
@param lessThan the shape to assert against | [
"Assert",
"the",
"both",
"shapes",
"are",
"the",
"same",
"length",
"and",
"shape",
"[",
"i",
"]",
"<",
"lessThan",
"[",
"i",
"]"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/shape/Shape.java#L2402-L2410 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/hover/SARLHoverSignatureProvider.java | SARLHoverSignatureProvider._signature | protected String _signature(XCastedExpression castExpression, boolean typeAtEnd) {
"""
Replies the hover for a SARL casted expression.
@param castExpression the casted expression.
@param typeAtEnd indicates if the type should be put at end.
@return the string representation into the hover.
"""
if (castE... | java | protected String _signature(XCastedExpression castExpression, boolean typeAtEnd) {
if (castExpression instanceof SarlCastedExpression) {
final JvmOperation delegate = ((SarlCastedExpression) castExpression).getFeature();
if (delegate != null) {
return _signature(delegate, typeAtEnd);
}
}
return Messa... | [
"protected",
"String",
"_signature",
"(",
"XCastedExpression",
"castExpression",
",",
"boolean",
"typeAtEnd",
")",
"{",
"if",
"(",
"castExpression",
"instanceof",
"SarlCastedExpression",
")",
"{",
"final",
"JvmOperation",
"delegate",
"=",
"(",
"(",
"SarlCastedExpressi... | Replies the hover for a SARL casted expression.
@param castExpression the casted expression.
@param typeAtEnd indicates if the type should be put at end.
@return the string representation into the hover. | [
"Replies",
"the",
"hover",
"for",
"a",
"SARL",
"casted",
"expression",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/hover/SARLHoverSignatureProvider.java#L245-L254 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/DscConfigurationsInner.java | DscConfigurationsInner.listByAutomationAccountAsync | public Observable<Page<DscConfigurationInner>> listByAutomationAccountAsync(final String resourceGroupName, final String automationAccountName, final String filter, final Integer skip, final Integer top, final String inlinecount) {
"""
Retrieve a list of configurations.
@param resourceGroupName Name of an Azure... | java | public Observable<Page<DscConfigurationInner>> listByAutomationAccountAsync(final String resourceGroupName, final String automationAccountName, final String filter, final Integer skip, final Integer top, final String inlinecount) {
return listByAutomationAccountWithServiceResponseAsync(resourceGroupName, automa... | [
"public",
"Observable",
"<",
"Page",
"<",
"DscConfigurationInner",
">",
">",
"listByAutomationAccountAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"automationAccountName",
",",
"final",
"String",
"filter",
",",
"final",
"Integer",
"skip"... | Retrieve a list of configurations.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param filter The filter to apply on the operation.
@param skip The number of rows to skip.
@param top The the number of rows to take.
@param inlinecount Return ... | [
"Retrieve",
"a",
"list",
"of",
"configurations",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/DscConfigurationsInner.java#L830-L838 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/misc/Pattern.java | Pattern.selection | public static Pattern selection(Pattern pattern1, Pattern pattern2) {
"""
A pattern which matches <code>pattern1</code> followed by <code>pattern2</code> and
returns the longer of the two matches.
@param pattern1
@param pattern2
@return
@throws IllegalArgumentException if either argument is <code>null</code>
... | java | public static Pattern selection(Pattern pattern1, Pattern pattern2)
{
if (pattern1 == null || pattern2 == null)
{
throw new IllegalArgumentException("Neither pattern can be null");
}
return new SelectPattern(pattern1, pattern2);
} | [
"public",
"static",
"Pattern",
"selection",
"(",
"Pattern",
"pattern1",
",",
"Pattern",
"pattern2",
")",
"{",
"if",
"(",
"pattern1",
"==",
"null",
"||",
"pattern2",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Neither pattern can b... | A pattern which matches <code>pattern1</code> followed by <code>pattern2</code> and
returns the longer of the two matches.
@param pattern1
@param pattern2
@return
@throws IllegalArgumentException if either argument is <code>null</code> | [
"A",
"pattern",
"which",
"matches",
"<code",
">",
"pattern1<",
"/",
"code",
">",
"followed",
"by",
"<code",
">",
"pattern2<",
"/",
"code",
">",
"and",
"returns",
"the",
"longer",
"of",
"the",
"two",
"matches",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/misc/Pattern.java#L163-L170 |
fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/assembly/DockerFileBuilder.java | DockerFileBuilder.write | public File write(File destDir) throws IOException {
"""
Create a DockerFile in the given directory
@param destDir directory where to store the dockerfile
@return the full path to the docker file
@throws IOException if writing fails
"""
File target = new File(destDir,"Dockerfile");
FileUtil... | java | public File write(File destDir) throws IOException {
File target = new File(destDir,"Dockerfile");
FileUtils.fileWrite(target, content());
return target;
} | [
"public",
"File",
"write",
"(",
"File",
"destDir",
")",
"throws",
"IOException",
"{",
"File",
"target",
"=",
"new",
"File",
"(",
"destDir",
",",
"\"Dockerfile\"",
")",
";",
"FileUtils",
".",
"fileWrite",
"(",
"target",
",",
"content",
"(",
")",
")",
";",... | Create a DockerFile in the given directory
@param destDir directory where to store the dockerfile
@return the full path to the docker file
@throws IOException if writing fails | [
"Create",
"a",
"DockerFile",
"in",
"the",
"given",
"directory"
] | train | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/assembly/DockerFileBuilder.java#L83-L87 |
s1ck/gdl | src/main/java/org/s1ck/gdl/GDLLoader.java | GDLLoader.processConjunctionExpression | private void processConjunctionExpression(List<TerminalNode> conjunctions) {
"""
Processes a conjuctive expression (AND, OR, XOR) and connects the filter with the corresponding operator
@param conjunctions list of conjunction operators
"""
Predicate conjunctionReuse;
for (int i = conjunctions.size(... | java | private void processConjunctionExpression(List<TerminalNode> conjunctions) {
Predicate conjunctionReuse;
for (int i = conjunctions.size() - 1; i >= 0; i--) {
Predicate rhs = currentPredicates.removeLast();
Predicate lhs = currentPredicates.removeLast();
switch (conjunctions.get(i).getText().... | [
"private",
"void",
"processConjunctionExpression",
"(",
"List",
"<",
"TerminalNode",
">",
"conjunctions",
")",
"{",
"Predicate",
"conjunctionReuse",
";",
"for",
"(",
"int",
"i",
"=",
"conjunctions",
".",
"size",
"(",
")",
"-",
"1",
";",
"i",
">=",
"0",
";"... | Processes a conjuctive expression (AND, OR, XOR) and connects the filter with the corresponding operator
@param conjunctions list of conjunction operators | [
"Processes",
"a",
"conjuctive",
"expression",
"(",
"AND",
"OR",
"XOR",
")",
"and",
"connects",
"the",
"filter",
"with",
"the",
"corresponding",
"operator"
] | train | https://github.com/s1ck/gdl/blob/c89b0f83526661823ad3392f338dbf7dc3e3f834/src/main/java/org/s1ck/gdl/GDLLoader.java#L474-L494 |
sap-production/xcode-maven-plugin | modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/AbstractXCodeMojo.java | AbstractXCodeMojo.zipSubfolder | protected File zipSubfolder(File rootDir, String zipSubFolder, String zipFileName, String archiveFolder)
throws MojoExecutionException {
"""
Calls a shell script in order to zip a folder. We have to call a shell script as Java cannot
zip symbolic links.
@param rootDir
the directory where the zip comma... | java | protected File zipSubfolder(File rootDir, String zipSubFolder, String zipFileName, String archiveFolder)
throws MojoExecutionException
{
int resultCode = 0;
try {
File scriptDirectory = new File(project.getBuild().getDirectory(), "scripts").getCanonicalFile();
scriptDirectory.deleteOnExi... | [
"protected",
"File",
"zipSubfolder",
"(",
"File",
"rootDir",
",",
"String",
"zipSubFolder",
",",
"String",
"zipFileName",
",",
"String",
"archiveFolder",
")",
"throws",
"MojoExecutionException",
"{",
"int",
"resultCode",
"=",
"0",
";",
"try",
"{",
"File",
"scrip... | Calls a shell script in order to zip a folder. We have to call a shell script as Java cannot
zip symbolic links.
@param rootDir
the directory where the zip command shall be executed
@param zipSubFolder
the subfolder to be zipped
@param zipFileName
the name of the zipFile (will be located in the rootDir)
@param archive... | [
"Calls",
"a",
"shell",
"script",
"in",
"order",
"to",
"zip",
"a",
"folder",
".",
"We",
"have",
"to",
"call",
"a",
"shell",
"script",
"as",
"Java",
"cannot",
"zip",
"symbolic",
"links",
"."
] | train | https://github.com/sap-production/xcode-maven-plugin/blob/3f8aa380f501a1d7602f33fef2f6348354e7eb7c/modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/AbstractXCodeMojo.java#L274-L303 |
aws/aws-sdk-java | aws-java-sdk-batch/src/main/java/com/amazonaws/services/batch/model/JobDefinition.java | JobDefinition.withParameters | public JobDefinition withParameters(java.util.Map<String, String> parameters) {
"""
<p>
Default parameters or parameter substitution placeholders that are set in the job definition. Parameters are
specified as a key-value pair mapping. Parameters in a <code>SubmitJob</code> request override any corresponding
pa... | java | public JobDefinition withParameters(java.util.Map<String, String> parameters) {
setParameters(parameters);
return this;
} | [
"public",
"JobDefinition",
"withParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"setParameters",
"(",
"parameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Default parameters or parameter substitution placeholders that are set in the job definition. Parameters are
specified as a key-value pair mapping. Parameters in a <code>SubmitJob</code> request override any corresponding
parameter defaults from the job definition. For more information about specifying parameters, ... | [
"<p",
">",
"Default",
"parameters",
"or",
"parameter",
"substitution",
"placeholders",
"that",
"are",
"set",
"in",
"the",
"job",
"definition",
".",
"Parameters",
"are",
"specified",
"as",
"a",
"key",
"-",
"value",
"pair",
"mapping",
".",
"Parameters",
"in",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-batch/src/main/java/com/amazonaws/services/batch/model/JobDefinition.java#L359-L362 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/wrapper/PAbstractObject.java | PAbstractObject.optArray | @Override
public final PArray optArray(final String key, final PArray defaultValue) {
"""
Get a property as a array or default.
@param key the property name
@param defaultValue default
"""
PArray result = optArray(key);
return result == null ? defaultValue : result;
} | java | @Override
public final PArray optArray(final String key, final PArray defaultValue) {
PArray result = optArray(key);
return result == null ? defaultValue : result;
} | [
"@",
"Override",
"public",
"final",
"PArray",
"optArray",
"(",
"final",
"String",
"key",
",",
"final",
"PArray",
"defaultValue",
")",
"{",
"PArray",
"result",
"=",
"optArray",
"(",
"key",
")",
";",
"return",
"result",
"==",
"null",
"?",
"defaultValue",
":"... | Get a property as a array or default.
@param key the property name
@param defaultValue default | [
"Get",
"a",
"property",
"as",
"a",
"array",
"or",
"default",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/wrapper/PAbstractObject.java#L221-L225 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClient.java | WorkflowTemplateServiceClient.createWorkflowTemplate | public final WorkflowTemplate createWorkflowTemplate(String parent, WorkflowTemplate template) {
"""
Creates new workflow template.
<p>Sample code:
<pre><code>
try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
RegionName parent = RegionName.of("[PR... | java | public final WorkflowTemplate createWorkflowTemplate(String parent, WorkflowTemplate template) {
CreateWorkflowTemplateRequest request =
CreateWorkflowTemplateRequest.newBuilder().setParent(parent).setTemplate(template).build();
return createWorkflowTemplate(request);
} | [
"public",
"final",
"WorkflowTemplate",
"createWorkflowTemplate",
"(",
"String",
"parent",
",",
"WorkflowTemplate",
"template",
")",
"{",
"CreateWorkflowTemplateRequest",
"request",
"=",
"CreateWorkflowTemplateRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
... | Creates new workflow template.
<p>Sample code:
<pre><code>
try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
WorkflowTemplate respon... | [
"Creates",
"new",
"workflow",
"template",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/WorkflowTemplateServiceClient.java#L229-L234 |
remkop/picocli | picocli-codegen/src/main/java/picocli/codegen/util/Assert.java | Assert.notNull | public static <T> T notNull(T object, String description) {
"""
Throws a NullPointerException if the specified object is null.
@param object the object to verify
@param description error message
@param <T> type of the object to check
@return the verified object
"""
if (object == null) {
... | java | public static <T> T notNull(T object, String description) {
if (object == null) {
throw new NullPointerException(description);
}
return object;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"notNull",
"(",
"T",
"object",
",",
"String",
"description",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"description",
")",
";",
"}",
"return",
"object",
"... | Throws a NullPointerException if the specified object is null.
@param object the object to verify
@param description error message
@param <T> type of the object to check
@return the verified object | [
"Throws",
"a",
"NullPointerException",
"if",
"the",
"specified",
"object",
"is",
"null",
"."
] | train | https://github.com/remkop/picocli/blob/3c5384f0d12817401d1921c3013c1282e2edcab2/picocli-codegen/src/main/java/picocli/codegen/util/Assert.java#L14-L19 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java | Types.resultSubtype | public boolean resultSubtype(Type t, Type s, Warner warner) {
"""
Does t have a result that is a subtype of the result type of s,
suitable for covariant returns? It is assumed that both types
are (possibly polymorphic) method types. Monomorphic method
types are handled in the obvious way. Polymorphic method ... | java | public boolean resultSubtype(Type t, Type s, Warner warner) {
List<Type> tvars = t.getTypeArguments();
List<Type> svars = s.getTypeArguments();
Type tres = t.getReturnType();
Type sres = subst(s.getReturnType(), svars, tvars);
return covariantReturnType(tres, sres, warner);
} | [
"public",
"boolean",
"resultSubtype",
"(",
"Type",
"t",
",",
"Type",
"s",
",",
"Warner",
"warner",
")",
"{",
"List",
"<",
"Type",
">",
"tvars",
"=",
"t",
".",
"getTypeArguments",
"(",
")",
";",
"List",
"<",
"Type",
">",
"svars",
"=",
"s",
".",
"get... | Does t have a result that is a subtype of the result type of s,
suitable for covariant returns? It is assumed that both types
are (possibly polymorphic) method types. Monomorphic method
types are handled in the obvious way. Polymorphic method types
require renaming all type variables of one to corresponding
type var... | [
"Does",
"t",
"have",
"a",
"result",
"that",
"is",
"a",
"subtype",
"of",
"the",
"result",
"type",
"of",
"s",
"suitable",
"for",
"covariant",
"returns?",
"It",
"is",
"assumed",
"that",
"both",
"types",
"are",
"(",
"possibly",
"polymorphic",
")",
"method",
... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java#L3965-L3971 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java | FSDataset.isBlockFinalizedWithLock | private boolean isBlockFinalizedWithLock(int namespaceId, Block b) {
"""
is this block finalized? Returns true if the block is already
finalized, otherwise returns false.
"""
lock.readLock().lock();
try {
return isBlockFinalizedInternal(namespaceId, b, true);
} finally {
lock.readLock(... | java | private boolean isBlockFinalizedWithLock(int namespaceId, Block b) {
lock.readLock().lock();
try {
return isBlockFinalizedInternal(namespaceId, b, true);
} finally {
lock.readLock().unlock();
}
} | [
"private",
"boolean",
"isBlockFinalizedWithLock",
"(",
"int",
"namespaceId",
",",
"Block",
"b",
")",
"{",
"lock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"return",
"isBlockFinalizedInternal",
"(",
"namespaceId",
",",
"b",
",",
"t... | is this block finalized? Returns true if the block is already
finalized, otherwise returns false. | [
"is",
"this",
"block",
"finalized?",
"Returns",
"true",
"if",
"the",
"block",
"is",
"already",
"finalized",
"otherwise",
"returns",
"false",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java#L2418-L2425 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/titlepaneforegound/TitlePaneButtonForegroundPainter.java | TitlePaneButtonForegroundPainter.paintHover | public void paintHover(Graphics2D g, JComponent c, int width, int height) {
"""
Paint the mouse-over state of the button foreground.
@param g the Graphics2D context to paint with.
@param c the button to paint.
@param width the width to paint.
@param height the height to paint.
"""
pain... | java | public void paintHover(Graphics2D g, JComponent c, int width, int height) {
paint(g, c, width, height, hoverBorder, hoverCorner, hoverInterior);
} | [
"public",
"void",
"paintHover",
"(",
"Graphics2D",
"g",
",",
"JComponent",
"c",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"paint",
"(",
"g",
",",
"c",
",",
"width",
",",
"height",
",",
"hoverBorder",
",",
"hoverCorner",
",",
"hoverInterior",
... | Paint the mouse-over state of the button foreground.
@param g the Graphics2D context to paint with.
@param c the button to paint.
@param width the width to paint.
@param height the height to paint. | [
"Paint",
"the",
"mouse",
"-",
"over",
"state",
"of",
"the",
"button",
"foreground",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/titlepaneforegound/TitlePaneButtonForegroundPainter.java#L46-L48 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManagerServiceImpl.java | ConnectionManagerServiceImpl.createPoolManager | private void createPoolManager(AbstractConnectionFactoryService svc) throws ResourceException {
"""
Create and initialize the connection manager/pool configuration
based on the connection factory configuration.
Precondition: invoker must have the write lock for this connection manager service.
@param svc the ... | java | private void createPoolManager(AbstractConnectionFactoryService svc) throws ResourceException {
final boolean trace = TraceComponent.isAnyTracingEnabled();
if (trace && tc.isEntryEnabled())
Tr.entry(this, tc, "createPoolManager", svc, properties);
J2CGlobalConfigProperties gConfigPr... | [
"private",
"void",
"createPoolManager",
"(",
"AbstractConnectionFactoryService",
"svc",
")",
"throws",
"ResourceException",
"{",
"final",
"boolean",
"trace",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"trace",
"&&",
"tc",
".",
"is... | Create and initialize the connection manager/pool configuration
based on the connection factory configuration.
Precondition: invoker must have the write lock for this connection manager service.
@param svc the connection factory service
@throws ResourceException if an error occurs | [
"Create",
"and",
"initialize",
"the",
"connection",
"manager",
"/",
"pool",
"configuration",
"based",
"on",
"the",
"connection",
"factory",
"configuration",
".",
"Precondition",
":",
"invoker",
"must",
"have",
"the",
"write",
"lock",
"for",
"this",
"connection",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManagerServiceImpl.java#L184-L207 |
carrotsearch/hppc | hppc/src/main/templates/com/carrotsearch/hppc/KTypeArrayDeque.java | KTypeArrayDeque.descendingForEach | private void descendingForEach(KTypePredicate<? super KType> predicate, int fromIndex, final int toIndex) {
"""
Applies <code>predicate</code> to a slice of the deque,
<code>toIndex</code>, exclusive, down to <code>fromIndex</code>, inclusive
or until the predicate returns <code>false</code>.
"""
if (fro... | java | private void descendingForEach(KTypePredicate<? super KType> predicate, int fromIndex, final int toIndex) {
if (fromIndex == toIndex)
return;
final KType[] buffer = Intrinsics.<KType[]> cast(this.buffer);
int i = toIndex;
do {
i = oneLeft(i, buffer.length);
if (!predicate.apply(buffer... | [
"private",
"void",
"descendingForEach",
"(",
"KTypePredicate",
"<",
"?",
"super",
"KType",
">",
"predicate",
",",
"int",
"fromIndex",
",",
"final",
"int",
"toIndex",
")",
"{",
"if",
"(",
"fromIndex",
"==",
"toIndex",
")",
"return",
";",
"final",
"KType",
"... | Applies <code>predicate</code> to a slice of the deque,
<code>toIndex</code>, exclusive, down to <code>fromIndex</code>, inclusive
or until the predicate returns <code>false</code>. | [
"Applies",
"<code",
">",
"predicate<",
"/",
"code",
">",
"to",
"a",
"slice",
"of",
"the",
"deque",
"<code",
">",
"toIndex<",
"/",
"code",
">",
"exclusive",
"down",
"to",
"<code",
">",
"fromIndex<",
"/",
"code",
">",
"inclusive",
"or",
"until",
"the",
"... | train | https://github.com/carrotsearch/hppc/blob/e359e9da358e846fcbffc64a765611df954ba3f6/hppc/src/main/templates/com/carrotsearch/hppc/KTypeArrayDeque.java#L746-L758 |
unbescape/unbescape | src/main/java/org/unbescape/uri/UriEscape.java | UriEscape.unescapeUriFragmentId | public static void unescapeUriFragmentId(final String text, final Writer writer, final String encoding)
throws IOException {
"""
<p>
Perform am URI fragment identifier <strong>unescape</strong> operation
on a <tt>String</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
This method will un... | java | public static void unescapeUriFragmentId(final String text, final Writer writer, final String encoding)
throws IOException {
if (writer == null) {
throw new IllegalArgumentException("Argument 'writer' cannot be null");
}
if (encoding == null) {
throw new Ill... | [
"public",
"static",
"void",
"unescapeUriFragmentId",
"(",
"final",
"String",
"text",
",",
"final",
"Writer",
"writer",
",",
"final",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"if",
"(",
"writer",
"==",
"null",
")",
"{",
"throw",
"new",
"Illega... | <p>
Perform am URI fragment identifier <strong>unescape</strong> operation
on a <tt>String</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
This method will unescape every percent-encoded (<tt>%HH</tt>) sequences present in input,
even for those characters that do not need to be percent-encoded in this contex... | [
"<p",
">",
"Perform",
"am",
"URI",
"fragment",
"identifier",
"<strong",
">",
"unescape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",
">",
"Writer<",
"/",
"tt",
">"... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L2063-L2076 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/BuildUniqueIdentifierHelper.java | BuildUniqueIdentifierHelper.isPassIdentifiedDownstream | public static boolean isPassIdentifiedDownstream(AbstractBuild<?, ?> build) {
"""
Check whether to pass the the downstream identifier according to the <b>root</b> build's descriptor
@param build The current build
@return True if to pass the downstream identifier to the child projects.
"""
Artifacto... | java | public static boolean isPassIdentifiedDownstream(AbstractBuild<?, ?> build) {
ArtifactoryRedeployPublisher publisher =
ActionableHelper.getPublisher(build.getProject(), ArtifactoryRedeployPublisher.class);
if (publisher != null) {
return publisher.isPassIdentifiedDownstream()... | [
"public",
"static",
"boolean",
"isPassIdentifiedDownstream",
"(",
"AbstractBuild",
"<",
"?",
",",
"?",
">",
"build",
")",
"{",
"ArtifactoryRedeployPublisher",
"publisher",
"=",
"ActionableHelper",
".",
"getPublisher",
"(",
"build",
".",
"getProject",
"(",
")",
","... | Check whether to pass the the downstream identifier according to the <b>root</b> build's descriptor
@param build The current build
@return True if to pass the downstream identifier to the child projects. | [
"Check",
"whether",
"to",
"pass",
"the",
"the",
"downstream",
"identifier",
"according",
"to",
"the",
"<b",
">",
"root<",
"/",
"b",
">",
"build",
"s",
"descriptor"
] | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/BuildUniqueIdentifierHelper.java#L89-L99 |
advantageous/boon | reflekt/src/main/java/io/advantageous/boon/core/Str.java | Str.sputs | public static String sputs(Object... messages) {
"""
Like puts but writes to a String.
@param messages the stuff you want to print out.
@return string
"""
CharBuf buf = CharBuf.create(80);
return sputs(buf, messages).toString();
} | java | public static String sputs(Object... messages) {
CharBuf buf = CharBuf.create(80);
return sputs(buf, messages).toString();
} | [
"public",
"static",
"String",
"sputs",
"(",
"Object",
"...",
"messages",
")",
"{",
"CharBuf",
"buf",
"=",
"CharBuf",
".",
"create",
"(",
"80",
")",
";",
"return",
"sputs",
"(",
"buf",
",",
"messages",
")",
".",
"toString",
"(",
")",
";",
"}"
] | Like puts but writes to a String.
@param messages the stuff you want to print out.
@return string | [
"Like",
"puts",
"but",
"writes",
"to",
"a",
"String",
"."
] | train | https://github.com/advantageous/boon/blob/12712d376761aa3b33223a9f1716720ddb67cb5e/reflekt/src/main/java/io/advantageous/boon/core/Str.java#L928-L931 |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/params/AbstractParam.java | AbstractParam.errorMessage | protected String errorMessage(String input, Exception e) {
"""
Given a string representation which was unable to be parsed and the exception thrown, produce
an entity to be sent to the client.
@param input the raw input value
@param e the exception thrown while parsing {@code input}
@return the error message... | java | protected String errorMessage(String input, Exception e) {
return String.format("Invalid parameter: %s (%s)", input, e.getMessage());
} | [
"protected",
"String",
"errorMessage",
"(",
"String",
"input",
",",
"Exception",
"e",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"Invalid parameter: %s (%s)\"",
",",
"input",
",",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"}"
] | Given a string representation which was unable to be parsed and the exception thrown, produce
an entity to be sent to the client.
@param input the raw input value
@param e the exception thrown while parsing {@code input}
@return the error message to be sent the client | [
"Given",
"a",
"string",
"representation",
"which",
"was",
"unable",
"to",
"be",
"parsed",
"and",
"the",
"exception",
"thrown",
"produce",
"an",
"entity",
"to",
"be",
"sent",
"to",
"the",
"client",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/params/AbstractParam.java#L82-L84 |
lotaris/rox-client-junit | src/main/java/com/lotaris/rox/client/junit/AbstractRoxListener.java | AbstractRoxListener.getName | private String getName(Description description, RoxableTest mAnnotation) {
"""
Retrieve a name from a test
@param description The description of the test
@param mAnnotation The method annotation
@return The name retrieved
"""
if (mAnnotation == null || mAnnotation.name() == null || mAnnotation.name().is... | java | private String getName(Description description, RoxableTest mAnnotation) {
if (mAnnotation == null || mAnnotation.name() == null || mAnnotation.name().isEmpty()) {
return Inflector.getHumanName(description.getMethodName());
}
else {
return mAnnotation.name();
}
} | [
"private",
"String",
"getName",
"(",
"Description",
"description",
",",
"RoxableTest",
"mAnnotation",
")",
"{",
"if",
"(",
"mAnnotation",
"==",
"null",
"||",
"mAnnotation",
".",
"name",
"(",
")",
"==",
"null",
"||",
"mAnnotation",
".",
"name",
"(",
")",
".... | Retrieve a name from a test
@param description The description of the test
@param mAnnotation The method annotation
@return The name retrieved | [
"Retrieve",
"a",
"name",
"from",
"a",
"test"
] | train | https://github.com/lotaris/rox-client-junit/blob/1bc5fd99feb1a4467788128c9486737ad8e47bb8/src/main/java/com/lotaris/rox/client/junit/AbstractRoxListener.java#L187-L194 |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/dragdrop/DragUtils.java | DragUtils.setDragData | public static void setDragData( Object source, Object data ) {
"""
Sets the drag and drop data and its source
@param source
@param data
"""
DragUtils.source = source;
DragUtils.data = data;
} | java | public static void setDragData( Object source, Object data )
{
DragUtils.source = source;
DragUtils.data = data;
} | [
"public",
"static",
"void",
"setDragData",
"(",
"Object",
"source",
",",
"Object",
"data",
")",
"{",
"DragUtils",
".",
"source",
"=",
"source",
";",
"DragUtils",
".",
"data",
"=",
"data",
";",
"}"
] | Sets the drag and drop data and its source
@param source
@param data | [
"Sets",
"the",
"drag",
"and",
"drop",
"data",
"and",
"its",
"source"
] | train | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/dragdrop/DragUtils.java#L30-L34 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/xen/disk_adapter.java | disk_adapter.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
disk_adapter_responses result = (disk_adapter_responses) service.get_pa... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
disk_adapter_responses result = (disk_adapter_responses) service.get_payload_formatter().string_to_resource(disk_adapter_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcod... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"disk_adapter_responses",
"result",
"=",
"(",
"disk_adapter_responses",
")",
"service",
".",
"get_payload_form... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/disk_adapter.java#L244-L261 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.createGroup | public GitlabGroup createGroup(String name, String path, String ldapCn, GitlabAccessLevel ldapAccess, GitlabUser sudoUser) throws IOException {
"""
Creates a Group
@param name The name of the group
@param path The path for the group
@param ldapCn LDAP Group Name to sync with, null otherwise
@... | java | public GitlabGroup createGroup(String name, String path, String ldapCn, GitlabAccessLevel ldapAccess, GitlabUser sudoUser) throws IOException {
return createGroup(name, path, ldapCn, ldapAccess, sudoUser, null);
} | [
"public",
"GitlabGroup",
"createGroup",
"(",
"String",
"name",
",",
"String",
"path",
",",
"String",
"ldapCn",
",",
"GitlabAccessLevel",
"ldapAccess",
",",
"GitlabUser",
"sudoUser",
")",
"throws",
"IOException",
"{",
"return",
"createGroup",
"(",
"name",
",",
"p... | Creates a Group
@param name The name of the group
@param path The path for the group
@param ldapCn LDAP Group Name to sync with, null otherwise
@param ldapAccess Access level for LDAP group members, null otherwise
@param sudoUser The user to create the group on behalf of
@return The GitLab Group
@thr... | [
"Creates",
"a",
"Group"
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L620-L622 |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/SolutionListUtils.java | SolutionListUtils.removeSolutionsFromList | public static <S> void removeSolutionsFromList(List<S> solutionList, int numberOfSolutionsToRemove) {
"""
Removes a number of solutions from a list
@param solutionList The list of solutions
@param numberOfSolutionsToRemove
"""
if (solutionList.size() < numberOfSolutionsToRemove) {
th... | java | public static <S> void removeSolutionsFromList(List<S> solutionList, int numberOfSolutionsToRemove) {
if (solutionList.size() < numberOfSolutionsToRemove) {
throw new JMetalException("The list size (" + solutionList.size() + ") is lower than " +
"the number of solutions to remove (" + numberOfSoluti... | [
"public",
"static",
"<",
"S",
">",
"void",
"removeSolutionsFromList",
"(",
"List",
"<",
"S",
">",
"solutionList",
",",
"int",
"numberOfSolutionsToRemove",
")",
"{",
"if",
"(",
"solutionList",
".",
"size",
"(",
")",
"<",
"numberOfSolutionsToRemove",
")",
"{",
... | Removes a number of solutions from a list
@param solutionList The list of solutions
@param numberOfSolutionsToRemove | [
"Removes",
"a",
"number",
"of",
"solutions",
"from",
"a",
"list"
] | train | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/SolutionListUtils.java#L329-L338 |
Samsung/GearVRf | GVRf/Extensions/script/src/main/java/org/gearvrf/script/javascript/ExternalScriptable.java | ExternalScriptable.put | public void put(String name, Scriptable start, Object value) {
"""
Sets the value of the named property, creating it if need be.
@param name the name of the property
@param start the object whose property is being set
@param value value to set the property to
"""
if (start == this) {
s... | java | public void put(String name, Scriptable start, Object value) {
if (start == this) {
synchronized (this) {
if (isEmpty(name)) {
indexedProps.put(name, value);
} else {
synchronized (context) {
int scope = ... | [
"public",
"void",
"put",
"(",
"String",
"name",
",",
"Scriptable",
"start",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"start",
"==",
"this",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"name",
")",
")",
"{",
"inde... | Sets the value of the named property, creating it if need be.
@param name the name of the property
@param start the object whose property is being set
@param value value to set the property to | [
"Sets",
"the",
"value",
"of",
"the",
"named",
"property",
"creating",
"it",
"if",
"need",
"be",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/script/src/main/java/org/gearvrf/script/javascript/ExternalScriptable.java#L173-L191 |
finmath/finmath-lib | src/main/java6/net/finmath/montecarlo/interestrate/products/Swaption.java | Swaption.getValue | @Override
public RandomVariableInterface getValue(double evaluationTime, LIBORModelMonteCarloSimulationInterface model) throws CalculationException {
"""
This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is ofte... | java | @Override
public RandomVariableInterface getValue(double evaluationTime, LIBORModelMonteCarloSimulationInterface model) throws CalculationException {
/*
* Calculate value of the swap at exercise date on each path (beware of perfect foresight - all rates are simulationTime=exerciseDate)
*/
RandomVariableInter... | [
"@",
"Override",
"public",
"RandomVariableInterface",
"getValue",
"(",
"double",
"evaluationTime",
",",
"LIBORModelMonteCarloSimulationInterface",
"model",
")",
"throws",
"CalculationException",
"{",
"/*\n\t\t * Calculate value of the swap at exercise date on each path (beware of perfe... | This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is the (sum of) value discounted to evaluation time.
Cashflows prior evaluationTime... | [
"This",
"method",
"returns",
"the",
"value",
"random",
"variable",
"of",
"the",
"product",
"within",
"the",
"specified",
"model",
"evaluated",
"at",
"a",
"given",
"evalutationTime",
".",
"Note",
":",
"For",
"a",
"lattice",
"this",
"is",
"often",
"the",
"valu... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/montecarlo/interestrate/products/Swaption.java#L117-L179 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java | PersistenceBrokerImpl.doGetObjectByIdentity | public Object doGetObjectByIdentity(Identity id) throws PersistenceBrokerException {
"""
Internal used method to retrieve object based on Identity.
@param id
@return
@throws PersistenceBrokerException
"""
if (logger.isDebugEnabled()) logger.debug("getObjectByIdentity " + id);
// check if ... | java | public Object doGetObjectByIdentity(Identity id) throws PersistenceBrokerException
{
if (logger.isDebugEnabled()) logger.debug("getObjectByIdentity " + id);
// check if object is present in ObjectCache:
Object obj = objectCache.lookup(id);
// only perform a db lookup if necessary (o... | [
"public",
"Object",
"doGetObjectByIdentity",
"(",
"Identity",
"id",
")",
"throws",
"PersistenceBrokerException",
"{",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"logger",
".",
"debug",
"(",
"\"getObjectByIdentity \"",
"+",
"id",
")",
";",
"// che... | Internal used method to retrieve object based on Identity.
@param id
@return
@throws PersistenceBrokerException | [
"Internal",
"used",
"method",
"to",
"retrieve",
"object",
"based",
"on",
"Identity",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java#L1702-L1732 |
deeplearning4j/deeplearning4j | datavec/datavec-spark/src/main/java/org/datavec/spark/transform/Normalization.java | Normalization.stdDevMeanColumns | public static List<Row> stdDevMeanColumns(DataRowsFacade data, String... columns) {
"""
Returns the standard deviation
and mean of the given columns
The list returned is a list of size 2 where each row
represents the standard deviation of each column and the mean of each column
@param data the data to get the ... | java | public static List<Row> stdDevMeanColumns(DataRowsFacade data, String... columns) {
return aggregate(data, columns, new String[] {"stddev", "mean"});
} | [
"public",
"static",
"List",
"<",
"Row",
">",
"stdDevMeanColumns",
"(",
"DataRowsFacade",
"data",
",",
"String",
"...",
"columns",
")",
"{",
"return",
"aggregate",
"(",
"data",
",",
"columns",
",",
"new",
"String",
"[",
"]",
"{",
"\"stddev\"",
",",
"\"mean\... | Returns the standard deviation
and mean of the given columns
The list returned is a list of size 2 where each row
represents the standard deviation of each column and the mean of each column
@param data the data to get the standard deviation and mean for
@param columns the columns to get the
@return | [
"Returns",
"the",
"standard",
"deviation",
"and",
"mean",
"of",
"the",
"given",
"columns",
"The",
"list",
"returned",
"is",
"a",
"list",
"of",
"size",
"2",
"where",
"each",
"row",
"represents",
"the",
"standard",
"deviation",
"of",
"each",
"column",
"and",
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/Normalization.java#L240-L242 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.writeThrowable | public void writeThrowable(OutputStream out, Throwable value) throws IOException {
"""
Encode a Throwable instance as JSON:
{
"throwable" : Base64,
"stackTrace" : String
}
@param out The stream to write JSON to
@param value The Throwable instance to encode. Can't be null.
@throws IOException If an I/O err... | java | public void writeThrowable(OutputStream out, Throwable value) throws IOException {
writeStartObject(out);
writeSerializedField(out, OM_THROWABLE, value);
StringWriter sw = new StringWriter();
value.printStackTrace(new PrintWriter(sw));
writeStringField(out, OM_STACKTRACE, sw.toSt... | [
"public",
"void",
"writeThrowable",
"(",
"OutputStream",
"out",
",",
"Throwable",
"value",
")",
"throws",
"IOException",
"{",
"writeStartObject",
"(",
"out",
")",
";",
"writeSerializedField",
"(",
"out",
",",
"OM_THROWABLE",
",",
"value",
")",
";",
"StringWriter... | Encode a Throwable instance as JSON:
{
"throwable" : Base64,
"stackTrace" : String
}
@param out The stream to write JSON to
@param value The Throwable instance to encode. Can't be null.
@throws IOException If an I/O error occurs
@see #readThrowable(InputStream) | [
"Encode",
"a",
"Throwable",
"instance",
"as",
"JSON",
":",
"{",
"throwable",
":",
"Base64",
"stackTrace",
":",
"String",
"}"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1948-L1955 |
VoltDB/voltdb | src/frontend/org/voltdb/compiler/VoltCompilerFileReader.java | VoltCompilerFileReader.getSchemaPath | static String getSchemaPath(String projectFilePath, String path) throws IOException {
"""
Get the path of a schema file, optionally relative to a project.xml file's path.
"""
File file = null;
if (path.contains(".jar!")) {
String ddlText = null;
ddlText = VoltCompilerUt... | java | static String getSchemaPath(String projectFilePath, String path) throws IOException
{
File file = null;
if (path.contains(".jar!")) {
String ddlText = null;
ddlText = VoltCompilerUtils.readFileFromJarfile(path);
file = VoltProjectBuilder.writeStringToTempFile(ddl... | [
"static",
"String",
"getSchemaPath",
"(",
"String",
"projectFilePath",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"File",
"file",
"=",
"null",
";",
"if",
"(",
"path",
".",
"contains",
"(",
"\".jar!\"",
")",
")",
"{",
"String",
"ddlText",
"="... | Get the path of a schema file, optionally relative to a project.xml file's path. | [
"Get",
"the",
"path",
"of",
"a",
"schema",
"file",
"optionally",
"relative",
"to",
"a",
"project",
".",
"xml",
"file",
"s",
"path",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/compiler/VoltCompilerFileReader.java#L91-L116 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfCopyForms.java | PdfCopyForms.setEncryption | public void setEncryption(byte userPassword[], byte ownerPassword[], int permissions, boolean strength128Bits) throws DocumentException {
"""
Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a rand... | java | public void setEncryption(byte userPassword[], byte ownerPassword[], int permissions, boolean strength128Bits) throws DocumentException {
fc.setEncryption(userPassword, ownerPassword, permissions, strength128Bits ? PdfWriter.STANDARD_ENCRYPTION_128 : PdfWriter.STANDARD_ENCRYPTION_40);
} | [
"public",
"void",
"setEncryption",
"(",
"byte",
"userPassword",
"[",
"]",
",",
"byte",
"ownerPassword",
"[",
"]",
",",
"int",
"permissions",
",",
"boolean",
"strength128Bits",
")",
"throws",
"DocumentException",
"{",
"fc",
".",
"setEncryption",
"(",
"userPasswor... | Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScre... | [
"Sets",
"the",
"encryption",
"options",
"for",
"this",
"document",
".",
"The",
"userPassword",
"and",
"the",
"ownerPassword",
"can",
"be",
"null",
"or",
"have",
"zero",
"length",
".",
"In",
"this",
"case",
"the",
"ownerPassword",
"is",
"replaced",
"by",
"a",... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfCopyForms.java#L137-L139 |
op4j/op4j | src/main/java/org/op4j/functions/FnString.java | FnString.toBigDecimal | public static final Function<String,BigDecimal> toBigDecimal(final int scale, final RoundingMode roundingMode, final Locale locale) {
"""
<p>
Converts a String into a BigDecimal, using the specified locale for decimal
point and thousands separator configuration and establishing the specified scale. Rounding
mod... | java | public static final Function<String,BigDecimal> toBigDecimal(final int scale, final RoundingMode roundingMode, final Locale locale) {
return new ToBigDecimal(scale, roundingMode, locale);
} | [
"public",
"static",
"final",
"Function",
"<",
"String",
",",
"BigDecimal",
">",
"toBigDecimal",
"(",
"final",
"int",
"scale",
",",
"final",
"RoundingMode",
"roundingMode",
",",
"final",
"Locale",
"locale",
")",
"{",
"return",
"new",
"ToBigDecimal",
"(",
"scale... | <p>
Converts a String into a BigDecimal, using the specified locale for decimal
point and thousands separator configuration and establishing the specified scale. Rounding
mode is used for setting the scale to the specified value.
</p>
@param scale the desired scale for the resulting BigDecimal object
@param roundingMo... | [
"<p",
">",
"Converts",
"a",
"String",
"into",
"a",
"BigDecimal",
"using",
"the",
"specified",
"locale",
"for",
"decimal",
"point",
"and",
"thousands",
"separator",
"configuration",
"and",
"establishing",
"the",
"specified",
"scale",
".",
"Rounding",
"mode",
"is"... | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnString.java#L221-L223 |
magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/MemcachedNodesManager.java | MemcachedNodesManager.setNodeAvailableForSessionId | public String setNodeAvailableForSessionId(final String sessionId, final boolean available) {
"""
Mark the memcached node encoded in the given sessionId as available or not. If nodeIds shall
not be encoded in the sessionId or if the given sessionId does not contain a nodeId no
action will be taken.
@param ses... | java | public String setNodeAvailableForSessionId(final String sessionId, final boolean available) {
if ( _nodeIdService != null && isEncodeNodeIdInSessionId() ) {
final String nodeId = _sessionIdFormat.extractMemcachedId(sessionId);
if ( nodeId != null ) {
_nodeIdService.setNodeAvailable(nodeId, available);
r... | [
"public",
"String",
"setNodeAvailableForSessionId",
"(",
"final",
"String",
"sessionId",
",",
"final",
"boolean",
"available",
")",
"{",
"if",
"(",
"_nodeIdService",
"!=",
"null",
"&&",
"isEncodeNodeIdInSessionId",
"(",
")",
")",
"{",
"final",
"String",
"nodeId",
... | Mark the memcached node encoded in the given sessionId as available or not. If nodeIds shall
not be encoded in the sessionId or if the given sessionId does not contain a nodeId no
action will be taken.
@param sessionId the sessionId that may contain a node id.
@param available specifies if the possibly referenced node... | [
"Mark",
"the",
"memcached",
"node",
"encoded",
"in",
"the",
"given",
"sessionId",
"as",
"available",
"or",
"not",
".",
"If",
"nodeIds",
"shall",
"not",
"be",
"encoded",
"in",
"the",
"sessionId",
"or",
"if",
"the",
"given",
"sessionId",
"does",
"not",
"cont... | train | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/MemcachedNodesManager.java#L482-L494 |
sarl/sarl | sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/space/AbstractEventSpace.java | AbstractEventSpace.ensureEventSource | protected void ensureEventSource(UUID eventSource, Event event) {
"""
Ensure that the given event has a source.
@param eventSource the source of the event.
@param event the event to emit.
@since 2.0.6.0
"""
if (event.getSource() == null) {
if (eventSource != null) {
event.setSource(new Address(ge... | java | protected void ensureEventSource(UUID eventSource, Event event) {
if (event.getSource() == null) {
if (eventSource != null) {
event.setSource(new Address(getSpaceID(), eventSource));
} else {
throw new AssertionError("Every event must have a source"); //$NON-NLS-1$
}
}
} | [
"protected",
"void",
"ensureEventSource",
"(",
"UUID",
"eventSource",
",",
"Event",
"event",
")",
"{",
"if",
"(",
"event",
".",
"getSource",
"(",
")",
"==",
"null",
")",
"{",
"if",
"(",
"eventSource",
"!=",
"null",
")",
"{",
"event",
".",
"setSource",
... | Ensure that the given event has a source.
@param eventSource the source of the event.
@param event the event to emit.
@since 2.0.6.0 | [
"Ensure",
"that",
"the",
"given",
"event",
"has",
"a",
"source",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/space/AbstractEventSpace.java#L154-L162 |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java | DiscoveryREST.searchWithParameters | @Path("basic")
@POST
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasSearchResult searchWithParameters(SearchParameters parameters) throws AtlasBaseException {
"""
Attribute based search for entities satisfying the search parameters
@param parameters Search para... | java | @Path("basic")
@POST
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasSearchResult searchWithParameters(SearchParameters parameters) throws AtlasBaseException {
AtlasPerfTracer perf = null;
try {
if (AtlasPerfTracer.isPerfTraceEnabled(PERF_... | [
"@",
"Path",
"(",
"\"basic\"",
")",
"@",
"POST",
"@",
"Consumes",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"@",
"Produces",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"public",
"AtlasSearchResult",
"searchWithParameters",
"(",
"SearchParameters",
"paramete... | Attribute based search for entities satisfying the search parameters
@param parameters Search parameters
@return Atlas search result
@throws AtlasBaseException
@HTTP 200 On successful search
@HTTP 400 Tag/Entity doesn't exist or Tag/entity filter is present without tag/type name | [
"Attribute",
"based",
"search",
"for",
"entities",
"satisfying",
"the",
"search",
"parameters",
"@param",
"parameters",
"Search",
"parameters",
"@return",
"Atlas",
"search",
"result",
"@throws",
"AtlasBaseException"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java#L228-L256 |
BigBadaboom/androidsvg | androidsvg/src/main/java/com/caverock/androidsvg/RenderOptions.java | RenderOptions.viewPort | public RenderOptions viewPort(float minX, float minY, float width, float height) {
"""
Describes the viewport into which the SVG should be rendered. If this is not specified,
then the whole of the canvas will be used as the viewport. If rendering to a <code>Picture</code>
then a default viewport width and hei... | java | public RenderOptions viewPort(float minX, float minY, float width, float height)
{
this.viewPort = new SVG.Box(minX, minY, width, height);
return this;
} | [
"public",
"RenderOptions",
"viewPort",
"(",
"float",
"minX",
",",
"float",
"minY",
",",
"float",
"width",
",",
"float",
"height",
")",
"{",
"this",
".",
"viewPort",
"=",
"new",
"SVG",
".",
"Box",
"(",
"minX",
",",
"minY",
",",
"width",
",",
"height",
... | Describes the viewport into which the SVG should be rendered. If this is not specified,
then the whole of the canvas will be used as the viewport. If rendering to a <code>Picture</code>
then a default viewport width and height will be used.
@param minX The left X coordinate of the viewport
@param minY The top Y coor... | [
"Describes",
"the",
"viewport",
"into",
"which",
"the",
"SVG",
"should",
"be",
"rendered",
".",
"If",
"this",
"is",
"not",
"specified",
"then",
"the",
"whole",
"of",
"the",
"canvas",
"will",
"be",
"used",
"as",
"the",
"viewport",
".",
"If",
"rendering",
... | train | https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/RenderOptions.java#L201-L205 |
chr78rm/tracelogger | src/main/java/de/christofreichardt/diagnosis/file/FileTracerLog4jTee.java | FileTracerLog4jTee.adapt | @Override
protected void adapt(LogLevel logLevel, String message, Class clazz) {
"""
Routes the given information to the log4j system.
@param logLevel {@inheritDoc}
@param message {@inheritDoc}
@param clazz {@inheritDoc}
"""
Logger logger = Logger.getLogger(clazz);
Level level = convertToLog4... | java | @Override
protected void adapt(LogLevel logLevel, String message, Class clazz)
{
Logger logger = Logger.getLogger(clazz);
Level level = convertToLog4jLevel(logLevel);
logger.log(DebugLogTee.class.getName(), level, message, null);
} | [
"@",
"Override",
"protected",
"void",
"adapt",
"(",
"LogLevel",
"logLevel",
",",
"String",
"message",
",",
"Class",
"clazz",
")",
"{",
"Logger",
"logger",
"=",
"Logger",
".",
"getLogger",
"(",
"clazz",
")",
";",
"Level",
"level",
"=",
"convertToLog4jLevel",
... | Routes the given information to the log4j system.
@param logLevel {@inheritDoc}
@param message {@inheritDoc}
@param clazz {@inheritDoc} | [
"Routes",
"the",
"given",
"information",
"to",
"the",
"log4j",
"system",
"."
] | train | https://github.com/chr78rm/tracelogger/blob/ad22452b20f8111ad4d367302c2b26a100a20200/src/main/java/de/christofreichardt/diagnosis/file/FileTracerLog4jTee.java#L62-L68 |
alkacon/opencms-core | src/org/opencms/importexport/CmsImportVersion10.java | CmsImportVersion10.sortParseableResources | protected static void sortParseableResources(List<CmsResource> parseables) {
"""
Sorts the parsealble resources before we actually parse the links.<p>
This is needed because we may, for example, have resources A and B such that A has a link to B, and B requires
the relation corresponding to that link to be pre... | java | protected static void sortParseableResources(List<CmsResource> parseables) {
Collections.sort(parseables, new Comparator<CmsResource>() {
public int compare(CmsResource a, CmsResource b) {
return ComparisonChain.start().compare(getRank(a), getRank(b)).compare(
... | [
"protected",
"static",
"void",
"sortParseableResources",
"(",
"List",
"<",
"CmsResource",
">",
"parseables",
")",
"{",
"Collections",
".",
"sort",
"(",
"parseables",
",",
"new",
"Comparator",
"<",
"CmsResource",
">",
"(",
")",
"{",
"public",
"int",
"compare",
... | Sorts the parsealble resources before we actually parse the links.<p>
This is needed because we may, for example, have resources A and B such that A has a link to B, and B requires
the relation corresponding to that link to be present for some functionality (e.g. the page_title macro in gallery name
mappings), so we n... | [
"Sorts",
"the",
"parsealble",
"resources",
"before",
"we",
"actually",
"parse",
"the",
"links",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/CmsImportVersion10.java#L646-L667 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/reflect/provider/JdkDynamicProxiesFactory.java | JdkDynamicProxiesFactory.canProxy | @Override
public boolean canProxy(Object target, Class<?>... proxyInterfaces) {
"""
Determines whether the given target {@link Object} can be proxied by this factory using JDK Dynamic Proxies.
@param target {@link Object} to evaluate.
@param proxyInterfaces array of {@link Class interfaces} to use in the pro... | java | @Override
public boolean canProxy(Object target, Class<?>... proxyInterfaces) {
return (canProxy(target) && canProxy(resolveInterfaces(target, proxyInterfaces)));
} | [
"@",
"Override",
"public",
"boolean",
"canProxy",
"(",
"Object",
"target",
",",
"Class",
"<",
"?",
">",
"...",
"proxyInterfaces",
")",
"{",
"return",
"(",
"canProxy",
"(",
"target",
")",
"&&",
"canProxy",
"(",
"resolveInterfaces",
"(",
"target",
",",
"prox... | Determines whether the given target {@link Object} can be proxied by this factory using JDK Dynamic Proxies.
@param target {@link Object} to evaluate.
@param proxyInterfaces array of {@link Class interfaces} to use in the proxy, which are also used
as part of the evaluation of determining whether the target {@link Obj... | [
"Determines",
"whether",
"the",
"given",
"target",
"{",
"@link",
"Object",
"}",
"can",
"be",
"proxied",
"by",
"this",
"factory",
"using",
"JDK",
"Dynamic",
"Proxies",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/reflect/provider/JdkDynamicProxiesFactory.java#L77-L80 |
orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/CoordinateUtils.java | CoordinateUtils.contains2D | public static boolean contains2D(Coordinate[] coords, Coordinate coord) {
"""
Checks if a coordinate array contains a specific coordinate.
The equality is done only in 2D (z values are not checked).
@param coords
@param coord
@return
"""
for (Coordinate coordinate : coords) {
if (co... | java | public static boolean contains2D(Coordinate[] coords, Coordinate coord) {
for (Coordinate coordinate : coords) {
if (coordinate.equals2D(coord)) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"contains2D",
"(",
"Coordinate",
"[",
"]",
"coords",
",",
"Coordinate",
"coord",
")",
"{",
"for",
"(",
"Coordinate",
"coordinate",
":",
"coords",
")",
"{",
"if",
"(",
"coordinate",
".",
"equals2D",
"(",
"coord",
")",
")",
"... | Checks if a coordinate array contains a specific coordinate.
The equality is done only in 2D (z values are not checked).
@param coords
@param coord
@return | [
"Checks",
"if",
"a",
"coordinate",
"array",
"contains",
"a",
"specific",
"coordinate",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/jts_utils/CoordinateUtils.java#L107-L114 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/config/ColumnDefinition.java | ColumnDefinition.deleteFromSchema | public void deleteFromSchema(Mutation mutation, long timestamp) {
"""
Drop specified column from the schema using given mutation.
@param mutation The schema mutation
@param timestamp The timestamp to use for column modification
"""
ColumnFamily cf = mutation.addOrGet(CFMetaData.SchemaColumnsCf);
... | java | public void deleteFromSchema(Mutation mutation, long timestamp)
{
ColumnFamily cf = mutation.addOrGet(CFMetaData.SchemaColumnsCf);
int ldt = (int) (System.currentTimeMillis() / 1000);
// Note: we do want to use name.toString(), not name.bytes directly for backward compatibility (For CQL3, t... | [
"public",
"void",
"deleteFromSchema",
"(",
"Mutation",
"mutation",
",",
"long",
"timestamp",
")",
"{",
"ColumnFamily",
"cf",
"=",
"mutation",
".",
"addOrGet",
"(",
"CFMetaData",
".",
"SchemaColumnsCf",
")",
";",
"int",
"ldt",
"=",
"(",
"int",
")",
"(",
"Sy... | Drop specified column from the schema using given mutation.
@param mutation The schema mutation
@param timestamp The timestamp to use for column modification | [
"Drop",
"specified",
"column",
"from",
"the",
"schema",
"using",
"given",
"mutation",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/config/ColumnDefinition.java#L316-L324 |
Appendium/objectlabkit | datecalc-common/src/main/java/net/objectlab/kit/datecalc/common/WorkingWeek.java | WorkingWeek.withWorkingDayFromCalendar | public WorkingWeek withWorkingDayFromCalendar(final boolean working, final int dayOfWeek) {
"""
If the value for the given day has changed, return a NEW WorkingWeek.
@param working
true if working day
@param dayOfWeek
e.g. Calendar.MONDAY, Calendar.TUESDAY, etc
@return a new instance of a <code>WorkingWeek<... | java | public WorkingWeek withWorkingDayFromCalendar(final boolean working, final int dayOfWeek) {
final int day = adjustDay(dayOfWeek);
WorkingWeek ret = this;
if (working && !isWorkingDayFromCalendar(dayOfWeek)) {
ret = new WorkingWeek((byte) (workingDays + WORKING_WEEK_DAYS_OFFSET[da... | [
"public",
"WorkingWeek",
"withWorkingDayFromCalendar",
"(",
"final",
"boolean",
"working",
",",
"final",
"int",
"dayOfWeek",
")",
"{",
"final",
"int",
"day",
"=",
"adjustDay",
"(",
"dayOfWeek",
")",
";",
"WorkingWeek",
"ret",
"=",
"this",
";",
"if",
"(",
"wo... | If the value for the given day has changed, return a NEW WorkingWeek.
@param working
true if working day
@param dayOfWeek
e.g. Calendar.MONDAY, Calendar.TUESDAY, etc
@return a new instance of a <code>WorkingWeek</code> with the working
day set | [
"If",
"the",
"value",
"for",
"the",
"given",
"day",
"has",
"changed",
"return",
"a",
"NEW",
"WorkingWeek",
"."
] | train | https://github.com/Appendium/objectlabkit/blob/cd649bce7a32e4e926520e62cb765f3b1d451594/datecalc-common/src/main/java/net/objectlab/kit/datecalc/common/WorkingWeek.java#L133-L142 |
Axway/Grapes | utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java | GrapesClient.promoteModule | public void promoteModule(final String name, final String version, final String user, final String password) throws GrapesCommunicationException, AuthenticationException {
"""
Promote a module in the Grapes server
@param name
@param version
@throws GrapesCommunicationException
@throws javax.naming.Authentica... | java | public void promoteModule(final String name, final String version, final String user, final String password) throws GrapesCommunicationException, AuthenticationException{
final Client client = getClient(user, password);
final WebResource resource = client.resource(serverURL).path(RequestUtils.promoteMod... | [
"public",
"void",
"promoteModule",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"version",
",",
"final",
"String",
"user",
",",
"final",
"String",
"password",
")",
"throws",
"GrapesCommunicationException",
",",
"AuthenticationException",
"{",
"final",
"... | Promote a module in the Grapes server
@param name
@param version
@throws GrapesCommunicationException
@throws javax.naming.AuthenticationException | [
"Promote",
"a",
"module",
"in",
"the",
"Grapes",
"server"
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java#L328-L341 |
bmwcarit/joynr | java/javaapi/src/main/java/io/joynr/provider/AbstractSubscriptionPublisher.java | AbstractSubscriptionPublisher.registerAttributeListener | @Override
public void registerAttributeListener(String attributeName, AttributeListener attributeListener) {
"""
Registers an attribute listener that gets notified in case the attribute
changes. This is used for on change subscriptions.
@param attributeName the attribute name as defined in the Franca m... | java | @Override
public void registerAttributeListener(String attributeName, AttributeListener attributeListener) {
attributeListeners.putIfAbsent(attributeName, new ArrayList<AttributeListener>());
List<AttributeListener> listeners = attributeListeners.get(attributeName);
synchronized (listeners) ... | [
"@",
"Override",
"public",
"void",
"registerAttributeListener",
"(",
"String",
"attributeName",
",",
"AttributeListener",
"attributeListener",
")",
"{",
"attributeListeners",
".",
"putIfAbsent",
"(",
"attributeName",
",",
"new",
"ArrayList",
"<",
"AttributeListener",
">... | Registers an attribute listener that gets notified in case the attribute
changes. This is used for on change subscriptions.
@param attributeName the attribute name as defined in the Franca model
to subscribe to.
@param attributeListener the listener to add. | [
"Registers",
"an",
"attribute",
"listener",
"that",
"gets",
"notified",
"in",
"case",
"the",
"attribute",
"changes",
".",
"This",
"is",
"used",
"for",
"on",
"change",
"subscriptions",
"."
] | train | https://github.com/bmwcarit/joynr/blob/b7a92bad1cf2f093de080facd2c803560f4c6c26/java/javaapi/src/main/java/io/joynr/provider/AbstractSubscriptionPublisher.java#L127-L134 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java | ConditionalCheck.notEmpty | @ArgumentsChecked
@Throws( {
"""
Ensures that a passed map as a parameter of the calling method is not empty.
<p>
We recommend to use the overloaded method {@link Check#notEmpty(Object[], String)} and pass as second argument
the name of the parameter to enhance the exception message.
@param condition
con... | java | @ArgumentsChecked
@Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class })
public static <T> void notEmpty(final boolean condition, @Nonnull final T[] array) {
if (condition) {
Check.notEmpty(array);
}
} | [
"@",
"ArgumentsChecked",
"@",
"Throws",
"(",
"{",
"IllegalNullArgumentException",
".",
"class",
",",
"IllegalEmptyArgumentException",
".",
"class",
"}",
")",
"public",
"static",
"<",
"T",
">",
"void",
"notEmpty",
"(",
"final",
"boolean",
"condition",
",",
"@",
... | Ensures that a passed map as a parameter of the calling method is not empty.
<p>
We recommend to use the overloaded method {@link Check#notEmpty(Object[], String)} and pass as second argument
the name of the parameter to enhance the exception message.
@param condition
condition must be {@code true}^ so that the check... | [
"Ensures",
"that",
"a",
"passed",
"map",
"as",
"a",
"parameter",
"of",
"the",
"calling",
"method",
"is",
"not",
"empty",
"."
] | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java#L1415-L1421 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/ExamplePicker.java | ExamplePicker.preparePaintComponent | @Override
protected void preparePaintComponent(final Request request) {
"""
Override preparePaint in order to set up the resources on first access by a user.
@param request the request being responded to.
"""
super.preparePaintComponent(request);
if (!isInitialised()) {
// Check project versions fo... | java | @Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request);
if (!isInitialised()) {
// Check project versions for Wcomponents-examples and WComponents match
String egVersion = Config.getInstance().getString("wcomponents-examples.version");
String wcVersio... | [
"@",
"Override",
"protected",
"void",
"preparePaintComponent",
"(",
"final",
"Request",
"request",
")",
"{",
"super",
".",
"preparePaintComponent",
"(",
"request",
")",
";",
"if",
"(",
"!",
"isInitialised",
"(",
")",
")",
"{",
"// Check project versions for Wcompo... | Override preparePaint in order to set up the resources on first access by a user.
@param request the request being responded to. | [
"Override",
"preparePaint",
"in",
"order",
"to",
"set",
"up",
"the",
"resources",
"on",
"first",
"access",
"by",
"a",
"user",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/picker/ExamplePicker.java#L79-L99 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java | AppServiceCertificateOrdersInner.beginCreateOrUpdateCertificateAsync | public Observable<AppServiceCertificateResourceInner> beginCreateOrUpdateCertificateAsync(String resourceGroupName, String certificateOrderName, String name, AppServiceCertificateResourceInner keyVaultCertificate) {
"""
Creates or updates a certificate and associates with key vault secret.
Creates or updates a ce... | java | public Observable<AppServiceCertificateResourceInner> beginCreateOrUpdateCertificateAsync(String resourceGroupName, String certificateOrderName, String name, AppServiceCertificateResourceInner keyVaultCertificate) {
return beginCreateOrUpdateCertificateWithServiceResponseAsync(resourceGroupName, certificateOrde... | [
"public",
"Observable",
"<",
"AppServiceCertificateResourceInner",
">",
"beginCreateOrUpdateCertificateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"certificateOrderName",
",",
"String",
"name",
",",
"AppServiceCertificateResourceInner",
"keyVaultCertificate",
")",
... | Creates or updates a certificate and associates with key vault secret.
Creates or updates a certificate and associates with key vault secret.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param certificateOrderName Name of the certificate order.
@param name Name of the certificate... | [
"Creates",
"or",
"updates",
"a",
"certificate",
"and",
"associates",
"with",
"key",
"vault",
"secret",
".",
"Creates",
"or",
"updates",
"a",
"certificate",
"and",
"associates",
"with",
"key",
"vault",
"secret",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java#L1308-L1315 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/message/query/RawQueryRequest.java | RawQueryRequest.jsonQuery | public static RawQueryRequest jsonQuery(String jsonQuery, String bucket, String password, InetAddress targetNode, String contextId) {
"""
Create a {@link RawQueryRequest} containing a full N1QL query in Json form (including additional
query parameters like named arguments, etc...).
The simplest form of such a ... | java | public static RawQueryRequest jsonQuery(String jsonQuery, String bucket, String password, InetAddress targetNode, String contextId) {
return new RawQueryRequest(jsonQuery, bucket, bucket, password, targetNode, contextId);
} | [
"public",
"static",
"RawQueryRequest",
"jsonQuery",
"(",
"String",
"jsonQuery",
",",
"String",
"bucket",
",",
"String",
"password",
",",
"InetAddress",
"targetNode",
",",
"String",
"contextId",
")",
"{",
"return",
"new",
"RawQueryRequest",
"(",
"jsonQuery",
",",
... | Create a {@link RawQueryRequest} containing a full N1QL query in Json form (including additional
query parameters like named arguments, etc...).
The simplest form of such a query is a single statement encapsulated in a json query object:
<pre>{"statement":"SELECT * FROM default"}</pre>.
@param jsonQuery the N1QL quer... | [
"Create",
"a",
"{",
"@link",
"RawQueryRequest",
"}",
"containing",
"a",
"full",
"N1QL",
"query",
"in",
"Json",
"form",
"(",
"including",
"additional",
"query",
"parameters",
"like",
"named",
"arguments",
"etc",
"...",
")",
"."
] | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/message/query/RawQueryRequest.java#L91-L93 |
BigBadaboom/androidsvg | androidsvg/src/main/java/com/caverock/androidsvg/SVGAndroidRenderer.java | SVGAndroidRenderer.makeViewPort | private Box makeViewPort(Length x, Length y, Length width, Length height) {
"""
Derive the viewport from the x, y, width and height attributes of an object
"""
float _x = (x != null) ? x.floatValueX(this) : 0f;
float _y = (y != null) ? y.floatValueY(this) : 0f;
Box viewPortUser = getCu... | java | private Box makeViewPort(Length x, Length y, Length width, Length height)
{
float _x = (x != null) ? x.floatValueX(this) : 0f;
float _y = (y != null) ? y.floatValueY(this) : 0f;
Box viewPortUser = getCurrentViewPortInUserUnits();
float _w = (width != null) ? width.floatValueX(this) ... | [
"private",
"Box",
"makeViewPort",
"(",
"Length",
"x",
",",
"Length",
"y",
",",
"Length",
"width",
",",
"Length",
"height",
")",
"{",
"float",
"_x",
"=",
"(",
"x",
"!=",
"null",
")",
"?",
"x",
".",
"floatValueX",
"(",
"this",
")",
":",
"0f",
";",
... | Derive the viewport from the x, y, width and height attributes of an object | [
"Derive",
"the",
"viewport",
"from",
"the",
"x",
"y",
"width",
"and",
"height",
"attributes",
"of",
"an",
"object"
] | train | https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGAndroidRenderer.java#L630-L640 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/metadata/CustomMatchingStrategy.java | CustomMatchingStrategy.getMatchResponse | @Override
public MatchResponse getMatchResponse(SecurityConstraint securityConstraint, String resourceName, String method) {
"""
Gets the response object that contains the roles, the SSL required
and access precluded indicators. Gets the response using the custom method algorithm.
If the collection match ret... | java | @Override
public MatchResponse getMatchResponse(SecurityConstraint securityConstraint, String resourceName, String method) {
CollectionMatch collectionMatch = getCollectionMatch(securityConstraint.getWebResourceCollections(), resourceName, method);
if (CollectionMatch.RESPONSE_NO_MATCH.equals(collec... | [
"@",
"Override",
"public",
"MatchResponse",
"getMatchResponse",
"(",
"SecurityConstraint",
"securityConstraint",
",",
"String",
"resourceName",
",",
"String",
"method",
")",
"{",
"CollectionMatch",
"collectionMatch",
"=",
"getCollectionMatch",
"(",
"securityConstraint",
"... | Gets the response object that contains the roles, the SSL required
and access precluded indicators. Gets the response using the custom method algorithm.
If the collection match returned from the collection is null,
then response must be CUSTOM_NO_MATCH_RESPONSE.
@param resourceName The resource name.
@param method The... | [
"Gets",
"the",
"response",
"object",
"that",
"contains",
"the",
"roles",
"the",
"SSL",
"required",
"and",
"access",
"precluded",
"indicators",
".",
"Gets",
"the",
"response",
"using",
"the",
"custom",
"method",
"algorithm",
".",
"If",
"the",
"collection",
"mat... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/metadata/CustomMatchingStrategy.java#L50-L61 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/QueryFactory.java | QueryFactory.newReportQuery | public static ReportQueryByCriteria newReportQuery(Class classToSearchFrom, Criteria criteria, boolean distinct) {
"""
create a new ReportQueryByCriteria
@param classToSearchFrom
@param criteria
@param distinct
@return ReportQueryByCriteria
"""
criteria = addCriteriaForOjbConcreteClasses(getReposi... | java | public static ReportQueryByCriteria newReportQuery(Class classToSearchFrom, Criteria criteria, boolean distinct)
{
criteria = addCriteriaForOjbConcreteClasses(getRepository().getDescriptorFor(classToSearchFrom), criteria);
return newReportQuery(classToSearchFrom, null, criteria, distinct);
} | [
"public",
"static",
"ReportQueryByCriteria",
"newReportQuery",
"(",
"Class",
"classToSearchFrom",
",",
"Criteria",
"criteria",
",",
"boolean",
"distinct",
")",
"{",
"criteria",
"=",
"addCriteriaForOjbConcreteClasses",
"(",
"getRepository",
"(",
")",
".",
"getDescriptorF... | create a new ReportQueryByCriteria
@param classToSearchFrom
@param criteria
@param distinct
@return ReportQueryByCriteria | [
"create",
"a",
"new",
"ReportQueryByCriteria"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/QueryFactory.java#L59-L63 |
SonarSource/sonarqube | server/sonar-db-dao/src/main/java/org/sonar/db/permission/GroupPermissionDao.java | GroupPermissionDao.deleteByRootComponentIdAndPermission | public int deleteByRootComponentIdAndPermission(DbSession dbSession, long rootComponentId, String permission) {
"""
Delete the specified permission for the specified component for any group (including group AnyOne).
"""
return mapper(dbSession).deleteByRootComponentIdAndPermission(rootComponentId, permissi... | java | public int deleteByRootComponentIdAndPermission(DbSession dbSession, long rootComponentId, String permission) {
return mapper(dbSession).deleteByRootComponentIdAndPermission(rootComponentId, permission);
} | [
"public",
"int",
"deleteByRootComponentIdAndPermission",
"(",
"DbSession",
"dbSession",
",",
"long",
"rootComponentId",
",",
"String",
"permission",
")",
"{",
"return",
"mapper",
"(",
"dbSession",
")",
".",
"deleteByRootComponentIdAndPermission",
"(",
"rootComponentId",
... | Delete the specified permission for the specified component for any group (including group AnyOne). | [
"Delete",
"the",
"specified",
"permission",
"for",
"the",
"specified",
"component",
"for",
"any",
"group",
"(",
"including",
"group",
"AnyOne",
")",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-dao/src/main/java/org/sonar/db/permission/GroupPermissionDao.java#L162-L164 |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonUtil.java | JsonUtil.putByteList | public static void putByteList(Writer writer, List<Byte> values) throws IOException {
"""
Writes the given value with the given writer.
@param writer
@param values
@throws IOException
@author vvakame
"""
if (values == null) {
writer.write("null");
} else {
startArray(writer);
for (int i = 0; i... | java | public static void putByteList(Writer writer, List<Byte> values) throws IOException {
if (values == null) {
writer.write("null");
} else {
startArray(writer);
for (int i = 0; i < values.size(); i++) {
put(writer, values.get(i));
if (i != values.size() - 1) {
addSeparator(writer);
}
}
... | [
"public",
"static",
"void",
"putByteList",
"(",
"Writer",
"writer",
",",
"List",
"<",
"Byte",
">",
"values",
")",
"throws",
"IOException",
"{",
"if",
"(",
"values",
"==",
"null",
")",
"{",
"writer",
".",
"write",
"(",
"\"null\"",
")",
";",
"}",
"else",... | Writes the given value with the given writer.
@param writer
@param values
@throws IOException
@author vvakame | [
"Writes",
"the",
"given",
"value",
"with",
"the",
"given",
"writer",
"."
] | train | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonUtil.java#L260-L273 |
cdk/cdk | tool/hash/src/main/java/org/openscience/cdk/hash/stereo/GeometricTetrahedralEncoderFactory.java | GeometricTetrahedralEncoderFactory.geometric3D | private static GeometricParity geometric3D(int i, int[] adjacent, IAtomContainer container) {
"""
Create the geometric part of an encoder of 3D configurations
@param i the central atom (index)
@param adjacent adjacent atoms (indices)
@param container container
@return geometric parity encoder (or nu... | java | private static GeometricParity geometric3D(int i, int[] adjacent, IAtomContainer container) {
IAtom atom = container.getAtom(i);
Point3d[] coordinates = new Point3d[4];
// set the forth ligand to centre as default (overwritten if
// we have 4 neighbors)
if (atom.getPoint3d() !=... | [
"private",
"static",
"GeometricParity",
"geometric3D",
"(",
"int",
"i",
",",
"int",
"[",
"]",
"adjacent",
",",
"IAtomContainer",
"container",
")",
"{",
"IAtom",
"atom",
"=",
"container",
".",
"getAtom",
"(",
"i",
")",
";",
"Point3d",
"[",
"]",
"coordinates... | Create the geometric part of an encoder of 3D configurations
@param i the central atom (index)
@param adjacent adjacent atoms (indices)
@param container container
@return geometric parity encoder (or null) | [
"Create",
"the",
"geometric",
"part",
"of",
"an",
"encoder",
"of",
"3D",
"configurations"
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/hash/src/main/java/org/openscience/cdk/hash/stereo/GeometricTetrahedralEncoderFactory.java#L185-L210 |
google/error-prone | check_api/src/main/java/com/google/errorprone/matchers/Matchers.java | Matchers.receiverSameAsArgument | public static Matcher<? super MethodInvocationTree> receiverSameAsArgument(final int argNum) {
"""
Matches when the receiver of an instance method is the same reference as a particular argument
to the method. For example, receiverSameAsArgument(1) would match {@code obj.method("", obj)}
@param argNum The numbe... | java | public static Matcher<? super MethodInvocationTree> receiverSameAsArgument(final int argNum) {
return new Matcher<MethodInvocationTree>() {
@Override
public boolean matches(MethodInvocationTree t, VisitorState state) {
List<? extends ExpressionTree> args = t.getArguments();
if (args.size... | [
"public",
"static",
"Matcher",
"<",
"?",
"super",
"MethodInvocationTree",
">",
"receiverSameAsArgument",
"(",
"final",
"int",
"argNum",
")",
"{",
"return",
"new",
"Matcher",
"<",
"MethodInvocationTree",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
... | Matches when the receiver of an instance method is the same reference as a particular argument
to the method. For example, receiverSameAsArgument(1) would match {@code obj.method("", obj)}
@param argNum The number of the argument to compare against (zero-based. | [
"Matches",
"when",
"the",
"receiver",
"of",
"an",
"instance",
"method",
"is",
"the",
"same",
"reference",
"as",
"a",
"particular",
"argument",
"to",
"the",
"method",
".",
"For",
"example",
"receiverSameAsArgument",
"(",
"1",
")",
"would",
"match",
"{",
"@cod... | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L285-L307 |
real-logic/agrona | agrona/src/main/java/org/agrona/collections/CollectionUtil.java | CollectionUtil.removeIf | public static <T> int removeIf(final List<T> values, final Predicate<T> predicate) {
"""
Remove element from a list if it matches a predicate.
<p>
<b>Note:</b> the list must implement {@link java.util.RandomAccess} to be efficient.
@param values to be iterated over.
@param predicate to test the value agai... | java | public static <T> int removeIf(final List<T> values, final Predicate<T> predicate)
{
int size = values.size();
int total = 0;
for (int i = 0; i < size; )
{
final T value = values.get(i);
if (predicate.test(value))
{
values.remove(i... | [
"public",
"static",
"<",
"T",
">",
"int",
"removeIf",
"(",
"final",
"List",
"<",
"T",
">",
"values",
",",
"final",
"Predicate",
"<",
"T",
">",
"predicate",
")",
"{",
"int",
"size",
"=",
"values",
".",
"size",
"(",
")",
";",
"int",
"total",
"=",
"... | Remove element from a list if it matches a predicate.
<p>
<b>Note:</b> the list must implement {@link java.util.RandomAccess} to be efficient.
@param values to be iterated over.
@param predicate to test the value against
@param <T> type of the value.
@return the number of items remove. | [
"Remove",
"element",
"from",
"a",
"list",
"if",
"it",
"matches",
"a",
"predicate",
".",
"<p",
">",
"<b",
">",
"Note",
":",
"<",
"/",
"b",
">",
"the",
"list",
"must",
"implement",
"{",
"@link",
"java",
".",
"util",
".",
"RandomAccess",
"}",
"to",
"b... | train | https://github.com/real-logic/agrona/blob/d1ea76e6e3598cd6a0d34879687652ef123f639b/agrona/src/main/java/org/agrona/collections/CollectionUtil.java#L113-L134 |
alkacon/opencms-core | src/org/opencms/search/CmsSearchIndex.java | CmsSearchIndex.getResource | protected CmsResource getResource(CmsObject cms, I_CmsSearchDocument doc) {
"""
Checks if the OpenCms resource referenced by the result document can be read
by the user of the given OpenCms context.
Returns the referenced <code>CmsResource</code> or <code>null</code> if
the user is not permitted to read the r... | java | protected CmsResource getResource(CmsObject cms, I_CmsSearchDocument doc) {
// check if the resource exits in the VFS,
// this will implicitly check read permission and if the resource was deleted
CmsResourceFilter filter = CmsResourceFilter.DEFAULT;
if (isRequireViewPermission()) {
... | [
"protected",
"CmsResource",
"getResource",
"(",
"CmsObject",
"cms",
",",
"I_CmsSearchDocument",
"doc",
")",
"{",
"// check if the resource exits in the VFS,",
"// this will implicitly check read permission and if the resource was deleted",
"CmsResourceFilter",
"filter",
"=",
"CmsReso... | Checks if the OpenCms resource referenced by the result document can be read
by the user of the given OpenCms context.
Returns the referenced <code>CmsResource</code> or <code>null</code> if
the user is not permitted to read the resource.<p>
@param cms the OpenCms user context to use for permission testing
@param doc... | [
"Checks",
"if",
"the",
"OpenCms",
"resource",
"referenced",
"by",
"the",
"result",
"document",
"can",
"be",
"read",
"by",
"the",
"user",
"of",
"the",
"given",
"OpenCms",
"context",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearchIndex.java#L1697-L1709 |
h2oai/h2o-2 | src/main/java/water/util/FrameUtils.java | FrameUtils.parseFrame | public static Frame parseFrame(Key okey, File ...files) {
"""
Parse given file into the form of frame represented by the given key.
@param okey destination key for parsed frame
@param files files to parse
@return a new frame
"""
assert files.length > 0 : "Ups. No files to parse!";
for (File f : ... | java | public static Frame parseFrame(Key okey, File ...files) {
assert files.length > 0 : "Ups. No files to parse!";
for (File f : files)
if (!f.exists())
throw new RuntimeException("File not found " + f);
// Create output key if not specified
if(okey == null)
okey = Key.make(files[0].getN... | [
"public",
"static",
"Frame",
"parseFrame",
"(",
"Key",
"okey",
",",
"File",
"...",
"files",
")",
"{",
"assert",
"files",
".",
"length",
">",
"0",
":",
"\"Ups. No files to parse!\"",
";",
"for",
"(",
"File",
"f",
":",
"files",
")",
"if",
"(",
"!",
"f",
... | Parse given file into the form of frame represented by the given key.
@param okey destination key for parsed frame
@param files files to parse
@return a new frame | [
"Parse",
"given",
"file",
"into",
"the",
"form",
"of",
"frame",
"represented",
"by",
"the",
"given",
"key",
"."
] | train | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/util/FrameUtils.java#L54-L67 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.reimageAll | public OperationStatusResponseInner reimageAll(String resourceGroupName, String vmScaleSetName) {
"""
Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks.
@param resourceGroupName The name of the resource group.
@param vm... | java | public OperationStatusResponseInner reimageAll(String resourceGroupName, String vmScaleSetName) {
return reimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().body();
} | [
"public",
"OperationStatusResponseInner",
"reimageAll",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
")",
"{",
"return",
"reimageAllWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmScaleSetName",
")",
".",
"toBlocking",
"(",
")",
".",
... | Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@throws IllegalArgumentException thrown if parameters fail the vali... | [
"Reimages",
"all",
"the",
"disks",
"(",
"including",
"data",
"disks",
")",
"in",
"the",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
".",
"This",
"operation",
"is",
"only",
"supported",
"for",
"managed",
"disks",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L3218-L3220 |
Byclosure/webcat-runner-jvm | src/main/java/com/byclosure/webcat/WebcatRunner.java | WebcatRunner.createRuntime | protected Runtime createRuntime(ResourceLoader resourceLoader, ClassLoader classLoader,
RuntimeOptions runtimeOptions) throws InitializationError, IOException {
"""
Create the Runtime. Can be overridden to customize the runtime or backend.
@param resourceLoader used to load r... | java | protected Runtime createRuntime(ResourceLoader resourceLoader, ClassLoader classLoader,
RuntimeOptions runtimeOptions) throws InitializationError, IOException {
ClassFinder classFinder = new ResourceLoaderClassFinder(resourceLoader, classLoader);
return new Runtime(re... | [
"protected",
"Runtime",
"createRuntime",
"(",
"ResourceLoader",
"resourceLoader",
",",
"ClassLoader",
"classLoader",
",",
"RuntimeOptions",
"runtimeOptions",
")",
"throws",
"InitializationError",
",",
"IOException",
"{",
"ClassFinder",
"classFinder",
"=",
"new",
"Resource... | Create the Runtime. Can be overridden to customize the runtime or backend.
@param resourceLoader used to load resources
@param classLoader used to load classes
@param runtimeOptions configuration
@return a new runtime
@throws InitializationError if a JUnit error occurred
@throws IOException if a class or resource c... | [
"Create",
"the",
"Runtime",
".",
"Can",
"be",
"overridden",
"to",
"customize",
"the",
"runtime",
"or",
"backend",
"."
] | train | https://github.com/Byclosure/webcat-runner-jvm/blob/18c9b9cfcf8d71ae5c353ad6e9577d317e0bcfb9/src/main/java/com/byclosure/webcat/WebcatRunner.java#L108-L112 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.