repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 194 | func_name stringlengths 6 111 | whole_func_string stringlengths 80 3.8k | language stringclasses 1
value | func_code_string stringlengths 80 3.8k | func_code_tokens listlengths 20 697 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 434 | split_name stringclasses 1
value | func_code_url stringlengths 111 308 |
|---|---|---|---|---|---|---|---|---|---|---|
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/util/CompilerUtil.java | CompilerUtil.formatForDisplay | private static String formatForDisplay(String setterMethodName, List<Object> args) {
StringBuilder sb = new StringBuilder(CompilerOptions.class.getName());
sb.append(".").append(setterMethodName).append("("); //$NON-NLS-1$ //$NON-NLS-2$
Joiner.on(",").appendTo(sb, args).append(")"); //$NON-NLS-1$ //$NON-NLS-2$... | java | private static String formatForDisplay(String setterMethodName, List<Object> args) {
StringBuilder sb = new StringBuilder(CompilerOptions.class.getName());
sb.append(".").append(setterMethodName).append("("); //$NON-NLS-1$ //$NON-NLS-2$
Joiner.on(",").appendTo(sb, args).append(")"); //$NON-NLS-1$ //$NON-NLS-2$... | [
"private",
"static",
"String",
"formatForDisplay",
"(",
"String",
"setterMethodName",
",",
"List",
"<",
"Object",
">",
"args",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"CompilerOptions",
".",
"class",
".",
"getName",
"(",
")",
")",
... | Formats the specified setter method and parameters into a string for display.
<p>
For example: <code>setXXX(arg1, ar2)</code>
@param setterMethodName
the method name
@param args
the method arguments
@return the formatted string | [
"Formats",
"the",
"specified",
"setter",
"method",
"and",
"parameters",
"into",
"a",
"string",
"for",
"display",
".",
"<p",
">",
"For",
"example",
":",
"<code",
">",
"setXXX",
"(",
"arg1",
"ar2",
")",
"<",
"/",
"code",
">"
] | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/util/CompilerUtil.java#L487-L492 |
dkpro/dkpro-argumentation | dkpro-argumentation-types/src/main/java/org/dkpro/argumentation/types/WebArgumentMetadataHelper.java | WebArgumentMetadataHelper.copy | public static void copy(final JCas sourceView, final JCas targetView)
throws IllegalArgumentException
{
if (hasWebArgumentMetadata(targetView)) {
throw new IllegalArgumentException(
"Target view already contains " + WebArgumentMetadata.class.getName());
}
... | java | public static void copy(final JCas sourceView, final JCas targetView)
throws IllegalArgumentException
{
if (hasWebArgumentMetadata(targetView)) {
throw new IllegalArgumentException(
"Target view already contains " + WebArgumentMetadata.class.getName());
}
... | [
"public",
"static",
"void",
"copy",
"(",
"final",
"JCas",
"sourceView",
",",
"final",
"JCas",
"targetView",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"hasWebArgumentMetadata",
"(",
"targetView",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentExcep... | Creates new {@linkplain WebArgumentMetadata} in the target and copies all meta data.
@param sourceView source jCas
@param targetView target jCas
@throws IllegalArgumentException if the {@code targetView} already contains
{@linkplain WebArgumentMetadata} | [
"Creates",
"new",
"{",
"@linkplain",
"WebArgumentMetadata",
"}",
"in",
"the",
"target",
"and",
"copies",
"all",
"meta",
"data",
"."
] | train | https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-types/src/main/java/org/dkpro/argumentation/types/WebArgumentMetadataHelper.java#L47-L70 |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/WebService.java | WebService.convertMolFileSMILESWithAtomMapping | public String convertMolFileSMILESWithAtomMapping(String molfile, List<Attachment> attachments) throws CTKException, ChemistryException{
return SMILES.convertMolToSMILESWithAtomMapping(molfile, attachments);
} | java | public String convertMolFileSMILESWithAtomMapping(String molfile, List<Attachment> attachments) throws CTKException, ChemistryException{
return SMILES.convertMolToSMILESWithAtomMapping(molfile, attachments);
} | [
"public",
"String",
"convertMolFileSMILESWithAtomMapping",
"(",
"String",
"molfile",
",",
"List",
"<",
"Attachment",
">",
"attachments",
")",
"throws",
"CTKException",
",",
"ChemistryException",
"{",
"return",
"SMILES",
".",
"convertMolToSMILESWithAtomMapping",
"(",
"mo... | method to generate a smiles with atom mapping for a given molfile with the given attachments
@param molfile given molfile
@param attachments given attachments
@return smiles with atom mapping
@throws CTKException general ChemToolKit exception passed to HELMToolKit
@throws ChemistryException if the chemistry engine can ... | [
"method",
"to",
"generate",
"a",
"smiles",
"with",
"atom",
"mapping",
"for",
"a",
"given",
"molfile",
"with",
"the",
"given",
"attachments"
] | train | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/WebService.java#L676-L678 |
liferay/com-liferay-commerce | commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPDisplayLayoutUtil.java | CPDisplayLayoutUtil.findByC_C | public static CPDisplayLayout findByC_C(long classNameId, long classPK)
throws com.liferay.commerce.product.exception.NoSuchCPDisplayLayoutException {
return getPersistence().findByC_C(classNameId, classPK);
} | java | public static CPDisplayLayout findByC_C(long classNameId, long classPK)
throws com.liferay.commerce.product.exception.NoSuchCPDisplayLayoutException {
return getPersistence().findByC_C(classNameId, classPK);
} | [
"public",
"static",
"CPDisplayLayout",
"findByC_C",
"(",
"long",
"classNameId",
",",
"long",
"classPK",
")",
"throws",
"com",
".",
"liferay",
".",
"commerce",
".",
"product",
".",
"exception",
".",
"NoSuchCPDisplayLayoutException",
"{",
"return",
"getPersistence",
... | Returns the cp display layout where classNameId = ? and classPK = ? or throws a {@link NoSuchCPDisplayLayoutException} if it could not be found.
@param classNameId the class name ID
@param classPK the class pk
@return the matching cp display layout
@throws NoSuchCPDisplayLayoutException if a matching cp displa... | [
"Returns",
"the",
"cp",
"display",
"layout",
"where",
"classNameId",
"=",
"?",
";",
"and",
"classPK",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCPDisplayLayoutException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPDisplayLayoutUtil.java#L513-L516 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java | PageFlowUtils.ensureGlobalApp | public static GlobalApp ensureGlobalApp( HttpServletRequest request, HttpServletResponse response )
{
ServletContext servletContext = InternalUtils.getServletContext( request );
return ensureGlobalApp( request, response, servletContext );
} | java | public static GlobalApp ensureGlobalApp( HttpServletRequest request, HttpServletResponse response )
{
ServletContext servletContext = InternalUtils.getServletContext( request );
return ensureGlobalApp( request, response, servletContext );
} | [
"public",
"static",
"GlobalApp",
"ensureGlobalApp",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"{",
"ServletContext",
"servletContext",
"=",
"InternalUtils",
".",
"getServletContext",
"(",
"request",
")",
";",
"return",
"ensureGlo... | Get or create the current {@link GlobalApp} instance.
@deprecated Use {@link #getGlobalApp} instead.
@param request the current HttpServletRequest.
@param response the current HttpServletResponse
@return the current {@link GlobalApp} from the user session, or a newly-instantiated one
(based on the user's Global.app fi... | [
"Get",
"or",
"create",
"the",
"current",
"{",
"@link",
"GlobalApp",
"}",
"instance",
".",
"@deprecated",
"Use",
"{",
"@link",
"#getGlobalApp",
"}",
"instead",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L1250-L1254 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/SwingBindingFactory.java | SwingBindingFactory.createBoundList | public Binding createBoundList(String selectionFormProperty, Object selectableItems) {
return createBoundList(selectionFormProperty, new ValueHolder(selectableItems));
} | java | public Binding createBoundList(String selectionFormProperty, Object selectableItems) {
return createBoundList(selectionFormProperty, new ValueHolder(selectableItems));
} | [
"public",
"Binding",
"createBoundList",
"(",
"String",
"selectionFormProperty",
",",
"Object",
"selectableItems",
")",
"{",
"return",
"createBoundList",
"(",
"selectionFormProperty",
",",
"new",
"ValueHolder",
"(",
"selectableItems",
")",
")",
";",
"}"
] | Binds the values specified in the collection contained within
<code>selectableItems</code> to a {@link JList}, with any
user selection being placed in the form property referred to by
<code>selectionFormProperty</code>. Each item in the list will be
rendered as a String. Note that the selection in the
bound list will... | [
"Binds",
"the",
"values",
"specified",
"in",
"the",
"collection",
"contained",
"within",
"<code",
">",
"selectableItems<",
"/",
"code",
">",
"to",
"a",
"{",
"@link",
"JList",
"}",
"with",
"any",
"user",
"selection",
"being",
"placed",
"in",
"the",
"form",
... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/SwingBindingFactory.java#L180-L182 |
Squarespace/cldr | compiler/src/main/java/com/squarespace/cldr/codegen/CalendarCodeGenerator.java | CalendarCodeGenerator.buildTypedPatternMethod | private MethodSpec buildTypedPatternMethod(String methodName, ClassName type, Format format) {
MethodSpec.Builder method = MethodSpec.methodBuilder(methodName)
.addAnnotation(Override.class)
.addModifiers(PUBLIC)
.addParameter(CALENDAR_FORMAT, "type")
.addParameter(ZonedDateTime.clas... | java | private MethodSpec buildTypedPatternMethod(String methodName, ClassName type, Format format) {
MethodSpec.Builder method = MethodSpec.methodBuilder(methodName)
.addAnnotation(Override.class)
.addModifiers(PUBLIC)
.addParameter(CALENDAR_FORMAT, "type")
.addParameter(ZonedDateTime.clas... | [
"private",
"MethodSpec",
"buildTypedPatternMethod",
"(",
"String",
"methodName",
",",
"ClassName",
"type",
",",
"Format",
"format",
")",
"{",
"MethodSpec",
".",
"Builder",
"method",
"=",
"MethodSpec",
".",
"methodBuilder",
"(",
"methodName",
")",
".",
"addAnnotati... | The CLDR contains 4 standard pattern types for date and time: short, medium, long and full.
This generates a switch statement to format patterns of this type.
See CLDR "dateFormats" and "timeFormats" nodes. | [
"The",
"CLDR",
"contains",
"4",
"standard",
"pattern",
"types",
"for",
"date",
"and",
"time",
":",
"short",
"medium",
"long",
"and",
"full",
".",
"This",
"generates",
"a",
"switch",
"statement",
"to",
"format",
"patterns",
"of",
"this",
"type",
".",
"See",... | train | https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/compiler/src/main/java/com/squarespace/cldr/codegen/CalendarCodeGenerator.java#L260-L280 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/MergeRequestApi.java | MergeRequestApi.createMergeRequest | public MergeRequest createMergeRequest(Object projectIdOrPath, String sourceBranch, String targetBranch, String title, String description, Integer assigneeId,
Integer targetProjectId, String[] labels, Integer milestoneId, Boolean removeSourceBranch) throws GitLabApiException {
return createMergeR... | java | public MergeRequest createMergeRequest(Object projectIdOrPath, String sourceBranch, String targetBranch, String title, String description, Integer assigneeId,
Integer targetProjectId, String[] labels, Integer milestoneId, Boolean removeSourceBranch) throws GitLabApiException {
return createMergeR... | [
"public",
"MergeRequest",
"createMergeRequest",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"sourceBranch",
",",
"String",
"targetBranch",
",",
"String",
"title",
",",
"String",
"description",
",",
"Integer",
"assigneeId",
",",
"Integer",
"targetProjectId",
",",
... | Creates a merge request and optionally assigns a reviewer to it.
<pre><code>GitLab Endpoint: POST /projects/:id/merge_requests</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param sourceBranch the source branch, required
@param targetBranch the target... | [
"Creates",
"a",
"merge",
"request",
"and",
"optionally",
"assigns",
"a",
"reviewer",
"to",
"it",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/MergeRequestApi.java#L396-L399 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/Item.java | Item.withString | public Item withString(String attrName, String val) {
checkInvalidAttribute(attrName, val);
attributes.put(attrName, val);
return this;
} | java | public Item withString(String attrName, String val) {
checkInvalidAttribute(attrName, val);
attributes.put(attrName, val);
return this;
} | [
"public",
"Item",
"withString",
"(",
"String",
"attrName",
",",
"String",
"val",
")",
"{",
"checkInvalidAttribute",
"(",
"attrName",
",",
"val",
")",
";",
"attributes",
".",
"put",
"(",
"attrName",
",",
"val",
")",
";",
"return",
"this",
";",
"}"
] | Sets the value of the specified attribute in the current item to the
given string value. | [
"Sets",
"the",
"value",
"of",
"the",
"specified",
"attribute",
"in",
"the",
"current",
"item",
"to",
"the",
"given",
"string",
"value",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/Item.java#L107-L111 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/block/meta/MasterWorkerInfo.java | MasterWorkerInfo.addLostStorage | public void addLostStorage(String tierAlias, String dirPath) {
List<String> paths = mLostStorage.getOrDefault(tierAlias, new ArrayList<>());
paths.add(dirPath);
mLostStorage.put(tierAlias, paths);
} | java | public void addLostStorage(String tierAlias, String dirPath) {
List<String> paths = mLostStorage.getOrDefault(tierAlias, new ArrayList<>());
paths.add(dirPath);
mLostStorage.put(tierAlias, paths);
} | [
"public",
"void",
"addLostStorage",
"(",
"String",
"tierAlias",
",",
"String",
"dirPath",
")",
"{",
"List",
"<",
"String",
">",
"paths",
"=",
"mLostStorage",
".",
"getOrDefault",
"(",
"tierAlias",
",",
"new",
"ArrayList",
"<>",
"(",
")",
")",
";",
"paths",... | Adds a new worker lost storage path.
@param tierAlias the tier alias
@param dirPath the lost storage path | [
"Adds",
"a",
"new",
"worker",
"lost",
"storage",
"path",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/block/meta/MasterWorkerInfo.java#L188-L192 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java | FieldUtils.readStaticField | public static Object readStaticField(final Class<?> cls, final String fieldName) throws IllegalAccessException {
return readStaticField(cls, fieldName, false);
} | java | public static Object readStaticField(final Class<?> cls, final String fieldName) throws IllegalAccessException {
return readStaticField(cls, fieldName, false);
} | [
"public",
"static",
"Object",
"readStaticField",
"(",
"final",
"Class",
"<",
"?",
">",
"cls",
",",
"final",
"String",
"fieldName",
")",
"throws",
"IllegalAccessException",
"{",
"return",
"readStaticField",
"(",
"cls",
",",
"fieldName",
",",
"false",
")",
";",
... | Reads the named {@code public static} {@link Field}. Superclasses will be considered.
@param cls
the {@link Class} to reflect, must not be {@code null}
@param fieldName
the field name to obtain
@return the value of the field
@throws IllegalArgumentException
if the class is {@code null}, or the field name is blank or e... | [
"Reads",
"the",
"named",
"{",
"@code",
"public",
"static",
"}",
"{",
"@link",
"Field",
"}",
".",
"Superclasses",
"will",
"be",
"considered",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java#L316-L318 |
denisneuling/apitrary.jar | apitrary-orm/apitrary-orm-core/src/main/java/com/apitrary/orm/core/util/ProxyUtil.java | ProxyUtil.createLazyProxy | @SuppressWarnings("unchecked")
public static <T> T createLazyProxy(Class<T> target, ApitraryDaoSupport apitraryDaoSupport, String id) {
if (id == null) {
return null;
}
try {
Enhancer e = new Enhancer();
e.setSuperclass(target);
e.setCallback(new LazyLoadingInterceptor(target, apitraryDaoSupport, id)... | java | @SuppressWarnings("unchecked")
public static <T> T createLazyProxy(Class<T> target, ApitraryDaoSupport apitraryDaoSupport, String id) {
if (id == null) {
return null;
}
try {
Enhancer e = new Enhancer();
e.setSuperclass(target);
e.setCallback(new LazyLoadingInterceptor(target, apitraryDaoSupport, id)... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"createLazyProxy",
"(",
"Class",
"<",
"T",
">",
"target",
",",
"ApitraryDaoSupport",
"apitraryDaoSupport",
",",
"String",
"id",
")",
"{",
"if",
"(",
"id",
"==",
"nu... | <p>
createLazyProxy.
</p>
@param target
a {@link java.lang.Class} object.
@param apitraryDaoSupport
a {@link com.apitrary.orm.core.ApitraryDaoSupport} object.
@param id
a {@link java.lang.String} object.
@param <T>
a T object.
@return a T object. | [
"<p",
">",
"createLazyProxy",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/denisneuling/apitrary.jar/blob/b7f639a1e735c60ba2b1b62851926757f5de8628/apitrary-orm/apitrary-orm-core/src/main/java/com/apitrary/orm/core/util/ProxyUtil.java#L48-L61 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.clickOnWebElement | public void clickOnWebElement(By by, int match, boolean scroll){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "clickOnWebElement("+by+", "+match+", "+scroll+")");
}
clicker.clickOnWebElement(by, match, scroll, config.useJavaScriptToClickWebElements);
} | java | public void clickOnWebElement(By by, int match, boolean scroll){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "clickOnWebElement("+by+", "+match+", "+scroll+")");
}
clicker.clickOnWebElement(by, match, scroll, config.useJavaScriptToClickWebElements);
} | [
"public",
"void",
"clickOnWebElement",
"(",
"By",
"by",
",",
"int",
"match",
",",
"boolean",
"scroll",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"clickOnWebElement(\"",
... | Clicks a WebElement matching the specified By object.
@param by the By object. Examples are: {@code By.id("id")} and {@code By.name("name")}
@param match if multiple objects match, this determines which one to click
@param scroll {@code true} if scrolling should be performed | [
"Clicks",
"a",
"WebElement",
"matching",
"the",
"specified",
"By",
"object",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L1323-L1329 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getPvPSeasonLeaderBoardInfo | public void getPvPSeasonLeaderBoardInfo(String id, String type, World.Region region, Callback<List<PvPLeaderBoard>> callback) throws NullPointerException {
gw2API.getPvPSeasonLeaderBoardInfo(id, type, region.name().toLowerCase()).enqueue(callback);
} | java | public void getPvPSeasonLeaderBoardInfo(String id, String type, World.Region region, Callback<List<PvPLeaderBoard>> callback) throws NullPointerException {
gw2API.getPvPSeasonLeaderBoardInfo(id, type, region.name().toLowerCase()).enqueue(callback);
} | [
"public",
"void",
"getPvPSeasonLeaderBoardInfo",
"(",
"String",
"id",
",",
"String",
"type",
",",
"World",
".",
"Region",
"region",
",",
"Callback",
"<",
"List",
"<",
"PvPLeaderBoard",
">",
">",
"callback",
")",
"throws",
"NullPointerException",
"{",
"gw2API",
... | For more info on pvp season API go <a href="https://wiki.guildwars2.com/wiki/API:2/pvp/seasons">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param id Season id
@param type ladder/legendary/gu... | [
"For",
"more",
"info",
"on",
"pvp",
"season",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"pvp",
"/",
"seasons",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">"... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L2159-L2161 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Retryer.java | Retryer.timeout | public Retryer<R> timeout(final TimeLimiter timeLimiter, final long duration, final TimeUnit timeUnit) {
return withTimelimiter(new AttemptTimelimit<R>() {
@Override public R call(Callable<R> callable) throws Exception {
return checkNotNull(timeLimiter, "TimeLimiter cannot be null")... | java | public Retryer<R> timeout(final TimeLimiter timeLimiter, final long duration, final TimeUnit timeUnit) {
return withTimelimiter(new AttemptTimelimit<R>() {
@Override public R call(Callable<R> callable) throws Exception {
return checkNotNull(timeLimiter, "TimeLimiter cannot be null")... | [
"public",
"Retryer",
"<",
"R",
">",
"timeout",
"(",
"final",
"TimeLimiter",
"timeLimiter",
",",
"final",
"long",
"duration",
",",
"final",
"TimeUnit",
"timeUnit",
")",
"{",
"return",
"withTimelimiter",
"(",
"new",
"AttemptTimelimit",
"<",
"R",
">",
"(",
")",... | Timing out after the specified time limit with {@link TimeLimiter}
@param timeLimiter
@param duration
@param timeUnit
@return | [
"Timing",
"out",
"after",
"the",
"specified",
"time",
"limit",
"with",
"{",
"@link",
"TimeLimiter",
"}"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Retryer.java#L101-L109 |
dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.startGetFile | public /*@Nullable*/Downloader startGetFile(final String path, /*@Nullable*/String rev)
throws DbxException
{
DbxPathV1.checkArgNonRoot("path", path);
String apiPath = "1/files/auto" + path;
/*@Nullable*/String[] params = {
"rev", rev
};
return startGe... | java | public /*@Nullable*/Downloader startGetFile(final String path, /*@Nullable*/String rev)
throws DbxException
{
DbxPathV1.checkArgNonRoot("path", path);
String apiPath = "1/files/auto" + path;
/*@Nullable*/String[] params = {
"rev", rev
};
return startGe... | [
"public",
"/*@Nullable*/",
"Downloader",
"startGetFile",
"(",
"final",
"String",
"path",
",",
"/*@Nullable*/",
"String",
"rev",
")",
"throws",
"DbxException",
"{",
"DbxPathV1",
".",
"checkArgNonRoot",
"(",
"\"path\"",
",",
"path",
")",
";",
"String",
"apiPath",
... | Retrieve a file's content and content metadata. You must call the {@link Downloader}'s
{@code close()} method; use a {@code try}/{@code finally}.
<pre>
DbxClientV1 dbxClient = ...
DbxClientV1.Downloader downloader = dbxClient.startGetFile("/ReadMe.txt")
try {
printStream(downloader.body)
}
finally {
downloader.close(... | [
"Retrieve",
"a",
"file",
"s",
"content",
"and",
"content",
"metadata",
".",
"You",
"must",
"call",
"the",
"{",
"@link",
"Downloader",
"}",
"s",
"{",
"@code",
"close",
"()",
"}",
"method",
";",
"use",
"a",
"{",
"@code",
"try",
"}",
"/",
"{",
"@code",
... | train | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L457-L466 |
apache/groovy | src/main/groovy/groovy/util/FactoryBuilderSupport.java | FactoryBuilderSupport.registerFactory | public void registerFactory(String name, String groupName, Factory factory) {
getProxyBuilder().factories.put(name, factory);
getRegistrationGroup(groupName).add(name);
factory.onFactoryRegistration(this, name, groupName);
} | java | public void registerFactory(String name, String groupName, Factory factory) {
getProxyBuilder().factories.put(name, factory);
getRegistrationGroup(groupName).add(name);
factory.onFactoryRegistration(this, name, groupName);
} | [
"public",
"void",
"registerFactory",
"(",
"String",
"name",
",",
"String",
"groupName",
",",
"Factory",
"factory",
")",
"{",
"getProxyBuilder",
"(",
")",
".",
"factories",
".",
"put",
"(",
"name",
",",
"factory",
")",
";",
"getRegistrationGroup",
"(",
"group... | Registers a factory for a node name.
@param name the name of the node
@param groupName thr group to register this node in
@param factory the factory to return the values | [
"Registers",
"a",
"factory",
"for",
"a",
"node",
"name",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/FactoryBuilderSupport.java#L690-L694 |
landawn/AbacusUtil | src/com/landawn/abacus/dataSource/PoolableConnection.java | PoolableConnection.prepareStatement | @Override
public PoolablePreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
return prepareStatement(sql, autoGeneratedKeys, -1, -1, -1);
} | java | @Override
public PoolablePreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
return prepareStatement(sql, autoGeneratedKeys, -1, -1, -1);
} | [
"@",
"Override",
"public",
"PoolablePreparedStatement",
"prepareStatement",
"(",
"String",
"sql",
",",
"int",
"autoGeneratedKeys",
")",
"throws",
"SQLException",
"{",
"return",
"prepareStatement",
"(",
"sql",
",",
"autoGeneratedKeys",
",",
"-",
"1",
",",
"-",
"1",... | Method prepareStatement.
@param sql
@param autoGeneratedKeys
@return PreparedStatement
@throws SQLException
@see java.sql.Connection#prepareStatement(String, int) | [
"Method",
"prepareStatement",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/dataSource/PoolableConnection.java#L508-L511 |
lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toVoid | public static Object toVoid(Object o) throws ExpressionException {
if (o == null) return null;
else if (o instanceof String && o.toString().length() == 0) return null;
else if (o instanceof Number && ((Number) o).intValue() == 0) return null;
else if (o instanceof Boolean && ((Boolean) o).booleanValue() == false) r... | java | public static Object toVoid(Object o) throws ExpressionException {
if (o == null) return null;
else if (o instanceof String && o.toString().length() == 0) return null;
else if (o instanceof Number && ((Number) o).intValue() == 0) return null;
else if (o instanceof Boolean && ((Boolean) o).booleanValue() == false) r... | [
"public",
"static",
"Object",
"toVoid",
"(",
"Object",
"o",
")",
"throws",
"ExpressionException",
"{",
"if",
"(",
"o",
"==",
"null",
")",
"return",
"null",
";",
"else",
"if",
"(",
"o",
"instanceof",
"String",
"&&",
"o",
".",
"toString",
"(",
")",
".",
... | cast a value to void (Empty String)
@param o
@return void value
@throws ExpressionException | [
"cast",
"a",
"value",
"to",
"void",
"(",
"Empty",
"String",
")"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L3926-L3933 |
rythmengine/rythmengine | src/main/java/org/rythmengine/template/TemplateBase.java | TemplateBase.__invokeTag | protected void __invokeTag(int line, String name) {
__engine.invokeTemplate(line, name, this, null, null, null);
} | java | protected void __invokeTag(int line, String name) {
__engine.invokeTemplate(line, name, this, null, null, null);
} | [
"protected",
"void",
"__invokeTag",
"(",
"int",
"line",
",",
"String",
"name",
")",
"{",
"__engine",
".",
"invokeTemplate",
"(",
"line",
",",
"name",
",",
"this",
",",
"null",
",",
"null",
",",
"null",
")",
";",
"}"
] | Invoke a tag. Usually should not used directly in user template
@param line
@param name | [
"Invoke",
"a",
"tag",
".",
"Usually",
"should",
"not",
"used",
"directly",
"in",
"user",
"template"
] | train | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/template/TemplateBase.java#L155-L157 |
hal/elemento | core/src/main/java/org/jboss/gwt/elemento/core/Elements.java | Elements.toggle | public static void toggle(HTMLElement element, String css, boolean condition) {
if (element != null) {
if (condition) {
element.classList.add(css);
} else {
element.classList.remove(css);
}
}
} | java | public static void toggle(HTMLElement element, String css, boolean condition) {
if (element != null) {
if (condition) {
element.classList.add(css);
} else {
element.classList.remove(css);
}
}
} | [
"public",
"static",
"void",
"toggle",
"(",
"HTMLElement",
"element",
",",
"String",
"css",
",",
"boolean",
"condition",
")",
"{",
"if",
"(",
"element",
"!=",
"null",
")",
"{",
"if",
"(",
"condition",
")",
"{",
"element",
".",
"classList",
".",
"add",
"... | Adds the specified CSS class to the element if {@code condition} is {@code true}, removes it otherwise. | [
"Adds",
"the",
"specified",
"CSS",
"class",
"to",
"the",
"element",
"if",
"{"
] | train | https://github.com/hal/elemento/blob/26da2d5a1fe2ec55b779737dbaeda25a942eee61/core/src/main/java/org/jboss/gwt/elemento/core/Elements.java#L787-L795 |
wildfly/wildfly-maven-plugin | plugin/src/main/java/org/wildfly/plugin/deployment/resource/AddResourceMojo.java | AddResourceMojo.handleDmrString | private void handleDmrString(final ModelNode node, final String name, final String value) {
final String realValue = value.substring(2);
node.get(name).set(ModelNode.fromString(realValue));
} | java | private void handleDmrString(final ModelNode node, final String name, final String value) {
final String realValue = value.substring(2);
node.get(name).set(ModelNode.fromString(realValue));
} | [
"private",
"void",
"handleDmrString",
"(",
"final",
"ModelNode",
"node",
",",
"final",
"String",
"name",
",",
"final",
"String",
"value",
")",
"{",
"final",
"String",
"realValue",
"=",
"value",
".",
"substring",
"(",
"2",
")",
";",
"node",
".",
"get",
"(... | Handles DMR strings in the configuration
@param node the node to create.
@param name the name for the node.
@param value the value for the node. | [
"Handles",
"DMR",
"strings",
"in",
"the",
"configuration"
] | train | https://github.com/wildfly/wildfly-maven-plugin/blob/c0e2d7ee28e511092561801959eae253b2b56def/plugin/src/main/java/org/wildfly/plugin/deployment/resource/AddResourceMojo.java#L274-L277 |
h2oai/h2o-3 | h2o-core/src/main/java/water/ExternalFrameUtils.java | ExternalFrameUtils.putMarkerAndSend | private static void putMarkerAndSend(AutoBuffer ab, ByteChannel channel, long data) throws IOException{
if(data == NUM_MARKER_NEXT_BYTE_FOLLOWS){
// we need to send another byte because zero is represented as 00 ( 2 bytes )
ab.put1(MARKER_ORIGINAL_VALUE);
}
writeToChannel... | java | private static void putMarkerAndSend(AutoBuffer ab, ByteChannel channel, long data) throws IOException{
if(data == NUM_MARKER_NEXT_BYTE_FOLLOWS){
// we need to send another byte because zero is represented as 00 ( 2 bytes )
ab.put1(MARKER_ORIGINAL_VALUE);
}
writeToChannel... | [
"private",
"static",
"void",
"putMarkerAndSend",
"(",
"AutoBuffer",
"ab",
",",
"ByteChannel",
"channel",
",",
"long",
"data",
")",
"throws",
"IOException",
"{",
"if",
"(",
"data",
"==",
"NUM_MARKER_NEXT_BYTE_FOLLOWS",
")",
"{",
"// we need to send another byte because... | Sends another byte as a marker if it's needed and send the data | [
"Sends",
"another",
"byte",
"as",
"a",
"marker",
"if",
"it",
"s",
"needed",
"and",
"send",
"the",
"data"
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/ExternalFrameUtils.java#L303-L309 |
code4everything/util | src/main/java/com/zhazhapan/util/encryption/JavaEncrypt.java | JavaEncrypt.cryptDES | private static String cryptDES(String string, int opmode, String key) throws NoSuchAlgorithmException,
NoSuchPaddingException, InvalidKeyException, UnsupportedEncodingException, IllegalBlockSizeException,
BadPaddingException {
String result = "";
int isInit = "DES".equals(key... | java | private static String cryptDES(String string, int opmode, String key) throws NoSuchAlgorithmException,
NoSuchPaddingException, InvalidKeyException, UnsupportedEncodingException, IllegalBlockSizeException,
BadPaddingException {
String result = "";
int isInit = "DES".equals(key... | [
"private",
"static",
"String",
"cryptDES",
"(",
"String",
"string",
",",
"int",
"opmode",
",",
"String",
"key",
")",
"throws",
"NoSuchAlgorithmException",
",",
"NoSuchPaddingException",
",",
"InvalidKeyException",
",",
"UnsupportedEncodingException",
",",
"IllegalBlockS... | Cipher加密解密器
@param string {@link String}
@param opmode {@link Integer}
@param key {@link String}
@return {@link String}
@throws NoSuchPaddingException 异常
@throws NoSuchAlgorithmException 异常
@throws InvalidKeyException 异常
@throws BadPaddingException 异常
@throws IllegalBlockSizeException 异常
@throws UnsupportedEncodingE... | [
"Cipher加密解密器"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/encryption/JavaEncrypt.java#L155-L177 |
base2Services/kagura | shared/reporting-core/src/main/java/com/base2/kagura/core/report/parameterTypes/ParamConfig.java | ParamConfig.prepareParameter | public void prepareParameter(Map<String, Object> extra) {
if (from != null)
{
from.prepareParameter(extra);
}
} | java | public void prepareParameter(Map<String, Object> extra) {
if (from != null)
{
from.prepareParameter(extra);
}
} | [
"public",
"void",
"prepareParameter",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"extra",
")",
"{",
"if",
"(",
"from",
"!=",
"null",
")",
"{",
"from",
".",
"prepareParameter",
"(",
"extra",
")",
";",
"}",
"}"
] | Prepares the parameter's datasource, passing it the extra options and if necessary executing the appropriate
code and caching the value.
@param extra | [
"Prepares",
"the",
"parameter",
"s",
"datasource",
"passing",
"it",
"the",
"extra",
"options",
"and",
"if",
"necessary",
"executing",
"the",
"appropriate",
"code",
"and",
"caching",
"the",
"value",
"."
] | train | https://github.com/base2Services/kagura/blob/5564aa71bfa2cb3baaae2eb098c6c673dd4e82ee/shared/reporting-core/src/main/java/com/base2/kagura/core/report/parameterTypes/ParamConfig.java#L263-L268 |
RoaringBitmap/RoaringBitmap | roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java | RoaringBitmap.andNotCardinality | public static int andNotCardinality(final RoaringBitmap x1, final RoaringBitmap x2) {
return x1.getCardinality() - andCardinality(x1, x2);
} | java | public static int andNotCardinality(final RoaringBitmap x1, final RoaringBitmap x2) {
return x1.getCardinality() - andCardinality(x1, x2);
} | [
"public",
"static",
"int",
"andNotCardinality",
"(",
"final",
"RoaringBitmap",
"x1",
",",
"final",
"RoaringBitmap",
"x2",
")",
"{",
"return",
"x1",
".",
"getCardinality",
"(",
")",
"-",
"andCardinality",
"(",
"x1",
",",
"x2",
")",
";",
"}"
] | Cardinality of the bitwise ANDNOT (left difference) operation.
The provided bitmaps are *not* modified. This operation is thread-safe
as long as the provided bitmaps remain unchanged.
@param x1 first bitmap
@param x2 other bitmap
@return cardinality of the left difference | [
"Cardinality",
"of",
"the",
"bitwise",
"ANDNOT",
"(",
"left",
"difference",
")",
"operation",
".",
"The",
"provided",
"bitmaps",
"are",
"*",
"not",
"*",
"modified",
".",
"This",
"operation",
"is",
"thread",
"-",
"safe",
"as",
"long",
"as",
"the",
"provided... | train | https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java#L871-L873 |
korpling/ANNIS | annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java | QueryServiceImpl.requiredParameter | private void requiredParameter(String value, String name, String description)
throws WebApplicationException
{
if (value == null)
{
throw new WebApplicationException(
Response.status(Response.Status.BAD_REQUEST).type(
MediaType.TEXT_PLAIN).entity(
"missing required parameter ... | java | private void requiredParameter(String value, String name, String description)
throws WebApplicationException
{
if (value == null)
{
throw new WebApplicationException(
Response.status(Response.Status.BAD_REQUEST).type(
MediaType.TEXT_PLAIN).entity(
"missing required parameter ... | [
"private",
"void",
"requiredParameter",
"(",
"String",
"value",
",",
"String",
"name",
",",
"String",
"description",
")",
"throws",
"WebApplicationException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"WebApplicationException",
"(",
"Respo... | Throw an exception if the parameter is missing.
@param value Value which is checked for null.
@param name The short name of parameter.
@param description A one line description of the meaing of the parameter. | [
"Throw",
"an",
"exception",
"if",
"the",
"parameter",
"is",
"missing",
"."
] | train | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java#L1000-L1011 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/io/IOUtils.java | IOUtils.writeObjectToTempFile | public static File writeObjectToTempFile(Object o, String filename)
throws IOException {
File file = File.createTempFile(filename, ".tmp");
file.deleteOnExit();
ObjectOutputStream oos = new ObjectOutputStream(new BufferedOutputStream(
new GZIPOutputStream(new FileOutputStream(file))));
o... | java | public static File writeObjectToTempFile(Object o, String filename)
throws IOException {
File file = File.createTempFile(filename, ".tmp");
file.deleteOnExit();
ObjectOutputStream oos = new ObjectOutputStream(new BufferedOutputStream(
new GZIPOutputStream(new FileOutputStream(file))));
o... | [
"public",
"static",
"File",
"writeObjectToTempFile",
"(",
"Object",
"o",
",",
"String",
"filename",
")",
"throws",
"IOException",
"{",
"File",
"file",
"=",
"File",
".",
"createTempFile",
"(",
"filename",
",",
"\".tmp\"",
")",
";",
"file",
".",
"deleteOnExit",
... | Write object to temp file which is destroyed when the program exits.
@param o
object to be written to file
@param filename
name of the temp file
@throws IOException
If file cannot be written
@return File containing the object | [
"Write",
"object",
"to",
"temp",
"file",
"which",
"is",
"destroyed",
"when",
"the",
"program",
"exits",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/io/IOUtils.java#L124-L133 |
getsentry/sentry-java | sentry/src/main/java/io/sentry/event/EventBuilder.java | EventBuilder.withTag | public EventBuilder withTag(String tagKey, String tagValue) {
event.getTags().put(tagKey, tagValue);
return this;
} | java | public EventBuilder withTag(String tagKey, String tagValue) {
event.getTags().put(tagKey, tagValue);
return this;
} | [
"public",
"EventBuilder",
"withTag",
"(",
"String",
"tagKey",
",",
"String",
"tagValue",
")",
"{",
"event",
".",
"getTags",
"(",
")",
".",
"put",
"(",
"tagKey",
",",
"tagValue",
")",
";",
"return",
"this",
";",
"}"
] | Adds a tag to an event.
<p>
This allows to set a tag value in different contexts.
@param tagKey name of the tag.
@param tagValue value of the tag.
@return the current {@code EventBuilder} for chained calls. | [
"Adds",
"a",
"tag",
"to",
"an",
"event",
".",
"<p",
">",
"This",
"allows",
"to",
"set",
"a",
"tag",
"value",
"in",
"different",
"contexts",
"."
] | train | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/event/EventBuilder.java#L303-L306 |
wildfly/wildfly-core | domain-management/src/main/java/org/jboss/as/domain/management/security/UserPropertiesFileLoader.java | UserPropertiesFileLoader.addLineContent | @Override
protected void addLineContent(BufferedReader bufferedFileReader, List<String> content, String line) throws IOException {
// Is the line an empty comment "#" ?
if (line.startsWith(COMMENT_PREFIX) && line.length() == 1) {
String nextLine = bufferedFileReader.readLine();
... | java | @Override
protected void addLineContent(BufferedReader bufferedFileReader, List<String> content, String line) throws IOException {
// Is the line an empty comment "#" ?
if (line.startsWith(COMMENT_PREFIX) && line.length() == 1) {
String nextLine = bufferedFileReader.readLine();
... | [
"@",
"Override",
"protected",
"void",
"addLineContent",
"(",
"BufferedReader",
"bufferedFileReader",
",",
"List",
"<",
"String",
">",
"content",
",",
"String",
"line",
")",
"throws",
"IOException",
"{",
"// Is the line an empty comment \"#\" ?",
"if",
"(",
"line",
"... | Remove the realm name block.
@see PropertiesFileLoader#addLineContent(java.io.BufferedReader, java.util.List, String) | [
"Remove",
"the",
"realm",
"name",
"block",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/domain-management/src/main/java/org/jboss/as/domain/management/security/UserPropertiesFileLoader.java#L170-L193 |
alkacon/opencms-core | src/org/opencms/widgets/CmsVfsImageWidget.java | CmsVfsImageWidget.getSelectedValue | protected String getSelectedValue(CmsObject cms, List<CmsSelectWidgetOption> selectOptions, String currentValue) {
String paramValue = currentValue;
if (CmsStringUtil.isEmpty(paramValue)) {
CmsSelectWidgetOption option = CmsSelectWidgetOption.getDefaultOption(selectOptions);
if ... | java | protected String getSelectedValue(CmsObject cms, List<CmsSelectWidgetOption> selectOptions, String currentValue) {
String paramValue = currentValue;
if (CmsStringUtil.isEmpty(paramValue)) {
CmsSelectWidgetOption option = CmsSelectWidgetOption.getDefaultOption(selectOptions);
if ... | [
"protected",
"String",
"getSelectedValue",
"(",
"CmsObject",
"cms",
",",
"List",
"<",
"CmsSelectWidgetOption",
">",
"selectOptions",
",",
"String",
"currentValue",
")",
"{",
"String",
"paramValue",
"=",
"currentValue",
";",
"if",
"(",
"CmsStringUtil",
".",
"isEmpt... | Returns the currently selected value of the select widget.<p>
If a value is found in the given parameter, this is used. Otherwise
the default value of the select options are used. If there is neither a parameter value
nor a default value, <code>null</code> is returned.<p>
@param cms the current users OpenCms context
... | [
"Returns",
"the",
"currently",
"selected",
"value",
"of",
"the",
"select",
"widget",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/CmsVfsImageWidget.java#L472-L482 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildsInner.java | BuildsInner.listAsync | public Observable<Page<BuildInner>> listAsync(final String resourceGroupName, final String registryName) {
return listWithServiceResponseAsync(resourceGroupName, registryName)
.map(new Func1<ServiceResponse<Page<BuildInner>>, Page<BuildInner>>() {
@Override
public Pag... | java | public Observable<Page<BuildInner>> listAsync(final String resourceGroupName, final String registryName) {
return listWithServiceResponseAsync(resourceGroupName, registryName)
.map(new Func1<ServiceResponse<Page<BuildInner>>, Page<BuildInner>>() {
@Override
public Pag... | [
"public",
"Observable",
"<",
"Page",
"<",
"BuildInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"registryName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
")"... | Gets all the builds for a registry.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<BuildInner>... | [
"Gets",
"all",
"the",
"builds",
"for",
"a",
"registry",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildsInner.java#L147-L155 |
opencb/biodata | biodata-tools/src/main/java/org/opencb/biodata/tools/commons/ChunkFrequencyManager.java | ChunkFrequencyManager.readFileId | private int readFileId(Path filePath, Connection conn) {
int fileId = -1;
try {
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT id FROM file where path = '" + filePath.getParent() + "';");
while (rs.next()) {
fileId = ... | java | private int readFileId(Path filePath, Connection conn) {
int fileId = -1;
try {
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT id FROM file where path = '" + filePath.getParent() + "';");
while (rs.next()) {
fileId = ... | [
"private",
"int",
"readFileId",
"(",
"Path",
"filePath",
",",
"Connection",
"conn",
")",
"{",
"int",
"fileId",
"=",
"-",
"1",
";",
"try",
"{",
"Statement",
"stmt",
"=",
"conn",
".",
"createStatement",
"(",
")",
";",
"ResultSet",
"rs",
"=",
"stmt",
".",... | Read file ID from the database.
@param filePath Path to the file
@param conn Database connection
@return File ID in the database | [
"Read",
"file",
"ID",
"from",
"the",
"database",
"."
] | train | https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/commons/ChunkFrequencyManager.java#L586-L599 |
iipc/webarchive-commons | src/main/java/org/archive/io/ObjectPlusFilesOutputStream.java | ObjectPlusFilesOutputStream.hardlinkOrCopy | private void hardlinkOrCopy(File file, File destination) throws IOException {
// For Linux/UNIX, try a hard link first.
Process link = Runtime.getRuntime().exec("ln "+file.getAbsolutePath()+" "+destination.getAbsolutePath());
// TODO NTFS also supports hard links; add appropriate try
try {
... | java | private void hardlinkOrCopy(File file, File destination) throws IOException {
// For Linux/UNIX, try a hard link first.
Process link = Runtime.getRuntime().exec("ln "+file.getAbsolutePath()+" "+destination.getAbsolutePath());
// TODO NTFS also supports hard links; add appropriate try
try {
... | [
"private",
"void",
"hardlinkOrCopy",
"(",
"File",
"file",
",",
"File",
"destination",
")",
"throws",
"IOException",
"{",
"// For Linux/UNIX, try a hard link first.",
"Process",
"link",
"=",
"Runtime",
".",
"getRuntime",
"(",
")",
".",
"exec",
"(",
"\"ln \"",
"+",
... | Create a backup of this given file, first by trying a "hard
link", then by using a copy if hard linking is unavailable
(either because it is unsupported or the origin and checkpoint
directories are on different volumes).
@param file
@param destination
@throws IOException | [
"Create",
"a",
"backup",
"of",
"this",
"given",
"file",
"first",
"by",
"trying",
"a",
"hard",
"link",
"then",
"by",
"using",
"a",
"copy",
"if",
"hard",
"linking",
"is",
"unavailable",
"(",
"either",
"because",
"it",
"is",
"unsupported",
"or",
"the",
"ori... | train | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/io/ObjectPlusFilesOutputStream.java#L118-L132 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ApplicationGatewaysInner.java | ApplicationGatewaysInner.beginBackendHealth | public ApplicationGatewayBackendHealthInner beginBackendHealth(String resourceGroupName, String applicationGatewayName) {
return beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body();
} | java | public ApplicationGatewayBackendHealthInner beginBackendHealth(String resourceGroupName, String applicationGatewayName) {
return beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body();
} | [
"public",
"ApplicationGatewayBackendHealthInner",
"beginBackendHealth",
"(",
"String",
"resourceGroupName",
",",
"String",
"applicationGatewayName",
")",
"{",
"return",
"beginBackendHealthWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"applicationGatewayName",
")",
"."... | Gets the backend health of the specified application gateway in a resource group.
@param resourceGroupName The name of the resource group.
@param applicationGatewayName The name of the application gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the re... | [
"Gets",
"the",
"backend",
"health",
"of",
"the",
"specified",
"application",
"gateway",
"in",
"a",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ApplicationGatewaysInner.java#L1543-L1545 |
Wikidata/Wikidata-Toolkit | wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/helpers/Datamodel.java | Datamodel.makeSenseIdValue | public static SenseIdValue makeSenseIdValue(String id, String siteIri) {
return factory.getSenseIdValue(id, siteIri);
} | java | public static SenseIdValue makeSenseIdValue(String id, String siteIri) {
return factory.getSenseIdValue(id, siteIri);
} | [
"public",
"static",
"SenseIdValue",
"makeSenseIdValue",
"(",
"String",
"id",
",",
"String",
"siteIri",
")",
"{",
"return",
"factory",
".",
"getSenseIdValue",
"(",
"id",
",",
"siteIri",
")",
";",
"}"
] | Creates an {@link SenseIdValue}.
@param id
a string of the form Ln...-Sm... where n... and m... are the string
representation of a positive integer number
@param siteIri
IRI to identify the site, usually the first part of the entity
IRI of the site this belongs to, e.g.,
"http://www.wikidata.org/entity/"
@return an {@... | [
"Creates",
"an",
"{",
"@link",
"SenseIdValue",
"}",
"."
] | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/helpers/Datamodel.java#L170-L172 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java | ULocale.getDisplayName | public static String getDisplayName(String localeID, String displayLocaleID) {
return getDisplayNameInternal(new ULocale(localeID), new ULocale(displayLocaleID));
} | java | public static String getDisplayName(String localeID, String displayLocaleID) {
return getDisplayNameInternal(new ULocale(localeID), new ULocale(displayLocaleID));
} | [
"public",
"static",
"String",
"getDisplayName",
"(",
"String",
"localeID",
",",
"String",
"displayLocaleID",
")",
"{",
"return",
"getDisplayNameInternal",
"(",
"new",
"ULocale",
"(",
"localeID",
")",
",",
"new",
"ULocale",
"(",
"displayLocaleID",
")",
")",
";",
... | <strong>[icu]</strong> Returns the locale ID localized for display in the provided locale.
This is a cover for the ICU4C API.
@param localeID the locale whose name is to be displayed.
@param displayLocaleID the id of the locale in which to display the locale name.
@return the localized locale name. | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Returns",
"the",
"locale",
"ID",
"localized",
"for",
"display",
"in",
"the",
"provided",
"locale",
".",
"This",
"is",
"a",
"cover",
"for",
"the",
"ICU4C",
"API",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java#L1778-L1780 |
kiswanij/jk-util | src/main/java/com/jk/util/JKFormatUtil.java | JKFormatUtil.formatTimeStamp | public synchronized static String formatTimeStamp(final Timestamp date, String pattern) {
if (pattern == null || pattern.equals("")) {
pattern = JKFormatUtil.DEFAULT_TIMESTAMP_PATTERN;
}
return JKFormatUtil.getDateFormatter(pattern).format(date);
} | java | public synchronized static String formatTimeStamp(final Timestamp date, String pattern) {
if (pattern == null || pattern.equals("")) {
pattern = JKFormatUtil.DEFAULT_TIMESTAMP_PATTERN;
}
return JKFormatUtil.getDateFormatter(pattern).format(date);
} | [
"public",
"synchronized",
"static",
"String",
"formatTimeStamp",
"(",
"final",
"Timestamp",
"date",
",",
"String",
"pattern",
")",
"{",
"if",
"(",
"pattern",
"==",
"null",
"||",
"pattern",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"pattern",
"=",
"JKForma... | Format time stamp.
@param date the date
@param pattern the pattern
@return the string | [
"Format",
"time",
"stamp",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKFormatUtil.java#L138-L143 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.eachLine | public static <T> T eachLine(URL url, int firstLine, @ClosureParams(value = FromString.class, options = {"String", "String,Integer"}) Closure<T> closure) throws IOException {
return IOGroovyMethods.eachLine(url.openConnection().getInputStream(), firstLine, closure);
} | java | public static <T> T eachLine(URL url, int firstLine, @ClosureParams(value = FromString.class, options = {"String", "String,Integer"}) Closure<T> closure) throws IOException {
return IOGroovyMethods.eachLine(url.openConnection().getInputStream(), firstLine, closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"eachLine",
"(",
"URL",
"url",
",",
"int",
"firstLine",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"FromString",
".",
"class",
",",
"options",
"=",
"{",
"\"String\"",
",",
"\"String,Integer\"",
"}",
")",
"Closur... | Iterates through the lines read from the URL's associated input stream passing each
line to the given 1 or 2 arg closure. The stream is closed before this method returns.
@param url a URL to open and read
@param firstLine the line number value used for the first line (default is 1, set to 0 to start counting fro... | [
"Iterates",
"through",
"the",
"lines",
"read",
"from",
"the",
"URL",
"s",
"associated",
"input",
"stream",
"passing",
"each",
"line",
"to",
"the",
"given",
"1",
"or",
"2",
"arg",
"closure",
".",
"The",
"stream",
"is",
"closed",
"before",
"this",
"method",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L318-L320 |
sahan/DroidBallet | droidballet/src/main/java/com/lonepulse/droidballet/detector/HorizontalMotionDetector.java | HorizontalMotionDetector.getMotionEvent | @Override
public <U extends SensorEvent> HorizontalMotionEvent getMotionEvent(final U sensorEvent)
throws MotionDetectorException {
try {
Sensor sensor = sensorEvent.sensor;
if (sensor.getType() != Sensor.TYPE_ACCELEROMETER) {
return null;
}
final float[] input = sensorEvent.values;
... | java | @Override
public <U extends SensorEvent> HorizontalMotionEvent getMotionEvent(final U sensorEvent)
throws MotionDetectorException {
try {
Sensor sensor = sensorEvent.sensor;
if (sensor.getType() != Sensor.TYPE_ACCELEROMETER) {
return null;
}
final float[] input = sensorEvent.values;
... | [
"@",
"Override",
"public",
"<",
"U",
"extends",
"SensorEvent",
">",
"HorizontalMotionEvent",
"getMotionEvent",
"(",
"final",
"U",
"sensorEvent",
")",
"throws",
"MotionDetectorException",
"{",
"try",
"{",
"Sensor",
"sensor",
"=",
"sensorEvent",
".",
"sensor",
";",
... | {@inheritDoc}
<p>The current implementation handles only {@link Sensor}s of type
{@link Sensor#TYPE_ACCELEROMETER}.</p>
<p>Future implementations may support {@link Sensor#TYPE_GYROSCOPE}.</p> | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/sahan/DroidBallet/blob/c6001c9e933cb2c8dbcabe1ae561678b31b10b62/droidballet/src/main/java/com/lonepulse/droidballet/detector/HorizontalMotionDetector.java#L83-L123 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_PUT | public void ip_PUT(String ip, OvhIp body) throws IOException {
String qPath = "/ip/{ip}";
StringBuilder sb = path(qPath, ip);
exec(qPath, "PUT", sb.toString(), body);
} | java | public void ip_PUT(String ip, OvhIp body) throws IOException {
String qPath = "/ip/{ip}";
StringBuilder sb = path(qPath, ip);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"ip_PUT",
"(",
"String",
"ip",
",",
"OvhIp",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"ip",
")",
";",
"exec",
"(",
"qPath",
",",
"\"... | Alter this object properties
REST: PUT /ip/{ip}
@param body [required] New object properties
@param ip [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L683-L687 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java | Query.select | @Nonnull
public Query select(FieldPath... fieldPaths) {
QueryOptions newOptions = new QueryOptions(options);
newOptions.fieldProjections = new ArrayList<>();
if (fieldPaths.length == 0) {
fieldPaths = new FieldPath[] {FieldPath.DOCUMENT_ID};
}
for (FieldPath path : fieldPaths) {
Fiel... | java | @Nonnull
public Query select(FieldPath... fieldPaths) {
QueryOptions newOptions = new QueryOptions(options);
newOptions.fieldProjections = new ArrayList<>();
if (fieldPaths.length == 0) {
fieldPaths = new FieldPath[] {FieldPath.DOCUMENT_ID};
}
for (FieldPath path : fieldPaths) {
Fiel... | [
"@",
"Nonnull",
"public",
"Query",
"select",
"(",
"FieldPath",
"...",
"fieldPaths",
")",
"{",
"QueryOptions",
"newOptions",
"=",
"new",
"QueryOptions",
"(",
"options",
")",
";",
"newOptions",
".",
"fieldProjections",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
... | Creates and returns a new Query instance that applies a field mask to the result and returns
the specified subset of fields. You can specify a list of field paths to return, or use an
empty list to only return the references of matching documents.
@param fieldPaths The field paths to include.
@return The created Query... | [
"Creates",
"and",
"returns",
"a",
"new",
"Query",
"instance",
"that",
"applies",
"a",
"field",
"mask",
"to",
"the",
"result",
"and",
"returns",
"the",
"specified",
"subset",
"of",
"fields",
".",
"You",
"can",
"specify",
"a",
"list",
"of",
"field",
"paths",... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java#L755-L771 |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/RedisJobStore.java | RedisJobStore.triggeredJobComplete | @Override
public void triggeredJobComplete(final OperableTrigger trigger, final JobDetail jobDetail, final Trigger.CompletedExecutionInstruction triggerInstCode) {
try {
doWithLock(new LockCallbackWithoutResult() {
@Override
public Void doWithLock(JedisCommands je... | java | @Override
public void triggeredJobComplete(final OperableTrigger trigger, final JobDetail jobDetail, final Trigger.CompletedExecutionInstruction triggerInstCode) {
try {
doWithLock(new LockCallbackWithoutResult() {
@Override
public Void doWithLock(JedisCommands je... | [
"@",
"Override",
"public",
"void",
"triggeredJobComplete",
"(",
"final",
"OperableTrigger",
"trigger",
",",
"final",
"JobDetail",
"jobDetail",
",",
"final",
"Trigger",
".",
"CompletedExecutionInstruction",
"triggerInstCode",
")",
"{",
"try",
"{",
"doWithLock",
"(",
... | Inform the <code>JobStore</code> that the scheduler has completed the
firing of the given <code>Trigger</code> (and the execution of its
associated <code>Job</code> completed, threw an exception, or was vetoed),
and that the <code>{@link org.quartz.JobDataMap}</code>
in the given <code>JobDetail</code> should be update... | [
"Inform",
"the",
"<code",
">",
"JobStore<",
"/",
"code",
">",
"that",
"the",
"scheduler",
"has",
"completed",
"the",
"firing",
"of",
"the",
"given",
"<code",
">",
"Trigger<",
"/",
"code",
">",
"(",
"and",
"the",
"execution",
"of",
"its",
"associated",
"<... | train | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/RedisJobStore.java#L1108-L1125 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.timemachine/src/main/java/de/tudarmstadt/ukp/wikipedia/timemachine/dump/xml/XMLDumpTableInputStream.java | XMLDumpTableInputStream.initialize | @Override
public void initialize(InputStream inputStream, DumpTableEnum table)
throws IOException {
unbufferedResult = new PipedInputStream();
decodedStream = new PipedOutputStream(unbufferedResult);
result = new BufferedInputStream(unbufferedResult, BUFFERSIZE);
xmlInputThread = new XMLDumpTableInputS... | java | @Override
public void initialize(InputStream inputStream, DumpTableEnum table)
throws IOException {
unbufferedResult = new PipedInputStream();
decodedStream = new PipedOutputStream(unbufferedResult);
result = new BufferedInputStream(unbufferedResult, BUFFERSIZE);
xmlInputThread = new XMLDumpTableInputS... | [
"@",
"Override",
"public",
"void",
"initialize",
"(",
"InputStream",
"inputStream",
",",
"DumpTableEnum",
"table",
")",
"throws",
"IOException",
"{",
"unbufferedResult",
"=",
"new",
"PipedInputStream",
"(",
")",
";",
"decodedStream",
"=",
"new",
"PipedOutputStream",... | Decorator for InputStream, which allows to convert an XML input stream to
SQL
@param inputStream
XML input stream
@throws IOException | [
"Decorator",
"for",
"InputStream",
"which",
"allows",
"to",
"convert",
"an",
"XML",
"input",
"stream",
"to",
"SQL"
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.timemachine/src/main/java/de/tudarmstadt/ukp/wikipedia/timemachine/dump/xml/XMLDumpTableInputStream.java#L67-L79 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameterization/TrackParameters.java | TrackParameters.descend | @Override
public Parameterization descend(Object option) {
registerChild(option);
return new TrackParameters(inner, option, options, parents, children);
} | java | @Override
public Parameterization descend(Object option) {
registerChild(option);
return new TrackParameters(inner, option, options, parents, children);
} | [
"@",
"Override",
"public",
"Parameterization",
"descend",
"(",
"Object",
"option",
")",
"{",
"registerChild",
"(",
"option",
")",
";",
"return",
"new",
"TrackParameters",
"(",
"inner",
",",
"option",
",",
"options",
",",
"parents",
",",
"children",
")",
";",... | {@inheritDoc}
Track parameters using a shared options list with parent tracker. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameterization/TrackParameters.java#L149-L153 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java | SvgGraphicsContext.drawImage | public void drawImage(Object parent, String name, String href, Bbox bounds, PictureStyle style) {
if (isAttached()) {
Element image = helper.createOrUpdateElement(parent, name, "image", style);
Dom.setElementAttribute(image, "x", Integer.toString((int) bounds.getX()));
Dom.setElementAttribute(image, "y", Int... | java | public void drawImage(Object parent, String name, String href, Bbox bounds, PictureStyle style) {
if (isAttached()) {
Element image = helper.createOrUpdateElement(parent, name, "image", style);
Dom.setElementAttribute(image, "x", Integer.toString((int) bounds.getX()));
Dom.setElementAttribute(image, "y", Int... | [
"public",
"void",
"drawImage",
"(",
"Object",
"parent",
",",
"String",
"name",
",",
"String",
"href",
",",
"Bbox",
"bounds",
",",
"PictureStyle",
"style",
")",
"{",
"if",
"(",
"isAttached",
"(",
")",
")",
"{",
"Element",
"image",
"=",
"helper",
".",
"c... | Draw an image onto the the <code>GraphicsContext</code>.
@param parent
parent group object
@param name
The image's name.
@param href
The image's location (URL).
@param bounds
The bounding box that sets the image's origin (x and y), it's width and it's height.
@param style
A styling object to be passed along with the i... | [
"Draw",
"an",
"image",
"onto",
"the",
"the",
"<code",
">",
"GraphicsContext<",
"/",
"code",
">",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java#L271-L280 |
xqbase/tuna | core/src/main/java/com/xqbase/tuna/packet/PacketOutputStream.java | PacketOutputStream.write | @Override
public void write(byte[] b, int off, int len) throws PacketException {
baq.add(b, off, len);
while (packetSize > 0 || (packetSize = parser.getSize(baq.array(),
baq.offset(), baq.length())) > 0) {
if (baq.length() < packetSize) {
return;
}
consumer.accept(baq.array(), baq.offset()... | java | @Override
public void write(byte[] b, int off, int len) throws PacketException {
baq.add(b, off, len);
while (packetSize > 0 || (packetSize = parser.getSize(baq.array(),
baq.offset(), baq.length())) > 0) {
if (baq.length() < packetSize) {
return;
}
consumer.accept(baq.array(), baq.offset()... | [
"@",
"Override",
"public",
"void",
"write",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"PacketException",
"{",
"baq",
".",
"add",
"(",
"b",
",",
"off",
",",
"len",
")",
";",
"while",
"(",
"packetSize",
">",
"... | Parse packets when data arrived. This routine will consume every successfully
parsed packet by calling {@link PacketConsumer#accept(byte[], int, int)}. | [
"Parse",
"packets",
"when",
"data",
"arrived",
".",
"This",
"routine",
"will",
"consume",
"every",
"successfully",
"parsed",
"packet",
"by",
"calling",
"{"
] | train | https://github.com/xqbase/tuna/blob/60d05a9e03877a3daafe9de83dc4427c6cbb9995/core/src/main/java/com/xqbase/tuna/packet/PacketOutputStream.java#L30-L42 |
alb-i986/selenium-tinafw | src/main/java/me/alb_i986/selenium/tinafw/ui/PageHelper.java | PageHelper.waitUntil | public static <T> T waitUntil(ExpectedCondition<T> expectedCondition,
WebDriver driver, long timeOutInSeconds) {
logger.debug("BEGIN wait (timeout=" + timeOutInSeconds + "s) for "
+ expectedCondition);
T object =
new WebDriverWait(driver, timeOutInSeconds)
.until(expectedCondition);
logger.debug("EN... | java | public static <T> T waitUntil(ExpectedCondition<T> expectedCondition,
WebDriver driver, long timeOutInSeconds) {
logger.debug("BEGIN wait (timeout=" + timeOutInSeconds + "s) for "
+ expectedCondition);
T object =
new WebDriverWait(driver, timeOutInSeconds)
.until(expectedCondition);
logger.debug("EN... | [
"public",
"static",
"<",
"T",
">",
"T",
"waitUntil",
"(",
"ExpectedCondition",
"<",
"T",
">",
"expectedCondition",
",",
"WebDriver",
"driver",
",",
"long",
"timeOutInSeconds",
")",
"{",
"logger",
".",
"debug",
"(",
"\"BEGIN wait (timeout=\"",
"+",
"timeOutInSeco... | Generic explicit wait, taking an {@link ExpectedCondition} as a parameter.
Times out after the given number of seconds.
@param expectedCondition
@param driver
@param timeOutInSeconds
@return whatever WebDriverWait#until returns
@see WebDriverWait#until(com.google.common.base.Function)
@throws TimeoutException if the ... | [
"Generic",
"explicit",
"wait",
"taking",
"an",
"{",
"@link",
"ExpectedCondition",
"}",
"as",
"a",
"parameter",
".",
"Times",
"out",
"after",
"the",
"given",
"number",
"of",
"seconds",
"."
] | train | https://github.com/alb-i986/selenium-tinafw/blob/91c66720cda9f69751f96c58c0a0624b2222186e/src/main/java/me/alb_i986/selenium/tinafw/ui/PageHelper.java#L57-L66 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/StringUtils.java | StringUtils.getBaseName | public static String getBaseName(String fileName, String suffix) {
String[] elts = fileName.split("/");
String lastElt = elts[elts.length - 1];
if (lastElt.endsWith(suffix)) {
lastElt = lastElt.substring(0, lastElt.length() - suffix.length());
}
return lastElt;
} | java | public static String getBaseName(String fileName, String suffix) {
String[] elts = fileName.split("/");
String lastElt = elts[elts.length - 1];
if (lastElt.endsWith(suffix)) {
lastElt = lastElt.substring(0, lastElt.length() - suffix.length());
}
return lastElt;
} | [
"public",
"static",
"String",
"getBaseName",
"(",
"String",
"fileName",
",",
"String",
"suffix",
")",
"{",
"String",
"[",
"]",
"elts",
"=",
"fileName",
".",
"split",
"(",
"\"/\"",
")",
";",
"String",
"lastElt",
"=",
"elts",
"[",
"elts",
".",
"length",
... | Strip directory and suffix from filename. Like Unix 'basename'. <p/>
Example: <code>getBaseName("/u/wcmac/foo.txt", "") ==> "foo.txt"</code><br/>
Example: <code>getBaseName("/u/wcmac/foo.txt", ".txt") ==> "foo"</code><br/>
Example: <code>getBaseName("/u/wcmac/foo.txt", ".pdf") ==> "foo.txt"</code><br/> | [
"Strip",
"directory",
"and",
"suffix",
"from",
"filename",
".",
"Like",
"Unix",
"basename",
".",
"<p",
"/",
">"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/StringUtils.java#L1695-L1702 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java | Check.notEmpty | @ArgumentsChecked
@Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class })
public static void notEmpty(final boolean expression, @Nullable final String name) {
if (expression) {
throw new IllegalEmptyArgumentException(name);
}
} | java | @ArgumentsChecked
@Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class })
public static void notEmpty(final boolean expression, @Nullable final String name) {
if (expression) {
throw new IllegalEmptyArgumentException(name);
}
} | [
"@",
"ArgumentsChecked",
"@",
"Throws",
"(",
"{",
"IllegalNullArgumentException",
".",
"class",
",",
"IllegalEmptyArgumentException",
".",
"class",
"}",
")",
"public",
"static",
"void",
"notEmpty",
"(",
"final",
"boolean",
"expression",
",",
"@",
"Nullable",
"fina... | Ensures that a passed parameter of the calling method is not empty, using the passed expression to evaluate the
emptiness.
@param expression
the result of the expression to verify the emptiness of a reference ({@code true} means empty,
{@code false} means not empty)
@param name
name of object reference (in source code... | [
"Ensures",
"that",
"a",
"passed",
"parameter",
"of",
"the",
"calling",
"method",
"is",
"not",
"empty",
"using",
"the",
"passed",
"expression",
"to",
"evaluate",
"the",
"emptiness",
"."
] | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java#L1930-L1936 |
brettwooldridge/SansOrm | src/main/java/com/zaxxer/sansorm/SqlClosureElf.java | SqlClosureElf.getObjectById | public static <T> T getObjectById(Class<T> type, Object... ids)
{
return SqlClosure.sqlExecute(c -> OrmElf.objectById(c, type, ids));
} | java | public static <T> T getObjectById(Class<T> type, Object... ids)
{
return SqlClosure.sqlExecute(c -> OrmElf.objectById(c, type, ids));
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getObjectById",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"Object",
"...",
"ids",
")",
"{",
"return",
"SqlClosure",
".",
"sqlExecute",
"(",
"c",
"->",
"OrmElf",
".",
"objectById",
"(",
"c",
",",
"type",
",",
... | Gets an object by ID from the database.
@param type The type of the desired object.
@param ids The ID or IDs of the object.
@param <T> The type of the object.
@return The object or {@code null} | [
"Gets",
"an",
"object",
"by",
"ID",
"from",
"the",
"database",
"."
] | train | https://github.com/brettwooldridge/SansOrm/blob/ab22721db79c5f20c0e8483f09eda2844d596557/src/main/java/com/zaxxer/sansorm/SqlClosureElf.java#L43-L46 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.deleteHierarchicalEntityRole | public OperationStatus deleteHierarchicalEntityRole(UUID appId, String versionId, UUID hEntityId, UUID roleId) {
return deleteHierarchicalEntityRoleWithServiceResponseAsync(appId, versionId, hEntityId, roleId).toBlocking().single().body();
} | java | public OperationStatus deleteHierarchicalEntityRole(UUID appId, String versionId, UUID hEntityId, UUID roleId) {
return deleteHierarchicalEntityRoleWithServiceResponseAsync(appId, versionId, hEntityId, roleId).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"deleteHierarchicalEntityRole",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"hEntityId",
",",
"UUID",
"roleId",
")",
"{",
"return",
"deleteHierarchicalEntityRoleWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",... | Delete an entity role.
@param appId The application ID.
@param versionId The version ID.
@param hEntityId The hierarchical entity extractor ID.
@param roleId The entity role Id.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by... | [
"Delete",
"an",
"entity",
"role",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L13465-L13467 |
DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/jdbc/AbstractJdbcHelper.java | AbstractJdbcHelper.calcFetchSizeForStream | protected int calcFetchSizeForStream(int hintFetchSize, Connection conn) throws SQLException {
DatabaseVendor dbVendor = DbcHelper.detectDbVendor(conn);
switch (dbVendor) {
case MYSQL:
return Integer.MIN_VALUE;
default:
return hintFetchSize < 0 ? 1 : hintFetchSize... | java | protected int calcFetchSizeForStream(int hintFetchSize, Connection conn) throws SQLException {
DatabaseVendor dbVendor = DbcHelper.detectDbVendor(conn);
switch (dbVendor) {
case MYSQL:
return Integer.MIN_VALUE;
default:
return hintFetchSize < 0 ? 1 : hintFetchSize... | [
"protected",
"int",
"calcFetchSizeForStream",
"(",
"int",
"hintFetchSize",
",",
"Connection",
"conn",
")",
"throws",
"SQLException",
"{",
"DatabaseVendor",
"dbVendor",
"=",
"DbcHelper",
".",
"detectDbVendor",
"(",
"conn",
")",
";",
"switch",
"(",
"dbVendor",
")",
... | Calculate fetch size used for streaming.
@param hintFetchSize
@param conn
@return
@throws SQLException | [
"Calculate",
"fetch",
"size",
"used",
"for",
"streaming",
"."
] | train | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/jdbc/AbstractJdbcHelper.java#L549-L557 |
alkacon/opencms-core | src/org/opencms/jsp/decorator/CmsHtmlDecorator.java | CmsHtmlDecorator.doDecoration | public String doDecoration(String html, String encoding) throws Exception {
return process(html, encoding);
} | java | public String doDecoration(String html, String encoding) throws Exception {
return process(html, encoding);
} | [
"public",
"String",
"doDecoration",
"(",
"String",
"html",
",",
"String",
"encoding",
")",
"throws",
"Exception",
"{",
"return",
"process",
"(",
"html",
",",
"encoding",
")",
";",
"}"
] | Processes a HTML string and adds text decorations according to the decoration configuration.<p>
@param html a string holding the HTML code that should be added with text decorations
@param encoding the encoding to be used
@return a HTML string with the decorations added.
@throws Exception if something goes wrong | [
"Processes",
"a",
"HTML",
"string",
"and",
"adds",
"text",
"decorations",
"according",
"to",
"the",
"decoration",
"configuration",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/decorator/CmsHtmlDecorator.java#L236-L239 |
tvesalainen/util | util/src/main/java/org/vesalainen/math/Vectors.java | Vectors.isCounterClockwise | public static final boolean isCounterClockwise(double ox, double oy, double x1, double y1, double x2, double y2)
{
return isCounterClockwise(x1-ox, y1-oy, x2-ox, y2-oy);
} | java | public static final boolean isCounterClockwise(double ox, double oy, double x1, double y1, double x2, double y2)
{
return isCounterClockwise(x1-ox, y1-oy, x2-ox, y2-oy);
} | [
"public",
"static",
"final",
"boolean",
"isCounterClockwise",
"(",
"double",
"ox",
",",
"double",
"oy",
",",
"double",
"x1",
",",
"double",
"y1",
",",
"double",
"x2",
",",
"double",
"y2",
")",
"{",
"return",
"isCounterClockwise",
"(",
"x1",
"-",
"ox",
",... | Returns true if vector (x2, y2) is clockwise of (x1, y1) in (ox, oy) centered
coordinate.
@param ox
@param oy
@param x1
@param y1
@param x2
@param y2
@return | [
"Returns",
"true",
"if",
"vector",
"(",
"x2",
"y2",
")",
"is",
"clockwise",
"of",
"(",
"x1",
"y1",
")",
"in",
"(",
"ox",
"oy",
")",
"centered",
"coordinate",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/Vectors.java#L76-L79 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/journal/recoverylog/JournalRecoveryLog.java | JournalRecoveryLog.writeMapValues | private <T> String writeMapValues(String mapName, MultiValueMap<T> map) {
StringBuffer buffer = new StringBuffer();
buffer.append(" " + mapName + "\n");
for (Iterator<T> names = map.names(); names.hasNext();) {
T name = names.next();
buffer.append(" ").a... | java | private <T> String writeMapValues(String mapName, MultiValueMap<T> map) {
StringBuffer buffer = new StringBuffer();
buffer.append(" " + mapName + "\n");
for (Iterator<T> names = map.names(); names.hasNext();) {
T name = names.next();
buffer.append(" ").a... | [
"private",
"<",
"T",
">",
"String",
"writeMapValues",
"(",
"String",
"mapName",
",",
"MultiValueMap",
"<",
"T",
">",
"map",
")",
"{",
"StringBuffer",
"buffer",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"buffer",
".",
"append",
"(",
"\" \"",
"+",
... | Helper for the {@link #log(ConsumerJournalEntry)} method. Writes the
values of a context multi-map. | [
"Helper",
"for",
"the",
"{"
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/recoverylog/JournalRecoveryLog.java#L207-L219 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/CassQuery.java | CassQuery.recursivelyPopulateEntities | @SuppressWarnings("unchecked")
@Override
protected List<Object> recursivelyPopulateEntities(EntityMetadata m, Client client) {
List<EnhanceEntity> ls = null;
ApplicationMetadata appMetadata = kunderaMetadata.getApplicationMetadata();
externalProperties = ((CassandraClientBase) client).ge... | java | @SuppressWarnings("unchecked")
@Override
protected List<Object> recursivelyPopulateEntities(EntityMetadata m, Client client) {
List<EnhanceEntity> ls = null;
ApplicationMetadata appMetadata = kunderaMetadata.getApplicationMetadata();
externalProperties = ((CassandraClientBase) client).ge... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"protected",
"List",
"<",
"Object",
">",
"recursivelyPopulateEntities",
"(",
"EntityMetadata",
"m",
",",
"Client",
"client",
")",
"{",
"List",
"<",
"EnhanceEntity",
">",
"ls",
"=",
"null",
";... | (non-Javadoc).
@param m
the m
@param client
the client
@return the list
@see com.impetus.kundera.query.QueryImpl#recursivelyPopulateEntities(com.impetus
.kundera.metadata.model.EntityMetadata, com.impetus.kundera.client.Client) | [
"(",
"non",
"-",
"Javadoc",
")",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/CassQuery.java#L214-L255 |
ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java | DefaultQueryLogEntryCreator.writeTimeEntry | protected void writeTimeEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("Time:");
sb.append(execInfo.getElapsedTime());
sb.append(", ");
} | java | protected void writeTimeEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("Time:");
sb.append(execInfo.getElapsedTime());
sb.append(", ");
} | [
"protected",
"void",
"writeTimeEntry",
"(",
"StringBuilder",
"sb",
",",
"ExecutionInfo",
"execInfo",
",",
"List",
"<",
"QueryInfo",
">",
"queryInfoList",
")",
"{",
"sb",
".",
"append",
"(",
"\"Time:\"",
")",
";",
"sb",
".",
"append",
"(",
"execInfo",
".",
... | Write elapsed time.
<p>default: Time: 123,
The unit of time is determined by underlying {@link net.ttddyy.dsproxy.proxy.Stopwatch} implementation.
(milli vs nano seconds)
@param sb StringBuilder to write
@param execInfo execution info
@param queryInfoList query info list
@since 1.3.3 | [
"Write",
"elapsed",
"time",
"."
] | train | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java#L126-L130 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/QueryParserBase.java | QueryParserBase.createQueryStringFromNode | @Deprecated
public String createQueryStringFromNode(Node node, int position) {
return createQueryStringFromNode(node, position, null);
} | java | @Deprecated
public String createQueryStringFromNode(Node node, int position) {
return createQueryStringFromNode(node, position, null);
} | [
"@",
"Deprecated",
"public",
"String",
"createQueryStringFromNode",
"(",
"Node",
"node",
",",
"int",
"position",
")",
"{",
"return",
"createQueryStringFromNode",
"(",
"node",
",",
"position",
",",
"null",
")",
";",
"}"
] | Create the plain query string representation of the given node.
@param node
@return
@deprecated since 4.0. Use {@link #createQueryStringFromNode(Node, int, Class)} instead. | [
"Create",
"the",
"plain",
"query",
"string",
"representation",
"of",
"the",
"given",
"node",
"."
] | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/QueryParserBase.java#L174-L177 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.mp.jwt_fat/fat/src/com/ibm/ws/security/mp/jwt/fat/CommonMpJwtFat.java | CommonMpJwtFat.goodAppExpectations | public Expectations goodAppExpectations(String theUrl, String appClass) throws Exception {
Expectations expectations = new Expectations();
expectations.addExpectations(CommonExpectations.successfullyReachedUrl(theUrl));
expectations.addExpectation(new ResponseFullExpectation(MpJwtFatConstants.S... | java | public Expectations goodAppExpectations(String theUrl, String appClass) throws Exception {
Expectations expectations = new Expectations();
expectations.addExpectations(CommonExpectations.successfullyReachedUrl(theUrl));
expectations.addExpectation(new ResponseFullExpectation(MpJwtFatConstants.S... | [
"public",
"Expectations",
"goodAppExpectations",
"(",
"String",
"theUrl",
",",
"String",
"appClass",
")",
"throws",
"Exception",
"{",
"Expectations",
"expectations",
"=",
"new",
"Expectations",
"(",
")",
";",
"expectations",
".",
"addExpectations",
"(",
"CommonExpec... | Set good app check expectations - sets checks for good status code and for a message indicating what if any app class was invoked successfully
@param theUrl - the url that the test invoked
@param appClass - the app class that should have been invoked
@return - newly created Expectations
@throws Exception | [
"Set",
"good",
"app",
"check",
"expectations",
"-",
"sets",
"checks",
"for",
"good",
"status",
"code",
"and",
"for",
"a",
"message",
"indicating",
"what",
"if",
"any",
"app",
"class",
"was",
"invoked",
"successfully"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.mp.jwt_fat/fat/src/com/ibm/ws/security/mp/jwt/fat/CommonMpJwtFat.java#L95-L102 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java | StringGroovyMethods.eachLine | public static <T> T eachLine(CharSequence self, int firstLine, @ClosureParams(value=FromString.class, options={"String","String,Integer"}) Closure<T> closure) throws IOException {
int count = firstLine;
T result = null;
for (String line : readLines(self.toString())) {
result = callCl... | java | public static <T> T eachLine(CharSequence self, int firstLine, @ClosureParams(value=FromString.class, options={"String","String,Integer"}) Closure<T> closure) throws IOException {
int count = firstLine;
T result = null;
for (String line : readLines(self.toString())) {
result = callCl... | [
"public",
"static",
"<",
"T",
">",
"T",
"eachLine",
"(",
"CharSequence",
"self",
",",
"int",
"firstLine",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"FromString",
".",
"class",
",",
"options",
"=",
"{",
"\"String\"",
",",
"\"String,Integer\"",
"}",
")",... | Iterates through this CharSequence line by line. Each line is passed
to the given 1 or 2 arg closure. If a 2 arg closure is found
the line count is passed as the second argument.
@param self a CharSequence
@param firstLine the line number value used for the first line (default is 1, set to 0 to start counting from... | [
"Iterates",
"through",
"this",
"CharSequence",
"line",
"by",
"line",
".",
"Each",
"line",
"is",
"passed",
"to",
"the",
"given",
"1",
"or",
"2",
"arg",
"closure",
".",
"If",
"a",
"2",
"arg",
"closure",
"is",
"found",
"the",
"line",
"count",
"is",
"passe... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L611-L619 |
lucee/Lucee | core/src/main/java/lucee/runtime/tag/Mail.java | Mail.setProxypassword | public void setProxypassword(String proxypassword) throws ApplicationException {
try {
smtp.getProxyData().setPassword(proxypassword);
}
catch (Exception e) {
throw new ApplicationException("attribute [proxypassword] of the tag [mail] is invalid", e.getMessage());
}
} | java | public void setProxypassword(String proxypassword) throws ApplicationException {
try {
smtp.getProxyData().setPassword(proxypassword);
}
catch (Exception e) {
throw new ApplicationException("attribute [proxypassword] of the tag [mail] is invalid", e.getMessage());
}
} | [
"public",
"void",
"setProxypassword",
"(",
"String",
"proxypassword",
")",
"throws",
"ApplicationException",
"{",
"try",
"{",
"smtp",
".",
"getProxyData",
"(",
")",
".",
"setPassword",
"(",
"proxypassword",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
... | set the value password When required by a proxy server, a valid password.
@param proxypassword value to set
@throws ApplicationException | [
"set",
"the",
"value",
"password",
"When",
"required",
"by",
"a",
"proxy",
"server",
"a",
"valid",
"password",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Mail.java#L170-L177 |
schallee/alib4j | core/src/main/java/net/darkmist/alib/res/PkgRes.java | PkgRes.appendResourcePathPrefixFor | protected static StringBuilder appendResourcePathPrefixFor(StringBuilder sb, Object obj)
{
if(obj == null)
throw new NullPointerException("obj is null");
return appendResourcePathPrefixFor(sb, getPackageName(obj));
} | java | protected static StringBuilder appendResourcePathPrefixFor(StringBuilder sb, Object obj)
{
if(obj == null)
throw new NullPointerException("obj is null");
return appendResourcePathPrefixFor(sb, getPackageName(obj));
} | [
"protected",
"static",
"StringBuilder",
"appendResourcePathPrefixFor",
"(",
"StringBuilder",
"sb",
",",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"obj is null\"",
")",
";",
"return",
"appendResou... | Apend a package name converted to a resource path prefix.
@param sb what to append to. If this is null, a new
StringBuilder is created.
@param obj The object to get the package name from.
@return Path, starting and ending with a slash, for resources
prefixed by the package name.
@throws NullPointerException if obj is n... | [
"Apend",
"a",
"package",
"name",
"converted",
"to",
"a",
"resource",
"path",
"prefix",
"."
] | train | https://github.com/schallee/alib4j/blob/0e0718aee574bbb62268e1cf58e99286529ce529/core/src/main/java/net/darkmist/alib/res/PkgRes.java#L172-L177 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/BillingApi.java | BillingApi.listPayments | public BillingPaymentsResponse listPayments(String accountId, BillingApi.ListPaymentsOptions options) throws ApiException {
Object localVarPostBody = "{}";
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(400, "Missing the required parameter ... | java | public BillingPaymentsResponse listPayments(String accountId, BillingApi.ListPaymentsOptions options) throws ApiException {
Object localVarPostBody = "{}";
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(400, "Missing the required parameter ... | [
"public",
"BillingPaymentsResponse",
"listPayments",
"(",
"String",
"accountId",
",",
"BillingApi",
".",
"ListPaymentsOptions",
"options",
")",
"throws",
"ApiException",
"{",
"Object",
"localVarPostBody",
"=",
"\"{}\"",
";",
"// verify the required parameter 'accountId' is se... | Gets payment information for one or more payments.
Retrieves a list containing information about one or more payments. If the from date or to date queries are not used, the response returns payment information for the last 365 days. Privileges required: account administrator
@param accountId The external account numb... | [
"Gets",
"payment",
"information",
"for",
"one",
"or",
"more",
"payments",
".",
"Retrieves",
"a",
"list",
"containing",
"information",
"about",
"one",
"or",
"more",
"payments",
".",
"If",
"the",
"from",
"date",
"or",
"to",
"date",
"queries",
"are",
"not",
"... | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/BillingApi.java#L542-L579 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/SortOrderHandler.java | SortOrderHandler.init | public void init(BaseField field, GridScreenParent gridScreen, Record recGrid, boolean bCreateSortOrder)
{
m_recGrid = recGrid;
m_bCreateSortOrder = bCreateSortOrder;
super.init(field, gridScreen, null);
m_iKeyAreaArray = new String[MAX_ARRAY_SIZE];
for (int i = 0; i < MAX_AR... | java | public void init(BaseField field, GridScreenParent gridScreen, Record recGrid, boolean bCreateSortOrder)
{
m_recGrid = recGrid;
m_bCreateSortOrder = bCreateSortOrder;
super.init(field, gridScreen, null);
m_iKeyAreaArray = new String[MAX_ARRAY_SIZE];
for (int i = 0; i < MAX_AR... | [
"public",
"void",
"init",
"(",
"BaseField",
"field",
",",
"GridScreenParent",
"gridScreen",
",",
"Record",
"recGrid",
",",
"boolean",
"bCreateSortOrder",
")",
"{",
"m_recGrid",
"=",
"recGrid",
";",
"m_bCreateSortOrder",
"=",
"bCreateSortOrder",
";",
"super",
".",
... | Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param gridScreen The grid screen you will be requering.
@param recGrid The grid record. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/SortOrderHandler.java#L106-L115 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/RedundentExprEliminator.java | RedundentExprEliminator.isNotSameAsOwner | protected boolean isNotSameAsOwner(MultistepExprHolder head, ElemTemplateElement ete)
{
MultistepExprHolder next = head;
while(null != next)
{
ElemTemplateElement elemOwner = getElemFromExpression(next.m_exprOwner.getExpression());
if(elemOwner == ete)
return false;
next = next.m_next;
}
... | java | protected boolean isNotSameAsOwner(MultistepExprHolder head, ElemTemplateElement ete)
{
MultistepExprHolder next = head;
while(null != next)
{
ElemTemplateElement elemOwner = getElemFromExpression(next.m_exprOwner.getExpression());
if(elemOwner == ete)
return false;
next = next.m_next;
}
... | [
"protected",
"boolean",
"isNotSameAsOwner",
"(",
"MultistepExprHolder",
"head",
",",
"ElemTemplateElement",
"ete",
")",
"{",
"MultistepExprHolder",
"next",
"=",
"head",
";",
"while",
"(",
"null",
"!=",
"next",
")",
"{",
"ElemTemplateElement",
"elemOwner",
"=",
"ge... | Find out if the given ElemTemplateElement is not the same as one of
the ElemTemplateElement owners of the expressions.
@param head Head of linked list of expression owners.
@param ete The ElemTemplateElement that is a candidate for a psuedo
variable parent.
@return true if the given ElemTemplateElement is not the same... | [
"Find",
"out",
"if",
"the",
"given",
"ElemTemplateElement",
"is",
"not",
"the",
"same",
"as",
"one",
"of",
"the",
"ElemTemplateElement",
"owners",
"of",
"the",
"expressions",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/RedundentExprEliminator.java#L382-L393 |
Jasig/resource-server | resource-server-core/src/main/java/org/jasig/resource/aggr/ResourcesAggregatorImpl.java | ResourcesAggregatorImpl.willAggregateWith | protected boolean willAggregateWith(Css first, Css second) {
Validate.notNull(first, "Css argument cannot be null");
Validate.notNull(second, "Css argument cannot be null");
// never can aggregate absolute Css values
if (this.resourcesDao.isAbsolute(first) || this.resourcesDao.i... | java | protected boolean willAggregateWith(Css first, Css second) {
Validate.notNull(first, "Css argument cannot be null");
Validate.notNull(second, "Css argument cannot be null");
// never can aggregate absolute Css values
if (this.resourcesDao.isAbsolute(first) || this.resourcesDao.i... | [
"protected",
"boolean",
"willAggregateWith",
"(",
"Css",
"first",
",",
"Css",
"second",
")",
"{",
"Validate",
".",
"notNull",
"(",
"first",
",",
"\"Css argument cannot be null\"",
")",
";",
"Validate",
".",
"notNull",
"(",
"second",
",",
"\"Css argument cannot be ... | Similar to the {@link #equals(Object)} method, this will return
true if this object and the argument are "aggregatable".
2 {@link Css} objects are aggregatable if and only if:
<ol>
<li>Neither object returns true for {@link #isAbsolute()}</li>
<li>The values of their "conditional" properties are equivalent</li>
<li>Th... | [
"Similar",
"to",
"the",
"{",
"@link",
"#equals",
"(",
"Object",
")",
"}",
"method",
"this",
"will",
"return",
"true",
"if",
"this",
"object",
"and",
"the",
"argument",
"are",
"aggregatable",
"."
] | train | https://github.com/Jasig/resource-server/blob/13375f716777ec3c99ae9917f672881d4aa32df3/resource-server-core/src/main/java/org/jasig/resource/aggr/ResourcesAggregatorImpl.java#L476-L493 |
xvik/dropwizard-guicey | src/main/java/ru/vyarus/dropwizard/guice/module/installer/util/JerseyBinding.java | JerseyBinding.bindFactory | @SuppressWarnings("unchecked")
public static <T> void bindFactory(final AbstractBinder binder, final Injector injector, final Class<?> type,
final boolean hkManaged, final boolean singleton) {
// resolve Factory<T> actual type to bind properly
final Class<T> re... | java | @SuppressWarnings("unchecked")
public static <T> void bindFactory(final AbstractBinder binder, final Injector injector, final Class<?> type,
final boolean hkManaged, final boolean singleton) {
// resolve Factory<T> actual type to bind properly
final Class<T> re... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"void",
"bindFactory",
"(",
"final",
"AbstractBinder",
"binder",
",",
"final",
"Injector",
"injector",
",",
"final",
"Class",
"<",
"?",
">",
"type",
",",
"final",
"boolean... | Binds HK2 {@link Supplier}. If bean is {@link HK2Managed} then registered directly as
factory. Otherwise register factory through special "lazy bridge" to delay guice factory bean instantiation.
Also registers factory directly (through wrapper to be able to inject factory by its type).
<p>
NOTE: since jersey 2.26 jerse... | [
"Binds",
"HK2",
"{",
"@link",
"Supplier",
"}",
".",
"If",
"bean",
"is",
"{",
"@link",
"HK2Managed",
"}",
"then",
"registered",
"directly",
"as",
"factory",
".",
"Otherwise",
"register",
"factory",
"through",
"special",
"lazy",
"bridge",
"to",
"delay",
"guice... | train | https://github.com/xvik/dropwizard-guicey/blob/dd39ad77283555be21f606d5ebf0f11207a733d4/src/main/java/ru/vyarus/dropwizard/guice/module/installer/util/JerseyBinding.java#L110-L126 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/mpsuser.java | mpsuser.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
mpsuser_responses result = (mpsuser_responses) service.get_payload_formatter().string_to_resource(mpsuser_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == SESSION_NO... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
mpsuser_responses result = (mpsuser_responses) service.get_payload_formatter().string_to_resource(mpsuser_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == SESSION_NO... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"mpsuser_responses",
"result",
"=",
"(",
"mpsuser_responses",
")",
"service",
".",
"get_payload_formatter",
... | <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/mps/mpsuser.java#L368-L385 |
jenkinsci/jenkins | core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java | HudsonPrivateSecurityRealm.createAccount | private User createAccount(StaplerRequest req, StaplerResponse rsp, boolean validateCaptcha, String formView) throws ServletException, IOException {
SignupInfo si = validateAccountCreationForm(req, validateCaptcha);
if (!si.errors.isEmpty()) {
// failed. ask the user to try again.
... | java | private User createAccount(StaplerRequest req, StaplerResponse rsp, boolean validateCaptcha, String formView) throws ServletException, IOException {
SignupInfo si = validateAccountCreationForm(req, validateCaptcha);
if (!si.errors.isEmpty()) {
// failed. ask the user to try again.
... | [
"private",
"User",
"createAccount",
"(",
"StaplerRequest",
"req",
",",
"StaplerResponse",
"rsp",
",",
"boolean",
"validateCaptcha",
",",
"String",
"formView",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"SignupInfo",
"si",
"=",
"validateAccountCreation... | @param req the request to get the form data from (is also used for redirection)
@param rsp the response to use for forwarding if the creation fails
@param validateCaptcha whether to attempt to validate a captcha in the request
@param formView the view to redirect to if creation fails
@return
null if failed. The browse... | [
"@param",
"req",
"the",
"request",
"to",
"get",
"the",
"form",
"data",
"from",
"(",
"is",
"also",
"used",
"for",
"redirection",
")",
"@param",
"rsp",
"the",
"response",
"to",
"use",
"for",
"forwarding",
"if",
"the",
"creation",
"fails",
"@param",
"validate... | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java#L383-L393 |
netty/netty | buffer/src/main/java/io/netty/buffer/ByteBufUtil.java | ByteBufUtil.appendPrettyHexDump | public static void appendPrettyHexDump(StringBuilder dump, ByteBuf buf) {
appendPrettyHexDump(dump, buf, buf.readerIndex(), buf.readableBytes());
} | java | public static void appendPrettyHexDump(StringBuilder dump, ByteBuf buf) {
appendPrettyHexDump(dump, buf, buf.readerIndex(), buf.readableBytes());
} | [
"public",
"static",
"void",
"appendPrettyHexDump",
"(",
"StringBuilder",
"dump",
",",
"ByteBuf",
"buf",
")",
"{",
"appendPrettyHexDump",
"(",
"dump",
",",
"buf",
",",
"buf",
".",
"readerIndex",
"(",
")",
",",
"buf",
".",
"readableBytes",
"(",
")",
")",
";"... | Appends the prettified multi-line hexadecimal dump of the specified {@link ByteBuf} to the specified
{@link StringBuilder} that is easy to read by humans. | [
"Appends",
"the",
"prettified",
"multi",
"-",
"line",
"hexadecimal",
"dump",
"of",
"the",
"specified",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/ByteBufUtil.java#L926-L928 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/cmp/cmppolicylabel_binding.java | cmppolicylabel_binding.get | public static cmppolicylabel_binding get(nitro_service service, String labelname) throws Exception{
cmppolicylabel_binding obj = new cmppolicylabel_binding();
obj.set_labelname(labelname);
cmppolicylabel_binding response = (cmppolicylabel_binding) obj.get_resource(service);
return response;
} | java | public static cmppolicylabel_binding get(nitro_service service, String labelname) throws Exception{
cmppolicylabel_binding obj = new cmppolicylabel_binding();
obj.set_labelname(labelname);
cmppolicylabel_binding response = (cmppolicylabel_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"cmppolicylabel_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"labelname",
")",
"throws",
"Exception",
"{",
"cmppolicylabel_binding",
"obj",
"=",
"new",
"cmppolicylabel_binding",
"(",
")",
";",
"obj",
".",
"set_labelname",
"(",... | Use this API to fetch cmppolicylabel_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"cmppolicylabel_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/cmp/cmppolicylabel_binding.java#L114-L119 |
mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.setAttributes | public void setAttributes(String name, int attributes)
{
checkNotSealed(name, 0);
findAttributeSlot(name, 0, SlotAccess.MODIFY).setAttributes(attributes);
} | java | public void setAttributes(String name, int attributes)
{
checkNotSealed(name, 0);
findAttributeSlot(name, 0, SlotAccess.MODIFY).setAttributes(attributes);
} | [
"public",
"void",
"setAttributes",
"(",
"String",
"name",
",",
"int",
"attributes",
")",
"{",
"checkNotSealed",
"(",
"name",
",",
"0",
")",
";",
"findAttributeSlot",
"(",
"name",
",",
"0",
",",
"SlotAccess",
".",
"MODIFY",
")",
".",
"setAttributes",
"(",
... | Set the attributes of a named property.
The property is specified by <code>name</code>
as defined for <code>has</code>.<p>
The possible attributes are READONLY, DONTENUM,
and PERMANENT. Combinations of attributes
are expressed by the bitwise OR of attributes.
EMPTY is the state of no attributes set. Any unused
bits a... | [
"Set",
"the",
"attributes",
"of",
"a",
"named",
"property",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L775-L779 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/WebhooksInner.java | WebhooksInner.generateUriAsync | public Observable<String> generateUriAsync(String resourceGroupName, String automationAccountName) {
return generateUriWithServiceResponseAsync(resourceGroupName, automationAccountName).map(new Func1<ServiceResponse<String>, String>() {
@Override
public String call(ServiceResponse<String... | java | public Observable<String> generateUriAsync(String resourceGroupName, String automationAccountName) {
return generateUriWithServiceResponseAsync(resourceGroupName, automationAccountName).map(new Func1<ServiceResponse<String>, String>() {
@Override
public String call(ServiceResponse<String... | [
"public",
"Observable",
"<",
"String",
">",
"generateUriAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
")",
"{",
"return",
"generateUriWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"automationAccountName",
")",
".",
"map",
... | Generates a Uri for use in creating a webhook.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the String object | [
"Generates",
"a",
"Uri",
"for",
"use",
"in",
"creating",
"a",
"webhook",
"."
] | 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/WebhooksInner.java#L133-L140 |
netty/netty | transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java | ChannelOutboundBuffer.addMessage | public void addMessage(Object msg, int size, ChannelPromise promise) {
Entry entry = Entry.newInstance(msg, size, total(msg), promise);
if (tailEntry == null) {
flushedEntry = null;
} else {
Entry tail = tailEntry;
tail.next = entry;
}
tailEntr... | java | public void addMessage(Object msg, int size, ChannelPromise promise) {
Entry entry = Entry.newInstance(msg, size, total(msg), promise);
if (tailEntry == null) {
flushedEntry = null;
} else {
Entry tail = tailEntry;
tail.next = entry;
}
tailEntr... | [
"public",
"void",
"addMessage",
"(",
"Object",
"msg",
",",
"int",
"size",
",",
"ChannelPromise",
"promise",
")",
"{",
"Entry",
"entry",
"=",
"Entry",
".",
"newInstance",
"(",
"msg",
",",
"size",
",",
"total",
"(",
"msg",
")",
",",
"promise",
")",
";",
... | Add given message to this {@link ChannelOutboundBuffer}. The given {@link ChannelPromise} will be notified once
the message was written. | [
"Add",
"given",
"message",
"to",
"this",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java#L112-L128 |
fozziethebeat/S-Space | opt/src/main/java/edu/ucla/sspace/lra/LatentRelationalAnalysis.java | LatentRelationalAnalysis.evaluateAnalogies | public void evaluateAnalogies(Matrix projection, String inputFileName, String outputFileName) {
try {
Scanner sc = new Scanner(new File(inputFileName));
PrintStream out = new PrintStream(new FileOutputStream(outputFileName));
while (sc.hasNext()) {
... | java | public void evaluateAnalogies(Matrix projection, String inputFileName, String outputFileName) {
try {
Scanner sc = new Scanner(new File(inputFileName));
PrintStream out = new PrintStream(new FileOutputStream(outputFileName));
while (sc.hasNext()) {
... | [
"public",
"void",
"evaluateAnalogies",
"(",
"Matrix",
"projection",
",",
"String",
"inputFileName",
",",
"String",
"outputFileName",
")",
"{",
"try",
"{",
"Scanner",
"sc",
"=",
"new",
"Scanner",
"(",
"new",
"File",
"(",
"inputFileName",
")",
")",
";",
"Print... | Reads analogies from file and outputs their cosine similarities to another file.
@param projection the projection {@code Matrix}
@param inputFileName the input file containing analogies in the proper format
separated by newlines
@param outputFileName the output file where the results will be stored
@return void
@see ... | [
"Reads",
"analogies",
"from",
"file",
"and",
"outputs",
"their",
"cosine",
"similarities",
"to",
"another",
"file",
"."
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/opt/src/main/java/edu/ucla/sspace/lra/LatentRelationalAnalysis.java#L940-L958 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/Counters.java | Counters.incrCounter | public synchronized void incrCounter(String group, String counter, long amount) {
getGroup(group).getCounterForName(counter).increment(amount);
} | java | public synchronized void incrCounter(String group, String counter, long amount) {
getGroup(group).getCounterForName(counter).increment(amount);
} | [
"public",
"synchronized",
"void",
"incrCounter",
"(",
"String",
"group",
",",
"String",
"counter",
",",
"long",
"amount",
")",
"{",
"getGroup",
"(",
"group",
")",
".",
"getCounterForName",
"(",
"counter",
")",
".",
"increment",
"(",
"amount",
")",
";",
"}"... | Increments the specified counter by the specified amount, creating it if
it didn't already exist.
@param group the name of the group
@param counter the internal name of the counter
@param amount amount by which counter is to be incremented | [
"Increments",
"the",
"specified",
"counter",
"by",
"the",
"specified",
"amount",
"creating",
"it",
"if",
"it",
"didn",
"t",
"already",
"exist",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/Counters.java#L424-L426 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java | ReUtil.get | public static String get(String regex, CharSequence content, int groupIndex) {
if (null == content || null == regex) {
return null;
}
// Pattern pattern = Pattern.compile(regex, Pattern.DOTALL);
final Pattern pattern = PatternPool.get(regex, Pattern.DOTALL);
return get(pattern, content, groupIndex)... | java | public static String get(String regex, CharSequence content, int groupIndex) {
if (null == content || null == regex) {
return null;
}
// Pattern pattern = Pattern.compile(regex, Pattern.DOTALL);
final Pattern pattern = PatternPool.get(regex, Pattern.DOTALL);
return get(pattern, content, groupIndex)... | [
"public",
"static",
"String",
"get",
"(",
"String",
"regex",
",",
"CharSequence",
"content",
",",
"int",
"groupIndex",
")",
"{",
"if",
"(",
"null",
"==",
"content",
"||",
"null",
"==",
"regex",
")",
"{",
"return",
"null",
";",
"}",
"// Pattern pattern = Pa... | 获得匹配的字符串
@param regex 匹配的正则
@param content 被匹配的内容
@param groupIndex 匹配正则的分组序号
@return 匹配后得到的字符串,未匹配返回null | [
"获得匹配的字符串"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java#L69-L77 |
adyliu/jafka | src/main/java/io/jafka/utils/zookeeper/ZkUtils.java | ZkUtils.createEphemeralPath | public static void createEphemeralPath(ZkClient zkClient, String path, String data) {
try {
zkClient.createEphemeral(path, Utils.getBytes(data));
} catch (ZkNoNodeException e) {
createParentPath(zkClient, path);
zkClient.createEphemeral(path, Utils.getBytes(data));
... | java | public static void createEphemeralPath(ZkClient zkClient, String path, String data) {
try {
zkClient.createEphemeral(path, Utils.getBytes(data));
} catch (ZkNoNodeException e) {
createParentPath(zkClient, path);
zkClient.createEphemeral(path, Utils.getBytes(data));
... | [
"public",
"static",
"void",
"createEphemeralPath",
"(",
"ZkClient",
"zkClient",
",",
"String",
"path",
",",
"String",
"data",
")",
"{",
"try",
"{",
"zkClient",
".",
"createEphemeral",
"(",
"path",
",",
"Utils",
".",
"getBytes",
"(",
"data",
")",
")",
";",
... | Create an ephemeral node with the given path and data. Create parents if necessary.
@param zkClient client of zookeeper
@param path node path of zookeeper
@param data node data | [
"Create",
"an",
"ephemeral",
"node",
"with",
"the",
"given",
"path",
"and",
"data",
".",
"Create",
"parents",
"if",
"necessary",
"."
] | train | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/utils/zookeeper/ZkUtils.java#L197-L204 |
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.createOrUpdateAsync | public Observable<VirtualMachineScaleSetInner> createOrUpdateAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, parameters).map(new Func1<ServiceResponse<VirtualMachineScaleSetInner>, V... | java | public Observable<VirtualMachineScaleSetInner> createOrUpdateAsync(String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, parameters).map(new Func1<ServiceResponse<VirtualMachineScaleSetInner>, V... | [
"public",
"Observable",
"<",
"VirtualMachineScaleSetInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
",",
"VirtualMachineScaleSetInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"r... | Create or update a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set to create or update.
@param parameters The scale set object.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Create",
"or",
"update",
"a",
"VM",
"scale",
"set",
"."
] | 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#L232-L239 |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListUserSegmentEntryRelPersistenceImpl.java | CommercePriceListUserSegmentEntryRelPersistenceImpl.fetchByUUID_G | @Override
public CommercePriceListUserSegmentEntryRel fetchByUUID_G(String uuid,
long groupId) {
return fetchByUUID_G(uuid, groupId, true);
} | java | @Override
public CommercePriceListUserSegmentEntryRel fetchByUUID_G(String uuid,
long groupId) {
return fetchByUUID_G(uuid, groupId, true);
} | [
"@",
"Override",
"public",
"CommercePriceListUserSegmentEntryRel",
"fetchByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"{",
"return",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
",",
"true",
")",
";",
"}"
] | Returns the commerce price list user segment entry rel where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce price list user segment entry rel, or <code>null</code> if a matchin... | [
"Returns",
"the",
"commerce",
"price",
"list",
"user",
"segment",
"entry",
"rel",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found"... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListUserSegmentEntryRelPersistenceImpl.java#L717-L721 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_alerting_id_GET | public OvhAlerting project_serviceName_alerting_id_GET(String serviceName, String id) throws IOException {
String qPath = "/cloud/project/{serviceName}/alerting/{id}";
StringBuilder sb = path(qPath, serviceName, id);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhAlerting.class... | java | public OvhAlerting project_serviceName_alerting_id_GET(String serviceName, String id) throws IOException {
String qPath = "/cloud/project/{serviceName}/alerting/{id}";
StringBuilder sb = path(qPath, serviceName, id);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhAlerting.class... | [
"public",
"OvhAlerting",
"project_serviceName_alerting_id_GET",
"(",
"String",
"serviceName",
",",
"String",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/alerting/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
... | Get this object properties
REST: GET /cloud/project/{serviceName}/alerting/{id}
@param serviceName [required] The project id
@param id [required] Alerting unique UUID | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2210-L2215 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/builder/ToStringStyle.java | ToStringStyle.appendSummary | protected void appendSummary(final StringBuffer buffer, final String fieldName, final Object value) {
buffer.append(summaryObjectStartText);
buffer.append(getShortClassName(value.getClass()));
buffer.append(summaryObjectEndText);
} | java | protected void appendSummary(final StringBuffer buffer, final String fieldName, final Object value) {
buffer.append(summaryObjectStartText);
buffer.append(getShortClassName(value.getClass()));
buffer.append(summaryObjectEndText);
} | [
"protected",
"void",
"appendSummary",
"(",
"final",
"StringBuffer",
"buffer",
",",
"final",
"String",
"fieldName",
",",
"final",
"Object",
"value",
")",
"{",
"buffer",
".",
"append",
"(",
"summaryObjectStartText",
")",
";",
"buffer",
".",
"append",
"(",
"getSh... | <p>Append to the <code>toString</code> an <code>Object</code>
value, printing a summary of the <code>Object</code>.</P>
@param buffer the <code>StringBuffer</code> to populate
@param fieldName the field name, typically not used as already appended
@param value the value to add to the <code>toString</code>,
not <cod... | [
"<p",
">",
"Append",
"to",
"the",
"<code",
">",
"toString<",
"/",
"code",
">",
"an",
"<code",
">",
"Object<",
"/",
"code",
">",
"value",
"printing",
"a",
"summary",
"of",
"the",
"<code",
">",
"Object<",
"/",
"code",
">",
".",
"<",
"/",
"P",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/builder/ToStringStyle.java#L662-L666 |
orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/URIUtilities.java | URIUtilities.getConcatenatedParameters | public static String getConcatenatedParameters(Map<String, String> parameters, String... keys) {
StringBuilder keyValues = new StringBuilder();
for(String key : keys) {
String value = parameters.get(key.toLowerCase().trim());
if(value!=null) {
if(keyValues.length(... | java | public static String getConcatenatedParameters(Map<String, String> parameters, String... keys) {
StringBuilder keyValues = new StringBuilder();
for(String key : keys) {
String value = parameters.get(key.toLowerCase().trim());
if(value!=null) {
if(keyValues.length(... | [
"public",
"static",
"String",
"getConcatenatedParameters",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
",",
"String",
"...",
"keys",
")",
"{",
"StringBuilder",
"keyValues",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"String",
"k... | Create the Query part of an URI
@param parameters Parameters to read
@param keys map property to read
@return Query part of an URI | [
"Create",
"the",
"Query",
"part",
"of",
"an",
"URI"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/URIUtilities.java#L93-L107 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/failover/AbstractMastersListener.java | AbstractMastersListener.isQueryRelaunchable | public boolean isQueryRelaunchable(Method method, Object[] args) {
if (method != null) {
switch (method.getName()) {
case "executeQuery":
if (!((Boolean) args[0])) {
return true; //launched on slave connection
}
if (args[2] instanceof String) {
ret... | java | public boolean isQueryRelaunchable(Method method, Object[] args) {
if (method != null) {
switch (method.getName()) {
case "executeQuery":
if (!((Boolean) args[0])) {
return true; //launched on slave connection
}
if (args[2] instanceof String) {
ret... | [
"public",
"boolean",
"isQueryRelaunchable",
"(",
"Method",
"method",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"method",
"!=",
"null",
")",
"{",
"switch",
"(",
"method",
".",
"getName",
"(",
")",
")",
"{",
"case",
"\"executeQuery\"",
":",
"... | Check if query can be re-executed.
@param method invoke method
@param args invoke arguments
@return true if can be re-executed | [
"Check",
"if",
"query",
"can",
"be",
"re",
"-",
"executed",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/AbstractMastersListener.java#L360-L391 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/DevicesManagementApi.java | DevicesManagementApi.getAllByDid | public TaskByDidListEnvelope getAllByDid(String did, Integer count, Integer offset, String status, String order, String sort) throws ApiException {
ApiResponse<TaskByDidListEnvelope> resp = getAllByDidWithHttpInfo(did, count, offset, status, order, sort);
return resp.getData();
} | java | public TaskByDidListEnvelope getAllByDid(String did, Integer count, Integer offset, String status, String order, String sort) throws ApiException {
ApiResponse<TaskByDidListEnvelope> resp = getAllByDidWithHttpInfo(did, count, offset, status, order, sort);
return resp.getData();
} | [
"public",
"TaskByDidListEnvelope",
"getAllByDid",
"(",
"String",
"did",
",",
"Integer",
"count",
",",
"Integer",
"offset",
",",
"String",
"status",
",",
"String",
"order",
",",
"String",
"sort",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"TaskByDidL... | Returns the list of tasks for a particular device id with optional status filter.
Returns the list of tasks for a particular device id with optional status filter.
@param did Device ID. (required)
@param count Max results count. (optional)
@param offset Result starting offset. (optional)
@param status Status filter. Co... | [
"Returns",
"the",
"list",
"of",
"tasks",
"for",
"a",
"particular",
"device",
"id",
"with",
"optional",
"status",
"filter",
".",
"Returns",
"the",
"list",
"of",
"tasks",
"for",
"a",
"particular",
"device",
"id",
"with",
"optional",
"status",
"filter",
"."
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/DevicesManagementApi.java#L390-L393 |
liferay/com-liferay-commerce | commerce-notification-api/src/main/java/com/liferay/commerce/notification/model/CommerceNotificationTemplateWrapper.java | CommerceNotificationTemplateWrapper.setBodyMap | @Override
public void setBodyMap(Map<java.util.Locale, String> bodyMap) {
_commerceNotificationTemplate.setBodyMap(bodyMap);
} | java | @Override
public void setBodyMap(Map<java.util.Locale, String> bodyMap) {
_commerceNotificationTemplate.setBodyMap(bodyMap);
} | [
"@",
"Override",
"public",
"void",
"setBodyMap",
"(",
"Map",
"<",
"java",
".",
"util",
".",
"Locale",
",",
"String",
">",
"bodyMap",
")",
"{",
"_commerceNotificationTemplate",
".",
"setBodyMap",
"(",
"bodyMap",
")",
";",
"}"
] | Sets the localized bodies of this commerce notification template from the map of locales and localized bodies.
@param bodyMap the locales and localized bodies of this commerce notification template | [
"Sets",
"the",
"localized",
"bodies",
"of",
"this",
"commerce",
"notification",
"template",
"from",
"the",
"map",
"of",
"locales",
"and",
"localized",
"bodies",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-api/src/main/java/com/liferay/commerce/notification/model/CommerceNotificationTemplateWrapper.java#L731-L734 |
google/closure-compiler | src/com/google/javascript/jscomp/ClosureRewriteModule.java | ClosureRewriteModule.isCallTo | private static boolean isCallTo(Node n, Node targetMethod) {
if (!n.isCall()) {
return false;
}
Node method = n.getFirstChild();
return method.isGetProp() && method.matchesQualifiedName(targetMethod);
} | java | private static boolean isCallTo(Node n, Node targetMethod) {
if (!n.isCall()) {
return false;
}
Node method = n.getFirstChild();
return method.isGetProp() && method.matchesQualifiedName(targetMethod);
} | [
"private",
"static",
"boolean",
"isCallTo",
"(",
"Node",
"n",
",",
"Node",
"targetMethod",
")",
"{",
"if",
"(",
"!",
"n",
".",
"isCall",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"Node",
"method",
"=",
"n",
".",
"getFirstChild",
"(",
")",
";... | A faster version of NodeUtil.isCallTo() for methods in the GETPROP form.
@param n The CALL node to be checked.
@param targetMethod A prebuilt GETPROP node representing a target method.
@return Whether n is a call to the target method. | [
"A",
"faster",
"version",
"of",
"NodeUtil",
".",
"isCallTo",
"()",
"for",
"methods",
"in",
"the",
"GETPROP",
"form",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ClosureRewriteModule.java#L1844-L1850 |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/decompose/TriangularSolver_ZDRM.java | TriangularSolver_ZDRM.solveL_diagReal | public static void solveL_diagReal(double L[], double[] b, int n)
{
// for( int i = 0; i < n; i++ ) {
// double sum = b[i];
// for( int k=0; k<i; k++ ) {
// sum -= L[i*n+k]* b[k];
// }
// b[i] = sum / L[i*n+i];
// }
int stride = n*2;
... | java | public static void solveL_diagReal(double L[], double[] b, int n)
{
// for( int i = 0; i < n; i++ ) {
// double sum = b[i];
// for( int k=0; k<i; k++ ) {
// sum -= L[i*n+k]* b[k];
// }
// b[i] = sum / L[i*n+i];
// }
int stride = n*2;
... | [
"public",
"static",
"void",
"solveL_diagReal",
"(",
"double",
"L",
"[",
"]",
",",
"double",
"[",
"]",
"b",
",",
"int",
"n",
")",
"{",
"// for( int i = 0; i < n; i++ ) {",
"// double sum = b[i];",
"// for( int k=0; k<i; k++ ) {",
"// ... | <p>
Solves for non-singular lower triangular matrices with real valued diagonal elements
using forward substitution.
<br>
b = L<sup>-1</sup>b<br>
<br>
where b is a vector, L is an n by n matrix.<br>
</p>
@param L An n by n non-singular lower triangular matrix. Not modified.
@param b A vector of length n. Modified.
@pa... | [
"<p",
">",
"Solves",
"for",
"non",
"-",
"singular",
"lower",
"triangular",
"matrices",
"with",
"real",
"valued",
"diagonal",
"elements",
"using",
"forward",
"substitution",
".",
"<br",
">",
"b",
"=",
"L<sup",
">",
"-",
"1<",
"/",
"sup",
">",
"b<br",
">",... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/decompose/TriangularSolver_ZDRM.java#L100-L133 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ManagedClustersInner.java | ManagedClustersInner.resetServicePrincipalProfileAsync | public Observable<Void> resetServicePrincipalProfileAsync(String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters) {
return resetServicePrincipalProfileWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1<ServiceResponse<Void>, Void>() {
... | java | public Observable<Void> resetServicePrincipalProfileAsync(String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters) {
return resetServicePrincipalProfileWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1<ServiceResponse<Void>, Void>() {
... | [
"public",
"Observable",
"<",
"Void",
">",
"resetServicePrincipalProfileAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ManagedClusterServicePrincipalProfile",
"parameters",
")",
"{",
"return",
"resetServicePrincipalProfileWithServiceResponseAsync"... | Reset Service Principal Profile of a managed cluster.
Update the service principal Profile for a managed cluster.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the managed cluster resource.
@param parameters Parameters supplied to the Reset Service Principal Profile operation... | [
"Reset",
"Service",
"Principal",
"Profile",
"of",
"a",
"managed",
"cluster",
".",
"Update",
"the",
"service",
"principal",
"Profile",
"for",
"a",
"managed",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ManagedClustersInner.java#L1530-L1537 |
aoindustries/ao-encoding | src/main/java/com/aoindustries/encoding/UrlValidator.java | UrlValidator.checkCharacter | public static boolean checkCharacter(int c, boolean foundQuestionMark) throws IOException {
if(foundQuestionMark) {
switch(c) {
case '.':
case '-':
case '*':
case '_':
case '+': // converted space
case '%': // encoded value
// Other characters used outside the URL data
//case ':':
... | java | public static boolean checkCharacter(int c, boolean foundQuestionMark) throws IOException {
if(foundQuestionMark) {
switch(c) {
case '.':
case '-':
case '*':
case '_':
case '+': // converted space
case '%': // encoded value
// Other characters used outside the URL data
//case ':':
... | [
"public",
"static",
"boolean",
"checkCharacter",
"(",
"int",
"c",
",",
"boolean",
"foundQuestionMark",
")",
"throws",
"IOException",
"{",
"if",
"(",
"foundQuestionMark",
")",
"{",
"switch",
"(",
"c",
")",
"{",
"case",
"'",
"'",
":",
"case",
"'",
"'",
":"... | Checks one character, throws IOException if invalid.
@see java.net.URLEncoder
@return <code>true</code> if found the first '?'. | [
"Checks",
"one",
"character",
"throws",
"IOException",
"if",
"invalid",
"."
] | train | https://github.com/aoindustries/ao-encoding/blob/54eeb8ff58ab7b44bb02549bbe2572625b449e4e/src/main/java/com/aoindustries/encoding/UrlValidator.java#L41-L73 |
aoindustries/aoweb-framework | src/main/java/com/aoindustries/website/framework/WebPage.java | WebPage.getHTMLChainWriter | protected final ChainWriter getHTMLChainWriter(WebSiteRequest req, HttpServletResponse resp) throws IOException {
resp.setContentType("text/html");
resp.setCharacterEncoding("UTF-8");
String[] headers=getAdditionalHeaders(req);
if(headers!=null) {
int len=headers.length;
for(int c=0; c<len; c+=2) resp.set... | java | protected final ChainWriter getHTMLChainWriter(WebSiteRequest req, HttpServletResponse resp) throws IOException {
resp.setContentType("text/html");
resp.setCharacterEncoding("UTF-8");
String[] headers=getAdditionalHeaders(req);
if(headers!=null) {
int len=headers.length;
for(int c=0; c<len; c+=2) resp.set... | [
"protected",
"final",
"ChainWriter",
"getHTMLChainWriter",
"(",
"WebSiteRequest",
"req",
",",
"HttpServletResponse",
"resp",
")",
"throws",
"IOException",
"{",
"resp",
".",
"setContentType",
"(",
"\"text/html\"",
")",
";",
"resp",
".",
"setCharacterEncoding",
"(",
"... | Sets the content type, encoding to UTF-8, sets the additional headers, then returns the <code>ChainWriter</code>.
@see #getAdditionalHeaders | [
"Sets",
"the",
"content",
"type",
"encoding",
"to",
"UTF",
"-",
"8",
"sets",
"the",
"additional",
"headers",
"then",
"returns",
"the",
"<code",
">",
"ChainWriter<",
"/",
"code",
">",
"."
] | train | https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/WebPage.java#L596-L605 |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/property/GeoPackageJavaProperties.java | GeoPackageJavaProperties.getProperty | public static synchronized String getProperty(String key, boolean required) {
if (mProperties == null) {
mProperties = initializeConfigurationProperties();
}
String value = mProperties.getProperty(key);
if (value == null && required) {
throw new RuntimeException("Property not found: " + key);
}
return... | java | public static synchronized String getProperty(String key, boolean required) {
if (mProperties == null) {
mProperties = initializeConfigurationProperties();
}
String value = mProperties.getProperty(key);
if (value == null && required) {
throw new RuntimeException("Property not found: " + key);
}
return... | [
"public",
"static",
"synchronized",
"String",
"getProperty",
"(",
"String",
"key",
",",
"boolean",
"required",
")",
"{",
"if",
"(",
"mProperties",
"==",
"null",
")",
"{",
"mProperties",
"=",
"initializeConfigurationProperties",
"(",
")",
";",
"}",
"String",
"v... | Get a property by key
@param key
key
@param required
required flag
@return property value | [
"Get",
"a",
"property",
"by",
"key"
] | train | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/property/GeoPackageJavaProperties.java#L49-L58 |
calrissian/mango | mango-core/src/main/java/org/calrissian/mango/io/Serializables.java | Serializables.deserialize | public static <T extends Serializable> T deserialize(byte[] bytes, boolean compressed) throws IOException, ClassNotFoundException {
requireNonNull(bytes);
try (ByteArrayInputStream i = new ByteArrayInputStream(bytes);
ObjectInputStream ois = new ObjectInputStream(compressed ? new GZIPInput... | java | public static <T extends Serializable> T deserialize(byte[] bytes, boolean compressed) throws IOException, ClassNotFoundException {
requireNonNull(bytes);
try (ByteArrayInputStream i = new ByteArrayInputStream(bytes);
ObjectInputStream ois = new ObjectInputStream(compressed ? new GZIPInput... | [
"public",
"static",
"<",
"T",
"extends",
"Serializable",
">",
"T",
"deserialize",
"(",
"byte",
"[",
"]",
"bytes",
",",
"boolean",
"compressed",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"requireNonNull",
"(",
"bytes",
")",
";",
"try",
... | Utility for returning a Serializable object from a byte array. Only use the {@code compressed} option if the
data was originally compresses when using the {@link Serializables#serialize(Serializable, boolean)} method. | [
"Utility",
"for",
"returning",
"a",
"Serializable",
"object",
"from",
"a",
"byte",
"array",
".",
"Only",
"use",
"the",
"{"
] | train | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-core/src/main/java/org/calrissian/mango/io/Serializables.java#L66-L73 |
headius/invokebinder | src/main/java/com/headius/invokebinder/Signature.java | Signature.insertArgs | public Signature insertArgs(String beforeName, String[] names, Class<?>... types) {
return insertArgs(argOffset(beforeName), names, types);
} | java | public Signature insertArgs(String beforeName, String[] names, Class<?>... types) {
return insertArgs(argOffset(beforeName), names, types);
} | [
"public",
"Signature",
"insertArgs",
"(",
"String",
"beforeName",
",",
"String",
"[",
"]",
"names",
",",
"Class",
"<",
"?",
">",
"...",
"types",
")",
"{",
"return",
"insertArgs",
"(",
"argOffset",
"(",
"beforeName",
")",
",",
"names",
",",
"types",
")",
... | Insert arguments (names + types) into the signature before the argument
with the given name.
@param beforeName the name of the argument before which to insert
@param names the names of the new arguments
@param types the types of the new arguments
@return a new Signature with the added arguments | [
"Insert",
"arguments",
"(",
"names",
"+",
"types",
")",
"into",
"the",
"signature",
"before",
"the",
"argument",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Signature.java#L298-L300 |
bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/core/DefaultDataStore.java | DefaultDataStore.scan | @Override
public Iterator<Map<String, Object>> scan(String tableName, @Nullable String fromKeyExclusive,
LimitCounter limit, ReadConsistency consistency) {
return scan(tableName, fromKeyExclusive, limit, false, consistency);
} | java | @Override
public Iterator<Map<String, Object>> scan(String tableName, @Nullable String fromKeyExclusive,
LimitCounter limit, ReadConsistency consistency) {
return scan(tableName, fromKeyExclusive, limit, false, consistency);
} | [
"@",
"Override",
"public",
"Iterator",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"scan",
"(",
"String",
"tableName",
",",
"@",
"Nullable",
"String",
"fromKeyExclusive",
",",
"LimitCounter",
"limit",
",",
"ReadConsistency",
"consistency",
")",
"{",
... | Internal API used by table DAOs that supports a LimitCounter instead of a long limit. | [
"Internal",
"API",
"used",
"by",
"table",
"DAOs",
"that",
"supports",
"a",
"LimitCounter",
"instead",
"of",
"a",
"long",
"limit",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/core/DefaultDataStore.java#L543-L547 |
mojohaus/flatten-maven-plugin | src/main/java/org/codehaus/mojo/flatten/FlattenMojo.java | FlattenMojo.writePom | protected void writePom( Model pom, File pomFile, String headerComment )
throws MojoExecutionException
{
File parentFile = pomFile.getParentFile();
if ( !parentFile.exists() )
{
boolean success = parentFile.mkdirs();
if ( !success )
{
... | java | protected void writePom( Model pom, File pomFile, String headerComment )
throws MojoExecutionException
{
File parentFile = pomFile.getParentFile();
if ( !parentFile.exists() )
{
boolean success = parentFile.mkdirs();
if ( !success )
{
... | [
"protected",
"void",
"writePom",
"(",
"Model",
"pom",
",",
"File",
"pomFile",
",",
"String",
"headerComment",
")",
"throws",
"MojoExecutionException",
"{",
"File",
"parentFile",
"=",
"pomFile",
".",
"getParentFile",
"(",
")",
";",
"if",
"(",
"!",
"parentFile",... | Writes the given POM {@link Model} to the given {@link File}.
@param pom the {@link Model} of the POM to write.
@param pomFile the {@link File} where to write the given POM will be written to. {@link File#getParentFile()
Parent directories} are {@link File#mkdirs() created} automatically.
@param headerComment is the c... | [
"Writes",
"the",
"given",
"POM",
"{",
"@link",
"Model",
"}",
"to",
"the",
"given",
"{",
"@link",
"File",
"}",
"."
] | train | https://github.com/mojohaus/flatten-maven-plugin/blob/df25d03a4d6c06c4de5cfd9f52dfbe72e823e403/src/main/java/org/codehaus/mojo/flatten/FlattenMojo.java#L384-L423 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ProjectApi.java | ProjectApi.createPushRules | public PushRules createPushRules(Object projectIdOrPath, PushRules pushRule) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("deny_delete_tag", pushRule.getDenyDeleteTag())
.withParam("member_check", pushRule.getMemberCheck())
.withParam("p... | java | public PushRules createPushRules(Object projectIdOrPath, PushRules pushRule) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("deny_delete_tag", pushRule.getDenyDeleteTag())
.withParam("member_check", pushRule.getMemberCheck())
.withParam("p... | [
"public",
"PushRules",
"createPushRules",
"(",
"Object",
"projectIdOrPath",
",",
"PushRules",
"pushRule",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"=",
"new",
"GitLabApiForm",
"(",
")",
".",
"withParam",
"(",
"\"deny_delete_tag\"",
",",
... | Adds a push rule to a specified project.
<pre><code>POST /projects/:id/push_rule</code></pre>
The following properties on the PushRules instance are utilized in the creation of the push rule:
<code>
denyDeleteTag (optional) - Deny deleting a tag
memberCheck (optional) - Restrict commits by author (email) to existing... | [
"Adds",
"a",
"push",
"rule",
"to",
"a",
"specified",
"project",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ProjectApi.java#L2202-L2215 |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/config/BigtableVeneerSettingsFactory.java | BigtableVeneerSettingsFactory.buildReadRowsSettings | private static void buildReadRowsSettings(Builder builder, BigtableOptions options) {
RetryOptions retryOptions = options.getRetryOptions();
CallOptionsConfig callOptions = options.getCallOptionsConfig();
RetrySettings.Builder retryBuilder = builder.readRowsSettings().getRetrySettings().toBuilder();
//... | java | private static void buildReadRowsSettings(Builder builder, BigtableOptions options) {
RetryOptions retryOptions = options.getRetryOptions();
CallOptionsConfig callOptions = options.getCallOptionsConfig();
RetrySettings.Builder retryBuilder = builder.readRowsSettings().getRetrySettings().toBuilder();
//... | [
"private",
"static",
"void",
"buildReadRowsSettings",
"(",
"Builder",
"builder",
",",
"BigtableOptions",
"options",
")",
"{",
"RetryOptions",
"retryOptions",
"=",
"options",
".",
"getRetryOptions",
"(",
")",
";",
"CallOptionsConfig",
"callOptions",
"=",
"options",
"... | To build BigtableDataSettings#readRowsSettings with default Retry settings. | [
"To",
"build",
"BigtableDataSettings#readRowsSettings",
"with",
"default",
"Retry",
"settings",
"."
] | train | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/config/BigtableVeneerSettingsFactory.java#L234-L257 |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java | GroupHandlerImpl.writeGroup | private void writeGroup(Group group, Node node) throws OrganizationServiceException
{
try
{
node.setProperty(GroupProperties.JOS_LABEL, group.getLabel());
node.setProperty(GroupProperties.JOS_DESCRIPTION, group.getDescription());
}
catch (RepositoryException e)
{
... | java | private void writeGroup(Group group, Node node) throws OrganizationServiceException
{
try
{
node.setProperty(GroupProperties.JOS_LABEL, group.getLabel());
node.setProperty(GroupProperties.JOS_DESCRIPTION, group.getDescription());
}
catch (RepositoryException e)
{
... | [
"private",
"void",
"writeGroup",
"(",
"Group",
"group",
",",
"Node",
"node",
")",
"throws",
"OrganizationServiceException",
"{",
"try",
"{",
"node",
".",
"setProperty",
"(",
"GroupProperties",
".",
"JOS_LABEL",
",",
"group",
".",
"getLabel",
"(",
")",
")",
"... | Write group properties to the node.
@param groupNode
the node where group properties are stored
@return {@link Group}
@throws OrganizationServiceException
if unexpected exception is occurred during writing | [
"Write",
"group",
"properties",
"to",
"the",
"node",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/GroupHandlerImpl.java#L497-L508 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.