repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
EclairJS/eclairjs-nashorn | src/main/java/org/eclairjs/nashorn/Utils.java | Utils.zipFile | @SuppressWarnings( {
"""
Zip up all files (or those that match filesToInclude[]) under a directory into a zipfile with the given name.
@param folderToZip {String} folder containing files to zip
@param zipFile {String} zipfile name for destination
@param filesToInclude {String[]} files to include - if omitted ev... | java | @SuppressWarnings({ "rawtypes", "unchecked" })
public static void zipFile(String folderToZip, String zipFile, String[] filesToInclude)
throws FileNotFoundException, IOException {
Logger logger = Logger.getLogger(Utils.class);
logger.debug("zipFile: "+folderToZip);
ZipOutputStream zi... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"public",
"static",
"void",
"zipFile",
"(",
"String",
"folderToZip",
",",
"String",
"zipFile",
",",
"String",
"[",
"]",
"filesToInclude",
")",
"throws",
"FileNotFoundException",
"... | Zip up all files (or those that match filesToInclude[]) under a directory into a zipfile with the given name.
@param folderToZip {String} folder containing files to zip
@param zipFile {String} zipfile name for destination
@param filesToInclude {String[]} files to include - if omitted everything under folder will be zip... | [
"Zip",
"up",
"all",
"files",
"(",
"or",
"those",
"that",
"match",
"filesToInclude",
"[]",
")",
"under",
"a",
"directory",
"into",
"a",
"zipfile",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/EclairJS/eclairjs-nashorn/blob/6723b80d5a7b0c97fd72eb1bcd5c0fa46b493080/src/main/java/org/eclairjs/nashorn/Utils.java#L421-L442 |
jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/orm/Mapping.java | Mapping.deleteById | public void deleteById(Object id) {
"""
Deletes an entity by its primary key.
@param id
Primary key of the entity.
"""
int count = beginDelete().whereEquals(idColumn.getColumnName(), id).delete();
if (count == 0) {
throw new RowNotFoundException(table, id);
}
} | java | public void deleteById(Object id) {
int count = beginDelete().whereEquals(idColumn.getColumnName(), id).delete();
if (count == 0) {
throw new RowNotFoundException(table, id);
}
} | [
"public",
"void",
"deleteById",
"(",
"Object",
"id",
")",
"{",
"int",
"count",
"=",
"beginDelete",
"(",
")",
".",
"whereEquals",
"(",
"idColumn",
".",
"getColumnName",
"(",
")",
",",
"id",
")",
".",
"delete",
"(",
")",
";",
"if",
"(",
"count",
"==",
... | Deletes an entity by its primary key.
@param id
Primary key of the entity. | [
"Deletes",
"an",
"entity",
"by",
"its",
"primary",
"key",
"."
] | train | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/orm/Mapping.java#L363-L370 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/dependency/Evidence.java | Evidence.compareToIgnoreCaseWithNullCheck | private int compareToIgnoreCaseWithNullCheck(String me, String other) {
"""
Wrapper around
{@link java.lang.String#compareToIgnoreCase(java.lang.String) String.compareToIgnoreCase}
with an exhaustive, possibly duplicative, check against nulls.
@param me the value to be compared
@param other the other value t... | java | private int compareToIgnoreCaseWithNullCheck(String me, String other) {
if (me == null && other == null) {
return 0;
} else if (me == null) {
return -1; //the other string is greater than me
} else if (other == null) {
return 1; //me is greater than the other ... | [
"private",
"int",
"compareToIgnoreCaseWithNullCheck",
"(",
"String",
"me",
",",
"String",
"other",
")",
"{",
"if",
"(",
"me",
"==",
"null",
"&&",
"other",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"else",
"if",
"(",
"me",
"==",
"null",
")",
"{... | Wrapper around
{@link java.lang.String#compareToIgnoreCase(java.lang.String) String.compareToIgnoreCase}
with an exhaustive, possibly duplicative, check against nulls.
@param me the value to be compared
@param other the other value to be compared
@return true if the values are equal; otherwise false | [
"Wrapper",
"around",
"{",
"@link",
"java",
".",
"lang",
".",
"String#compareToIgnoreCase",
"(",
"java",
".",
"lang",
".",
"String",
")",
"String",
".",
"compareToIgnoreCase",
"}",
"with",
"an",
"exhaustive",
"possibly",
"duplicative",
"check",
"against",
"nulls"... | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/dependency/Evidence.java#L243-L252 |
undertow-io/undertow | servlet/src/main/java/io/undertow/servlet/api/DeploymentInfo.java | DeploymentInfo.addLastAuthenticationMechanism | public DeploymentInfo addLastAuthenticationMechanism(final String name, final AuthenticationMechanism mechanism) {
"""
Adds an authentication mechanism directly to the deployment. This mechanism will be last in the list.
In general you should just use {@link #addAuthenticationMechanism(String, io.undertow.secur... | java | public DeploymentInfo addLastAuthenticationMechanism(final String name, final AuthenticationMechanism mechanism) {
authenticationMechanisms.put(name, new ImmediateAuthenticationMechanismFactory(mechanism));
if(loginConfig == null) {
loginConfig = new LoginConfig(null);
}
logi... | [
"public",
"DeploymentInfo",
"addLastAuthenticationMechanism",
"(",
"final",
"String",
"name",
",",
"final",
"AuthenticationMechanism",
"mechanism",
")",
"{",
"authenticationMechanisms",
".",
"put",
"(",
"name",
",",
"new",
"ImmediateAuthenticationMechanismFactory",
"(",
"... | Adds an authentication mechanism directly to the deployment. This mechanism will be last in the list.
In general you should just use {@link #addAuthenticationMechanism(String, io.undertow.security.api.AuthenticationMechanismFactory)}
and allow the user to configure the methods they want by name.
This method is essent... | [
"Adds",
"an",
"authentication",
"mechanism",
"directly",
"to",
"the",
"deployment",
".",
"This",
"mechanism",
"will",
"be",
"last",
"in",
"the",
"list",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/servlet/src/main/java/io/undertow/servlet/api/DeploymentInfo.java#L1031-L1038 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/Response.java | Response.andHeader | public Response andHeader(HttpString key, String value) {
"""
Adds an additional header to the request response. If an header
key already exists, it will we overwritten with the latest value.
@param key The header constant from Headers class (e.g. Header.CONTENT_TYPE.toString())
@param value The header value
... | java | public Response andHeader(HttpString key, String value) {
Objects.requireNonNull(key, Required.KEY.toString());
this.headers.put(key, value);
return this;
} | [
"public",
"Response",
"andHeader",
"(",
"HttpString",
"key",
",",
"String",
"value",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"key",
",",
"Required",
".",
"KEY",
".",
"toString",
"(",
")",
")",
";",
"this",
".",
"headers",
".",
"put",
"(",
"key... | Adds an additional header to the request response. If an header
key already exists, it will we overwritten with the latest value.
@param key The header constant from Headers class (e.g. Header.CONTENT_TYPE.toString())
@param value The header value
@return A response object {@link io.mangoo.routing.Response} | [
"Adds",
"an",
"additional",
"header",
"to",
"the",
"request",
"response",
".",
"If",
"an",
"header",
"key",
"already",
"exists",
"it",
"will",
"we",
"overwritten",
"with",
"the",
"latest",
"value",
"."
] | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/Response.java#L411-L416 |
prolificinteractive/material-calendarview | library/src/main/java/com/prolificinteractive/materialcalendarview/MaterialCalendarView.java | MaterialCalendarView.onDateClicked | protected void onDateClicked(@NonNull CalendarDay date, boolean nowSelected) {
"""
Call by {@link CalendarPagerView} to indicate that a day was clicked and we should handle it.
This method will always process the click to the selected date.
@param date date of the day that was clicked
@param nowSelected true ... | java | protected void onDateClicked(@NonNull CalendarDay date, boolean nowSelected) {
switch (selectionMode) {
case SELECTION_MODE_MULTIPLE: {
adapter.setDateSelected(date, nowSelected);
dispatchOnDateSelected(date, nowSelected);
}
break;
case SELECTION_MODE_RANGE: {
final L... | [
"protected",
"void",
"onDateClicked",
"(",
"@",
"NonNull",
"CalendarDay",
"date",
",",
"boolean",
"nowSelected",
")",
"{",
"switch",
"(",
"selectionMode",
")",
"{",
"case",
"SELECTION_MODE_MULTIPLE",
":",
"{",
"adapter",
".",
"setDateSelected",
"(",
"date",
",",... | Call by {@link CalendarPagerView} to indicate that a day was clicked and we should handle it.
This method will always process the click to the selected date.
@param date date of the day that was clicked
@param nowSelected true if the date is now selected, false otherwise | [
"Call",
"by",
"{",
"@link",
"CalendarPagerView",
"}",
"to",
"indicate",
"that",
"a",
"day",
"was",
"clicked",
"and",
"we",
"should",
"handle",
"it",
".",
"This",
"method",
"will",
"always",
"process",
"the",
"click",
"to",
"the",
"selected",
"date",
"."
] | train | https://github.com/prolificinteractive/material-calendarview/blob/04fae8175fd034d0a7131f8cb253cae883a88aa2/library/src/main/java/com/prolificinteractive/materialcalendarview/MaterialCalendarView.java#L1397-L1443 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/restricted/Expression.java | Expression.invokeVoid | public Statement invokeVoid(MethodRef method, Expression... args) {
"""
A simple helper that calls through to {@link MethodRef#invokeVoid(Expression...)}, but allows a
more natural fluent call style.
"""
return method.invokeVoid(ImmutableList.<Expression>builder().add(this).add(args).build());
} | java | public Statement invokeVoid(MethodRef method, Expression... args) {
return method.invokeVoid(ImmutableList.<Expression>builder().add(this).add(args).build());
} | [
"public",
"Statement",
"invokeVoid",
"(",
"MethodRef",
"method",
",",
"Expression",
"...",
"args",
")",
"{",
"return",
"method",
".",
"invokeVoid",
"(",
"ImmutableList",
".",
"<",
"Expression",
">",
"builder",
"(",
")",
".",
"add",
"(",
"this",
")",
".",
... | A simple helper that calls through to {@link MethodRef#invokeVoid(Expression...)}, but allows a
more natural fluent call style. | [
"A",
"simple",
"helper",
"that",
"calls",
"through",
"to",
"{"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/Expression.java#L392-L394 |
apache/groovy | src/main/java/org/codehaus/groovy/control/ClassNodeResolver.java | ClassNodeResolver.tryAsLoaderClassOrScript | private LookupResult tryAsLoaderClassOrScript(String name, CompilationUnit compilationUnit) {
"""
This method is used to realize the lookup of a class using the compilation
unit class loader. Should no class be found we fall back to a script lookup.
If a class is found we check if there is also a script and mayb... | java | private LookupResult tryAsLoaderClassOrScript(String name, CompilationUnit compilationUnit) {
GroovyClassLoader loader = compilationUnit.getClassLoader();
Map<String, Boolean> options = compilationUnit.configuration.getOptimizationOptions();
boolean useAsm = !Boolean.FALSE.equals(options.get("a... | [
"private",
"LookupResult",
"tryAsLoaderClassOrScript",
"(",
"String",
"name",
",",
"CompilationUnit",
"compilationUnit",
")",
"{",
"GroovyClassLoader",
"loader",
"=",
"compilationUnit",
".",
"getClassLoader",
"(",
")",
";",
"Map",
"<",
"String",
",",
"Boolean",
">",... | This method is used to realize the lookup of a class using the compilation
unit class loader. Should no class be found we fall back to a script lookup.
If a class is found we check if there is also a script and maybe use that
one in case it is newer.<p/>
Two class search strategies are possible: by ASM decompilation o... | [
"This",
"method",
"is",
"used",
"to",
"realize",
"the",
"lookup",
"of",
"a",
"class",
"using",
"the",
"compilation",
"unit",
"class",
"loader",
".",
"Should",
"no",
"class",
"be",
"found",
"we",
"fall",
"back",
"to",
"a",
"script",
"lookup",
".",
"If",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/control/ClassNodeResolver.java#L182-L199 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/NameUtil.java | NameUtil.getHomeLocalImplClassName | public static String getHomeLocalImplClassName(EnterpriseBean enterpriseBean, boolean isPost11DD) // d114199 {
"""
Return the name of the deployed class that implements the local home
interface of the bean. <p>
@param enterpriseBean bean impl class
@param isPost11DD true if bean is defined using later than 1.... | java | public static String getHomeLocalImplClassName(EnterpriseBean enterpriseBean, boolean isPost11DD) // d114199
{
String homeLocalInterfaceName = getLocalHomeInterfaceName(enterpriseBean);
if (homeLocalInterfaceName == null) {
return null;
}
String localInterfaceName = getL... | [
"public",
"static",
"String",
"getHomeLocalImplClassName",
"(",
"EnterpriseBean",
"enterpriseBean",
",",
"boolean",
"isPost11DD",
")",
"// d114199",
"{",
"String",
"homeLocalInterfaceName",
"=",
"getLocalHomeInterfaceName",
"(",
"enterpriseBean",
")",
";",
"if",
"(",
"h... | Return the name of the deployed class that implements the local home
interface of the bean. <p>
@param enterpriseBean bean impl class
@param isPost11DD true if bean is defined using later than 1.1 deployment description. | [
"Return",
"the",
"name",
"of",
"the",
"deployed",
"class",
"that",
"implements",
"the",
"local",
"home",
"interface",
"of",
"the",
"bean",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/NameUtil.java#L307-L328 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/MPP8Reader.java | MPP8Reader.updateBaseCalendarNames | private void updateBaseCalendarNames(List<Pair<ProjectCalendar, Integer>> baseCalendars) {
"""
The way calendars are stored in an MPP8 file means that there
can be forward references between the base calendar unique ID for a
derived calendar, and the base calendar itself. To get around this,
we initially popula... | java | private void updateBaseCalendarNames(List<Pair<ProjectCalendar, Integer>> baseCalendars)
{
for (Pair<ProjectCalendar, Integer> pair : baseCalendars)
{
ProjectCalendar cal = pair.getFirst();
Integer baseCalendarID = pair.getSecond();
ProjectCalendar baseCal = m_calendarMap.get(b... | [
"private",
"void",
"updateBaseCalendarNames",
"(",
"List",
"<",
"Pair",
"<",
"ProjectCalendar",
",",
"Integer",
">",
">",
"baseCalendars",
")",
"{",
"for",
"(",
"Pair",
"<",
"ProjectCalendar",
",",
"Integer",
">",
"pair",
":",
"baseCalendars",
")",
"{",
"Pro... | The way calendars are stored in an MPP8 file means that there
can be forward references between the base calendar unique ID for a
derived calendar, and the base calendar itself. To get around this,
we initially populate the base calendar name attribute with the
base calendar unique ID, and now in this method we can con... | [
"The",
"way",
"calendars",
"are",
"stored",
"in",
"an",
"MPP8",
"file",
"means",
"that",
"there",
"can",
"be",
"forward",
"references",
"between",
"the",
"base",
"calendar",
"unique",
"ID",
"for",
"a",
"derived",
"calendar",
"and",
"the",
"base",
"calendar",... | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPP8Reader.java#L374-L386 |
unbescape/unbescape | src/main/java/org/unbescape/uri/UriEscape.java | UriEscape.escapeUriPathSegment | public static void escapeUriPathSegment(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
"""
<p>
Perform am URI path segment <strong>escape</strong> operation
on a <tt>char[]</tt> input using <tt>UTF-8</tt> as encoding.
<... | java | public static void escapeUriPathSegment(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
escapeUriPathSegment(text, offset, len, writer, DEFAULT_ENCODING);
} | [
"public",
"static",
"void",
"escapeUriPathSegment",
"(",
"final",
"char",
"[",
"]",
"text",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"len",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeUriPathSegment",
"(",
"text",
"... | <p>
Perform am URI path segment <strong>escape</strong> operation
on a <tt>char[]</tt> input using <tt>UTF-8</tt> as encoding.
</p>
<p>
The following are the only allowed chars in an URI path segment (will not be escaped):
</p>
<ul>
<li><tt>A-Z a-z 0-9</tt></li>
<li><tt>- . _ ~</tt></li>
<li><tt>! $ & ' ( ) * + , ;... | [
"<p",
">",
"Perform",
"am",
"URI",
"path",
"segment",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"char",
"[]",
"<",
"/",
"tt",
">",
"input",
"using",
"<tt",
">",
"UTF",
"-",
"8<",
"/",
"tt",
">",
"as",
"enc... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L1243-L1246 |
phax/ph-commons | ph-security/src/main/java/com/helger/security/keystore/KeyStoreHelper.java | KeyStoreHelper.loadKeyStore | @Nonnull
public static LoadedKeyStore loadKeyStore (@Nonnull final IKeyStoreType aKeyStoreType,
@Nullable final String sKeyStorePath,
@Nullable final String sKeyStorePassword) {
"""
Load the provided key store in a safe man... | java | @Nonnull
public static LoadedKeyStore loadKeyStore (@Nonnull final IKeyStoreType aKeyStoreType,
@Nullable final String sKeyStorePath,
@Nullable final String sKeyStorePassword)
{
ValueEnforcer.notNull (aKeyStoreType, "KeySt... | [
"@",
"Nonnull",
"public",
"static",
"LoadedKeyStore",
"loadKeyStore",
"(",
"@",
"Nonnull",
"final",
"IKeyStoreType",
"aKeyStoreType",
",",
"@",
"Nullable",
"final",
"String",
"sKeyStorePath",
",",
"@",
"Nullable",
"final",
"String",
"sKeyStorePassword",
")",
"{",
... | Load the provided key store in a safe manner.
@param aKeyStoreType
Type of key store. May not be <code>null</code>.
@param sKeyStorePath
Path to the key store. May not be <code>null</code> to succeed.
@param sKeyStorePassword
Password for the key store. May not be <code>null</code> to succeed.
@return The key store lo... | [
"Load",
"the",
"provided",
"key",
"store",
"in",
"a",
"safe",
"manner",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-security/src/main/java/com/helger/security/keystore/KeyStoreHelper.java#L214-L258 |
wildfly/wildfly-core | server/src/main/java/org/jboss/as/server/mgmt/domain/HostControllerConnection.java | HostControllerConnection.openConnection | synchronized void openConnection(final ModelController controller, final ActiveOperation.CompletedCallback<ModelNode> callback) throws Exception {
"""
Connect to the HC and retrieve the current model updates.
@param controller the server controller
@param callback the operation completed callback
@throws IO... | java | synchronized void openConnection(final ModelController controller, final ActiveOperation.CompletedCallback<ModelNode> callback) throws Exception {
boolean ok = false;
final Connection connection = connectionManager.connect();
try {
channelHandler.executeRequest(new ServerRegisterRequ... | [
"synchronized",
"void",
"openConnection",
"(",
"final",
"ModelController",
"controller",
",",
"final",
"ActiveOperation",
".",
"CompletedCallback",
"<",
"ModelNode",
">",
"callback",
")",
"throws",
"Exception",
"{",
"boolean",
"ok",
"=",
"false",
";",
"final",
"Co... | Connect to the HC and retrieve the current model updates.
@param controller the server controller
@param callback the operation completed callback
@throws IOException for any error | [
"Connect",
"to",
"the",
"HC",
"and",
"retrieve",
"the",
"current",
"model",
"updates",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/mgmt/domain/HostControllerConnection.java#L126-L141 |
HotelsDotCom/corc | corc-core/src/main/java/com/hotels/corc/mapred/CorcInputFormat.java | CorcInputFormat.getOrcAtomicRowColumnId | static private int getOrcAtomicRowColumnId() {
"""
/* This ugliness can go when the column id can be referenced from a public place.
"""
try {
Field rowField = OrcRecordUpdater.class.getDeclaredField("ROW");
rowField.setAccessible(true);
int rowId = (int) rowField.get(null);
rowFiel... | java | static private int getOrcAtomicRowColumnId() {
try {
Field rowField = OrcRecordUpdater.class.getDeclaredField("ROW");
rowField.setAccessible(true);
int rowId = (int) rowField.get(null);
rowField.setAccessible(false);
return rowId;
} catch (NoSuchFieldException | SecurityException |... | [
"static",
"private",
"int",
"getOrcAtomicRowColumnId",
"(",
")",
"{",
"try",
"{",
"Field",
"rowField",
"=",
"OrcRecordUpdater",
".",
"class",
".",
"getDeclaredField",
"(",
"\"ROW\"",
")",
";",
"rowField",
".",
"setAccessible",
"(",
"true",
")",
";",
"int",
"... | /* This ugliness can go when the column id can be referenced from a public place. | [
"/",
"*",
"This",
"ugliness",
"can",
"go",
"when",
"the",
"column",
"id",
"can",
"be",
"referenced",
"from",
"a",
"public",
"place",
"."
] | train | https://github.com/HotelsDotCom/corc/blob/37ecb5966315e4cf630a878ffcbada61c50bdcd3/corc-core/src/main/java/com/hotels/corc/mapred/CorcInputFormat.java#L293-L304 |
VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java | ComponentExposedTypeGenerator.initFieldsValues | private void initFieldsValues(TypeElement component, MethodSpec.Builder createdMethodBuilder) {
"""
Init fields at creation by using an instance of the Java class
@param component {@link IsVueComponent} to process
@param createdMethodBuilder Builder for our Create method
"""
// Do not init instance fie... | java | private void initFieldsValues(TypeElement component, MethodSpec.Builder createdMethodBuilder) {
// Do not init instance fields for abstract components
if (component.getModifiers().contains(Modifier.ABSTRACT)) {
return;
}
createdMethodBuilder.addStatement(
"$T.initComponentInstanceFields(t... | [
"private",
"void",
"initFieldsValues",
"(",
"TypeElement",
"component",
",",
"MethodSpec",
".",
"Builder",
"createdMethodBuilder",
")",
"{",
"// Do not init instance fields for abstract components",
"if",
"(",
"component",
".",
"getModifiers",
"(",
")",
".",
"contains",
... | Init fields at creation by using an instance of the Java class
@param component {@link IsVueComponent} to process
@param createdMethodBuilder Builder for our Create method | [
"Init",
"fields",
"at",
"creation",
"by",
"using",
"an",
"instance",
"of",
"the",
"Java",
"class"
] | train | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java#L736-L746 |
virgo47/javasimon | core/src/main/java/org/javasimon/callback/timeline/TimelineCallback.java | TimelineCallback.onSimonCreated | @Override
public void onSimonCreated(Simon simon) {
"""
On simon creation a timeline attribute is added (for Stopwatches only).
@param simon created simon
"""
if (simon instanceof Stopwatch) {
simon.setAttribute(timelineAttributeName, new StopwatchTimeline(timelineCapacity, timeRangeWidth));
}
} | java | @Override
public void onSimonCreated(Simon simon) {
if (simon instanceof Stopwatch) {
simon.setAttribute(timelineAttributeName, new StopwatchTimeline(timelineCapacity, timeRangeWidth));
}
} | [
"@",
"Override",
"public",
"void",
"onSimonCreated",
"(",
"Simon",
"simon",
")",
"{",
"if",
"(",
"simon",
"instanceof",
"Stopwatch",
")",
"{",
"simon",
".",
"setAttribute",
"(",
"timelineAttributeName",
",",
"new",
"StopwatchTimeline",
"(",
"timelineCapacity",
"... | On simon creation a timeline attribute is added (for Stopwatches only).
@param simon created simon | [
"On",
"simon",
"creation",
"a",
"timeline",
"attribute",
"is",
"added",
"(",
"for",
"Stopwatches",
"only",
")",
"."
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/callback/timeline/TimelineCallback.java#L77-L82 |
geomajas/geomajas-project-client-gwt | common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java | HtmlBuilder.tagClass | public static String tagClass(String tag, String clazz, String... content) {
"""
Build a String containing a HTML opening tag with given CSS class, content and closing tag.
Content should contain no HTML, because it is prepared with {@link #htmlEncode(String)}.
@param tag String name of HTML tag
@param clazz ... | java | public static String tagClass(String tag, String clazz, String... content) {
return openTagClass(tag, clazz, content) + closeTag(tag);
} | [
"public",
"static",
"String",
"tagClass",
"(",
"String",
"tag",
",",
"String",
"clazz",
",",
"String",
"...",
"content",
")",
"{",
"return",
"openTagClass",
"(",
"tag",
",",
"clazz",
",",
"content",
")",
"+",
"closeTag",
"(",
"tag",
")",
";",
"}"
] | Build a String containing a HTML opening tag with given CSS class, content and closing tag.
Content should contain no HTML, because it is prepared with {@link #htmlEncode(String)}.
@param tag String name of HTML tag
@param clazz CSS class of the tag
@param content content string
@return HTML tag element as string | [
"Build",
"a",
"String",
"containing",
"a",
"HTML",
"opening",
"tag",
"with",
"given",
"CSS",
"class",
"content",
"and",
"closing",
"tag",
".",
"Content",
"should",
"contain",
"no",
"HTML",
"because",
"it",
"is",
"prepared",
"with",
"{",
"@link",
"#htmlEncode... | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L301-L303 |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java | InternalService.queryProfiles | public Observable<ComapiResult<List<Map<String, Object>>>> queryProfiles(@NonNull final String queryString) {
"""
Query user profiles on the services.
@param queryString Query string. See https://www.npmjs.com/package/mongo-querystring for query syntax. You can use {@link QueryBuilder} helper class to construct... | java | public Observable<ComapiResult<List<Map<String, Object>>>> queryProfiles(@NonNull final String queryString) {
final String token = getToken();
if (sessionController.isCreatingSession()) {
return getTaskQueue().queueQueryProfiles(queryString);
} else if (TextUtils.isEmpty(token)) {
... | [
"public",
"Observable",
"<",
"ComapiResult",
"<",
"List",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
">",
">",
"queryProfiles",
"(",
"@",
"NonNull",
"final",
"String",
"queryString",
")",
"{",
"final",
"String",
"token",
"=",
"getToken",
"(",
")... | Query user profiles on the services.
@param queryString Query string. See https://www.npmjs.com/package/mongo-querystring for query syntax. You can use {@link QueryBuilder} helper class to construct valid query string.
@return Profiles detail from the service. | [
"Query",
"user",
"profiles",
"on",
"the",
"services",
"."
] | train | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java#L289-L300 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/activerecord/Db.java | Db.tx | static boolean tx(Config config, int transactionLevel, IAtom atom) {
"""
Execute transaction.
@param config the Config object
@param transactionLevel the transaction level
@param atom the atom operation
@return true if transaction executing succeed otherwise false
"""
return MAIN.tx(config, transactionL... | java | static boolean tx(Config config, int transactionLevel, IAtom atom) {
return MAIN.tx(config, transactionLevel, atom);
} | [
"static",
"boolean",
"tx",
"(",
"Config",
"config",
",",
"int",
"transactionLevel",
",",
"IAtom",
"atom",
")",
"{",
"return",
"MAIN",
".",
"tx",
"(",
"config",
",",
"transactionLevel",
",",
"atom",
")",
";",
"}"
] | Execute transaction.
@param config the Config object
@param transactionLevel the transaction level
@param atom the atom operation
@return true if transaction executing succeed otherwise false | [
"Execute",
"transaction",
"."
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/Db.java#L532-L534 |
actorapp/actor-platform | actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java | Messenger.changeGroupAvatar | @ObjectiveCName("changeGroupAvatarWithGid:withDescriptor:")
public void changeGroupAvatar(int gid, String descriptor) {
"""
Change group avatar
@param gid group's id
@param descriptor descriptor of avatar file
"""
modules.getGroupsModule().changeAvatar(gid, descriptor);
} | java | @ObjectiveCName("changeGroupAvatarWithGid:withDescriptor:")
public void changeGroupAvatar(int gid, String descriptor) {
modules.getGroupsModule().changeAvatar(gid, descriptor);
} | [
"@",
"ObjectiveCName",
"(",
"\"changeGroupAvatarWithGid:withDescriptor:\"",
")",
"public",
"void",
"changeGroupAvatar",
"(",
"int",
"gid",
",",
"String",
"descriptor",
")",
"{",
"modules",
".",
"getGroupsModule",
"(",
")",
".",
"changeAvatar",
"(",
"gid",
",",
"de... | Change group avatar
@param gid group's id
@param descriptor descriptor of avatar file | [
"Change",
"group",
"avatar"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java#L1523-L1526 |
jcustenborder/connect-utils | connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java | Validators.validKeyStoreType | public static Validator validKeyStoreType() {
"""
Validator is used to ensure that the KeyStore type specified is valid.
@return
"""
return (s, o) -> {
if (!(o instanceof String)) {
throw new ConfigException(s, o, "Must be a string.");
}
String keyStoreType = o.toString();
... | java | public static Validator validKeyStoreType() {
return (s, o) -> {
if (!(o instanceof String)) {
throw new ConfigException(s, o, "Must be a string.");
}
String keyStoreType = o.toString();
try {
KeyStore.getInstance(keyStoreType);
} catch (KeyStoreException e) {
... | [
"public",
"static",
"Validator",
"validKeyStoreType",
"(",
")",
"{",
"return",
"(",
"s",
",",
"o",
")",
"->",
"{",
"if",
"(",
"!",
"(",
"o",
"instanceof",
"String",
")",
")",
"{",
"throw",
"new",
"ConfigException",
"(",
"s",
",",
"o",
",",
"\"Must be... | Validator is used to ensure that the KeyStore type specified is valid.
@return | [
"Validator",
"is",
"used",
"to",
"ensure",
"that",
"the",
"KeyStore",
"type",
"specified",
"is",
"valid",
"."
] | train | https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java#L190-L205 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/ui/CmsCategoriesTab.java | CmsCategoriesTab.updateContentList | public void updateContentList(List<CmsCategoryBean> categoriesBeans, List<String> selectedCategories) {
"""
Updates the content of the categories list.<p>
@param categoriesBeans the updates list of categories tree item beans
@param selectedCategories the categories to select in the list by update
"""
... | java | public void updateContentList(List<CmsCategoryBean> categoriesBeans, List<String> selectedCategories) {
clearList();
if (m_categories == null) {
m_categories = new HashMap<String, CmsCategoryBean>();
}
if ((categoriesBeans != null) && !categoriesBeans.isEmpty()) {
... | [
"public",
"void",
"updateContentList",
"(",
"List",
"<",
"CmsCategoryBean",
">",
"categoriesBeans",
",",
"List",
"<",
"String",
">",
"selectedCategories",
")",
"{",
"clearList",
"(",
")",
";",
"if",
"(",
"m_categories",
"==",
"null",
")",
"{",
"m_categories",
... | Updates the content of the categories list.<p>
@param categoriesBeans the updates list of categories tree item beans
@param selectedCategories the categories to select in the list by update | [
"Updates",
"the",
"content",
"of",
"the",
"categories",
"list",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/ui/CmsCategoriesTab.java#L211-L247 |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/FormatUtilities.java | FormatUtilities.getFormattedTime | static public String getFormattedTime(long dt, String format, boolean isTime) {
"""
Returns the given time parsed using "HH:mm:ss".
@param dt The time to be parsed
@param format The format to use when parsing the date
@param isTime <CODE>true</CODE> if the given time has a timezone
@return The given time parse... | java | static public String getFormattedTime(long dt, String format, boolean isTime)
{
String ret = "";
SimpleDateFormat df = null;
try
{
if(dt > 0)
{
df = formatPool.getFormat(format);
if(isTime)
df.setTimeZone(Da... | [
"static",
"public",
"String",
"getFormattedTime",
"(",
"long",
"dt",
",",
"String",
"format",
",",
"boolean",
"isTime",
")",
"{",
"String",
"ret",
"=",
"\"\"",
";",
"SimpleDateFormat",
"df",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"dt",
">",
"0",
")",... | Returns the given time parsed using "HH:mm:ss".
@param dt The time to be parsed
@param format The format to use when parsing the date
@param isTime <CODE>true</CODE> if the given time has a timezone
@return The given time parsed using "HH:mm:ss" | [
"Returns",
"the",
"given",
"time",
"parsed",
"using",
"HH",
":",
"mm",
":",
"ss",
"."
] | train | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/FormatUtilities.java#L392-L417 |
nutzam/nutzboot | nutzboot-starter/nutzboot-starter-fastdfs/src/main/java/org/nutz/boot/starter/fastdfs/FastdfsService.java | FastdfsService.getToken | private String getToken(String filename, long timestamp, String secret_key) throws Exception {
"""
获取Token
@param filename 文件名
@param timestamp 时间戳
@param secret_key 密钥
@return
@throws Exception
"""
byte[] bsFilename = filename.getBytes(conf.get(PROP_CHARSET, "UTF-8"));
byte[] bsKey =... | java | private String getToken(String filename, long timestamp, String secret_key) throws Exception {
byte[] bsFilename = filename.getBytes(conf.get(PROP_CHARSET, "UTF-8"));
byte[] bsKey = secret_key.getBytes(conf.get(PROP_CHARSET, "UTF-8"));
byte[] bsTimestamp = (new Long(timestamp)).toString().getByt... | [
"private",
"String",
"getToken",
"(",
"String",
"filename",
",",
"long",
"timestamp",
",",
"String",
"secret_key",
")",
"throws",
"Exception",
"{",
"byte",
"[",
"]",
"bsFilename",
"=",
"filename",
".",
"getBytes",
"(",
"conf",
".",
"get",
"(",
"PROP_CHARSET"... | 获取Token
@param filename 文件名
@param timestamp 时间戳
@param secret_key 密钥
@return
@throws Exception | [
"获取Token"
] | train | https://github.com/nutzam/nutzboot/blob/fd33fd4fdce058eab594f28e4d3202f997e3c66a/nutzboot-starter/nutzboot-starter-fastdfs/src/main/java/org/nutz/boot/starter/fastdfs/FastdfsService.java#L156-L165 |
realtime-framework/RealtimeStorage-Android | library/src/main/java/co/realtime/storage/TableRef.java | TableRef.greaterThan | public TableRef greaterThan(String attributeName, ItemAttribute value) {
"""
Applies a filter to the table. When fetched, it will return the items greater than the filter property value.
<pre>
StorageRef storage = new StorageRef("your_app_key", "your_token");
TableRef tableRef = storage.table("your_table");... | java | public TableRef greaterThan(String attributeName, ItemAttribute value){
filters.add(new Filter(StorageFilter.GREATERTHAN, attributeName, value, null));
return this;
} | [
"public",
"TableRef",
"greaterThan",
"(",
"String",
"attributeName",
",",
"ItemAttribute",
"value",
")",
"{",
"filters",
".",
"add",
"(",
"new",
"Filter",
"(",
"StorageFilter",
".",
"GREATERTHAN",
",",
"attributeName",
",",
"value",
",",
"null",
")",
")",
";... | Applies a filter to the table. When fetched, it will return the items greater than the filter property value.
<pre>
StorageRef storage = new StorageRef("your_app_key", "your_token");
TableRef tableRef = storage.table("your_table");
// Retrieve all items that have their "itemProperty" value greater than 10
tableRef.g... | [
"Applies",
"a",
"filter",
"to",
"the",
"table",
".",
"When",
"fetched",
"it",
"will",
"return",
"the",
"items",
"greater",
"than",
"the",
"filter",
"property",
"value",
"."
] | train | https://github.com/realtime-framework/RealtimeStorage-Android/blob/05816a6b7a6dcc83f9e7400ac3048494dadca302/library/src/main/java/co/realtime/storage/TableRef.java#L693-L696 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/DiscountSettingsUrl.java | DiscountSettingsUrl.getDiscountSettingsUrl | public static MozuUrl getDiscountSettingsUrl(Integer catalogId, String responseFields) {
"""
Get Resource Url for GetDiscountSettings
@param catalogId Unique identifier for a catalog.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON ... | java | public static MozuUrl getDiscountSettingsUrl(Integer catalogId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/discountsettings/{catalogId}?responseFields={responseFields}");
formatter.formatUrl("catalogId", catalogId);
formatter.formatUrl("responseFields", respon... | [
"public",
"static",
"MozuUrl",
"getDiscountSettingsUrl",
"(",
"Integer",
"catalogId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/discountsettings/{catalogId}?responseFields={responseField... | Get Resource Url for GetDiscountSettings
@param catalogId Unique identifier for a catalog.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this pa... | [
"Get",
"Resource",
"Url",
"for",
"GetDiscountSettings"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/DiscountSettingsUrl.java#L22-L28 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/workspace/VoiceApi.java | VoiceApi.setAgentNotReady | public void setAgentNotReady(
String workMode,
String reasonCode,
KeyValueCollection reasons,
KeyValueCollection extensions
) throws WorkspaceApiException {
"""
Set the current agent's state to NotReady on the voice channel.
@param workMode The agent workmo... | java | public void setAgentNotReady(
String workMode,
String reasonCode,
KeyValueCollection reasons,
KeyValueCollection extensions
) throws WorkspaceApiException {
try {
NotReadyData data = new NotReadyData();
VoicenotreadyData notRe... | [
"public",
"void",
"setAgentNotReady",
"(",
"String",
"workMode",
",",
"String",
"reasonCode",
",",
"KeyValueCollection",
"reasons",
",",
"KeyValueCollection",
"extensions",
")",
"throws",
"WorkspaceApiException",
"{",
"try",
"{",
"NotReadyData",
"data",
"=",
"new",
... | Set the current agent's state to NotReady on the voice channel.
@param workMode The agent workmode. Possible values are `AfterCallWork`, `AuxWork`, `LegalGuard`, `NoCallDisconnect`, `WalkAway`. (optional)
@param reasonCode The reason code representing why the agent is not ready. These codes are a business-defined set o... | [
"Set",
"the",
"current",
"agent",
"s",
"state",
"to",
"NotReady",
"on",
"the",
"voice",
"channel",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/VoiceApi.java#L359-L384 |
xm-online/xm-commons | xm-commons-logging/src/main/java/com/icthh/xm/commons/logging/util/LogObjectPrinter.java | LogObjectPrinter.printResult | public static String printResult(final JoinPoint joinPoint, final Object object, final boolean printResultDetail) {
"""
Print Result object according to input parameters and {@link LoggingAspectConfig}.
@param joinPoint - intercepting join point
@param object - result value to be printed
@p... | java | public static String printResult(final JoinPoint joinPoint, final Object object, final boolean printResultDetail) {
Optional<LoggingAspectConfig> config = AopAnnotationUtils.getConfigAnnotation(joinPoint);
boolean resultDetails = printResultDetail;
boolean resultCollectionAware = LoggingAspect... | [
"public",
"static",
"String",
"printResult",
"(",
"final",
"JoinPoint",
"joinPoint",
",",
"final",
"Object",
"object",
",",
"final",
"boolean",
"printResultDetail",
")",
"{",
"Optional",
"<",
"LoggingAspectConfig",
">",
"config",
"=",
"AopAnnotationUtils",
".",
"g... | Print Result object according to input parameters and {@link LoggingAspectConfig}.
@param joinPoint - intercepting join point
@param object - result value to be printed
@param printResultDetail - print result detail flag for programming approach. NOTE! can me overridden with {@link
LoggingAspectConf... | [
"Print",
"Result",
"object",
"according",
"to",
"input",
"parameters",
"and",
"{",
"@link",
"LoggingAspectConfig",
"}",
"."
] | train | https://github.com/xm-online/xm-commons/blob/43eb2273adb96f40830d7b905ee3a767b8715caf/xm-commons-logging/src/main/java/com/icthh/xm/commons/logging/util/LogObjectPrinter.java#L256-L278 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.restoreCertificateAsync | public ServiceFuture<CertificateBundle> restoreCertificateAsync(String vaultBaseUrl, byte[] certificateBundleBackup, final ServiceCallback<CertificateBundle> serviceCallback) {
"""
Restores a backed up certificate to a vault.
Restores a backed up certificate, and all its versions, to a vault. This operation requi... | java | public ServiceFuture<CertificateBundle> restoreCertificateAsync(String vaultBaseUrl, byte[] certificateBundleBackup, final ServiceCallback<CertificateBundle> serviceCallback) {
return ServiceFuture.fromResponse(restoreCertificateWithServiceResponseAsync(vaultBaseUrl, certificateBundleBackup), serviceCallback);
... | [
"public",
"ServiceFuture",
"<",
"CertificateBundle",
">",
"restoreCertificateAsync",
"(",
"String",
"vaultBaseUrl",
",",
"byte",
"[",
"]",
"certificateBundleBackup",
",",
"final",
"ServiceCallback",
"<",
"CertificateBundle",
">",
"serviceCallback",
")",
"{",
"return",
... | Restores a backed up certificate to a vault.
Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param certificateBundleBackup The backup blob associated with a... | [
"Restores",
"a",
"backed",
"up",
"certificate",
"to",
"a",
"vault",
".",
"Restores",
"a",
"backed",
"up",
"certificate",
"and",
"all",
"its",
"versions",
"to",
"a",
"vault",
".",
"This",
"operation",
"requires",
"the",
"certificates",
"/",
"restore",
"permis... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L8217-L8219 |
apiman/apiman | common/net/src/main/java/io/apiman/common/net/hawkular/HawkularMetricsClient.java | HawkularMetricsClient.addCounterDataPoint | public DataPointLongBean addCounterDataPoint(String tenantId, String counterId, Date timestamp, long value) {
"""
Adds a single data point to the given counter.
@param tenantId
@param counterId
@param timestamp
@param value
"""
List<DataPointLongBean> dataPoints = new ArrayList<>();
DataPoi... | java | public DataPointLongBean addCounterDataPoint(String tenantId, String counterId, Date timestamp, long value) {
List<DataPointLongBean> dataPoints = new ArrayList<>();
DataPointLongBean dataPoint = new DataPointLongBean(timestamp, value);
dataPoints.add(dataPoint);
addCounterDataPoints(ten... | [
"public",
"DataPointLongBean",
"addCounterDataPoint",
"(",
"String",
"tenantId",
",",
"String",
"counterId",
",",
"Date",
"timestamp",
",",
"long",
"value",
")",
"{",
"List",
"<",
"DataPointLongBean",
">",
"dataPoints",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
... | Adds a single data point to the given counter.
@param tenantId
@param counterId
@param timestamp
@param value | [
"Adds",
"a",
"single",
"data",
"point",
"to",
"the",
"given",
"counter",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/net/src/main/java/io/apiman/common/net/hawkular/HawkularMetricsClient.java#L219-L225 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/SelectObjectContentEventStream.java | SelectObjectContentEventStream.getRecordsInputStream | public SelectRecordsInputStream getRecordsInputStream(SelectObjectContentEventVisitor listener)
throws SelectObjectContentEventException {
"""
Retrieve an input stream to the subset of the S3 object that matched the query. This is equivalent to loading the content
of all {@link SelectObjectContentEven... | java | public SelectRecordsInputStream getRecordsInputStream(SelectObjectContentEventVisitor listener)
throws SelectObjectContentEventException {
InputStream recordInputStream = new SequenceInputStream(new EventStreamEnumeration(getEventsIterator(), listener));
// Ignore close() calls to the recor... | [
"public",
"SelectRecordsInputStream",
"getRecordsInputStream",
"(",
"SelectObjectContentEventVisitor",
"listener",
")",
"throws",
"SelectObjectContentEventException",
"{",
"InputStream",
"recordInputStream",
"=",
"new",
"SequenceInputStream",
"(",
"new",
"EventStreamEnumeration",
... | Retrieve an input stream to the subset of the S3 object that matched the query. This is equivalent to loading the content
of all {@link SelectObjectContentEvent.RecordsEvent}s into an {@link InputStream}. This will lazily-load the content from
S3, minimizing the amount of memory used.
Unlike {@link #getRecordsInputStr... | [
"Retrieve",
"an",
"input",
"stream",
"to",
"the",
"subset",
"of",
"the",
"S3",
"object",
"that",
"matched",
"the",
"query",
".",
"This",
"is",
"equivalent",
"to",
"loading",
"the",
"content",
"of",
"all",
"{",
"@link",
"SelectObjectContentEvent",
".",
"Recor... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/SelectObjectContentEventStream.java#L151-L160 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/cookies/CookieUtils.java | CookieUtils.maybeQuote | private static void maybeQuote(StringBuilder buff, String value) {
"""
Append the input value string to the given buffer, wrapping it with
quotes if need be.
@param buff
@param value
"""
// PK48169 - handle a null value as well as an empty one
if (null == value || 0 == value.length()) {
... | java | private static void maybeQuote(StringBuilder buff, String value) {
// PK48169 - handle a null value as well as an empty one
if (null == value || 0 == value.length()) {
buff.append("\"\"");
} else if (needsQuote(value)) {
buff.append('"');
buff.append(value);
... | [
"private",
"static",
"void",
"maybeQuote",
"(",
"StringBuilder",
"buff",
",",
"String",
"value",
")",
"{",
"// PK48169 - handle a null value as well as an empty one",
"if",
"(",
"null",
"==",
"value",
"||",
"0",
"==",
"value",
".",
"length",
"(",
")",
")",
"{",
... | Append the input value string to the given buffer, wrapping it with
quotes if need be.
@param buff
@param value | [
"Append",
"the",
"input",
"value",
"string",
"to",
"the",
"given",
"buffer",
"wrapping",
"it",
"with",
"quotes",
"if",
"need",
"be",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/cookies/CookieUtils.java#L169-L180 |
lucee/Lucee | core/src/main/java/lucee/runtime/ComponentImpl.java | ComponentImpl.registerUDF | @Override
public void registerUDF(Collection.Key key, UDF udf) throws ApplicationException {
"""
/*
public void reg(Collection.Key key, UDFPlus udf) throws ApplicationException { registerUDF(key,
udf,useShadow,false); } public void reg(String key, UDFPlus udf) throws ApplicationException {
registerUDF(KeyIm... | java | @Override
public void registerUDF(Collection.Key key, UDF udf) throws ApplicationException {
registerUDF(key, (UDFPlus) udf, useShadow, false);
} | [
"@",
"Override",
"public",
"void",
"registerUDF",
"(",
"Collection",
".",
"Key",
"key",
",",
"UDF",
"udf",
")",
"throws",
"ApplicationException",
"{",
"registerUDF",
"(",
"key",
",",
"(",
"UDFPlus",
")",
"udf",
",",
"useShadow",
",",
"false",
")",
";",
"... | /*
public void reg(Collection.Key key, UDFPlus udf) throws ApplicationException { registerUDF(key,
udf,useShadow,false); } public void reg(String key, UDFPlus udf) throws ApplicationException {
registerUDF(KeyImpl.init(key), udf,useShadow,false); } | [
"/",
"*",
"public",
"void",
"reg",
"(",
"Collection",
".",
"Key",
"key",
"UDFPlus",
"udf",
")",
"throws",
"ApplicationException",
"{",
"registerUDF",
"(",
"key",
"udf",
"useShadow",
"false",
")",
";",
"}",
"public",
"void",
"reg",
"(",
"String",
"key",
"... | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/ComponentImpl.java#L1663-L1666 |
ragunathjawahar/adapter-kit | library/src/com/mobsandgeeks/adapters/InstantAdapter.java | InstantAdapter.getView | @Override
public View getView(final int position, final View convertView, final ViewGroup parent) {
"""
Returns a {@link View} that has been inflated from the {@code layoutResourceId} argument in
the constructor. This method handles recycling as well. Subclasses are recommended to chain
upwards by calling {@... | java | @Override
public View getView(final int position, final View convertView, final ViewGroup parent) {
View view = convertView;
if (view == null) {
view = mInstantAdapterCore.createNewView(mContext, parent);
}
T instance = getItem(position);
mInstantAdapterCore.bin... | [
"@",
"Override",
"public",
"View",
"getView",
"(",
"final",
"int",
"position",
",",
"final",
"View",
"convertView",
",",
"final",
"ViewGroup",
"parent",
")",
"{",
"View",
"view",
"=",
"convertView",
";",
"if",
"(",
"view",
"==",
"null",
")",
"{",
"view",... | Returns a {@link View} that has been inflated from the {@code layoutResourceId} argument in
the constructor. This method handles recycling as well. Subclasses are recommended to chain
upwards by calling {@code super.getView(position, convertView, parent)} and abstain from
recycling views unless and until you know what ... | [
"Returns",
"a",
"{"
] | train | https://github.com/ragunathjawahar/adapter-kit/blob/e5c13458c7f6dcc1c61410f9cfb55cd24bd31ca2/library/src/com/mobsandgeeks/adapters/InstantAdapter.java#L65-L77 |
js-lib-com/commons | src/main/java/js/converter/TimeZoneConverter.java | TimeZoneConverter.asObject | @Override
public <T> T asObject(String string, Class<T> valueType) {
"""
Create time zone instance from time zone ID. If time zone ID is not recognized return UTC.
"""
// at this point value type is guaranteed to be a kind of TimeZone
return (T) TimeZone.getTimeZone(string);
} | java | @Override
public <T> T asObject(String string, Class<T> valueType) {
// at this point value type is guaranteed to be a kind of TimeZone
return (T) TimeZone.getTimeZone(string);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"asObject",
"(",
"String",
"string",
",",
"Class",
"<",
"T",
">",
"valueType",
")",
"{",
"// at this point value type is guaranteed to be a kind of TimeZone\r",
"return",
"(",
"T",
")",
"TimeZone",
".",
"getTimeZone",... | Create time zone instance from time zone ID. If time zone ID is not recognized return UTC. | [
"Create",
"time",
"zone",
"instance",
"from",
"time",
"zone",
"ID",
".",
"If",
"time",
"zone",
"ID",
"is",
"not",
"recognized",
"return",
"UTC",
"."
] | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/converter/TimeZoneConverter.java#L18-L22 |
policeman-tools/forbidden-apis | src/main/java/de/thetaphi/forbiddenapis/Signatures.java | Signatures.parseSignaturesStream | public void parseSignaturesStream(InputStream in, String name) throws IOException,ParseException {
"""
Reads a list of API signatures. Closes the Reader when done (on Exception, too)!
"""
logger.info("Reading API signatures: " + name);
final Set<String> missingClasses = new TreeSet<String>();
parse... | java | public void parseSignaturesStream(InputStream in, String name) throws IOException,ParseException {
logger.info("Reading API signatures: " + name);
final Set<String> missingClasses = new TreeSet<String>();
parseSignaturesStream(in, false, missingClasses);
reportMissingSignatureClasses(missingClasses);
... | [
"public",
"void",
"parseSignaturesStream",
"(",
"InputStream",
"in",
",",
"String",
"name",
")",
"throws",
"IOException",
",",
"ParseException",
"{",
"logger",
".",
"info",
"(",
"\"Reading API signatures: \"",
"+",
"name",
")",
";",
"final",
"Set",
"<",
"String"... | Reads a list of API signatures. Closes the Reader when done (on Exception, too)! | [
"Reads",
"a",
"list",
"of",
"API",
"signatures",
".",
"Closes",
"the",
"Reader",
"when",
"done",
"(",
"on",
"Exception",
"too",
")",
"!"
] | train | https://github.com/policeman-tools/forbidden-apis/blob/df5f00c6bb779875ec6bae967f7cec96670b27d9/src/main/java/de/thetaphi/forbiddenapis/Signatures.java#L301-L306 |
Jasig/uPortal | uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java | AuthorizationImpl.primGetPermissionsForPrincipal | private IPermission[] primGetPermissionsForPrincipal(IAuthorizationPrincipal principal)
throws AuthorizationException {
"""
Returns permissions for a principal. First check the entity caching service, and if the
permissions have not been cached, retrieve and cache them.
@return IPermission[]
@para... | java | private IPermission[] primGetPermissionsForPrincipal(IAuthorizationPrincipal principal)
throws AuthorizationException {
if (!this.cachePermissions) {
return getUncachedPermissionsForPrincipal(principal, null, null, null);
}
IPermissionSet ps = null;
// Check the ... | [
"private",
"IPermission",
"[",
"]",
"primGetPermissionsForPrincipal",
"(",
"IAuthorizationPrincipal",
"principal",
")",
"throws",
"AuthorizationException",
"{",
"if",
"(",
"!",
"this",
".",
"cachePermissions",
")",
"{",
"return",
"getUncachedPermissionsForPrincipal",
"(",... | Returns permissions for a principal. First check the entity caching service, and if the
permissions have not been cached, retrieve and cache them.
@return IPermission[]
@param principal org.apereo.portal.security.IAuthorizationPrincipal | [
"Returns",
"permissions",
"for",
"a",
"principal",
".",
"First",
"check",
"the",
"entity",
"caching",
"service",
"and",
"if",
"the",
"permissions",
"have",
"not",
"been",
"cached",
"retrieve",
"and",
"cache",
"them",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java#L974-L995 |
vorburger/ch.vorburger.exec | src/main/java/ch/vorburger/exec/ManagedProcessBuilder.java | ManagedProcessBuilder.addFileArgument | public ManagedProcessBuilder addFileArgument(String arg, File file) throws IOException {
"""
Adds a single argument to the command, composed of a prefix, separated by a '=', followed by a file path.
The prefix and file path are independently escaped (see above), and then concatenated.
"""
return addAr... | java | public ManagedProcessBuilder addFileArgument(String arg, File file) throws IOException {
return addArgument(arg, "=", file.getCanonicalPath());
} | [
"public",
"ManagedProcessBuilder",
"addFileArgument",
"(",
"String",
"arg",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"return",
"addArgument",
"(",
"arg",
",",
"\"=\"",
",",
"file",
".",
"getCanonicalPath",
"(",
")",
")",
";",
"}"
] | Adds a single argument to the command, composed of a prefix, separated by a '=', followed by a file path.
The prefix and file path are independently escaped (see above), and then concatenated. | [
"Adds",
"a",
"single",
"argument",
"to",
"the",
"command",
"composed",
"of",
"a",
"prefix",
"separated",
"by",
"a",
"=",
"followed",
"by",
"a",
"file",
"path",
".",
"The",
"prefix",
"and",
"file",
"path",
"are",
"independently",
"escaped",
"(",
"see",
"a... | train | https://github.com/vorburger/ch.vorburger.exec/blob/98853c55c8dfb3a6185019b8928df2a091baa471/src/main/java/ch/vorburger/exec/ManagedProcessBuilder.java#L153-L155 |
upwork/java-upwork | src/com/Upwork/api/Routers/Activities/Team.java | Team.getSpecificList | public JSONObject getSpecificList(String company, String team, String code) throws JSONException {
"""
List all oTask/Activity records within a team by specified code(s)
@param company Company ID
@param team Team ID
@param code Specific code(s)
@throws JSONException If error occurred
@return {@link JSON... | java | public JSONObject getSpecificList(String company, String team, String code) throws JSONException {
return _getByType(company, team, code);
} | [
"public",
"JSONObject",
"getSpecificList",
"(",
"String",
"company",
",",
"String",
"team",
",",
"String",
"code",
")",
"throws",
"JSONException",
"{",
"return",
"_getByType",
"(",
"company",
",",
"team",
",",
"code",
")",
";",
"}"
] | List all oTask/Activity records within a team by specified code(s)
@param company Company ID
@param team Team ID
@param code Specific code(s)
@throws JSONException If error occurred
@return {@link JSONObject} | [
"List",
"all",
"oTask",
"/",
"Activity",
"records",
"within",
"a",
"team",
"by",
"specified",
"code",
"(",
"s",
")"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Activities/Team.java#L84-L86 |
roboconf/roboconf-platform | miscellaneous/roboconf-dm-rest-client/src/main/java/net/roboconf/dm/rest/client/delegates/SchedulerWsDelegate.java | SchedulerWsDelegate.createOrUpdateJob | public String createOrUpdateJob( String jobId, String jobName, String appName, String cmdName, String cron )
throws SchedulerWsException {
"""
Creates or updates a scheduled job.
@param jobId the job's ID (null to create a new job)
@param jobName the job's name
@param appName the application's name
@param cmd... | java | public String createOrUpdateJob( String jobId, String jobName, String appName, String cmdName, String cron )
throws SchedulerWsException {
if( jobId == null )
this.logger.finer( "Creating a new scheduled job." );
else
this.logger.finer( "Updating the following scheduled job: " + jobId );
WebResource pat... | [
"public",
"String",
"createOrUpdateJob",
"(",
"String",
"jobId",
",",
"String",
"jobName",
",",
"String",
"appName",
",",
"String",
"cmdName",
",",
"String",
"cron",
")",
"throws",
"SchedulerWsException",
"{",
"if",
"(",
"jobId",
"==",
"null",
")",
"this",
"... | Creates or updates a scheduled job.
@param jobId the job's ID (null to create a new job)
@param jobName the job's name
@param appName the application's name
@param cmdName the name of the commands file to execute
@param cron the CRON expression to trigger the job
@return the created (or updated) job
@throws SchedulerWs... | [
"Creates",
"or",
"updates",
"a",
"scheduled",
"job",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-dm-rest-client/src/main/java/net/roboconf/dm/rest/client/delegates/SchedulerWsDelegate.java#L131-L155 |
SonarSource/sonarqube | sonar-core/src/main/java/org/sonar/core/util/stream/MoreCollectors.java | MoreCollectors.uniqueIndex | public static <K, E, V> Collector<E, Map<K, V>, ImmutableMap<K, V>> uniqueIndex(Function<? super E, K> keyFunction,
Function<? super E, V> valueFunction) {
"""
Creates an {@link ImmutableMap} from the stream where the values are the result of {@link Function valueFunction}
applied to the values in the stream ... | java | public static <K, E, V> Collector<E, Map<K, V>, ImmutableMap<K, V>> uniqueIndex(Function<? super E, K> keyFunction,
Function<? super E, V> valueFunction) {
return uniqueIndex(keyFunction, valueFunction, DEFAULT_HASHMAP_CAPACITY);
} | [
"public",
"static",
"<",
"K",
",",
"E",
",",
"V",
">",
"Collector",
"<",
"E",
",",
"Map",
"<",
"K",
",",
"V",
">",
",",
"ImmutableMap",
"<",
"K",
",",
"V",
">",
">",
"uniqueIndex",
"(",
"Function",
"<",
"?",
"super",
"E",
",",
"K",
">",
"keyF... | Creates an {@link ImmutableMap} from the stream where the values are the result of {@link Function valueFunction}
applied to the values in the stream and the keys are the result of the provided {@link Function keyFunction}
applied to each value in the stream.
<p>
The {@link Function keyFunction} must return a unique (... | [
"Creates",
"an",
"{",
"@link",
"ImmutableMap",
"}",
"from",
"the",
"stream",
"where",
"the",
"values",
"are",
"the",
"result",
"of",
"{",
"@link",
"Function",
"valueFunction",
"}",
"applied",
"to",
"the",
"values",
"in",
"the",
"stream",
"and",
"the",
"key... | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-core/src/main/java/org/sonar/core/util/stream/MoreCollectors.java#L230-L233 |
facebookarchive/hive-dwrf | hive-dwrf-shims/src/main/java/org/apache/hadoop/hive/ql/io/slice/Slice.java | Slice.setByte | public void setByte(int index, int value) {
"""
Sets the specified byte at the specified absolute {@code index} in this
buffer. The 24 high-order bits of the specified value are ignored.
@throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or
{@code index + 1} is greater th... | java | public void setByte(int index, int value)
{
checkIndexLength(index, SizeOf.SIZE_OF_BYTE);
unsafe.putByte(base, address + index, (byte) (value & 0xFF));
} | [
"public",
"void",
"setByte",
"(",
"int",
"index",
",",
"int",
"value",
")",
"{",
"checkIndexLength",
"(",
"index",
",",
"SizeOf",
".",
"SIZE_OF_BYTE",
")",
";",
"unsafe",
".",
"putByte",
"(",
"base",
",",
"address",
"+",
"index",
",",
"(",
"byte",
")",... | Sets the specified byte at the specified absolute {@code index} in this
buffer. The 24 high-order bits of the specified value are ignored.
@throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or
{@code index + 1} is greater than {@code this.length()} | [
"Sets",
"the",
"specified",
"byte",
"at",
"the",
"specified",
"absolute",
"{",
"@code",
"index",
"}",
"in",
"this",
"buffer",
".",
"The",
"24",
"high",
"-",
"order",
"bits",
"of",
"the",
"specified",
"value",
"are",
"ignored",
"."
] | train | https://github.com/facebookarchive/hive-dwrf/blob/a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45/hive-dwrf-shims/src/main/java/org/apache/hadoop/hive/ql/io/slice/Slice.java#L406-L410 |
Axway/Grapes | utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java | GrapesClient.postArtifact | public void postArtifact(final Artifact artifact, final String user, final String password) throws GrapesCommunicationException, AuthenticationException {
"""
Post an artifact to the Grapes server
@param artifact The artifact to post
@param user The user posting the information
@param password The user passwo... | java | public void postArtifact(final Artifact artifact, final String user, final String password) throws GrapesCommunicationException, AuthenticationException {
final Client client = getClient(user, password);
final WebResource resource = client.resource(serverURL).path(RequestUtils.artifactResourcePath());
... | [
"public",
"void",
"postArtifact",
"(",
"final",
"Artifact",
"artifact",
",",
"final",
"String",
"user",
",",
"final",
"String",
"password",
")",
"throws",
"GrapesCommunicationException",
",",
"AuthenticationException",
"{",
"final",
"Client",
"client",
"=",
"getClie... | Post an artifact to the Grapes server
@param artifact The artifact to post
@param user The user posting the information
@param password The user password
@throws GrapesCommunicationException
@throws javax.naming.AuthenticationException | [
"Post",
"an",
"artifact",
"to",
"the",
"Grapes",
"server"
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/utils/src/main/java/org/axway/grapes/utils/client/GrapesClient.java#L418-L431 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachinesInner.java | VirtualMachinesInner.beginUpdateAsync | public Observable<VirtualMachineInner> beginUpdateAsync(String resourceGroupName, String vmName, VirtualMachineUpdate parameters) {
"""
The operation to update a virtual machine.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@param parameters Parameter... | java | public Observable<VirtualMachineInner> beginUpdateAsync(String resourceGroupName, String vmName, VirtualMachineUpdate parameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, vmName, parameters).map(new Func1<ServiceResponse<VirtualMachineInner>, VirtualMachineInner>() {
@Override... | [
"public",
"Observable",
"<",
"VirtualMachineInner",
">",
"beginUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmName",
",",
"VirtualMachineUpdate",
"parameters",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"... | The operation to update a virtual machine.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@param parameters Parameters supplied to the Update Virtual Machine operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observa... | [
"The",
"operation",
"to",
"update",
"a",
"virtual",
"machine",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachinesInner.java#L836-L843 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/customer/CreditUrl.java | CreditUrl.getCreditUrl | public static MozuUrl getCreditUrl(String code, String responseFields) {
"""
Get Resource Url for GetCredit
@param code User-defined code that uniqely identifies the channel group.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON obj... | java | public static MozuUrl getCreditUrl(String code, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/credits/{code}?responseFields={responseFields}");
formatter.formatUrl("code", code);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatte... | [
"public",
"static",
"MozuUrl",
"getCreditUrl",
"(",
"String",
"code",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/customer/credits/{code}?responseFields={responseFields}\"",
")",
";",
"formatter",... | Get Resource Url for GetCredit
@param code User-defined code that uniqely identifies the channel group.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data ... | [
"Get",
"Resource",
"Url",
"for",
"GetCredit"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/customer/CreditUrl.java#L42-L48 |
ogaclejapan/SmartTabLayout | utils-v4/src/main/java/com/ogaclejapan/smarttablayout/utils/v4/Bundler.java | Bundler.putIntegerArrayList | public Bundler putIntegerArrayList(String key, ArrayList<Integer> value) {
"""
Inserts an ArrayList<Integer> value into the mapping of this Bundle, replacing
any existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value an ArrayList<Integer> object, or null
... | java | public Bundler putIntegerArrayList(String key, ArrayList<Integer> value) {
bundle.putIntegerArrayList(key, value);
return this;
} | [
"public",
"Bundler",
"putIntegerArrayList",
"(",
"String",
"key",
",",
"ArrayList",
"<",
"Integer",
">",
"value",
")",
"{",
"bundle",
".",
"putIntegerArrayList",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts an ArrayList<Integer> value into the mapping of this Bundle, replacing
any existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value an ArrayList<Integer> object, or null
@return this | [
"Inserts",
"an",
"ArrayList<Integer",
">",
"value",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/ogaclejapan/SmartTabLayout/blob/712e81a92f1e12a3c33dcbda03d813e0162e8589/utils-v4/src/main/java/com/ogaclejapan/smarttablayout/utils/v4/Bundler.java#L225-L228 |
allure-framework/allure1 | allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AllureResultsUtils.java | AllureResultsUtils.setPropertySafely | public static void setPropertySafely(Marshaller marshaller, String name, Object value) {
"""
Try to set specified property to given marshaller
@param marshaller specified marshaller
@param name name of property to set
@param value value of property to set
"""
try {
marshalle... | java | public static void setPropertySafely(Marshaller marshaller, String name, Object value) {
try {
marshaller.setProperty(name, value);
} catch (PropertyException e) {
LOGGER.warn(String.format("Can't set \"%s\" property to given marshaller", name), e);
}
} | [
"public",
"static",
"void",
"setPropertySafely",
"(",
"Marshaller",
"marshaller",
",",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"try",
"{",
"marshaller",
".",
"setProperty",
"(",
"name",
",",
"value",
")",
";",
"}",
"catch",
"(",
"PropertyExceptio... | Try to set specified property to given marshaller
@param marshaller specified marshaller
@param name name of property to set
@param value value of property to set | [
"Try",
"to",
"set",
"specified",
"property",
"to",
"given",
"marshaller"
] | train | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AllureResultsUtils.java#L194-L200 |
asterisk-java/asterisk-java | src/main/java/org/asteriskjava/pbx/internal/activity/ActivityHelper.java | ActivityHelper.validateChannel | public boolean validateChannel(final Channel channel) {
"""
/*
Attempt to set a variable on the channel to see if it's up.
@param channel the channel which is to be tested.
"""
boolean ret = false;
final SetVarAction var = new SetVarAction(channel, "testState", "1");
ManagerRes... | java | public boolean validateChannel(final Channel channel)
{
boolean ret = false;
final SetVarAction var = new SetVarAction(channel, "testState", "1");
ManagerResponse response = null;
try
{
AsteriskPBX pbx = (AsteriskPBX) PBXFactory.getActivePBX();
... | [
"public",
"boolean",
"validateChannel",
"(",
"final",
"Channel",
"channel",
")",
"{",
"boolean",
"ret",
"=",
"false",
";",
"final",
"SetVarAction",
"var",
"=",
"new",
"SetVarAction",
"(",
"channel",
",",
"\"testState\"",
",",
"\"1\"",
")",
";",
"ManagerRespons... | /*
Attempt to set a variable on the channel to see if it's up.
@param channel the channel which is to be tested. | [
"/",
"*",
"Attempt",
"to",
"set",
"a",
"variable",
"on",
"the",
"channel",
"to",
"see",
"if",
"it",
"s",
"up",
"."
] | train | https://github.com/asterisk-java/asterisk-java/blob/cdc9849270d97ef75afa447a02c5194ed29121eb/src/main/java/org/asteriskjava/pbx/internal/activity/ActivityHelper.java#L153-L177 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/user/UserCoreDao.java | UserCoreDao.queryForChunk | public TResult queryForChunk(String orderBy, int limit, long offset) {
"""
Query for ordered rows starting at the offset and returning no more than
the limit.
@param orderBy
order by
@param limit
chunk limit
@param offset
chunk query offset
@return result
@since 3.1.0
"""
return query(null, null, ... | java | public TResult queryForChunk(String orderBy, int limit, long offset) {
return query(null, null, null, null, orderBy, buildLimit(limit, offset));
} | [
"public",
"TResult",
"queryForChunk",
"(",
"String",
"orderBy",
",",
"int",
"limit",
",",
"long",
"offset",
")",
"{",
"return",
"query",
"(",
"null",
",",
"null",
",",
"null",
",",
"null",
",",
"orderBy",
",",
"buildLimit",
"(",
"limit",
",",
"offset",
... | Query for ordered rows starting at the offset and returning no more than
the limit.
@param orderBy
order by
@param limit
chunk limit
@param offset
chunk query offset
@return result
@since 3.1.0 | [
"Query",
"for",
"ordered",
"rows",
"starting",
"at",
"the",
"offset",
"and",
"returning",
"no",
"more",
"than",
"the",
"limit",
"."
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/user/UserCoreDao.java#L504-L506 |
elki-project/elki | elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/invertedlist/InMemoryInvertedIndex.java | InMemoryInvertedIndex.naiveQuerySparse | private double naiveQuerySparse(SparseNumberVector obj, WritableDoubleDataStore scores, HashSetModifiableDBIDs cands) {
"""
Query the most similar objects, sparse version.
@param obj Query object
@param scores Score storage
@param cands Non-zero objects set
@return Result
"""
double len = 0.; // Leng... | java | private double naiveQuerySparse(SparseNumberVector obj, WritableDoubleDataStore scores, HashSetModifiableDBIDs cands) {
double len = 0.; // Length of query object, for final normalization
for(int iter = obj.iter(); obj.iterValid(iter); iter = obj.iterAdvance(iter)) {
final int dim = obj.iterDim(iter);
... | [
"private",
"double",
"naiveQuerySparse",
"(",
"SparseNumberVector",
"obj",
",",
"WritableDoubleDataStore",
"scores",
",",
"HashSetModifiableDBIDs",
"cands",
")",
"{",
"double",
"len",
"=",
"0.",
";",
"// Length of query object, for final normalization",
"for",
"(",
"int",... | Query the most similar objects, sparse version.
@param obj Query object
@param scores Score storage
@param cands Non-zero objects set
@return Result | [
"Query",
"the",
"most",
"similar",
"objects",
"sparse",
"version",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/invertedlist/InMemoryInvertedIndex.java#L180-L200 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyInfo.java | PropertyInfo.getConfigValueInt | public Integer getConfigValueInt(String key, Integer dflt) {
"""
This is a convenience method for returning a named configuration value that is expected to be
an integer.
@param key The configuration value's key.
@param dflt Default value.
@return Configuration value as an integer or default value if not fou... | java | public Integer getConfigValueInt(String key, Integer dflt) {
try {
return Integer.parseInt(getConfigValue(key));
} catch (Exception e) {
return dflt;
}
} | [
"public",
"Integer",
"getConfigValueInt",
"(",
"String",
"key",
",",
"Integer",
"dflt",
")",
"{",
"try",
"{",
"return",
"Integer",
".",
"parseInt",
"(",
"getConfigValue",
"(",
"key",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"return",... | This is a convenience method for returning a named configuration value that is expected to be
an integer.
@param key The configuration value's key.
@param dflt Default value.
@return Configuration value as an integer or default value if not found or not a valid
integer. | [
"This",
"is",
"a",
"convenience",
"method",
"for",
"returning",
"a",
"named",
"configuration",
"value",
"that",
"is",
"expected",
"to",
"be",
"an",
"integer",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyInfo.java#L309-L315 |
dnsjava/dnsjava | org/xbill/DNS/Cache.java | Cache.addRRset | public synchronized void
addRRset(RRset rrset, int cred) {
"""
Adds an RRset to the Cache.
@param rrset The RRset to be added
@param cred The credibility of these records
@see RRset
"""
long ttl = rrset.getTTL();
Name name = rrset.getName();
int type = rrset.getType();
Element element = findElement(name... | java | public synchronized void
addRRset(RRset rrset, int cred) {
long ttl = rrset.getTTL();
Name name = rrset.getName();
int type = rrset.getType();
Element element = findElement(name, type, 0);
if (ttl == 0) {
if (element != null && element.compareCredibility(cred) <= 0)
removeElement(name, type);
} else {
if (... | [
"public",
"synchronized",
"void",
"addRRset",
"(",
"RRset",
"rrset",
",",
"int",
"cred",
")",
"{",
"long",
"ttl",
"=",
"rrset",
".",
"getTTL",
"(",
")",
";",
"Name",
"name",
"=",
"rrset",
".",
"getName",
"(",
")",
";",
"int",
"type",
"=",
"rrset",
... | Adds an RRset to the Cache.
@param rrset The RRset to be added
@param cred The credibility of these records
@see RRset | [
"Adds",
"an",
"RRset",
"to",
"the",
"Cache",
"."
] | train | https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Cache.java#L350-L371 |
jbossws/jbossws-common | src/main/java/org/jboss/ws/common/DOMWriter.java | DOMWriter.printNode | public static String printNode(Node node, boolean prettyprint) {
"""
Print a node with explicit prettyprinting.
The defaults for all other DOMWriter properties apply.
"""
StringWriter strw = new StringWriter();
new DOMWriter(strw).setPrettyprint(prettyprint).print(node);
return strw.toString... | java | public static String printNode(Node node, boolean prettyprint)
{
StringWriter strw = new StringWriter();
new DOMWriter(strw).setPrettyprint(prettyprint).print(node);
return strw.toString();
} | [
"public",
"static",
"String",
"printNode",
"(",
"Node",
"node",
",",
"boolean",
"prettyprint",
")",
"{",
"StringWriter",
"strw",
"=",
"new",
"StringWriter",
"(",
")",
";",
"new",
"DOMWriter",
"(",
"strw",
")",
".",
"setPrettyprint",
"(",
"prettyprint",
")",
... | Print a node with explicit prettyprinting.
The defaults for all other DOMWriter properties apply. | [
"Print",
"a",
"node",
"with",
"explicit",
"prettyprinting",
".",
"The",
"defaults",
"for",
"all",
"other",
"DOMWriter",
"properties",
"apply",
"."
] | train | https://github.com/jbossws/jbossws-common/blob/fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7/src/main/java/org/jboss/ws/common/DOMWriter.java#L150-L155 |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.setEnterpriseDate | public void setEnterpriseDate(int index, Date value) {
"""
Set an enterprise field value.
@param index field index
@param value field value
"""
set(selectField(TaskFieldLists.ENTERPRISE_DATE, index), value);
} | java | public void setEnterpriseDate(int index, Date value)
{
set(selectField(TaskFieldLists.ENTERPRISE_DATE, index), value);
} | [
"public",
"void",
"setEnterpriseDate",
"(",
"int",
"index",
",",
"Date",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"TaskFieldLists",
".",
"ENTERPRISE_DATE",
",",
"index",
")",
",",
"value",
")",
";",
"}"
] | Set an enterprise field value.
@param index field index
@param value field value | [
"Set",
"an",
"enterprise",
"field",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L3859-L3862 |
apiman/apiman | gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ConfigDrivenComponentRegistry.java | ConfigDrivenComponentRegistry.addComponentMapping | protected void addComponentMapping(Class<? extends IComponent> klazz, IComponent component) {
"""
Add a component that may have been instantiated elsewhere.
@param klazz component class
@param component instantiated component of same class
"""
components.put(klazz, component);
} | java | protected void addComponentMapping(Class<? extends IComponent> klazz, IComponent component) {
components.put(klazz, component);
} | [
"protected",
"void",
"addComponentMapping",
"(",
"Class",
"<",
"?",
"extends",
"IComponent",
">",
"klazz",
",",
"IComponent",
"component",
")",
"{",
"components",
".",
"put",
"(",
"klazz",
",",
"component",
")",
";",
"}"
] | Add a component that may have been instantiated elsewhere.
@param klazz component class
@param component instantiated component of same class | [
"Add",
"a",
"component",
"that",
"may",
"have",
"been",
"instantiated",
"elsewhere",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ConfigDrivenComponentRegistry.java#L125-L127 |
ZieIony/Carbon | carbon/src/main/java/carbon/shadow/ShapePath.java | ShapePath.addArc | public void addArc(float left, float top, float right, float bottom, float startAngle,
float sweepAngle) {
"""
Add an arc to the ShapePath.
@param left the X coordinate of the left side of the rectangle containing the arc
oval.
@param top the Y coordinate of the top of the ... | java | public void addArc(float left, float top, float right, float bottom, float startAngle,
float sweepAngle) {
PathArcOperation operation = new PathArcOperation(left, top, right, bottom);
operation.startAngle = startAngle;
operation.sweepAngle = sweepAngle;
operations.... | [
"public",
"void",
"addArc",
"(",
"float",
"left",
",",
"float",
"top",
",",
"float",
"right",
",",
"float",
"bottom",
",",
"float",
"startAngle",
",",
"float",
"sweepAngle",
")",
"{",
"PathArcOperation",
"operation",
"=",
"new",
"PathArcOperation",
"(",
"lef... | Add an arc to the ShapePath.
@param left the X coordinate of the left side of the rectangle containing the arc
oval.
@param top the Y coordinate of the top of the rectangle containing the arc oval.
@param right the X coordinate of the right side of the rectangle containing the arc
oval.
@param bottom... | [
"Add",
"an",
"arc",
"to",
"the",
"ShapePath",
"."
] | train | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/shadow/ShapePath.java#L129-L151 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java | DependencyBundlingAnalyzer.cpeIdentifiersMatch | private boolean cpeIdentifiersMatch(Dependency dependency1, Dependency dependency2) {
"""
Returns true if the CPE identifiers in the two supplied dependencies are
equal.
@param dependency1 a dependency2 to compare
@param dependency2 a dependency2 to compare
@return true if the identifiers in the two supplied... | java | private boolean cpeIdentifiersMatch(Dependency dependency1, Dependency dependency2) {
if (dependency1 == null || dependency1.getVulnerableSoftwareIdentifiers() == null
|| dependency2 == null || dependency2.getVulnerableSoftwareIdentifiers() == null) {
return false;
}
... | [
"private",
"boolean",
"cpeIdentifiersMatch",
"(",
"Dependency",
"dependency1",
",",
"Dependency",
"dependency2",
")",
"{",
"if",
"(",
"dependency1",
"==",
"null",
"||",
"dependency1",
".",
"getVulnerableSoftwareIdentifiers",
"(",
")",
"==",
"null",
"||",
"dependency... | Returns true if the CPE identifiers in the two supplied dependencies are
equal.
@param dependency1 a dependency2 to compare
@param dependency2 a dependency2 to compare
@return true if the identifiers in the two supplied dependencies are
equal | [
"Returns",
"true",
"if",
"the",
"CPE",
"identifiers",
"in",
"the",
"two",
"supplied",
"dependencies",
"are",
"equal",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java#L258-L276 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/jdbc/cloud/storage/S3StorageObjectMetadata.java | S3StorageObjectMetadata.addUserMetadata | @Override
public void addUserMetadata(String key, String value) {
"""
Adds the key value pair of custom user-metadata for the associated object.
@param key the key of user metadata
@param value the value of user metadata
"""
this.s3Metadata.addUserMetadata(key, value);
} | java | @Override
public void addUserMetadata(String key, String value)
{
this.s3Metadata.addUserMetadata(key, value);
} | [
"@",
"Override",
"public",
"void",
"addUserMetadata",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"this",
".",
"s3Metadata",
".",
"addUserMetadata",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Adds the key value pair of custom user-metadata for the associated object.
@param key the key of user metadata
@param value the value of user metadata | [
"Adds",
"the",
"key",
"value",
"pair",
"of",
"custom",
"user",
"-",
"metadata",
"for",
"the",
"associated",
"object",
"."
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/jdbc/cloud/storage/S3StorageObjectMetadata.java#L63-L67 |
apache/incubator-gobblin | gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/source/jdbc/JdbcExtractor.java | JdbcExtractor.getExtractQuery | private String getExtractQuery(String schema, String entity, String inputQuery) {
"""
Build/Format input query in the required format
@param schema
@param entity
@param inputQuery
@return formatted extract query
"""
String inputColProjection = this.getInputColumnProjection();
String outputColProj... | java | private String getExtractQuery(String schema, String entity, String inputQuery) {
String inputColProjection = this.getInputColumnProjection();
String outputColProjection = this.getOutputColumnProjection();
String query = inputQuery;
if (query == null) {
// if input query is null, build the query f... | [
"private",
"String",
"getExtractQuery",
"(",
"String",
"schema",
",",
"String",
"entity",
",",
"String",
"inputQuery",
")",
"{",
"String",
"inputColProjection",
"=",
"this",
".",
"getInputColumnProjection",
"(",
")",
";",
"String",
"outputColProjection",
"=",
"thi... | Build/Format input query in the required format
@param schema
@param entity
@param inputQuery
@return formatted extract query | [
"Build",
"/",
"Format",
"input",
"query",
"in",
"the",
"required",
"format"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/source/jdbc/JdbcExtractor.java#L376-L392 |
CloudBees-community/syslog-java-client | src/main/java/com/cloudbees/syslog/util/IoUtils.java | IoUtils.closeQuietly | public static void closeQuietly(@Nullable Socket socket, @Nullable Writer writer) {
"""
Note: does not {@link java.io.Writer#flush()} before closing.
@param socket
@param writer
"""
if (writer != null) {
try {
writer.close();
} catch (IOException e) {
... | java | public static void closeQuietly(@Nullable Socket socket, @Nullable Writer writer) {
if (writer != null) {
try {
writer.close();
} catch (IOException e) {
}
}
closeQuietly(socket);
} | [
"public",
"static",
"void",
"closeQuietly",
"(",
"@",
"Nullable",
"Socket",
"socket",
",",
"@",
"Nullable",
"Writer",
"writer",
")",
"{",
"if",
"(",
"writer",
"!=",
"null",
")",
"{",
"try",
"{",
"writer",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(... | Note: does not {@link java.io.Writer#flush()} before closing.
@param socket
@param writer | [
"Note",
":",
"does",
"not",
"{",
"@link",
"java",
".",
"io",
".",
"Writer#flush",
"()",
"}",
"before",
"closing",
"."
] | train | https://github.com/CloudBees-community/syslog-java-client/blob/41e01206e4ce17c6d225ffb443bf19792a3f3c3a/src/main/java/com/cloudbees/syslog/util/IoUtils.java#L46-L55 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cart_cartId_dns_POST | public OvhItem cart_cartId_dns_POST(String cartId, String duration, String planCode, String pricingMode, Long quantity) throws IOException {
"""
Post a new DNS zone item in your cart
REST: POST /order/cart/{cartId}/dns
@param cartId [required] Cart identifier
@param planCode [required] Identifier of a DNS zon... | java | public OvhItem cart_cartId_dns_POST(String cartId, String duration, String planCode, String pricingMode, Long quantity) throws IOException {
String qPath = "/order/cart/{cartId}/dns";
StringBuilder sb = path(qPath, cartId);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "duration", duratio... | [
"public",
"OvhItem",
"cart_cartId_dns_POST",
"(",
"String",
"cartId",
",",
"String",
"duration",
",",
"String",
"planCode",
",",
"String",
"pricingMode",
",",
"Long",
"quantity",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cart/{cartId}/dns\... | Post a new DNS zone item in your cart
REST: POST /order/cart/{cartId}/dns
@param cartId [required] Cart identifier
@param planCode [required] Identifier of a DNS zone offer
@param duration [required] Duration selected for the purchase of the product
@param pricingMode [required] Pricing mode selected for the purchase ... | [
"Post",
"a",
"new",
"DNS",
"zone",
"item",
"in",
"your",
"cart"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L7916-L7926 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/mq/kafka/Consumer.java | Consumer._startStreamingMessages | private void _startStreamingMessages(String topic, List<KafkaStream<byte[], byte[]>> streams) {
"""
Retrieves the executor service for the given topic from the map of topics and submits a KafkaConsumer task for each stream in the list of
streams.
@param topic The topic to start streaming messages from.
@p... | java | private void _startStreamingMessages(String topic, List<KafkaStream<byte[], byte[]>> streams) {
ExecutorService executorService = _topics.get(topic).getStreamExecutorService();
for (final KafkaStream<byte[], byte[]> stream : streams) {
executorService.submit(new KafkaConsumer(stream));
... | [
"private",
"void",
"_startStreamingMessages",
"(",
"String",
"topic",
",",
"List",
"<",
"KafkaStream",
"<",
"byte",
"[",
"]",
",",
"byte",
"[",
"]",
">",
">",
"streams",
")",
"{",
"ExecutorService",
"executorService",
"=",
"_topics",
".",
"get",
"(",
"topi... | Retrieves the executor service for the given topic from the map of topics and submits a KafkaConsumer task for each stream in the list of
streams.
@param topic The topic to start streaming messages from.
@param streams The streams for those messages. | [
"Retrieves",
"the",
"executor",
"service",
"for",
"the",
"given",
"topic",
"from",
"the",
"map",
"of",
"topics",
"and",
"submits",
"a",
"KafkaConsumer",
"task",
"for",
"each",
"stream",
"in",
"the",
"list",
"of",
"streams",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/mq/kafka/Consumer.java#L145-L151 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSetDTM.java | NodeSetDTM.insertElementAt | public void insertElementAt(int value, int at) {
"""
Inserts the specified node in this vector at the specified index.
Each component in this vector with an index greater or equal to
the specified index is shifted upward to have an index one greater
than the value it had previously.
@param value The node to ... | java | public void insertElementAt(int value, int at)
{
if (!m_mutable)
throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");
super.insertElementAt(value, at);
} | [
"public",
"void",
"insertElementAt",
"(",
"int",
"value",
",",
"int",
"at",
")",
"{",
"if",
"(",
"!",
"m_mutable",
")",
"throw",
"new",
"RuntimeException",
"(",
"XSLMessages",
".",
"createXPATHMessage",
"(",
"XPATHErrorResources",
".",
"ER_NODESETDTM_NOT_MUTABLE",... | Inserts the specified node in this vector at the specified index.
Each component in this vector with an index greater or equal to
the specified index is shifted upward to have an index one greater
than the value it had previously.
@param value The node to be inserted.
@param at The index where the insert should occur.... | [
"Inserts",
"the",
"specified",
"node",
"in",
"this",
"vector",
"at",
"the",
"specified",
"index",
".",
"Each",
"component",
"in",
"this",
"vector",
"with",
"an",
"index",
"greater",
"or",
"equal",
"to",
"the",
"specified",
"index",
"is",
"shifted",
"upward",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSetDTM.java#L913-L920 |
konvergeio/cofoja | src/main/java/com/google/java/contract/core/agent/SpecificationMethodAdapter.java | SpecificationMethodAdapter.allocateOldValues | @Requires( {
"""
Injects code to allocate the local variables needed to hold old
values for the postconditions of the method. These variables are
initialized to {@code null}.
@param kind either OLD or SIGNAL_OLD
@param list the list that will hold the allocated indexes
"""
"kind != null",
"kind.i... | java | @Requires({
"kind != null",
"kind.isOld()",
"list != null"
})
protected void allocateOldValues(ContractKind kind, List<Integer> list) {
List<MethodContractHandle> olds =
contracts.getMethodHandles(kind, methodName, methodDesc, 0);
if (olds.isEmpty()) {
return;
}
Integer[] ... | [
"@",
"Requires",
"(",
"{",
"\"kind != null\"",
",",
"\"kind.isOld()\"",
",",
"\"list != null\"",
"}",
")",
"protected",
"void",
"allocateOldValues",
"(",
"ContractKind",
"kind",
",",
"List",
"<",
"Integer",
">",
"list",
")",
"{",
"List",
"<",
"MethodContractHand... | Injects code to allocate the local variables needed to hold old
values for the postconditions of the method. These variables are
initialized to {@code null}.
@param kind either OLD or SIGNAL_OLD
@param list the list that will hold the allocated indexes | [
"Injects",
"code",
"to",
"allocate",
"the",
"local",
"variables",
"needed",
"to",
"hold",
"old",
"values",
"for",
"the",
"postconditions",
"of",
"the",
"method",
".",
"These",
"variables",
"are",
"initialized",
"to",
"{",
"@code",
"null",
"}",
"."
] | train | https://github.com/konvergeio/cofoja/blob/6ded58fa05eb5bf85f16353c8dd4c70bee59121a/src/main/java/com/google/java/contract/core/agent/SpecificationMethodAdapter.java#L319-L339 |
mucaho/jnetrobust | jnetrobust-core/src/main/java/com/github/mucaho/jnetrobust/util/IdComparator.java | IdComparator.difference | private final static int difference(int seq1, int seq2, int maxSequence) {
"""
/*
Example: maxSequence = 100; maxSequence/2 = 50;
seq1 = 10;
seq2 = 30;
diff = -20;
abs(-20 ) <= 50 ==> return -20;
seq1 = 30;
seq2 = 10;
diff = 20;
abs(20) <= 50 ==> return 20;
seq1 = 70;
seq2 = 10;
diff = 60;
a... | java | private final static int difference(int seq1, int seq2, int maxSequence) {
int diff = seq1 - seq2;
if (Math.abs(diff) <= maxSequence / 2)
return diff;
else
return (-Integer.signum(diff) * maxSequence) + diff;
} | [
"private",
"final",
"static",
"int",
"difference",
"(",
"int",
"seq1",
",",
"int",
"seq2",
",",
"int",
"maxSequence",
")",
"{",
"int",
"diff",
"=",
"seq1",
"-",
"seq2",
";",
"if",
"(",
"Math",
".",
"abs",
"(",
"diff",
")",
"<=",
"maxSequence",
"/",
... | /*
Example: maxSequence = 100; maxSequence/2 = 50;
seq1 = 10;
seq2 = 30;
diff = -20;
abs(-20 ) <= 50 ==> return -20;
seq1 = 30;
seq2 = 10;
diff = 20;
abs(20) <= 50 ==> return 20;
seq1 = 70;
seq2 = 10;
diff = 60;
abs(60) !<= 50 ==> return (-1 * 100) + 60 = -40
seq1 = 10;
seq2 = 70;
diff = -60;
abs(-60) !<= 50 ... | [
"/",
"*",
"Example",
":",
"maxSequence",
"=",
"100",
";",
"maxSequence",
"/",
"2",
"=",
"50",
";",
"seq1",
"=",
"10",
";",
"seq2",
"=",
"30",
";",
"diff",
"=",
"-",
"20",
";",
"abs",
"(",
"-",
"20",
")",
"<",
"=",
"50",
"==",
">",
"return",
... | train | https://github.com/mucaho/jnetrobust/blob/b82150eb2a4371dae9e4f40814cb8f538917c0fb/jnetrobust-core/src/main/java/com/github/mucaho/jnetrobust/util/IdComparator.java#L49-L55 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/DTDSchemaFactory.java | DTDSchemaFactory.doCreateSchema | @SuppressWarnings("resource")
protected XMLValidationSchema doCreateSchema
(ReaderConfig rcfg, InputBootstrapper bs, String publicId, String systemIdStr, URL ctxt)
throws XMLStreamException {
"""
The main validator construction method, called by all externally
visible methods.
"""
... | java | @SuppressWarnings("resource")
protected XMLValidationSchema doCreateSchema
(ReaderConfig rcfg, InputBootstrapper bs, String publicId, String systemIdStr, URL ctxt)
throws XMLStreamException
{
try {
Reader r = bs.bootstrapInput(rcfg, false, XmlConsts.XML_V_UNKNOWN);
... | [
"@",
"SuppressWarnings",
"(",
"\"resource\"",
")",
"protected",
"XMLValidationSchema",
"doCreateSchema",
"(",
"ReaderConfig",
"rcfg",
",",
"InputBootstrapper",
"bs",
",",
"String",
"publicId",
",",
"String",
"systemIdStr",
",",
"URL",
"ctxt",
")",
"throws",
"XMLStre... | The main validator construction method, called by all externally
visible methods. | [
"The",
"main",
"validator",
"construction",
"method",
"called",
"by",
"all",
"externally",
"visible",
"methods",
"."
] | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/DTDSchemaFactory.java#L168-L198 |
JCTools/JCTools | jctools-core/src/main/java/org/jctools/queues/atomic/BaseSpscLinkedAtomicArrayQueue.java | BaseSpscLinkedAtomicArrayQueue.poll | @SuppressWarnings("unchecked")
@Override
public E poll() {
"""
{@inheritDoc}
<p>
This implementation is correct for single consumer thread use only.
"""
// local load of field to avoid repeated loads after volatile reads
final AtomicReferenceArray<E> buffer = consumerBuffer;
f... | java | @SuppressWarnings("unchecked")
@Override
public E poll() {
// local load of field to avoid repeated loads after volatile reads
final AtomicReferenceArray<E> buffer = consumerBuffer;
final long index = lpConsumerIndex();
final long mask = consumerMask;
final int offset = c... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"E",
"poll",
"(",
")",
"{",
"// local load of field to avoid repeated loads after volatile reads",
"final",
"AtomicReferenceArray",
"<",
"E",
">",
"buffer",
"=",
"consumerBuffer",
";",
"final... | {@inheritDoc}
<p>
This implementation is correct for single consumer thread use only. | [
"{"
] | train | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-core/src/main/java/org/jctools/queues/atomic/BaseSpscLinkedAtomicArrayQueue.java#L289-L309 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java | ST_AsGeoJSON.toGeojsonCoordinate | public static void toGeojsonCoordinate(Coordinate coord, StringBuilder sb) {
"""
Convert a JTS coordinate to a GeoJSON representation.
Only x, y and z values are supported.
Syntax:
[X,Y] or [X,Y,Z]
@param coord
@param sb
"""
sb.append("[");
sb.append(coord.x).append(",").append(coo... | java | public static void toGeojsonCoordinate(Coordinate coord, StringBuilder sb) {
sb.append("[");
sb.append(coord.x).append(",").append(coord.y);
if (!Double.isNaN(coord.z)) {
sb.append(",").append(coord.z);
}
sb.append("]");
} | [
"public",
"static",
"void",
"toGeojsonCoordinate",
"(",
"Coordinate",
"coord",
",",
"StringBuilder",
"sb",
")",
"{",
"sb",
".",
"append",
"(",
"\"[\"",
")",
";",
"sb",
".",
"append",
"(",
"coord",
".",
"x",
")",
".",
"append",
"(",
"\",\"",
")",
".",
... | Convert a JTS coordinate to a GeoJSON representation.
Only x, y and z values are supported.
Syntax:
[X,Y] or [X,Y,Z]
@param coord
@param sb | [
"Convert",
"a",
"JTS",
"coordinate",
"to",
"a",
"GeoJSON",
"representation",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/ST_AsGeoJSON.java#L308-L315 |
redkale/redkale | src/org/redkale/source/DataJdbcSource.java | DataJdbcSource.directQuery | @Local
@Override
public <V> V directQuery(String sql, Function<ResultSet, V> handler) {
"""
直接本地执行SQL语句进行查询,远程模式不可用 <br>
通常用于复杂的关联查询 <br>
@param <V> 泛型
@param sql SQL语句
@param handler 回调函数
@return 结果
"""
final Connection conn = readPool.poll();
try {
... | java | @Local
@Override
public <V> V directQuery(String sql, Function<ResultSet, V> handler) {
final Connection conn = readPool.poll();
try {
if (logger.isLoggable(Level.FINEST)) logger.finest("direct query sql=" + sql);
conn.setReadOnly(true);
final Statement... | [
"@",
"Local",
"@",
"Override",
"public",
"<",
"V",
">",
"V",
"directQuery",
"(",
"String",
"sql",
",",
"Function",
"<",
"ResultSet",
",",
"V",
">",
"handler",
")",
"{",
"final",
"Connection",
"conn",
"=",
"readPool",
".",
"poll",
"(",
")",
";",
"try"... | 直接本地执行SQL语句进行查询,远程模式不可用 <br>
通常用于复杂的关联查询 <br>
@param <V> 泛型
@param sql SQL语句
@param handler 回调函数
@return 结果 | [
"直接本地执行SQL语句进行查询,远程模式不可用",
"<br",
">",
"通常用于复杂的关联查询",
"<br",
">"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/source/DataJdbcSource.java#L632-L651 |
alkacon/opencms-core | src/org/opencms/workplace/comparison/CmsHistoryListUtil.java | CmsHistoryListUtil.getDisplayVersion | public static String getDisplayVersion(String version, Locale locale) {
"""
Returns the version number from a version parameter.<p>
@param version might be negative for the online version
@param locale if the result is for display purposes, the locale has to be <code>!= null</code>
@return the display name
... | java | public static String getDisplayVersion(String version, Locale locale) {
int ver = Integer.parseInt(version);
if (ver == CmsHistoryResourceHandler.PROJECT_OFFLINE_VERSION) {
return Messages.get().getBundle(locale).key(Messages.GUI_PROJECT_OFFLINE_0);
}
if (ver < 0) {
... | [
"public",
"static",
"String",
"getDisplayVersion",
"(",
"String",
"version",
",",
"Locale",
"locale",
")",
"{",
"int",
"ver",
"=",
"Integer",
".",
"parseInt",
"(",
"version",
")",
";",
"if",
"(",
"ver",
"==",
"CmsHistoryResourceHandler",
".",
"PROJECT_OFFLINE_... | Returns the version number from a version parameter.<p>
@param version might be negative for the online version
@param locale if the result is for display purposes, the locale has to be <code>!= null</code>
@return the display name | [
"Returns",
"the",
"version",
"number",
"from",
"a",
"version",
"parameter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/comparison/CmsHistoryListUtil.java#L61-L74 |
foundation-runtime/logging | logging-log4j/src/main/java/com/cisco/oss/foundation/logging/appender/FoundationFileRollingAppender.java | FoundationFileRollingAppender.setDatePatternLocale | public void setDatePatternLocale(String datePatternLocale) {
"""
Sets the {@link java.util.Locale} to be used when processing date patterns.
Variants are not supported; only language and (optionally) country may be
used, e.g. "en", "en_GB" or
"fr_CA" are all valid. If no... | java | public void setDatePatternLocale(String datePatternLocale) {
if (datePatternLocale == null) {
LogLog.warn("Null date pattern locale supplied for appender [" + this.getName() + "], defaulting to " + this.getProperties().getDatePatternLocale());
return;
}
datePatternLocale = datePatternLocale.trim();
if (""... | [
"public",
"void",
"setDatePatternLocale",
"(",
"String",
"datePatternLocale",
")",
"{",
"if",
"(",
"datePatternLocale",
"==",
"null",
")",
"{",
"LogLog",
".",
"warn",
"(",
"\"Null date pattern locale supplied for appender [\"",
"+",
"this",
".",
"getName",
"(",
")",... | Sets the {@link java.util.Locale} to be used when processing date patterns.
Variants are not supported; only language and (optionally) country may be
used, e.g. "en", "en_GB" or
"fr_CA" are all valid. If no locale is supplied,
{@link java.util.Locale#ENGLISH} will be used.
@par... | [
"Sets",
"the",
"{",
"@link",
"java",
".",
"util",
".",
"Locale",
"}",
"to",
"be",
"used",
"when",
"processing",
"date",
"patterns",
".",
"Variants",
"are",
"not",
"supported",
";",
"only",
"language",
"and",
"(",
"optionally",
")",
"country",
"may",
"be"... | train | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-log4j/src/main/java/com/cisco/oss/foundation/logging/appender/FoundationFileRollingAppender.java#L510-L531 |
cdapio/tigon | tigon-sql/src/main/java/co/cask/tigon/sql/io/GDATEncoder.java | GDATEncoder.writeLengthToStream | private void writeLengthToStream(int length, OutputStream out) throws IOException {
"""
Write Length in Big Endian Order as per GDAT format specification.
"""
sharedByteBuffer.clear();
sharedByteBuffer.order(ByteOrder.BIG_ENDIAN).putInt(length);
sharedByteBuffer.flip();
out.write(sharedByteBuff... | java | private void writeLengthToStream(int length, OutputStream out) throws IOException {
sharedByteBuffer.clear();
sharedByteBuffer.order(ByteOrder.BIG_ENDIAN).putInt(length);
sharedByteBuffer.flip();
out.write(sharedByteBuffer.array(), 0, Ints.BYTES);
sharedByteBuffer.order(byteOrder);
} | [
"private",
"void",
"writeLengthToStream",
"(",
"int",
"length",
",",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"sharedByteBuffer",
".",
"clear",
"(",
")",
";",
"sharedByteBuffer",
".",
"order",
"(",
"ByteOrder",
".",
"BIG_ENDIAN",
")",
".",
"pu... | Write Length in Big Endian Order as per GDAT format specification. | [
"Write",
"Length",
"in",
"Big",
"Endian",
"Order",
"as",
"per",
"GDAT",
"format",
"specification",
"."
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-sql/src/main/java/co/cask/tigon/sql/io/GDATEncoder.java#L75-L81 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/javax/net/ssl/SSLContext.java | SSLContext.createSSLEngine | public final SSLEngine createSSLEngine(String peerHost, int peerPort) {
"""
Creates a new <code>SSLEngine</code> using this context using
advisory peer information.
<P>
Applications using this factory method are providing hints
for an internal session reuse strategy.
<P>
Some cipher suites (such as Kerberos)... | java | public final SSLEngine createSSLEngine(String peerHost, int peerPort) {
try {
return contextSpi.engineCreateSSLEngine(peerHost, peerPort);
} catch (AbstractMethodError e) {
UnsupportedOperationException unsup =
new UnsupportedOperationException(
... | [
"public",
"final",
"SSLEngine",
"createSSLEngine",
"(",
"String",
"peerHost",
",",
"int",
"peerPort",
")",
"{",
"try",
"{",
"return",
"contextSpi",
".",
"engineCreateSSLEngine",
"(",
"peerHost",
",",
"peerPort",
")",
";",
"}",
"catch",
"(",
"AbstractMethodError"... | Creates a new <code>SSLEngine</code> using this context using
advisory peer information.
<P>
Applications using this factory method are providing hints
for an internal session reuse strategy.
<P>
Some cipher suites (such as Kerberos) require remote hostname
information, in which case peerHost needs to be specified.
@p... | [
"Creates",
"a",
"new",
"<code",
">",
"SSLEngine<",
"/",
"code",
">",
"using",
"this",
"context",
"using",
"advisory",
"peer",
"information",
".",
"<P",
">",
"Applications",
"using",
"this",
"factory",
"method",
"are",
"providing",
"hints",
"for",
"an",
"inte... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/javax/net/ssl/SSLContext.java#L393-L404 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/csv/CSVParser.java | CSVParser._anyCharactersAreTheSame | private boolean _anyCharactersAreTheSame () {
"""
checks to see if any two of the three characters are the same. This is
because in openCSV the separator, quote, and escape characters must the
different.
@return <code>true</code> if any two of the three are the same.
"""
return _isSameCharacter (m_cSe... | java | private boolean _anyCharactersAreTheSame ()
{
return _isSameCharacter (m_cSeparatorChar, m_cQuoteChar) ||
_isSameCharacter (m_cSeparatorChar, m_cEscapeChar) ||
_isSameCharacter (m_cQuoteChar, m_cEscapeChar);
} | [
"private",
"boolean",
"_anyCharactersAreTheSame",
"(",
")",
"{",
"return",
"_isSameCharacter",
"(",
"m_cSeparatorChar",
",",
"m_cQuoteChar",
")",
"||",
"_isSameCharacter",
"(",
"m_cSeparatorChar",
",",
"m_cEscapeChar",
")",
"||",
"_isSameCharacter",
"(",
"m_cQuoteChar",... | checks to see if any two of the three characters are the same. This is
because in openCSV the separator, quote, and escape characters must the
different.
@return <code>true</code> if any two of the three are the same. | [
"checks",
"to",
"see",
"if",
"any",
"two",
"of",
"the",
"three",
"characters",
"are",
"the",
"same",
".",
"This",
"is",
"because",
"in",
"openCSV",
"the",
"separator",
"quote",
"and",
"escape",
"characters",
"must",
"the",
"different",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/csv/CSVParser.java#L244-L249 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Viewport.java | Viewport.viewGlobalArea | public final void viewGlobalArea(double x, double y, double width, double height) {
"""
Change the viewport's transform so that the specified area (in global or canvas coordinates)
is visible.
@param x
@param y
@param width
@param height
"""
if ((width <= 0) || (height <= 0))
{
... | java | public final void viewGlobalArea(double x, double y, double width, double height)
{
if ((width <= 0) || (height <= 0))
{
return;
}
final Transform t = getTransform();
if (null != t)
{
final Point2D a = new Point2D(x, y);
final Poi... | [
"public",
"final",
"void",
"viewGlobalArea",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"width",
",",
"double",
"height",
")",
"{",
"if",
"(",
"(",
"width",
"<=",
"0",
")",
"||",
"(",
"height",
"<=",
"0",
")",
")",
"{",
"return",
";",
... | Change the viewport's transform so that the specified area (in global or canvas coordinates)
is visible.
@param x
@param y
@param width
@param height | [
"Change",
"the",
"viewport",
"s",
"transform",
"so",
"that",
"the",
"specified",
"area",
"(",
"in",
"global",
"or",
"canvas",
"coordinates",
")",
"is",
"visible",
"."
] | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Viewport.java#L506-L535 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/mock/servlet/MockHttpServletRequest.java | MockHttpServletRequest.setParameter | public void setParameter(final String name, final String value) {
"""
Sets a parameter. If the parameter already exists, another value will be added to the parameter values.
@param name the parameter name
@param value the parameter value
"""
String[] currentValue = (String[]) parameters.get(name);
if ... | java | public void setParameter(final String name, final String value) {
String[] currentValue = (String[]) parameters.get(name);
if (currentValue == null) {
currentValue = new String[]{value};
} else {
// convert the current values into a new array..
String[] newValues = new String[currentValue.length + 1];
... | [
"public",
"void",
"setParameter",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"value",
")",
"{",
"String",
"[",
"]",
"currentValue",
"=",
"(",
"String",
"[",
"]",
")",
"parameters",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"currentValu... | Sets a parameter. If the parameter already exists, another value will be added to the parameter values.
@param name the parameter name
@param value the parameter value | [
"Sets",
"a",
"parameter",
".",
"If",
"the",
"parameter",
"already",
"exists",
"another",
"value",
"will",
"be",
"added",
"to",
"the",
"parameter",
"values",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/mock/servlet/MockHttpServletRequest.java#L490-L504 |
kiegroup/drools | drools-compiler/src/main/java/org/drools/compiler/builder/impl/TypeDeclarationUtils.java | TypeDeclarationUtils.toBuildableType | public static String toBuildableType(String className, ClassLoader loader) {
"""
not the cleanest logic, but this is what the builders expect downstream
"""
int arrayDim = BuildUtils.externalArrayDimSize(className);
String prefix = "";
String coreType = arrayDim == 0 ? className : clas... | java | public static String toBuildableType(String className, ClassLoader loader) {
int arrayDim = BuildUtils.externalArrayDimSize(className);
String prefix = "";
String coreType = arrayDim == 0 ? className : className.substring(0, className.indexOf("["));
coreType = typeName2ClassName(coreTyp... | [
"public",
"static",
"String",
"toBuildableType",
"(",
"String",
"className",
",",
"ClassLoader",
"loader",
")",
"{",
"int",
"arrayDim",
"=",
"BuildUtils",
".",
"externalArrayDimSize",
"(",
"className",
")",
";",
"String",
"prefix",
"=",
"\"\"",
";",
"String",
... | not the cleanest logic, but this is what the builders expect downstream | [
"not",
"the",
"cleanest",
"logic",
"but",
"this",
"is",
"what",
"the",
"builders",
"expect",
"downstream"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/builder/impl/TypeDeclarationUtils.java#L273-L290 |
BellaDati/belladati-sdk-api | src/main/java/com/belladati/sdk/dataset/data/OverwritePolicy.java | OverwritePolicy.byDateFromTo | public static OverwritePolicy byDateFromTo(String attribute, Calendar start, Calendar end) {
"""
Returns an {@link OverwritePolicy} that deletes records with a date
between or on the given dates in the specified column.
<p>
Records with an empty date value in existing data are also deleted.
@param attribute ... | java | public static OverwritePolicy byDateFromTo(String attribute, Calendar start, Calendar end) {
return new DateRangeOverwritePolicy(attribute, start, end);
} | [
"public",
"static",
"OverwritePolicy",
"byDateFromTo",
"(",
"String",
"attribute",
",",
"Calendar",
"start",
",",
"Calendar",
"end",
")",
"{",
"return",
"new",
"DateRangeOverwritePolicy",
"(",
"attribute",
",",
"start",
",",
"end",
")",
";",
"}"
] | Returns an {@link OverwritePolicy} that deletes records with a date
between or on the given dates in the specified column.
<p>
Records with an empty date value in existing data are also deleted.
@param attribute date attribute to compare
@param start first day (inclusive) from which to delete data
@param end last day ... | [
"Returns",
"an",
"{",
"@link",
"OverwritePolicy",
"}",
"that",
"deletes",
"records",
"with",
"a",
"date",
"between",
"or",
"on",
"the",
"given",
"dates",
"in",
"the",
"specified",
"column",
".",
"<p",
">",
"Records",
"with",
"an",
"empty",
"date",
"value",... | train | https://github.com/BellaDati/belladati-sdk-api/blob/ec45a42048d8255838ad0200aa6784a8e8a121c1/src/main/java/com/belladati/sdk/dataset/data/OverwritePolicy.java#L154-L156 |
syphr42/libmythtv-java | commons/src/main/java/org/syphr/mythtv/commons/socket/CommandUtils.java | CommandUtils.sendExpectOk | public static void sendExpectOk(SocketManager socketManager, String message) throws IOException {
"""
Send a message via the given socket manager which should always receive a case
insensitive "OK" as the reply.
@param socketManager
the socket manager that will be used to send and receive over the
network
@... | java | public static void sendExpectOk(SocketManager socketManager, String message) throws IOException
{
expectOk(socketManager.sendAndWait(message));
} | [
"public",
"static",
"void",
"sendExpectOk",
"(",
"SocketManager",
"socketManager",
",",
"String",
"message",
")",
"throws",
"IOException",
"{",
"expectOk",
"(",
"socketManager",
".",
"sendAndWait",
"(",
"message",
")",
")",
";",
"}"
] | Send a message via the given socket manager which should always receive a case
insensitive "OK" as the reply.
@param socketManager
the socket manager that will be used to send and receive over the
network
@param message
the message to send
@throws IOException
if there is a communication error or an unexpected response | [
"Send",
"a",
"message",
"via",
"the",
"given",
"socket",
"manager",
"which",
"should",
"always",
"receive",
"a",
"case",
"insensitive",
"OK",
"as",
"the",
"reply",
"."
] | train | https://github.com/syphr42/libmythtv-java/blob/cc7a2012fbd4a4ba2562dda6b2614fb0548526ea/commons/src/main/java/org/syphr/mythtv/commons/socket/CommandUtils.java#L37-L40 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/dialog/DateRangePicker.java | DateRangePicker.checkSelection | private void checkSelection(boolean suppressEvent) {
"""
Check the current selection. If nothing is selected, display a prompt message in gray text.
Also, remembers the last selection made.
@param suppressEvent If true, onSelectRange event is not fired.
"""
Dateitem selectedItem = getSelectedItem()... | java | private void checkSelection(boolean suppressEvent) {
Dateitem selectedItem = getSelectedItem();
if (selectedItem == null) {
selectedItem = lastSelectedItem;
setSelectedItem(selectedItem);
} else if (selectedItem != customItem && lastSelectedItem != selectedItem) ... | [
"private",
"void",
"checkSelection",
"(",
"boolean",
"suppressEvent",
")",
"{",
"Dateitem",
"selectedItem",
"=",
"getSelectedItem",
"(",
")",
";",
"if",
"(",
"selectedItem",
"==",
"null",
")",
"{",
"selectedItem",
"=",
"lastSelectedItem",
";",
"setSelectedItem",
... | Check the current selection. If nothing is selected, display a prompt message in gray text.
Also, remembers the last selection made.
@param suppressEvent If true, onSelectRange event is not fired. | [
"Check",
"the",
"current",
"selection",
".",
"If",
"nothing",
"is",
"selected",
"display",
"a",
"prompt",
"message",
"in",
"gray",
"text",
".",
"Also",
"remembers",
"the",
"last",
"selection",
"made",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/dialog/DateRangePicker.java#L288-L303 |
xiancloud/xian | xian-zookeeper/xian-curator/xian-curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java | ZKPaths.makePath | public static String makePath(String parent, String child) {
"""
Given a parent path and a child node, create a combined full path
@param parent the parent
@param child the child
@return full path
"""
StringBuilder path = new StringBuilder();
joinPath(path, parent, child);
retur... | java | public static String makePath(String parent, String child)
{
StringBuilder path = new StringBuilder();
joinPath(path, parent, child);
return path.toString();
} | [
"public",
"static",
"String",
"makePath",
"(",
"String",
"parent",
",",
"String",
"child",
")",
"{",
"StringBuilder",
"path",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"joinPath",
"(",
"path",
",",
"parent",
",",
"child",
")",
";",
"return",
"path",
".... | Given a parent path and a child node, create a combined full path
@param parent the parent
@param child the child
@return full path | [
"Given",
"a",
"parent",
"path",
"and",
"a",
"child",
"node",
"create",
"a",
"combined",
"full",
"path"
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-zookeeper/xian-curator/xian-curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java#L365-L372 |
tomgibara/bits | src/main/java/com/tomgibara/bits/Bits.java | Bits.writerTo | public static BitWriter writerTo(byte[] bytes, long size) {
"""
A {@link BitWriter} that writes its bits to an array of bytes. Bits are
written to the byte array starting at index zero. Within each byte, the
most significant bits is written to first.
@param bytes
the array of bytes
@param size
the number o... | java | public static BitWriter writerTo(byte[] bytes, long size) {
if (bytes == null) throw new IllegalArgumentException("null bytes");
checkSize(size, ((long) bytes.length) << 3);
return new ByteArrayBitWriter(bytes, size);
} | [
"public",
"static",
"BitWriter",
"writerTo",
"(",
"byte",
"[",
"]",
"bytes",
",",
"long",
"size",
")",
"{",
"if",
"(",
"bytes",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"null bytes\"",
")",
";",
"checkSize",
"(",
"size",
",",
... | A {@link BitWriter} that writes its bits to an array of bytes. Bits are
written to the byte array starting at index zero. Within each byte, the
most significant bits is written to first.
@param bytes
the array of bytes
@param size
the number of bits that may be written, not negative and no
greater than the number of b... | [
"A",
"{",
"@link",
"BitWriter",
"}",
"that",
"writes",
"its",
"bits",
"to",
"an",
"array",
"of",
"bytes",
".",
"Bits",
"are",
"written",
"to",
"the",
"byte",
"array",
"starting",
"at",
"index",
"zero",
".",
"Within",
"each",
"byte",
"the",
"most",
"sig... | train | https://github.com/tomgibara/bits/blob/56c32c0a30efd3d7c4e7c6600a0ca39e51eecc97/src/main/java/com/tomgibara/bits/Bits.java#L843-L847 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/LongTermRetentionBackupsInner.java | LongTermRetentionBackupsInner.beginDelete | public void beginDelete(String locationName, String longTermRetentionServerName, String longTermRetentionDatabaseName, String backupName) {
"""
Deletes a long term retention backup.
@param locationName The location of the database
@param longTermRetentionServerName the String value
@param longTermRetentionDat... | java | public void beginDelete(String locationName, String longTermRetentionServerName, String longTermRetentionDatabaseName, String backupName) {
beginDeleteWithServiceResponseAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"locationName",
",",
"String",
"longTermRetentionServerName",
",",
"String",
"longTermRetentionDatabaseName",
",",
"String",
"backupName",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"locationName",
",",
"longTermRet... | Deletes a long term retention backup.
@param locationName The location of the database
@param longTermRetentionServerName the String value
@param longTermRetentionDatabaseName the String value
@param backupName The backup name.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudExce... | [
"Deletes",
"a",
"long",
"term",
"retention",
"backup",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/LongTermRetentionBackupsInner.java#L293-L295 |
aoindustries/ao-taglib | src/main/java/com/aoindustries/taglib/UrlUtils.java | UrlUtils.writeHref | public static void writeHref(
PageContext pageContext,
Appendable out,
String href,
HttpParameters params,
boolean hrefAbsolute,
LastModifiedServlet.AddLastModifiedWhen addLastModified
) throws JspTagException, IOException {
"""
Writes an href attribute with parameters.
Adds contextPath to URLs that ... | java | public static void writeHref(
PageContext pageContext,
Appendable out,
String href,
HttpParameters params,
boolean hrefAbsolute,
LastModifiedServlet.AddLastModifiedWhen addLastModified
) throws JspTagException, IOException {
if(href != null) {
out.append(" href=\"");
encodeTextInXhtmlAttribute(
... | [
"public",
"static",
"void",
"writeHref",
"(",
"PageContext",
"pageContext",
",",
"Appendable",
"out",
",",
"String",
"href",
",",
"HttpParameters",
"params",
",",
"boolean",
"hrefAbsolute",
",",
"LastModifiedServlet",
".",
"AddLastModifiedWhen",
"addLastModified",
")"... | Writes an href attribute with parameters.
Adds contextPath to URLs that begin with a slash (/).
Encodes the URL. | [
"Writes",
"an",
"href",
"attribute",
"with",
"parameters",
".",
"Adds",
"contextPath",
"to",
"URLs",
"that",
"begin",
"with",
"a",
"slash",
"(",
"/",
")",
".",
"Encodes",
"the",
"URL",
"."
] | train | https://github.com/aoindustries/ao-taglib/blob/5670eba8485196bd42d31d3ff09a42deacb025f8/src/main/java/com/aoindustries/taglib/UrlUtils.java#L46-L64 |
shekhargulati/strman-java | src/main/java/strman/Strman.java | Strman.containsAll | public static boolean containsAll(final String value, final String[] needles) {
"""
Verifies that all needles are contained in value. The search is case insensitive
@param value input String to search
@param needles needles to find
@return true if all needles are found else false.
"""
validate(v... | java | public static boolean containsAll(final String value, final String[] needles) {
validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
return Arrays.stream(needles).allMatch(needle -> contains(value, needle, false));
} | [
"public",
"static",
"boolean",
"containsAll",
"(",
"final",
"String",
"value",
",",
"final",
"String",
"[",
"]",
"needles",
")",
"{",
"validate",
"(",
"value",
",",
"NULL_STRING_PREDICATE",
",",
"NULL_STRING_MSG_SUPPLIER",
")",
";",
"return",
"Arrays",
".",
"s... | Verifies that all needles are contained in value. The search is case insensitive
@param value input String to search
@param needles needles to find
@return true if all needles are found else false. | [
"Verifies",
"that",
"all",
"needles",
"are",
"contained",
"in",
"value",
".",
"The",
"search",
"is",
"case",
"insensitive"
] | train | https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L180-L183 |
krummas/DrizzleJDBC | src/main/java/org/drizzle/jdbc/CommonDatabaseMetaData.java | CommonDatabaseMetaData.getProcedures | public ResultSet getProcedures(final String catalog, final String schemaPattern, final String procedureNamePattern)
throws SQLException {
"""
Retrieves a description of the stored procedures available in the given catalog.
<p/>
Only procedure descriptions matching the schema and procedure name criter... | java | public ResultSet getProcedures(final String catalog, final String schemaPattern, final String procedureNamePattern)
throws SQLException {
log.info("getting empty result set, procedures");
return getEmptyResultSet();
} | [
"public",
"ResultSet",
"getProcedures",
"(",
"final",
"String",
"catalog",
",",
"final",
"String",
"schemaPattern",
",",
"final",
"String",
"procedureNamePattern",
")",
"throws",
"SQLException",
"{",
"log",
".",
"info",
"(",
"\"getting empty result set, procedures\"",
... | Retrieves a description of the stored procedures available in the given catalog.
<p/>
Only procedure descriptions matching the schema and procedure name criteria are returned. They are ordered by
<code>PROCEDURE_CAT</code>, <code>PROCEDURE_SCHEM</code>, <code>PROCEDURE_NAME</code> and <code>SPECIFIC_
NAME</code>.
<p/>... | [
"Retrieves",
"a",
"description",
"of",
"the",
"stored",
"procedures",
"available",
"in",
"the",
"given",
"catalog",
".",
"<p",
"/",
">",
"Only",
"procedure",
"descriptions",
"matching",
"the",
"schema",
"and",
"procedure",
"name",
"criteria",
"are",
"returned",
... | train | https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/CommonDatabaseMetaData.java#L1342-L1346 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/io/util/Memory.java | Memory.getBytes | public void getBytes(long memoryOffset, byte[] buffer, int bufferOffset, int count) {
"""
Transfers count bytes from Memory starting at memoryOffset to buffer starting at bufferOffset
@param memoryOffset start offset in the memory
@param buffer the data buffer
@param bufferOffset start offset of the buffer
@... | java | public void getBytes(long memoryOffset, byte[] buffer, int bufferOffset, int count)
{
if (buffer == null)
throw new NullPointerException();
else if (bufferOffset < 0 || count < 0 || count > buffer.length - bufferOffset)
throw new IndexOutOfBoundsException();
else if (... | [
"public",
"void",
"getBytes",
"(",
"long",
"memoryOffset",
",",
"byte",
"[",
"]",
"buffer",
",",
"int",
"bufferOffset",
",",
"int",
"count",
")",
"{",
"if",
"(",
"buffer",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"else",
... | Transfers count bytes from Memory starting at memoryOffset to buffer starting at bufferOffset
@param memoryOffset start offset in the memory
@param buffer the data buffer
@param bufferOffset start offset of the buffer
@param count number of bytes to transfer | [
"Transfers",
"count",
"bytes",
"from",
"Memory",
"starting",
"at",
"memoryOffset",
"to",
"buffer",
"starting",
"at",
"bufferOffset"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/util/Memory.java#L311-L322 |
korpling/ANNIS | annis-service/src/main/java/annis/dao/autogenqueries/QueriesGenerator.java | QueriesGenerator.generateQueries | public void generateQueries(String name, boolean delete) {
"""
Iterates over all registered {@link QueryBuilder} and generate example
queries.
@param name Determines the corpus, for which the example queries are
generated for. It must be the final ANNIS id of the corpus.
"""
List<String> names = new A... | java | public void generateQueries(String name, boolean delete)
{
List<String> names = new ArrayList<>();
names.add(name);
List<Long> ids = queryDao.mapCorpusNamesToIds(names);
if (!ids.isEmpty())
{
generateQueries(ids.get(0), delete);
}
else
{
log.error("{} is unknown to the syst... | [
"public",
"void",
"generateQueries",
"(",
"String",
"name",
",",
"boolean",
"delete",
")",
"{",
"List",
"<",
"String",
">",
"names",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"names",
".",
"add",
"(",
"name",
")",
";",
"List",
"<",
"Long",
">",
... | Iterates over all registered {@link QueryBuilder} and generate example
queries.
@param name Determines the corpus, for which the example queries are
generated for. It must be the final ANNIS id of the corpus. | [
"Iterates",
"over",
"all",
"registered",
"{",
"@link",
"QueryBuilder",
"}",
"and",
"generate",
"example",
"queries",
"."
] | train | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/dao/autogenqueries/QueriesGenerator.java#L207-L220 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java | AppServiceCertificateOrdersInner.resendRequestEmailsAsync | public Observable<Void> resendRequestEmailsAsync(String resourceGroupName, String certificateOrderName, String name) {
"""
Verify domain ownership for this certificate order.
Verify domain ownership for this certificate order.
@param resourceGroupName Name of the resource group to which the resource belongs.
... | java | public Observable<Void> resendRequestEmailsAsync(String resourceGroupName, String certificateOrderName, String name) {
return resendRequestEmailsWithServiceResponseAsync(resourceGroupName, certificateOrderName, name).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void ca... | [
"public",
"Observable",
"<",
"Void",
">",
"resendRequestEmailsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"certificateOrderName",
",",
"String",
"name",
")",
"{",
"return",
"resendRequestEmailsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"certi... | Verify domain ownership for this certificate order.
Verify domain ownership for this certificate order.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param certificateOrderName Name of the certificate order.
@param name Name of the object.
@throws IllegalArgumentException thrown i... | [
"Verify",
"domain",
"ownership",
"for",
"this",
"certificate",
"order",
".",
"Verify",
"domain",
"ownership",
"for",
"this",
"certificate",
"order",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java#L1981-L1988 |
StripesFramework/stripes-stuff | src/main/java/org/stripesstuff/plugin/session/SessionStoreInterceptor.java | SessionStoreInterceptor.getAttribute | @Deprecated
public static Object getAttribute(HttpSession session, String key) {
"""
Returns an object in session.
@param session session.
@param key Key under which object is saved.
@return Object.
@deprecated Use {@link HttpSession#getAttribute(String)} instead.
"""
return session.getAttrib... | java | @Deprecated
public static Object getAttribute(HttpSession session, String key) {
return session.getAttribute(key);
} | [
"@",
"Deprecated",
"public",
"static",
"Object",
"getAttribute",
"(",
"HttpSession",
"session",
",",
"String",
"key",
")",
"{",
"return",
"session",
".",
"getAttribute",
"(",
"key",
")",
";",
"}"
] | Returns an object in session.
@param session session.
@param key Key under which object is saved.
@return Object.
@deprecated Use {@link HttpSession#getAttribute(String)} instead. | [
"Returns",
"an",
"object",
"in",
"session",
"."
] | train | https://github.com/StripesFramework/stripes-stuff/blob/51ad92b4bd5862ba34d7c18c5829fb00ea3a3811/src/main/java/org/stripesstuff/plugin/session/SessionStoreInterceptor.java#L179-L182 |
joniles/mpxj | src/main/java/net/sf/mpxj/mspdi/MSPDIWriter.java | MSPDIWriter.writeProjectExtendedAttributes | private void writeProjectExtendedAttributes(Project project) {
"""
This method writes project extended attribute data into an MSPDI file.
@param project Root node of the MSPDI file
"""
Project.ExtendedAttributes attributes = m_factory.createProjectExtendedAttributes();
project.setExtendedAttribu... | java | private void writeProjectExtendedAttributes(Project project)
{
Project.ExtendedAttributes attributes = m_factory.createProjectExtendedAttributes();
project.setExtendedAttributes(attributes);
List<Project.ExtendedAttributes.ExtendedAttribute> list = attributes.getExtendedAttribute();
Set<Fiel... | [
"private",
"void",
"writeProjectExtendedAttributes",
"(",
"Project",
"project",
")",
"{",
"Project",
".",
"ExtendedAttributes",
"attributes",
"=",
"m_factory",
".",
"createProjectExtendedAttributes",
"(",
")",
";",
"project",
".",
"setExtendedAttributes",
"(",
"attribut... | This method writes project extended attribute data into an MSPDI file.
@param project Root node of the MSPDI file | [
"This",
"method",
"writes",
"project",
"extended",
"attribute",
"data",
"into",
"an",
"MSPDI",
"file",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/MSPDIWriter.java#L295-L341 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/model/TypeSystem.java | TypeSystem.withOppositeComparator | public static <T> TypeFactory<T> withOppositeComparator( final TypeFactory<T> original ) {
"""
Return a new type factory that has a comparator that inverts the normal comparison.
@param original the original type factory; may not be null
@return the new type factory; never null
"""
final Comparator... | java | public static <T> TypeFactory<T> withOppositeComparator( final TypeFactory<T> original ) {
final Comparator<T> comparator = original.getComparator();
final Comparator<T> inverted = new SerializableComparator<T>() {
private static final long serialVersionUID = 1L;
@Override
... | [
"public",
"static",
"<",
"T",
">",
"TypeFactory",
"<",
"T",
">",
"withOppositeComparator",
"(",
"final",
"TypeFactory",
"<",
"T",
">",
"original",
")",
"{",
"final",
"Comparator",
"<",
"T",
">",
"comparator",
"=",
"original",
".",
"getComparator",
"(",
")"... | Return a new type factory that has a comparator that inverts the normal comparison.
@param original the original type factory; may not be null
@return the new type factory; never null | [
"Return",
"a",
"new",
"type",
"factory",
"that",
"has",
"a",
"comparator",
"that",
"inverts",
"the",
"normal",
"comparison",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/model/TypeSystem.java#L319-L331 |
j-easy/easy-random | easy-random-randomizers/src/main/java/org/jeasy/random/randomizers/EmailRandomizer.java | EmailRandomizer.aNewEmailRandomizer | public static EmailRandomizer aNewEmailRandomizer(final long seed, final Locale locale, final boolean safe) {
"""
Create a new {@link EmailRandomizer}.
@param seed the initial seed
@param locale the locale to use
@param safe true to generate safe emails (invalid domains), false otherwise
@return a new {@... | java | public static EmailRandomizer aNewEmailRandomizer(final long seed, final Locale locale, final boolean safe) {
return new EmailRandomizer(seed, locale, safe);
} | [
"public",
"static",
"EmailRandomizer",
"aNewEmailRandomizer",
"(",
"final",
"long",
"seed",
",",
"final",
"Locale",
"locale",
",",
"final",
"boolean",
"safe",
")",
"{",
"return",
"new",
"EmailRandomizer",
"(",
"seed",
",",
"locale",
",",
"safe",
")",
";",
"}... | Create a new {@link EmailRandomizer}.
@param seed the initial seed
@param locale the locale to use
@param safe true to generate safe emails (invalid domains), false otherwise
@return a new {@link EmailRandomizer} | [
"Create",
"a",
"new",
"{",
"@link",
"EmailRandomizer",
"}",
"."
] | train | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-randomizers/src/main/java/org/jeasy/random/randomizers/EmailRandomizer.java#L114-L116 |
vkostyukov/la4j | src/main/java/org/la4j/Matrix.java | Matrix.rowMajorIterator | public RowMajorMatrixIterator rowMajorIterator() {
"""
Returns a row-major matrix iterator.
@return a row-major matrix iterator.
"""
return new RowMajorMatrixIterator(rows, columns) {
private long limit = (long) rows * columns;
private int i = - 1;
@Override
... | java | public RowMajorMatrixIterator rowMajorIterator() {
return new RowMajorMatrixIterator(rows, columns) {
private long limit = (long) rows * columns;
private int i = - 1;
@Override
public int rowIndex() {
return i / columns;
}
... | [
"public",
"RowMajorMatrixIterator",
"rowMajorIterator",
"(",
")",
"{",
"return",
"new",
"RowMajorMatrixIterator",
"(",
"rows",
",",
"columns",
")",
"{",
"private",
"long",
"limit",
"=",
"(",
"long",
")",
"rows",
"*",
"columns",
";",
"private",
"int",
"i",
"=... | Returns a row-major matrix iterator.
@return a row-major matrix iterator. | [
"Returns",
"a",
"row",
"-",
"major",
"matrix",
"iterator",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Matrix.java#L1891-L1931 |
teatrove/teatrove | teaapps/src/main/java/org/teatrove/teaapps/contexts/FileSystemContext.java | FileSystemContext.writeToFile | public void writeToFile(String filePath, String fileData, boolean append)
throws IOException {
"""
Write the contents of the given file data to the file at the given path.
If the append flag is <code>true</code>, the file data will be appended
to the end of the file if it already exists. Note that this w... | java | public void writeToFile(String filePath, String fileData, boolean append)
throws IOException {
// synchronized on an interned string makes has all the
// makings for exclusive write access as far as this
// process is concerned.
String path = (String) Utils.intern(filePath);
... | [
"public",
"void",
"writeToFile",
"(",
"String",
"filePath",
",",
"String",
"fileData",
",",
"boolean",
"append",
")",
"throws",
"IOException",
"{",
"// synchronized on an interned string makes has all the",
"// makings for exclusive write access as far as this",
"// process is co... | Write the contents of the given file data to the file at the given path.
If the append flag is <code>true</code>, the file data will be appended
to the end of the file if it already exists. Note that this will attempt
to create any and all parent directories if the path does not exist.
@param filePath The path to the ... | [
"Write",
"the",
"contents",
"of",
"the",
"given",
"file",
"data",
"to",
"the",
"file",
"at",
"the",
"given",
"path",
".",
"If",
"the",
"append",
"flag",
"is",
"<code",
">",
"true<",
"/",
"code",
">",
"the",
"file",
"data",
"will",
"be",
"appended",
"... | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/FileSystemContext.java#L268-L305 |
TGIO/RNCryptorNative | jncryptor/src/main/java/org/cryptonode/jncryptor/StreamUtils.java | StreamUtils.readAllBytes | static int readAllBytes(InputStream in, byte[] buffer) throws IOException {
"""
Attempts to fill the buffer by reading as many bytes as available. The
returned number indicates how many bytes were read, which may be smaller
than the buffer size if EOF was reached.
@param in
input stream
@param buffer
buffe... | java | static int readAllBytes(InputStream in, byte[] buffer) throws IOException {
int index = 0;
while (index < buffer.length) {
int read = in.read(buffer, index, buffer.length - index);
if (read == -1) {
return index;
}
index += read;
}
return index;
} | [
"static",
"int",
"readAllBytes",
"(",
"InputStream",
"in",
",",
"byte",
"[",
"]",
"buffer",
")",
"throws",
"IOException",
"{",
"int",
"index",
"=",
"0",
";",
"while",
"(",
"index",
"<",
"buffer",
".",
"length",
")",
"{",
"int",
"read",
"=",
"in",
"."... | Attempts to fill the buffer by reading as many bytes as available. The
returned number indicates how many bytes were read, which may be smaller
than the buffer size if EOF was reached.
@param in
input stream
@param buffer
buffer to fill
@return the number of bytes read
@throws IOException | [
"Attempts",
"to",
"fill",
"the",
"buffer",
"by",
"reading",
"as",
"many",
"bytes",
"as",
"available",
".",
"The",
"returned",
"number",
"indicates",
"how",
"many",
"bytes",
"were",
"read",
"which",
"may",
"be",
"smaller",
"than",
"the",
"buffer",
"size",
"... | train | https://github.com/TGIO/RNCryptorNative/blob/5209f10b988e4033c0b769a40b0d6cc99ea16af7/jncryptor/src/main/java/org/cryptonode/jncryptor/StreamUtils.java#L38-L50 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbvserver_binding.java | lbvserver_binding.get | public static lbvserver_binding get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch lbvserver_binding resource of given name .
"""
lbvserver_binding obj = new lbvserver_binding();
obj.set_name(name);
lbvserver_binding response = (lbvserver_binding) obj.get_resource(servic... | java | public static lbvserver_binding get(nitro_service service, String name) throws Exception{
lbvserver_binding obj = new lbvserver_binding();
obj.set_name(name);
lbvserver_binding response = (lbvserver_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"lbvserver_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"lbvserver_binding",
"obj",
"=",
"new",
"lbvserver_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
... | Use this API to fetch lbvserver_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"lbvserver_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/lb/lbvserver_binding.java#L345-L350 |
MutabilityDetector/MutabilityDetector | src/main/java/org/mutabilitydetector/checkers/settermethod/InitialisersFinder.java | InitialisersFinder.newInstance | public static InitialisersFinder newInstance(final Collection<MethodNode> methodsOfAnalysedClass,
final CandidatesInitialisersMapping candidatesInitialisersMapping) {
"""
Creates a new instance of this class. None of the arguments must be
{@code null}.
@param methodsOfAnalysedClass
{@link Collecti... | java | public static InitialisersFinder newInstance(final Collection<MethodNode> methodsOfAnalysedClass,
final CandidatesInitialisersMapping candidatesInitialisersMapping) {
final String msgTemplate = "Argument '%s' must not be null!";
checkNotNull(methodsOfAnalysedClass, format(msgTemplate, "metho... | [
"public",
"static",
"InitialisersFinder",
"newInstance",
"(",
"final",
"Collection",
"<",
"MethodNode",
">",
"methodsOfAnalysedClass",
",",
"final",
"CandidatesInitialisersMapping",
"candidatesInitialisersMapping",
")",
"{",
"final",
"String",
"msgTemplate",
"=",
"\"Argumen... | Creates a new instance of this class. None of the arguments must be
{@code null}.
@param methodsOfAnalysedClass
{@link Collection} containing all methods ({@code MethodNode})
of the class under examination.
@param candidatesInitialisersMapping
an instance of
{@link VariableInitialiserAssociation} which
contains all ca... | [
"Creates",
"a",
"new",
"instance",
"of",
"this",
"class",
".",
"None",
"of",
"the",
"arguments",
"must",
"be",
"{",
"@code",
"null",
"}",
"."
] | train | https://github.com/MutabilityDetector/MutabilityDetector/blob/36014d2f9e45cf0cc6d67b81395942cd39c4f6ae/src/main/java/org/mutabilitydetector/checkers/settermethod/InitialisersFinder.java#L73-L79 |
getsentry/sentry-java | sentry/src/main/java/io/sentry/dsn/Dsn.java | Dsn.extractOptions | private void extractOptions(URI dsnUri) {
"""
Extracts the DSN options from the DSN provided as an {@code URI}.
@param dsnUri DSN as an URI.
"""
String query = dsnUri.getQuery();
if (query == null || query.isEmpty()) {
return;
}
for (String optionPair : query.spli... | java | private void extractOptions(URI dsnUri) {
String query = dsnUri.getQuery();
if (query == null || query.isEmpty()) {
return;
}
for (String optionPair : query.split("&")) {
try {
String[] pairDetails = optionPair.split("=");
String ke... | [
"private",
"void",
"extractOptions",
"(",
"URI",
"dsnUri",
")",
"{",
"String",
"query",
"=",
"dsnUri",
".",
"getQuery",
"(",
")",
";",
"if",
"(",
"query",
"==",
"null",
"||",
"query",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"for",
"... | Extracts the DSN options from the DSN provided as an {@code URI}.
@param dsnUri DSN as an URI. | [
"Extracts",
"the",
"DSN",
"options",
"from",
"the",
"DSN",
"provided",
"as",
"an",
"{",
"@code",
"URI",
"}",
"."
] | train | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/dsn/Dsn.java#L159-L174 |
Harium/keel | src/main/java/com/harium/keel/effect/LevelsLinear.java | LevelsLinear.CalculateMap | private void CalculateMap(IntRange inRange, IntRange outRange, int[] map) {
"""
Calculate conversion map.
@param inRange Input range.
@param outRange Output range.
@param map Conversion map.
"""
double k = 0, b = 0;
if (inRange.getMax() != inRange.getMin()) {
k = (do... | java | private void CalculateMap(IntRange inRange, IntRange outRange, int[] map) {
double k = 0, b = 0;
if (inRange.getMax() != inRange.getMin()) {
k = (double) (outRange.getMax() - outRange.getMin()) / (double) (inRange.getMax() - inRange.getMin());
b = (double) (outRange.getMin(... | [
"private",
"void",
"CalculateMap",
"(",
"IntRange",
"inRange",
",",
"IntRange",
"outRange",
",",
"int",
"[",
"]",
"map",
")",
"{",
"double",
"k",
"=",
"0",
",",
"b",
"=",
"0",
";",
"if",
"(",
"inRange",
".",
"getMax",
"(",
")",
"!=",
"inRange",
"."... | Calculate conversion map.
@param inRange Input range.
@param outRange Output range.
@param map Conversion map. | [
"Calculate",
"conversion",
"map",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/LevelsLinear.java#L285-L305 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.