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 |
|---|---|---|---|---|---|---|---|---|---|---|
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/system/NativeLibraryLoader.java | NativeLibraryLoader.extractToTemp | private File extractToTemp(InputStream _fileToExtract, String _tmpName, String _fileSuffix) throws IOException {
"""
Extract the file behind InputStream _fileToExtract to the tmp-folder.
@param _fileToExtract InputStream with file to extract
@param _tmpName temp file name
@param _fileSuffix temp file suffix
... | java | private File extractToTemp(InputStream _fileToExtract, String _tmpName, String _fileSuffix) throws IOException {
if (_fileToExtract == null) {
throw new IOException("Null stream");
}
File tempFile = File.createTempFile(_tmpName, _fileSuffix);
tempFile.deleteOnExit();
... | [
"private",
"File",
"extractToTemp",
"(",
"InputStream",
"_fileToExtract",
",",
"String",
"_tmpName",
",",
"String",
"_fileSuffix",
")",
"throws",
"IOException",
"{",
"if",
"(",
"_fileToExtract",
"==",
"null",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Null... | Extract the file behind InputStream _fileToExtract to the tmp-folder.
@param _fileToExtract InputStream with file to extract
@param _tmpName temp file name
@param _fileSuffix temp file suffix
@return temp file object
@throws IOException on any error | [
"Extract",
"the",
"file",
"behind",
"InputStream",
"_fileToExtract",
"to",
"the",
"tmp",
"-",
"folder",
"."
] | train | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/system/NativeLibraryLoader.java#L235-L259 |
phax/ph-oton | ph-oton-html/src/main/java/com/helger/html/js/JSMarshaller.java | JSMarshaller.javaScriptEscapeForRegEx | @Nullable
public static String javaScriptEscapeForRegEx (@Nullable final String sInput) {
"""
Turn special regular expression characters into escaped characters
conforming to JavaScript.<br>
Reference: <a href=
"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions"
>MDN Regular E... | java | @Nullable
public static String javaScriptEscapeForRegEx (@Nullable final String sInput)
{
if (StringHelper.hasNoText (sInput))
return sInput;
final char [] aInput = sInput.toCharArray ();
if (!StringHelper.containsAny (aInput, CHARS_TO_MASK_REGEX))
return sInput;
// At last each charac... | [
"@",
"Nullable",
"public",
"static",
"String",
"javaScriptEscapeForRegEx",
"(",
"@",
"Nullable",
"final",
"String",
"sInput",
")",
"{",
"if",
"(",
"StringHelper",
".",
"hasNoText",
"(",
"sInput",
")",
")",
"return",
"sInput",
";",
"final",
"char",
"[",
"]",
... | Turn special regular expression characters into escaped characters
conforming to JavaScript.<br>
Reference: <a href=
"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions"
>MDN Regular Expressions</a>
@param sInput
the input string
@return the escaped string | [
"Turn",
"special",
"regular",
"expression",
"characters",
"into",
"escaped",
"characters",
"conforming",
"to",
"JavaScript",
".",
"<br",
">",
"Reference",
":",
"<a",
"href",
"=",
"https",
":",
"//",
"developer",
".",
"mozilla",
".",
"org",
"/",
"en",
"-",
... | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/js/JSMarshaller.java#L186-L209 |
GoogleCloudPlatform/appengine-pipelines | java/src/main/java/com/google/appengine/tools/pipeline/Job.java | Job.futureCall | public <T, T1, T2> FutureValue<T> futureCall(Job2<T, T1, T2> jobInstance, Value<? extends T1> v1,
Value<? extends T2> v2, JobSetting... settings) {
"""
Invoke this method from within the {@code run} method of a <b>generator
job</b> in order to specify a job node in the generated child job graph.
This versi... | java | public <T, T1, T2> FutureValue<T> futureCall(Job2<T, T1, T2> jobInstance, Value<? extends T1> v1,
Value<? extends T2> v2, JobSetting... settings) {
return futureCallUnchecked(settings, jobInstance, v1, v2);
} | [
"public",
"<",
"T",
",",
"T1",
",",
"T2",
">",
"FutureValue",
"<",
"T",
">",
"futureCall",
"(",
"Job2",
"<",
"T",
",",
"T1",
",",
"T2",
">",
"jobInstance",
",",
"Value",
"<",
"?",
"extends",
"T1",
">",
"v1",
",",
"Value",
"<",
"?",
"extends",
"... | Invoke this method from within the {@code run} method of a <b>generator
job</b> in order to specify a job node in the generated child job graph.
This version of the method is for child jobs that take two arguments.
@param <T> The return type of the child job being specified
@param <T1> The type of the first input to t... | [
"Invoke",
"this",
"method",
"from",
"within",
"the",
"{",
"@code",
"run",
"}",
"method",
"of",
"a",
"<b",
">",
"generator",
"job<",
"/",
"b",
">",
"in",
"order",
"to",
"specify",
"a",
"job",
"node",
"in",
"the",
"generated",
"child",
"job",
"graph",
... | train | https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/Job.java#L240-L243 |
aequologica/geppaequo | geppaequo-core/src/main/java/net/aequologica/neo/geppaequo/auth/MethodUtils.java | MethodUtils.isAssignmentCompatible | public static final boolean isAssignmentCompatible(Class<?> parameterType, Class<?> parameterization) {
"""
<p>Determine whether a type can be used as a parameter in a method invocation.
This method handles primitive conversions correctly.</p>
<p>In order words, it will match a <code>Boolean</code> to a <code>... | java | public static final boolean isAssignmentCompatible(Class<?> parameterType, Class<?> parameterization) {
// try plain assignment
if (parameterType.isAssignableFrom(parameterization)) {
return true;
}
if (parameterType.isPrimitive()) {
// this method does *n... | [
"public",
"static",
"final",
"boolean",
"isAssignmentCompatible",
"(",
"Class",
"<",
"?",
">",
"parameterType",
",",
"Class",
"<",
"?",
">",
"parameterization",
")",
"{",
"// try plain assignment\r",
"if",
"(",
"parameterType",
".",
"isAssignableFrom",
"(",
"param... | <p>Determine whether a type can be used as a parameter in a method invocation.
This method handles primitive conversions correctly.</p>
<p>In order words, it will match a <code>Boolean</code> to a <code>boolean</code>,
a <code>Long</code> to a <code>long</code>,
a <code>Float</code> to a <code>float</code>,
a <code>In... | [
"<p",
">",
"Determine",
"whether",
"a",
"type",
"can",
"be",
"used",
"as",
"a",
"parameter",
"in",
"a",
"method",
"invocation",
".",
"This",
"method",
"handles",
"primitive",
"conversions",
"correctly",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aequologica/geppaequo/blob/b72e5f6356535fd045a931f8c544d4a8ea6e35a2/geppaequo-core/src/main/java/net/aequologica/neo/geppaequo/auth/MethodUtils.java#L1175-L1191 |
structr/structr | structr-core/src/main/java/org/structr/core/graph/GraphObjectModificationState.java | GraphObjectModificationState.doValidationAndIndexing | public boolean doValidationAndIndexing(ModificationQueue modificationQueue, SecurityContext securityContext, ErrorBuffer errorBuffer, boolean doValidation) throws FrameworkException {
"""
Call beforeModification/Creation/Deletion methods.
@param modificationQueue
@param securityContext
@param errorBuffer
@pa... | java | public boolean doValidationAndIndexing(ModificationQueue modificationQueue, SecurityContext securityContext, ErrorBuffer errorBuffer, boolean doValidation) throws FrameworkException {
boolean valid = true;
// examine only the last 4 bits here
switch (status & 0x000f) {
case 6: // created, modified => only c... | [
"public",
"boolean",
"doValidationAndIndexing",
"(",
"ModificationQueue",
"modificationQueue",
",",
"SecurityContext",
"securityContext",
",",
"ErrorBuffer",
"errorBuffer",
",",
"boolean",
"doValidation",
")",
"throws",
"FrameworkException",
"{",
"boolean",
"valid",
"=",
... | Call beforeModification/Creation/Deletion methods.
@param modificationQueue
@param securityContext
@param errorBuffer
@param doValidation
@return valid
@throws FrameworkException | [
"Call",
"beforeModification",
"/",
"Creation",
"/",
"Deletion",
"methods",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/graph/GraphObjectModificationState.java#L363-L395 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WContentRenderer.java | WContentRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
"""
<p>
Paints the given WContent.</p>
<p>
This paint method outputs a popup that opens browser window in which the content document will be displayed. The
component is only rendered for requests in which t... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WContent content = (WContent) component;
XmlStringBuilder xml = renderContext.getWriter();
if (!content.isDisplayRequested()) {
// This is the normal situation.
return;
}
Object contentAccess = conte... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WContent",
"content",
"=",
"(",
"WContent",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"renderConte... | <p>
Paints the given WContent.</p>
<p>
This paint method outputs a popup that opens browser window in which the content document will be displayed. The
component is only rendered for requests in which the display() method of the content component has just been
called.</p>
<p>
WContent's handleRequest() method will re... | [
"<p",
">",
"Paints",
"the",
"given",
"WContent",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WContentRenderer.java#L39-L77 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/CmsGalleryControllerHandler.java | CmsGalleryControllerHandler.onUpdateCategoriesList | public void onUpdateCategoriesList(List<CmsCategoryBean> categoriesList, List<String> selectedCategories) {
"""
Will be triggered when categories list is sorted.<p>
@param categoriesList the updated categories list
@param selectedCategories the selected categories
"""
m_galleryDialog.getCategories... | java | public void onUpdateCategoriesList(List<CmsCategoryBean> categoriesList, List<String> selectedCategories) {
m_galleryDialog.getCategoriesTab().updateContentList(categoriesList, selectedCategories);
} | [
"public",
"void",
"onUpdateCategoriesList",
"(",
"List",
"<",
"CmsCategoryBean",
">",
"categoriesList",
",",
"List",
"<",
"String",
">",
"selectedCategories",
")",
"{",
"m_galleryDialog",
".",
"getCategoriesTab",
"(",
")",
".",
"updateContentList",
"(",
"categoriesL... | Will be triggered when categories list is sorted.<p>
@param categoriesList the updated categories list
@param selectedCategories the selected categories | [
"Will",
"be",
"triggered",
"when",
"categories",
"list",
"is",
"sorted",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/CmsGalleryControllerHandler.java#L363-L366 |
future-architect/uroborosql | src/main/java/jp/co/future/uroborosql/parameter/mapper/JdbcParameterFactory.java | JdbcParameterFactory.createArrayOf | public static Array createArrayOf(final Connection conn, final String typeName, final Object[] elements) {
"""
{@link java.sql.Connection#createArrayOf(String, Object[])}のラッパー
@param conn コネクション
@param typeName 配列の要素がマッピングされる型のSQL名。typeNameはデータベース固有の名前で、組込み型、ユーザー定義型、またはこのデータベースでサポートされる標準SQL型の名前のこと。これは、Array.ge... | java | public static Array createArrayOf(final Connection conn, final String typeName, final Object[] elements) {
try {
return conn.createArrayOf(typeName, elements);
} catch (SQLException e) {
throw new UroborosqlRuntimeException(e);
}
} | [
"public",
"static",
"Array",
"createArrayOf",
"(",
"final",
"Connection",
"conn",
",",
"final",
"String",
"typeName",
",",
"final",
"Object",
"[",
"]",
"elements",
")",
"{",
"try",
"{",
"return",
"conn",
".",
"createArrayOf",
"(",
"typeName",
",",
"elements"... | {@link java.sql.Connection#createArrayOf(String, Object[])}のラッパー
@param conn コネクション
@param typeName 配列の要素がマッピングされる型のSQL名。typeNameはデータベース固有の名前で、組込み型、ユーザー定義型、またはこのデータベースでサポートされる標準SQL型の名前のこと。これは、Array.getBaseTypeNameで返される値
@param elements 返されるオブジェクトを生成する要素
@return 指定されたSQL型に要素がマッピングされるArrayオブジェクト
@see java.sql.Connectio... | [
"{",
"@link",
"java",
".",
"sql",
".",
"Connection#createArrayOf",
"(",
"String",
"Object",
"[]",
")",
"}",
"のラッパー"
] | train | https://github.com/future-architect/uroborosql/blob/4c26db51defdac3c6ed16866e33ab45e190e2e0c/src/main/java/jp/co/future/uroborosql/parameter/mapper/JdbcParameterFactory.java#L42-L48 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/datebox/CmsDateBox.java | CmsDateBox.setPickerValue | private void setPickerValue(Date date, boolean fireEvents) {
"""
Sets the value of the date picker.<p>
@param date the value to set
@param fireEvents signals whether the value changed event should be fired or not
"""
if (date == null) {
date = new Date();
}
m_picker.set... | java | private void setPickerValue(Date date, boolean fireEvents) {
if (date == null) {
date = new Date();
}
m_picker.setValue(date, fireEvents);
m_picker.setCurrentMonth(date);
m_time.setFormValueAsString(CmsDateConverter.cutSuffix(CmsDateConverter.getTime(date)).trim());
... | [
"private",
"void",
"setPickerValue",
"(",
"Date",
"date",
",",
"boolean",
"fireEvents",
")",
"{",
"if",
"(",
"date",
"==",
"null",
")",
"{",
"date",
"=",
"new",
"Date",
"(",
")",
";",
"}",
"m_picker",
".",
"setValue",
"(",
"date",
",",
"fireEvents",
... | Sets the value of the date picker.<p>
@param date the value to set
@param fireEvents signals whether the value changed event should be fired or not | [
"Sets",
"the",
"value",
"of",
"the",
"date",
"picker",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/datebox/CmsDateBox.java#L949-L962 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/ResponseHandler.java | ResponseHandler.onEvent | @Override
public void onEvent(final ResponseEvent event, long sequence, boolean endOfBatch) throws Exception {
"""
Handles {@link ResponseEvent}s that come into the response RingBuffer.
Hey I just mapped you,
And this is crazy,
But here's my data
so subscribe me maybe.
It's hard to block right,
at yo... | java | @Override
public void onEvent(final ResponseEvent event, long sequence, boolean endOfBatch) throws Exception {
try {
CouchbaseMessage message = event.getMessage();
if (message instanceof SignalConfigReload) {
configurationProvider.signalOutdated();
} else ... | [
"@",
"Override",
"public",
"void",
"onEvent",
"(",
"final",
"ResponseEvent",
"event",
",",
"long",
"sequence",
",",
"boolean",
"endOfBatch",
")",
"throws",
"Exception",
"{",
"try",
"{",
"CouchbaseMessage",
"message",
"=",
"event",
".",
"getMessage",
"(",
")",
... | Handles {@link ResponseEvent}s that come into the response RingBuffer.
Hey I just mapped you,
And this is crazy,
But here's my data
so subscribe me maybe.
It's hard to block right,
at you baby,
But here's my data ,
so subscribe me maybe. | [
"Handles",
"{",
"@link",
"ResponseEvent",
"}",
"s",
"that",
"come",
"into",
"the",
"response",
"RingBuffer",
"."
] | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/ResponseHandler.java#L94-L131 |
pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/ExceptionUtilities.java | ExceptionUtilities.getStackTrace | public static String getStackTrace(final Throwable ex) {
"""
A standard function to get the stack trace from a
thrown Exception
@param ex The thrown exception
@return The stack trace from the exception
"""
final StringWriter sw = new StringWriter();
final PrintWriter pw = new PrintWriter(s... | java | public static String getStackTrace(final Throwable ex) {
final StringWriter sw = new StringWriter();
final PrintWriter pw = new PrintWriter(sw, true);
ex.printStackTrace(pw);
pw.flush();
sw.flush();
return sw.toString();
} | [
"public",
"static",
"String",
"getStackTrace",
"(",
"final",
"Throwable",
"ex",
")",
"{",
"final",
"StringWriter",
"sw",
"=",
"new",
"StringWriter",
"(",
")",
";",
"final",
"PrintWriter",
"pw",
"=",
"new",
"PrintWriter",
"(",
"sw",
",",
"true",
")",
";",
... | A standard function to get the stack trace from a
thrown Exception
@param ex The thrown exception
@return The stack trace from the exception | [
"A",
"standard",
"function",
"to",
"get",
"the",
"stack",
"trace",
"from",
"a",
"thrown",
"Exception"
] | train | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/ExceptionUtilities.java#L33-L40 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java | CommerceCountryPersistenceImpl.removeByG_Tw | @Override
public CommerceCountry removeByG_Tw(long groupId, String twoLettersISOCode)
throws NoSuchCountryException {
"""
Removes the commerce country where groupId = ? and twoLettersISOCode = ? from the database.
@param groupId the group ID
@param twoLettersISOCode the two letters iso code
@return... | java | @Override
public CommerceCountry removeByG_Tw(long groupId, String twoLettersISOCode)
throws NoSuchCountryException {
CommerceCountry commerceCountry = findByG_Tw(groupId, twoLettersISOCode);
return remove(commerceCountry);
} | [
"@",
"Override",
"public",
"CommerceCountry",
"removeByG_Tw",
"(",
"long",
"groupId",
",",
"String",
"twoLettersISOCode",
")",
"throws",
"NoSuchCountryException",
"{",
"CommerceCountry",
"commerceCountry",
"=",
"findByG_Tw",
"(",
"groupId",
",",
"twoLettersISOCode",
")"... | Removes the commerce country where groupId = ? and twoLettersISOCode = ? from the database.
@param groupId the group ID
@param twoLettersISOCode the two letters iso code
@return the commerce country that was removed | [
"Removes",
"the",
"commerce",
"country",
"where",
"groupId",
"=",
"?",
";",
"and",
"twoLettersISOCode",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java#L2156-L2162 |
zalando-nakadi/fahrschein | fahrschein/src/main/java/org/zalando/fahrschein/NakadiClient.java | NakadiClient.subscribe | @Deprecated
public Subscription subscribe(String applicationName, String eventName, String consumerGroup) throws IOException {
"""
Create a subscription for a single event type.
@deprecated Use the {@link SubscriptionBuilder} and {@link NakadiClient#subscription(String, String)} instead.
"""
ret... | java | @Deprecated
public Subscription subscribe(String applicationName, String eventName, String consumerGroup) throws IOException {
return subscription(applicationName, eventName).withConsumerGroup(consumerGroup).subscribe();
} | [
"@",
"Deprecated",
"public",
"Subscription",
"subscribe",
"(",
"String",
"applicationName",
",",
"String",
"eventName",
",",
"String",
"consumerGroup",
")",
"throws",
"IOException",
"{",
"return",
"subscription",
"(",
"applicationName",
",",
"eventName",
")",
".",
... | Create a subscription for a single event type.
@deprecated Use the {@link SubscriptionBuilder} and {@link NakadiClient#subscription(String, String)} instead. | [
"Create",
"a",
"subscription",
"for",
"a",
"single",
"event",
"type",
"."
] | train | https://github.com/zalando-nakadi/fahrschein/blob/b55ae0ff79aacb300548a88f3969fd11a0904804/fahrschein/src/main/java/org/zalando/fahrschein/NakadiClient.java#L82-L85 |
agmip/translator-dssat | src/main/java/org/agmip/translators/dssat/DssatBatchFileOutput.java | DssatBatchFileOutput.writeFile | @Override
public void writeFile(String arg0, Map result) {
"""
DSSAT Batch File Output method
@param arg0 file output path
@param result data holder object
"""
// Initial variables
BufferedWriter bwB; // output object
StringBuilder sbData = new StringBui... | java | @Override
public void writeFile(String arg0, Map result) {
// Initial variables
BufferedWriter bwB; // output object
StringBuilder sbData = new StringBuilder(); // construct the data info in the output
try {
// Set default value for missing data... | [
"@",
"Override",
"public",
"void",
"writeFile",
"(",
"String",
"arg0",
",",
"Map",
"result",
")",
"{",
"// Initial variables",
"BufferedWriter",
"bwB",
";",
"// output object",
"StringBuilder",
"sbData",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"// construct th... | DSSAT Batch File Output method
@param arg0 file output path
@param result data holder object | [
"DSSAT",
"Batch",
"File",
"Output",
"method"
] | train | https://github.com/agmip/translator-dssat/blob/4be61d998f106eb7234ea8701b63c3746ae688f4/src/main/java/org/agmip/translators/dssat/DssatBatchFileOutput.java#L145-L210 |
apache/incubator-shardingsphere | sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/communication/jdbc/connection/BackendConnection.java | BackendConnection.setCurrentSchema | public void setCurrentSchema(final String schemaName) {
"""
Change logic schema of current channel.
@param schemaName schema name
"""
if (isSwitchFailed()) {
throw new ShardingException("Failed to switch schema, please terminate current transaction.");
}
this.schemaName =... | java | public void setCurrentSchema(final String schemaName) {
if (isSwitchFailed()) {
throw new ShardingException("Failed to switch schema, please terminate current transaction.");
}
this.schemaName = schemaName;
this.logicSchema = LogicSchemas.getInstance().getLogicSchema(schemaNa... | [
"public",
"void",
"setCurrentSchema",
"(",
"final",
"String",
"schemaName",
")",
"{",
"if",
"(",
"isSwitchFailed",
"(",
")",
")",
"{",
"throw",
"new",
"ShardingException",
"(",
"\"Failed to switch schema, please terminate current transaction.\"",
")",
";",
"}",
"this"... | Change logic schema of current channel.
@param schemaName schema name | [
"Change",
"logic",
"schema",
"of",
"current",
"channel",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/communication/jdbc/connection/BackendConnection.java#L105-L111 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/JMessageClient.java | JMessageClient.getMessageList | public MessageListResult getMessageList(int count, String begin_time, String end_time)
throws APIConnectionException, APIRequestException {
"""
Get message list from history, messages will store 60 days.
@param count Necessary parameter. The count of the message list.
@param begin_time Necessary para... | java | public MessageListResult getMessageList(int count, String begin_time, String end_time)
throws APIConnectionException, APIRequestException {
return _messageClient.getMessageList(count, begin_time, end_time);
} | [
"public",
"MessageListResult",
"getMessageList",
"(",
"int",
"count",
",",
"String",
"begin_time",
",",
"String",
"end_time",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"return",
"_messageClient",
".",
"getMessageList",
"(",
"count",
","... | Get message list from history, messages will store 60 days.
@param count Necessary parameter. The count of the message list.
@param begin_time Necessary parameter. The format must follow by 'yyyy-MM-dd HH:mm:ss'
@param end_time Necessary parameter. The format must follow by 'yyyy-MM-dd HH:mm:ss'
@return MessageListResu... | [
"Get",
"message",
"list",
"from",
"history",
"messages",
"will",
"store",
"60",
"days",
"."
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/JMessageClient.java#L500-L503 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FailoverGroupsInner.java | FailoverGroupsInner.failoverAsync | public Observable<FailoverGroupInner> failoverAsync(String resourceGroupName, String serverName, String failoverGroupName) {
"""
Fails over from the current primary server to this server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure... | java | public Observable<FailoverGroupInner> failoverAsync(String resourceGroupName, String serverName, String failoverGroupName) {
return failoverWithServiceResponseAsync(resourceGroupName, serverName, failoverGroupName).map(new Func1<ServiceResponse<FailoverGroupInner>, FailoverGroupInner>() {
@Override
... | [
"public",
"Observable",
"<",
"FailoverGroupInner",
">",
"failoverAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"failoverGroupName",
")",
"{",
"return",
"failoverWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName... | Fails over from the current primary server to this server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server containing the failover group.
@param failoverGroupName Th... | [
"Fails",
"over",
"from",
"the",
"current",
"primary",
"server",
"to",
"this",
"server",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FailoverGroupsInner.java#L917-L924 |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository/src/com/ibm/ws/repository/resources/internal/ResourceFactory.java | ResourceFactory.createResourceFromAsset | public RepositoryResourceImpl createResourceFromAsset(Asset ass, RepositoryConnection connection) throws RepositoryBackendException {
"""
Creates a resources from the supplied asset
@param ass The asset to create the resource from.
@param userId user id to log on to massive with
@param password password to lo... | java | public RepositoryResourceImpl createResourceFromAsset(Asset ass, RepositoryConnection connection) throws RepositoryBackendException {
// No wlp information means no type set, so can't create a resource from this....
RepositoryResourceImpl result;
if (null == ass.getWlpInformation() ||
... | [
"public",
"RepositoryResourceImpl",
"createResourceFromAsset",
"(",
"Asset",
"ass",
",",
"RepositoryConnection",
"connection",
")",
"throws",
"RepositoryBackendException",
"{",
"// No wlp information means no type set, so can't create a resource from this....",
"RepositoryResourceImpl",
... | Creates a resources from the supplied asset
@param ass The asset to create the resource from.
@param userId user id to log on to massive with
@param password password to log on to massive with
@param apiKey the apikey for the marketplace
@return
@throws RepositoryBackendException | [
"Creates",
"a",
"resources",
"from",
"the",
"supplied",
"asset"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository/src/com/ibm/ws/repository/resources/internal/ResourceFactory.java#L49-L61 |
osmdroid/osmdroid | osmdroid-third-party/src/main/java/org/osmdroid/google/wrapper/v2/MapFactory.java | MapFactory.canGetMapsFingerprint | public static boolean canGetMapsFingerprint(final PackageManager pm, final String packageName) {
"""
Sometimes {@link #isGoogleMapsV1Supported} can give a false positive which causes a subsequent
error when starting the map activity.
This method can be called as an extra check.
"""
try {
final Class<?> ... | java | public static boolean canGetMapsFingerprint(final PackageManager pm, final String packageName) {
try {
final Class<?> cls = Class.forName("com.google.android.maps.KeyHelper");
final Method gsf = cls.getDeclaredMethod("getSignatureFingerprint", new Class[]{PackageManager.class, String.class});
gsf.setAccessib... | [
"public",
"static",
"boolean",
"canGetMapsFingerprint",
"(",
"final",
"PackageManager",
"pm",
",",
"final",
"String",
"packageName",
")",
"{",
"try",
"{",
"final",
"Class",
"<",
"?",
">",
"cls",
"=",
"Class",
".",
"forName",
"(",
"\"com.google.android.maps.KeyHe... | Sometimes {@link #isGoogleMapsV1Supported} can give a false positive which causes a subsequent
error when starting the map activity.
This method can be called as an extra check. | [
"Sometimes",
"{"
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-third-party/src/main/java/org/osmdroid/google/wrapper/v2/MapFactory.java#L82-L92 |
google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java | BigDecimal.doRound | private static BigDecimal doRound(long compactVal, int scale, MathContext mc) {
"""
/*
Returns a {@code BigDecimal} created from {@code long} value with
given scale rounded according to the MathContext settings
"""
int mcp = mc.precision;
if (mcp > 0 && mcp < 19) {
int prec = long... | java | private static BigDecimal doRound(long compactVal, int scale, MathContext mc) {
int mcp = mc.precision;
if (mcp > 0 && mcp < 19) {
int prec = longDigitLength(compactVal);
int drop = prec - mcp; // drop can't be more than 18
while (drop > 0) {
scale = ... | [
"private",
"static",
"BigDecimal",
"doRound",
"(",
"long",
"compactVal",
",",
"int",
"scale",
",",
"MathContext",
"mc",
")",
"{",
"int",
"mcp",
"=",
"mc",
".",
"precision",
";",
"if",
"(",
"mcp",
">",
"0",
"&&",
"mcp",
"<",
"19",
")",
"{",
"int",
"... | /*
Returns a {@code BigDecimal} created from {@code long} value with
given scale rounded according to the MathContext settings | [
"/",
"*",
"Returns",
"a",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java#L4028-L4042 |
zaproxy/zaproxy | src/org/zaproxy/zap/utils/HarUtils.java | HarUtils.createHarEntry | public static HarEntry createHarEntry(HttpMessage httpMessage) {
"""
Creates a {@code HarEntry} from the given message.
@param httpMessage the HTTP message.
@return the {@code HarEntry}, never {@code null}.
@see #createHarEntry(int, int, HttpMessage)
@see #createMessageHarCustomFields(int, int, String)
"... | java | public static HarEntry createHarEntry(HttpMessage httpMessage) {
HarEntryTimings timings = new HarEntryTimings(0, 0, httpMessage.getTimeElapsedMillis());
return new HarEntry(
new Date(httpMessage.getTimeSentMillis()),
httpMessage.getTimeElapsedMillis(),
c... | [
"public",
"static",
"HarEntry",
"createHarEntry",
"(",
"HttpMessage",
"httpMessage",
")",
"{",
"HarEntryTimings",
"timings",
"=",
"new",
"HarEntryTimings",
"(",
"0",
",",
"0",
",",
"httpMessage",
".",
"getTimeElapsedMillis",
"(",
")",
")",
";",
"return",
"new",
... | Creates a {@code HarEntry} from the given message.
@param httpMessage the HTTP message.
@return the {@code HarEntry}, never {@code null}.
@see #createHarEntry(int, int, HttpMessage)
@see #createMessageHarCustomFields(int, int, String) | [
"Creates",
"a",
"{",
"@code",
"HarEntry",
"}",
"from",
"the",
"given",
"message",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/utils/HarUtils.java#L177-L187 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/BaseField.java | BaseField.setupTablePopup | public ScreenComponent setupTablePopup(ScreenLoc itsLocation, ComponentParent targetScreen, int iDisplayFieldDesc, Rec record, String displayFieldName, boolean bIncludeBlankOption) {
"""
Add a popup for the table tied to this field.
@return Return the component or ScreenField that is created for this field.
... | java | public ScreenComponent setupTablePopup(ScreenLoc itsLocation, ComponentParent targetScreen, int iDisplayFieldDesc, Rec record, String displayFieldName, boolean bIncludeBlankOption)
{
return this.setupTablePopup(itsLocation, targetScreen, this, iDisplayFieldDesc, record, null, displayFieldName, bIncludeBlank... | [
"public",
"ScreenComponent",
"setupTablePopup",
"(",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"int",
"iDisplayFieldDesc",
",",
"Rec",
"record",
",",
"String",
"displayFieldName",
",",
"boolean",
"bIncludeBlankOption",
")",
"{",
"return",
... | Add a popup for the table tied to this field.
@return Return the component or ScreenField that is created for this field. | [
"Add",
"a",
"popup",
"for",
"the",
"table",
"tied",
"to",
"this",
"field",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L1185-L1188 |
EvidentSolutions/dalesbred | dalesbred/src/main/java/org/dalesbred/Database.java | Database.findOptional | public @NotNull <T> Optional<T> findOptional(@NotNull Class<T> cl, @NotNull @SQL String sql, Object... args) {
"""
Finds a unique result from database, converting the database row to given class using default mechanisms.
Returns empty if there are no results or if single null result is returned.
@throws NonUni... | java | public @NotNull <T> Optional<T> findOptional(@NotNull Class<T> cl, @NotNull @SQL String sql, Object... args) {
return findOptional(cl, SqlQuery.query(sql, args));
} | [
"public",
"@",
"NotNull",
"<",
"T",
">",
"Optional",
"<",
"T",
">",
"findOptional",
"(",
"@",
"NotNull",
"Class",
"<",
"T",
">",
"cl",
",",
"@",
"NotNull",
"@",
"SQL",
"String",
"sql",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"findOptional",... | Finds a unique result from database, converting the database row to given class using default mechanisms.
Returns empty if there are no results or if single null result is returned.
@throws NonUniqueResultException if there are multiple result rows | [
"Finds",
"a",
"unique",
"result",
"from",
"database",
"converting",
"the",
"database",
"row",
"to",
"given",
"class",
"using",
"default",
"mechanisms",
".",
"Returns",
"empty",
"if",
"there",
"are",
"no",
"results",
"or",
"if",
"single",
"null",
"result",
"i... | train | https://github.com/EvidentSolutions/dalesbred/blob/713f5b6e152d97e1672ca68b9ff9c7c6c288ceb1/dalesbred/src/main/java/org/dalesbred/Database.java#L402-L404 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/CmsGalleryController.java | CmsGalleryController.setIncludeExpired | public void setIncludeExpired(boolean includeExpired, boolean fireEvent) {
"""
Sets if the search should include expired or unreleased resources.<p>
@param includeExpired if the search should include expired or unreleased resources
@param fireEvent true if a change event should be fired after setting the value... | java | public void setIncludeExpired(boolean includeExpired, boolean fireEvent) {
m_searchObject.setIncludeExpired(includeExpired);
m_searchObjectChanged = true;
if (fireEvent) {
ValueChangeEvent.fire(this, m_searchObject);
}
} | [
"public",
"void",
"setIncludeExpired",
"(",
"boolean",
"includeExpired",
",",
"boolean",
"fireEvent",
")",
"{",
"m_searchObject",
".",
"setIncludeExpired",
"(",
"includeExpired",
")",
";",
"m_searchObjectChanged",
"=",
"true",
";",
"if",
"(",
"fireEvent",
")",
"{"... | Sets if the search should include expired or unreleased resources.<p>
@param includeExpired if the search should include expired or unreleased resources
@param fireEvent true if a change event should be fired after setting the value | [
"Sets",
"if",
"the",
"search",
"should",
"include",
"expired",
"or",
"unreleased",
"resources",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/CmsGalleryController.java#L1288-L1296 |
vtatai/srec | core/src/main/java/com/github/srec/util/Utils.java | Utils.groovyEvaluateConvert | public static Value groovyEvaluateConvert(ExecutionContext context, String expression) {
"""
Evaluates an expression using Groovy, converting the final value.
@param context The EC
@param expression The expression to evaluate
@return The value converted
"""
Object obj = groovyEvaluate(context, exp... | java | public static Value groovyEvaluateConvert(ExecutionContext context, String expression) {
Object obj = groovyEvaluate(context, expression);
return Utils.convertFromJava(obj);
} | [
"public",
"static",
"Value",
"groovyEvaluateConvert",
"(",
"ExecutionContext",
"context",
",",
"String",
"expression",
")",
"{",
"Object",
"obj",
"=",
"groovyEvaluate",
"(",
"context",
",",
"expression",
")",
";",
"return",
"Utils",
".",
"convertFromJava",
"(",
... | Evaluates an expression using Groovy, converting the final value.
@param context The EC
@param expression The expression to evaluate
@return The value converted | [
"Evaluates",
"an",
"expression",
"using",
"Groovy",
"converting",
"the",
"final",
"value",
"."
] | train | https://github.com/vtatai/srec/blob/87fa6754a6a5f8569ef628db4d149eea04062568/core/src/main/java/com/github/srec/util/Utils.java#L266-L269 |
infinispan/infinispan | commons/src/main/java/org/infinispan/commons/util/TypedProperties.java | TypedProperties.putIfAbsent | public synchronized TypedProperties putIfAbsent(String key, String value) {
"""
Put a value if the associated key is not present
@param key new key
@param value new value
@return this TypedProperties instance for method chaining
"""
if (getProperty(key) == null) {
put(key, value);
}
... | java | public synchronized TypedProperties putIfAbsent(String key, String value) {
if (getProperty(key) == null) {
put(key, value);
}
return this;
} | [
"public",
"synchronized",
"TypedProperties",
"putIfAbsent",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"getProperty",
"(",
"key",
")",
"==",
"null",
")",
"{",
"put",
"(",
"key",
",",
"value",
")",
";",
"}",
"return",
"this",
";"... | Put a value if the associated key is not present
@param key new key
@param value new value
@return this TypedProperties instance for method chaining | [
"Put",
"a",
"value",
"if",
"the",
"associated",
"key",
"is",
"not",
"present",
"@param",
"key",
"new",
"key",
"@param",
"value",
"new",
"value",
"@return",
"this",
"TypedProperties",
"instance",
"for",
"method",
"chaining"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/util/TypedProperties.java#L162-L167 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/entities/Game.java | Game.playing | public static Game playing(String name) {
"""
Creates a new Game instance with the specified name.
<br>In order to appear as "streaming" in the official client you must
provide a valid (see documentation of method) streaming URL in {@link #streaming(String, String) Game.streaming(String, String)}.
@param nam... | java | public static Game playing(String name)
{
Checks.notBlank(name, "Name");
return new Game(name, null, GameType.DEFAULT);
} | [
"public",
"static",
"Game",
"playing",
"(",
"String",
"name",
")",
"{",
"Checks",
".",
"notBlank",
"(",
"name",
",",
"\"Name\"",
")",
";",
"return",
"new",
"Game",
"(",
"name",
",",
"null",
",",
"GameType",
".",
"DEFAULT",
")",
";",
"}"
] | Creates a new Game instance with the specified name.
<br>In order to appear as "streaming" in the official client you must
provide a valid (see documentation of method) streaming URL in {@link #streaming(String, String) Game.streaming(String, String)}.
@param name
The not-null name of the newly created game
@throws ... | [
"Creates",
"a",
"new",
"Game",
"instance",
"with",
"the",
"specified",
"name",
".",
"<br",
">",
"In",
"order",
"to",
"appear",
"as",
"streaming",
"in",
"the",
"official",
"client",
"you",
"must",
"provide",
"a",
"valid",
"(",
"see",
"documentation",
"of",
... | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/entities/Game.java#L168-L172 |
wildfly/wildfly-maven-plugin | core/src/main/java/org/wildfly/plugin/core/Deployment.java | Deployment.of | public static Deployment of(final File content) {
"""
Creates a new deployment for the file. If the file is a directory the content will be deployed exploded using
the file system location.
@param content the file containing the content
@return the deployment
"""
final DeploymentContent deployme... | java | public static Deployment of(final File content) {
final DeploymentContent deploymentContent = DeploymentContent.of(Assert.checkNotNullParam("content", content).toPath());
return new Deployment(deploymentContent, null);
} | [
"public",
"static",
"Deployment",
"of",
"(",
"final",
"File",
"content",
")",
"{",
"final",
"DeploymentContent",
"deploymentContent",
"=",
"DeploymentContent",
".",
"of",
"(",
"Assert",
".",
"checkNotNullParam",
"(",
"\"content\"",
",",
"content",
")",
".",
"toP... | Creates a new deployment for the file. If the file is a directory the content will be deployed exploded using
the file system location.
@param content the file containing the content
@return the deployment | [
"Creates",
"a",
"new",
"deployment",
"for",
"the",
"file",
".",
"If",
"the",
"file",
"is",
"a",
"directory",
"the",
"content",
"will",
"be",
"deployed",
"exploded",
"using",
"the",
"file",
"system",
"location",
"."
] | train | https://github.com/wildfly/wildfly-maven-plugin/blob/c0e2d7ee28e511092561801959eae253b2b56def/core/src/main/java/org/wildfly/plugin/core/Deployment.java#L66-L69 |
otto-de/edison-microservice | edison-core/src/main/java/de/otto/edison/status/domain/StatusDetail.java | StatusDetail.withoutDetail | public StatusDetail withoutDetail(final String key) {
"""
Create a copy of this StatusDetail, remove a detail and return the new StatusDetail.
@param key the key of the additional detail
@return StatusDetail
"""
final LinkedHashMap<String, String> newDetails = new LinkedHashMap<>(details);
... | java | public StatusDetail withoutDetail(final String key) {
final LinkedHashMap<String, String> newDetails = new LinkedHashMap<>(details);
newDetails.remove(key);
return statusDetail(name,status,message, newDetails);
} | [
"public",
"StatusDetail",
"withoutDetail",
"(",
"final",
"String",
"key",
")",
"{",
"final",
"LinkedHashMap",
"<",
"String",
",",
"String",
">",
"newDetails",
"=",
"new",
"LinkedHashMap",
"<>",
"(",
"details",
")",
";",
"newDetails",
".",
"remove",
"(",
"key... | Create a copy of this StatusDetail, remove a detail and return the new StatusDetail.
@param key the key of the additional detail
@return StatusDetail | [
"Create",
"a",
"copy",
"of",
"this",
"StatusDetail",
"remove",
"a",
"detail",
"and",
"return",
"the",
"new",
"StatusDetail",
"."
] | train | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-core/src/main/java/de/otto/edison/status/domain/StatusDetail.java#L144-L148 |
marklogic/java-client-api | marklogic-client-api/src/main/java/com/marklogic/client/example/util/Bootstrapper.java | Bootstrapper.makeServer | public void makeServer(ConfigServer configServer, RESTServer restServer)
throws IOException {
"""
Programmatic invocation.
@param configServer the configuration server for creating the REST server
@param restServer the specification of the REST server
@throws IOException if a communication error occurs
... | java | public void makeServer(ConfigServer configServer, RESTServer restServer)
throws IOException
{
DefaultHttpClient client = new DefaultHttpClient();
String host = configServer.getHost();
int configPort = configServer.getPort();
// TODO: SSL
Authentication authType = configServer.getAuthTy... | [
"public",
"void",
"makeServer",
"(",
"ConfigServer",
"configServer",
",",
"RESTServer",
"restServer",
")",
"throws",
"IOException",
"{",
"DefaultHttpClient",
"client",
"=",
"new",
"DefaultHttpClient",
"(",
")",
";",
"String",
"host",
"=",
"configServer",
".",
"get... | Programmatic invocation.
@param configServer the configuration server for creating the REST server
@param restServer the specification of the REST server
@throws IOException if a communication error occurs | [
"Programmatic",
"invocation",
"."
] | train | https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/example/util/Bootstrapper.java#L115-L180 |
mikepenz/Android-Iconics | library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java | IconicsDrawable.backgroundColorRes | @NonNull
public IconicsDrawable backgroundColorRes(@ColorRes int colorResId) {
"""
Set background color from res.
@return The current IconicsDrawable for chaining.
"""
return backgroundColor(ContextCompat.getColor(mContext, colorResId));
} | java | @NonNull
public IconicsDrawable backgroundColorRes(@ColorRes int colorResId) {
return backgroundColor(ContextCompat.getColor(mContext, colorResId));
} | [
"@",
"NonNull",
"public",
"IconicsDrawable",
"backgroundColorRes",
"(",
"@",
"ColorRes",
"int",
"colorResId",
")",
"{",
"return",
"backgroundColor",
"(",
"ContextCompat",
".",
"getColor",
"(",
"mContext",
",",
"colorResId",
")",
")",
";",
"}"
] | Set background color from res.
@return The current IconicsDrawable for chaining. | [
"Set",
"background",
"color",
"from",
"res",
"."
] | train | https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java#L839-L842 |
ical4j/ical4j | src/main/java/net/fortuna/ical4j/util/Dates.java | Dates.getAbsMonthDay | public static int getAbsMonthDay(final java.util.Date date, final int monthDay) {
"""
Returns the absolute month day for the month specified by the
supplied date. Note that a value of zero (0) is invalid for the
monthDay parameter and an <code>IllegalArgumentException</code>
will be thrown.
@param date a date ... | java | public static int getAbsMonthDay(final java.util.Date date, final int monthDay) {
if (monthDay == 0 || monthDay < -MAX_DAYS_PER_MONTH || monthDay > MAX_DAYS_PER_MONTH) {
throw new IllegalArgumentException(MessageFormat.format(INVALID_MONTH_DAY_MESSAGE,
monthDay));
}
... | [
"public",
"static",
"int",
"getAbsMonthDay",
"(",
"final",
"java",
".",
"util",
".",
"Date",
"date",
",",
"final",
"int",
"monthDay",
")",
"{",
"if",
"(",
"monthDay",
"==",
"0",
"||",
"monthDay",
"<",
"-",
"MAX_DAYS_PER_MONTH",
"||",
"monthDay",
">",
"MA... | Returns the absolute month day for the month specified by the
supplied date. Note that a value of zero (0) is invalid for the
monthDay parameter and an <code>IllegalArgumentException</code>
will be thrown.
@param date a date instance representing a day of the month
@param monthDay a day of month offset
@return the abso... | [
"Returns",
"the",
"absolute",
"month",
"day",
"for",
"the",
"month",
"specified",
"by",
"the",
"supplied",
"date",
".",
"Note",
"that",
"a",
"value",
"of",
"zero",
"(",
"0",
")",
"is",
"invalid",
"for",
"the",
"monthDay",
"parameter",
"and",
"an",
"<code... | train | https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/util/Dates.java#L192-L211 |
bbottema/simple-java-mail | modules/simple-java-mail/src/main/java/org/simplejavamail/converter/internal/mimemessage/MimeMessageHelper.java | MimeMessageHelper.setTexts | static void setTexts(final Email email, final MimeMultipart multipartAlternativeMessages)
throws MessagingException {
"""
Fills the {@link Message} instance with the content bodies (text, html and calendar).
@param email The message in which the content is defined.
@param multipartAlt... | java | static void setTexts(final Email email, final MimeMultipart multipartAlternativeMessages)
throws MessagingException {
if (email.getPlainText() != null) {
final MimeBodyPart messagePart = new MimeBodyPart();
messagePart.setText(email.getPlainText(), CHARACTER_ENCODING);
multipartAlternativeMessages.addBody... | [
"static",
"void",
"setTexts",
"(",
"final",
"Email",
"email",
",",
"final",
"MimeMultipart",
"multipartAlternativeMessages",
")",
"throws",
"MessagingException",
"{",
"if",
"(",
"email",
".",
"getPlainText",
"(",
")",
"!=",
"null",
")",
"{",
"final",
"MimeBodyPa... | Fills the {@link Message} instance with the content bodies (text, html and calendar).
@param email The message in which the content is defined.
@param multipartAlternativeMessages See {@link MimeMultipart#addBodyPart(BodyPart)}
@throws MessagingException See {@link BodyPart#setText(String)}, {@l... | [
"Fills",
"the",
"{",
"@link",
"Message",
"}",
"instance",
"with",
"the",
"content",
"bodies",
"(",
"text",
"html",
"and",
"calendar",
")",
"."
] | train | https://github.com/bbottema/simple-java-mail/blob/b03635328aeecd525e35eddfef8f5b9a184559d8/modules/simple-java-mail/src/main/java/org/simplejavamail/converter/internal/mimemessage/MimeMessageHelper.java#L97-L114 |
lets-blade/blade | src/main/java/com/blade/kit/StringKit.java | StringKit.noNullElseGet | public static <T> T noNullElseGet(@NonNull Supplier<T> s1, @NonNull Supplier<T> s2) {
"""
we can replace
if(doMethod1()!= null) {
return doMethod1()
} else {
return doMethod2()
}
with
return notBlankElse(bar::getName, bar::getNickName)
@param s1 Supplier
@param s2 Supplier
"""
T t1 = s1.get();... | java | public static <T> T noNullElseGet(@NonNull Supplier<T> s1, @NonNull Supplier<T> s2) {
T t1 = s1.get();
if (t1 != null) {
return t1;
}
return s2.get();
} | [
"public",
"static",
"<",
"T",
">",
"T",
"noNullElseGet",
"(",
"@",
"NonNull",
"Supplier",
"<",
"T",
">",
"s1",
",",
"@",
"NonNull",
"Supplier",
"<",
"T",
">",
"s2",
")",
"{",
"T",
"t1",
"=",
"s1",
".",
"get",
"(",
")",
";",
"if",
"(",
"t1",
"... | we can replace
if(doMethod1()!= null) {
return doMethod1()
} else {
return doMethod2()
}
with
return notBlankElse(bar::getName, bar::getNickName)
@param s1 Supplier
@param s2 Supplier | [
"we",
"can",
"replace",
"if(doMethod1",
"()",
"!",
"=",
"null)",
"{",
"return",
"doMethod1",
"()",
"}",
"else",
"{",
"return",
"doMethod2",
"()",
"}",
"with",
"return",
"notBlankElse",
"(",
"bar",
"::",
"getName",
"bar",
"::",
"getNickName",
")"
] | train | https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/kit/StringKit.java#L143-L149 |
JodaOrg/joda-time | src/main/java/org/joda/time/chrono/ZonedChronology.java | ZonedChronology.getInstance | public static ZonedChronology getInstance(Chronology base, DateTimeZone zone) {
"""
Create a ZonedChronology for any chronology, overriding any time zone it
may already have.
@param base base chronology to wrap
@param zone the time zone
@throws IllegalArgumentException if chronology or time zone is null
... | java | public static ZonedChronology getInstance(Chronology base, DateTimeZone zone) {
if (base == null) {
throw new IllegalArgumentException("Must supply a chronology");
}
base = base.withUTC();
if (base == null) {
throw new IllegalArgumentException("UTC chronology must... | [
"public",
"static",
"ZonedChronology",
"getInstance",
"(",
"Chronology",
"base",
",",
"DateTimeZone",
"zone",
")",
"{",
"if",
"(",
"base",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Must supply a chronology\"",
")",
";",
"}",
"ba... | Create a ZonedChronology for any chronology, overriding any time zone it
may already have.
@param base base chronology to wrap
@param zone the time zone
@throws IllegalArgumentException if chronology or time zone is null | [
"Create",
"a",
"ZonedChronology",
"for",
"any",
"chronology",
"overriding",
"any",
"time",
"zone",
"it",
"may",
"already",
"have",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/ZonedChronology.java#L58-L70 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/config/ConfigValidator.java | ConfigValidator.checkCacheConfig | public static void checkCacheConfig(CacheSimpleConfig cacheSimpleConfig, CacheMergePolicyProvider mergePolicyProvider) {
"""
Validates the given {@link CacheSimpleConfig}.
@param cacheSimpleConfig the {@link CacheSimpleConfig} to check
@param mergePolicyProvider the {@link CacheMergePolicyProvider} to resolv... | java | public static void checkCacheConfig(CacheSimpleConfig cacheSimpleConfig, CacheMergePolicyProvider mergePolicyProvider) {
checkCacheConfig(cacheSimpleConfig.getInMemoryFormat(), cacheSimpleConfig.getEvictionConfig(),
cacheSimpleConfig.getMergePolicy(), cacheSimpleConfig, mergePolicyProvider);
... | [
"public",
"static",
"void",
"checkCacheConfig",
"(",
"CacheSimpleConfig",
"cacheSimpleConfig",
",",
"CacheMergePolicyProvider",
"mergePolicyProvider",
")",
"{",
"checkCacheConfig",
"(",
"cacheSimpleConfig",
".",
"getInMemoryFormat",
"(",
")",
",",
"cacheSimpleConfig",
".",
... | Validates the given {@link CacheSimpleConfig}.
@param cacheSimpleConfig the {@link CacheSimpleConfig} to check
@param mergePolicyProvider the {@link CacheMergePolicyProvider} to resolve merge policy classes | [
"Validates",
"the",
"given",
"{",
"@link",
"CacheSimpleConfig",
"}",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/config/ConfigValidator.java#L319-L322 |
igniterealtime/Smack | smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoManager.java | OmemoManager.isDecidedOmemoIdentity | public boolean isDecidedOmemoIdentity(OmemoDevice device, OmemoFingerprint fingerprint) {
"""
Returns true, if the fingerprint/OmemoDevice tuple is decided by the user.
The fingerprint must be the lowercase, hexadecimal fingerprint of the identityKey of the device and must
be of length 64.
@param device device
... | java | public boolean isDecidedOmemoIdentity(OmemoDevice device, OmemoFingerprint fingerprint) {
if (trustCallback == null) {
throw new IllegalStateException("No TrustCallback set.");
}
return trustCallback.getTrust(device, fingerprint) != TrustState.undecided;
} | [
"public",
"boolean",
"isDecidedOmemoIdentity",
"(",
"OmemoDevice",
"device",
",",
"OmemoFingerprint",
"fingerprint",
")",
"{",
"if",
"(",
"trustCallback",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"No TrustCallback set.\"",
")",
";",
"}... | Returns true, if the fingerprint/OmemoDevice tuple is decided by the user.
The fingerprint must be the lowercase, hexadecimal fingerprint of the identityKey of the device and must
be of length 64.
@param device device
@param fingerprint fingerprint
@return | [
"Returns",
"true",
"if",
"the",
"fingerprint",
"/",
"OmemoDevice",
"tuple",
"is",
"decided",
"by",
"the",
"user",
".",
"The",
"fingerprint",
"must",
"be",
"the",
"lowercase",
"hexadecimal",
"fingerprint",
"of",
"the",
"identityKey",
"of",
"the",
"device",
"and... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoManager.java#L467-L473 |
gallandarakhneorg/afc | core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/GraphPath.java | GraphPath.removeFromLast | public boolean removeFromLast(ST obj, PT pt) {
"""
Remove the path's elements after the
specified one which is starting
at the specified point. The specified element will
be removed.
<p>This function removes after the <i>last occurence</i>
of the given object.
@param obj is the segment to remove
@param ... | java | public boolean removeFromLast(ST obj, PT pt) {
return removeAfter(lastIndexOf(obj, pt), true);
} | [
"public",
"boolean",
"removeFromLast",
"(",
"ST",
"obj",
",",
"PT",
"pt",
")",
"{",
"return",
"removeAfter",
"(",
"lastIndexOf",
"(",
"obj",
",",
"pt",
")",
",",
"true",
")",
";",
"}"
] | Remove the path's elements after the
specified one which is starting
at the specified point. The specified element will
be removed.
<p>This function removes after the <i>last occurence</i>
of the given object.
@param obj is the segment to remove
@param pt is the point on which the segment was connected
as its first p... | [
"Remove",
"the",
"path",
"s",
"elements",
"after",
"the",
"specified",
"one",
"which",
"is",
"starting",
"at",
"the",
"specified",
"point",
".",
"The",
"specified",
"element",
"will",
"be",
"removed",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/GraphPath.java#L840-L842 |
alkacon/opencms-core | src/org/opencms/ade/publish/A_CmsPublishGroupHelper.java | A_CmsPublishGroupHelper.getPublishGroupName | public String getPublishGroupName(List<RESOURCE> resources, GroupAge age) {
"""
Returns the localized name for a given publish group based on its age.<p>
@param resources the resources of the publish group
@param age the age of the publish group
@return the localized name of the publish group
"""
... | java | public String getPublishGroupName(List<RESOURCE> resources, GroupAge age) {
long groupDate = getDateLastModified(resources.get(0));
String groupName;
switch (age) {
case young:
groupName = Messages.get().getBundle(m_locale).key(
Messages.GUI_GROUP... | [
"public",
"String",
"getPublishGroupName",
"(",
"List",
"<",
"RESOURCE",
">",
"resources",
",",
"GroupAge",
"age",
")",
"{",
"long",
"groupDate",
"=",
"getDateLastModified",
"(",
"resources",
".",
"get",
"(",
"0",
")",
")",
";",
"String",
"groupName",
";",
... | Returns the localized name for a given publish group based on its age.<p>
@param resources the resources of the publish group
@param age the age of the publish group
@return the localized name of the publish group | [
"Returns",
"the",
"localized",
"name",
"for",
"a",
"given",
"publish",
"group",
"based",
"on",
"its",
"age",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/publish/A_CmsPublishGroupHelper.java#L236-L256 |
logic-ng/LogicNG | src/main/java/org/logicng/cardinalityconstraints/CCEncoder.java | CCEncoder.encodeConstraint | private void encodeConstraint(final PBConstraint cc, final EncodingResult result) {
"""
Encodes the constraint in the given result.
@param cc the constraint
@param result the result
"""
if (!cc.isCC())
throw new IllegalArgumentException("Cannot encode a non-cardinality constraint with a cardina... | java | private void encodeConstraint(final PBConstraint cc, final EncodingResult result) {
if (!cc.isCC())
throw new IllegalArgumentException("Cannot encode a non-cardinality constraint with a cardinality constraint encoder.");
final Variable[] ops = litsAsVars(cc.operands());
switch (cc.comparator()) {
... | [
"private",
"void",
"encodeConstraint",
"(",
"final",
"PBConstraint",
"cc",
",",
"final",
"EncodingResult",
"result",
")",
"{",
"if",
"(",
"!",
"cc",
".",
"isCC",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot encode a non-cardinality con... | Encodes the constraint in the given result.
@param cc the constraint
@param result the result | [
"Encodes",
"the",
"constraint",
"in",
"the",
"given",
"result",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/cardinalityconstraints/CCEncoder.java#L198-L230 |
BrunoEberhard/minimal-j | src/main/java/org/minimalj/frontend/form/Form.java | Form.addDependecy | @SuppressWarnings("rawtypes")
public <FROM, TO> void addDependecy(FROM from, PropertyUpdater<FROM, TO, T> updater, TO to) {
"""
Declares that if the key or property <i>from</i> changes the specified
updater should be called and after its return the <i>to</i> key or property
could have changed.<p>
This is use... | java | @SuppressWarnings("rawtypes")
public <FROM, TO> void addDependecy(FROM from, PropertyUpdater<FROM, TO, T> updater, TO to) {
PropertyInterface fromProperty = Keys.getProperty(from);
if (!propertyUpdater.containsKey(fromProperty)) {
propertyUpdater.put(fromProperty, new HashMap<PropertyInterface, PropertyUpdater>... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"<",
"FROM",
",",
"TO",
">",
"void",
"addDependecy",
"(",
"FROM",
"from",
",",
"PropertyUpdater",
"<",
"FROM",
",",
"TO",
",",
"T",
">",
"updater",
",",
"TO",
"to",
")",
"{",
"PropertyInterface... | Declares that if the key or property <i>from</i> changes the specified
updater should be called and after its return the <i>to</i> key or property
could have changed.<p>
This is used if there is a more complex relation between two fields.
@param <FROM> the type (class) of the fromKey / field
@param <TO> the type (cla... | [
"Declares",
"that",
"if",
"the",
"key",
"or",
"property",
"<i",
">",
"from<",
"/",
"i",
">",
"changes",
"the",
"specified",
"updater",
"should",
"be",
"called",
"and",
"after",
"its",
"return",
"the",
"<i",
">",
"to<",
"/",
"i",
">",
"key",
"or",
"pr... | train | https://github.com/BrunoEberhard/minimal-j/blob/f7c5461b2b47a10b383aee1e2f1f150f6773703b/src/main/java/org/minimalj/frontend/form/Form.java#L272-L281 |
infinispan/infinispan | query/src/main/java/org/infinispan/query/dsl/embedded/impl/HibernateSearchPropertyHelper.java | HibernateSearchPropertyHelper.convertToPropertyType | @Override
public Object convertToPropertyType(Class<?> entityType, String[] propertyPath, String value) {
"""
Returns the given value converted into the type of the given property as determined via the field bridge of the
property.
@param value the value to convert
@param entityType the type hosti... | java | @Override
public Object convertToPropertyType(Class<?> entityType, String[] propertyPath, String value) {
EntityIndexBinding indexBinding = searchFactory.getIndexBindings().get(entityType);
if (indexBinding != null) {
DocumentFieldMetadata fieldMetadata = getDocumentFieldMetadata(indexBinding, p... | [
"@",
"Override",
"public",
"Object",
"convertToPropertyType",
"(",
"Class",
"<",
"?",
">",
"entityType",
",",
"String",
"[",
"]",
"propertyPath",
",",
"String",
"value",
")",
"{",
"EntityIndexBinding",
"indexBinding",
"=",
"searchFactory",
".",
"getIndexBindings",... | Returns the given value converted into the type of the given property as determined via the field bridge of the
property.
@param value the value to convert
@param entityType the type hosting the property
@param propertyPath the name of the property
@return the given value converted into the type of the given ... | [
"Returns",
"the",
"given",
"value",
"converted",
"into",
"the",
"type",
"of",
"the",
"given",
"property",
"as",
"determined",
"via",
"the",
"field",
"bridge",
"of",
"the",
"property",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/query/src/main/java/org/infinispan/query/dsl/embedded/impl/HibernateSearchPropertyHelper.java#L98-L109 |
pressgang-ccms/PressGangCCMSBuilder | src/main/java/org/jboss/pressgang/ccms/contentspec/builder/utils/DocBookBuildUtilities.java | DocBookBuildUtilities.convertDocumentToCDATAFormattedString | public static String convertDocumentToCDATAFormattedString(final Document doc, final XMLFormatProperties xmlFormatProperties) {
"""
Convert a DOM Document to a Formatted String representation and wrap it in a CDATA element.
@param doc The DOM Document to be converted and formatted.
@param xmlFo... | java | public static String convertDocumentToCDATAFormattedString(final Document doc, final XMLFormatProperties xmlFormatProperties) {
return XMLUtilities.wrapStringInCDATA(convertDocumentToFormattedString(doc, xmlFormatProperties));
} | [
"public",
"static",
"String",
"convertDocumentToCDATAFormattedString",
"(",
"final",
"Document",
"doc",
",",
"final",
"XMLFormatProperties",
"xmlFormatProperties",
")",
"{",
"return",
"XMLUtilities",
".",
"wrapStringInCDATA",
"(",
"convertDocumentToFormattedString",
"(",
"d... | Convert a DOM Document to a Formatted String representation and wrap it in a CDATA element.
@param doc The DOM Document to be converted and formatted.
@param xmlFormatProperties The XML Formatting Properties.
@return The converted XML String representation. | [
"Convert",
"a",
"DOM",
"Document",
"to",
"a",
"Formatted",
"String",
"representation",
"and",
"wrap",
"it",
"in",
"a",
"CDATA",
"element",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/utils/DocBookBuildUtilities.java#L474-L476 |
rollbar/rollbar-java | rollbar-java/src/main/java/com/rollbar/notifier/util/ObjectsUtils.java | ObjectsUtils.requireNonNull | public static <T> T requireNonNull(T object, String errorMessage) {
"""
Checks that the specified object reference is not null.
@param object the object reference to check for nullity
@param errorMessage detail message to be used in the event that a NullPointerException is
thrown
@param <T> the type of the r... | java | public static <T> T requireNonNull(T object, String errorMessage) {
if (object == null) {
throw new NullPointerException(errorMessage);
} else {
return object;
}
} | [
"public",
"static",
"<",
"T",
">",
"T",
"requireNonNull",
"(",
"T",
"object",
",",
"String",
"errorMessage",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"errorMessage",
")",
";",
"}",
"else",
"{",
... | Checks that the specified object reference is not null.
@param object the object reference to check for nullity
@param errorMessage detail message to be used in the event that a NullPointerException is
thrown
@param <T> the type of the reference
@return object if not null | [
"Checks",
"that",
"the",
"specified",
"object",
"reference",
"is",
"not",
"null",
"."
] | train | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-java/src/main/java/com/rollbar/notifier/util/ObjectsUtils.java#L33-L39 |
kiegroup/jbpm | jbpm-human-task/jbpm-human-task-audit/src/main/java/org/jbpm/services/task/lifecycle/listeners/BAMTaskEventListener.java | BAMTaskEventListener.createOrUpdateTask | protected BAMTaskSummaryImpl createOrUpdateTask(TaskEvent event, Status newStatus) {
"""
Creates or updates a bam task summary instance.
@param ti The source task
@param newStatus The new state for the task.
@return The created or updated bam task summary instance.
"""
return updateTask(event, new... | java | protected BAMTaskSummaryImpl createOrUpdateTask(TaskEvent event, Status newStatus) {
return updateTask(event, newStatus, null);
} | [
"protected",
"BAMTaskSummaryImpl",
"createOrUpdateTask",
"(",
"TaskEvent",
"event",
",",
"Status",
"newStatus",
")",
"{",
"return",
"updateTask",
"(",
"event",
",",
"newStatus",
",",
"null",
")",
";",
"}"
] | Creates or updates a bam task summary instance.
@param ti The source task
@param newStatus The new state for the task.
@return The created or updated bam task summary instance. | [
"Creates",
"or",
"updates",
"a",
"bam",
"task",
"summary",
"instance",
"."
] | train | https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-human-task/jbpm-human-task-audit/src/main/java/org/jbpm/services/task/lifecycle/listeners/BAMTaskEventListener.java#L206-L208 |
CenturyLinkCloud/mdw | mdw-common/src/com/centurylink/mdw/common/service/SystemMessages.java | SystemMessages.bulletinOff | public static void bulletinOff(Bulletin bulletin, Level level, String message) {
"""
Should be the same instance or have the same id as the bulletinOn message.
"""
if (bulletin == null)
return;
synchronized (bulletins) {
bulletins.remove(bulletin.getId(), bulletin);
... | java | public static void bulletinOff(Bulletin bulletin, Level level, String message) {
if (bulletin == null)
return;
synchronized (bulletins) {
bulletins.remove(bulletin.getId(), bulletin);
}
try {
WebSocketMessenger.getInstance().send("SystemMessage", bulle... | [
"public",
"static",
"void",
"bulletinOff",
"(",
"Bulletin",
"bulletin",
",",
"Level",
"level",
",",
"String",
"message",
")",
"{",
"if",
"(",
"bulletin",
"==",
"null",
")",
"return",
";",
"synchronized",
"(",
"bulletins",
")",
"{",
"bulletins",
".",
"remov... | Should be the same instance or have the same id as the bulletinOn message. | [
"Should",
"be",
"the",
"same",
"instance",
"or",
"have",
"the",
"same",
"id",
"as",
"the",
"bulletinOn",
"message",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/common/service/SystemMessages.java#L76-L88 |
Azure/azure-sdk-for-java | recoveryservices.backup/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_12_01/implementation/ProtectedItemsInner.java | ProtectedItemsInner.createOrUpdate | public void createOrUpdate(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, ProtectedItemResourceInner parameters) {
"""
Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an asynchronous operati... | java | public void createOrUpdate(String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, ProtectedItemResourceInner parameters) {
createOrUpdateWithServiceResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters).toBloc... | [
"public",
"void",
"createOrUpdate",
"(",
"String",
"vaultName",
",",
"String",
"resourceGroupName",
",",
"String",
"fabricName",
",",
"String",
"containerName",
",",
"String",
"protectedItemName",
",",
"ProtectedItemResourceInner",
"parameters",
")",
"{",
"createOrUpdat... | Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an asynchronous operation. To know the status of the operation, call the GetItemOperationResult API.
@param vaultName The name of the recovery services vault.
@param resourceGroupName The name of the resource g... | [
"Enables",
"backup",
"of",
"an",
"item",
"or",
"to",
"modifies",
"the",
"backup",
"policy",
"information",
"of",
"an",
"already",
"backed",
"up",
"item",
".",
"This",
"is",
"an",
"asynchronous",
"operation",
".",
"To",
"know",
"the",
"status",
"of",
"the",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_12_01/implementation/ProtectedItemsInner.java#L297-L299 |
landawn/AbacusUtil | src/com/landawn/abacus/util/DoubleList.java | DoubleList.reduce | public <E extends Exception> double reduce(final double identity, final Try.DoubleBinaryOperator<E> accumulator) throws E {
"""
This is equivalent to:
<pre>
<code>
if (isEmpty()) {
return identity;
}
double result = identity;
for (int i = 0; i < size; i++) {
result = accumulator.applyAsDouble(result, e... | java | public <E extends Exception> double reduce(final double identity, final Try.DoubleBinaryOperator<E> accumulator) throws E {
if (isEmpty()) {
return identity;
}
double result = identity;
for (int i = 0; i < size; i++) {
result = accumulator.applyAsDouble(... | [
"public",
"<",
"E",
"extends",
"Exception",
">",
"double",
"reduce",
"(",
"final",
"double",
"identity",
",",
"final",
"Try",
".",
"DoubleBinaryOperator",
"<",
"E",
">",
"accumulator",
")",
"throws",
"E",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"{",
... | This is equivalent to:
<pre>
<code>
if (isEmpty()) {
return identity;
}
double result = identity;
for (int i = 0; i < size; i++) {
result = accumulator.applyAsDouble(result, elementData[i]);
}
return result;
</code>
</pre>
@param identity
@param accumulator
@return | [
"This",
"is",
"equivalent",
"to",
":",
"<pre",
">",
"<code",
">",
"if",
"(",
"isEmpty",
"()",
")",
"{",
"return",
"identity",
";",
"}"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/DoubleList.java#L1103-L1115 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java | CheckpointCoordinator.triggerCheckpoint | public boolean triggerCheckpoint(long timestamp, boolean isPeriodic) {
"""
Triggers a new standard checkpoint and uses the given timestamp as the checkpoint
timestamp.
@param timestamp The timestamp for the checkpoint.
@param isPeriodic Flag indicating whether this triggered checkpoint is
periodic. If this f... | java | public boolean triggerCheckpoint(long timestamp, boolean isPeriodic) {
try {
triggerCheckpoint(timestamp, checkpointProperties, null, isPeriodic, false);
return true;
} catch (CheckpointException e) {
return false;
}
} | [
"public",
"boolean",
"triggerCheckpoint",
"(",
"long",
"timestamp",
",",
"boolean",
"isPeriodic",
")",
"{",
"try",
"{",
"triggerCheckpoint",
"(",
"timestamp",
",",
"checkpointProperties",
",",
"null",
",",
"isPeriodic",
",",
"false",
")",
";",
"return",
"true",
... | Triggers a new standard checkpoint and uses the given timestamp as the checkpoint
timestamp.
@param timestamp The timestamp for the checkpoint.
@param isPeriodic Flag indicating whether this triggered checkpoint is
periodic. If this flag is true, but the periodic scheduler is disabled,
the checkpoint will be declined.... | [
"Triggers",
"a",
"new",
"standard",
"checkpoint",
"and",
"uses",
"the",
"given",
"timestamp",
"as",
"the",
"checkpoint",
"timestamp",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java#L433-L440 |
spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/endpoint/DefaultRedirectResolver.java | DefaultRedirectResolver.obtainMatchingRedirect | private String obtainMatchingRedirect(Set<String> redirectUris, String requestedRedirect) {
"""
Attempt to match one of the registered URIs to the that of the requested one.
@param redirectUris the set of the registered URIs to try and find a match. This cannot be null or empty.
@param requestedRedirect the UR... | java | private String obtainMatchingRedirect(Set<String> redirectUris, String requestedRedirect) {
Assert.notEmpty(redirectUris, "Redirect URIs cannot be empty");
if (redirectUris.size() == 1 && requestedRedirect == null) {
return redirectUris.iterator().next();
}
for (String redirectUri : redirectUris) {
if (... | [
"private",
"String",
"obtainMatchingRedirect",
"(",
"Set",
"<",
"String",
">",
"redirectUris",
",",
"String",
"requestedRedirect",
")",
"{",
"Assert",
".",
"notEmpty",
"(",
"redirectUris",
",",
"\"Redirect URIs cannot be empty\"",
")",
";",
"if",
"(",
"redirectUris"... | Attempt to match one of the registered URIs to the that of the requested one.
@param redirectUris the set of the registered URIs to try and find a match. This cannot be null or empty.
@param requestedRedirect the URI used as part of the request
@return redirect uri
@throws RedirectMismatchException if no match was fou... | [
"Attempt",
"to",
"match",
"one",
"of",
"the",
"registered",
"URIs",
"to",
"the",
"that",
"of",
"the",
"requested",
"one",
"."
] | train | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/endpoint/DefaultRedirectResolver.java#L205-L233 |
dmak/jaxb-xew-plugin | src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java | CommonUtils.copyFields | public static <S, D extends S> void copyFields(final S src, D dest) throws IllegalArgumentException {
"""
Perform the copying of all fields from {@code src} to {@code dest}. The code was copied from
{@code org.springframework.util.ReflectionUtils#shallowCopyFieldState(Object, Object)}.
"""
Class<?> targetCl... | java | public static <S, D extends S> void copyFields(final S src, D dest) throws IllegalArgumentException {
Class<?> targetClass = src.getClass();
do {
Field[] fields = targetClass.getDeclaredFields();
for (Field field : fields) {
// Skip static fields:
if (Modifier.isStatic(field.getModifiers())) {
c... | [
"public",
"static",
"<",
"S",
",",
"D",
"extends",
"S",
">",
"void",
"copyFields",
"(",
"final",
"S",
"src",
",",
"D",
"dest",
")",
"throws",
"IllegalArgumentException",
"{",
"Class",
"<",
"?",
">",
"targetClass",
"=",
"src",
".",
"getClass",
"(",
")",... | Perform the copying of all fields from {@code src} to {@code dest}. The code was copied from
{@code org.springframework.util.ReflectionUtils#shallowCopyFieldState(Object, Object)}. | [
"Perform",
"the",
"copying",
"of",
"all",
"fields",
"from",
"{"
] | train | https://github.com/dmak/jaxb-xew-plugin/blob/d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3/src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java#L209-L236 |
kstateome/canvas-api | src/main/java/edu/ksu/canvas/CanvasApiFactory.java | CanvasApiFactory.getReader | public <T extends CanvasReader> T getReader(Class<T> type, OauthToken oauthToken, Integer paginationPageSize) {
"""
Get a reader implementation class to perform API calls with while specifying
an explicit page size for paginated API calls. This gets translated to a per_page=
parameter on API requests. Note that ... | java | public <T extends CanvasReader> T getReader(Class<T> type, OauthToken oauthToken, Integer paginationPageSize) {
LOG.debug("Factory call to instantiate class: " + type.getName());
RestClient restClient = new RefreshingRestClient();
@SuppressWarnings("unchecked")
Class<T> concreteClass = ... | [
"public",
"<",
"T",
"extends",
"CanvasReader",
">",
"T",
"getReader",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"OauthToken",
"oauthToken",
",",
"Integer",
"paginationPageSize",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Factory call to instantiate class: \"",
"+",
... | Get a reader implementation class to perform API calls with while specifying
an explicit page size for paginated API calls. This gets translated to a per_page=
parameter on API requests. Note that Canvas does not guarantee it will honor this page size request.
There is an explicit maximum page size on the server side w... | [
"Get",
"a",
"reader",
"implementation",
"class",
"to",
"perform",
"API",
"calls",
"with",
"while",
"specifying",
"an",
"explicit",
"page",
"size",
"for",
"paginated",
"API",
"calls",
".",
"This",
"gets",
"translated",
"to",
"a",
"per_page",
"=",
"parameter",
... | train | https://github.com/kstateome/canvas-api/blob/426bf403a8fd7aca3f170348005feda25b374e5a/src/main/java/edu/ksu/canvas/CanvasApiFactory.java#L83-L103 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/zinternaltools/InternalUtilities.java | InternalUtilities.getMostCommonElementInList | public static <T> T getMostCommonElementInList(List<T> sourceList) {
"""
getMostCommonElementInList, This returns the most common element in the supplied list. In the
event of a tie, any element that is tied as the "largest element" may be returned. If the
list has no elements, or if the list is null, then this ... | java | public static <T> T getMostCommonElementInList(List<T> sourceList) {
if (sourceList == null || sourceList.isEmpty()) {
return null;
}
Map<T, Integer> hashMap = new HashMap<T, Integer>();
for (T element : sourceList) {
Integer countOrNull = hashMap.get(element);
... | [
"public",
"static",
"<",
"T",
">",
"T",
"getMostCommonElementInList",
"(",
"List",
"<",
"T",
">",
"sourceList",
")",
"{",
"if",
"(",
"sourceList",
"==",
"null",
"||",
"sourceList",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"Map",
... | getMostCommonElementInList, This returns the most common element in the supplied list. In the
event of a tie, any element that is tied as the "largest element" may be returned. If the
list has no elements, or if the list is null, then this will return null. This can also
return null if null happens to be the most commo... | [
"getMostCommonElementInList",
"This",
"returns",
"the",
"most",
"common",
"element",
"in",
"the",
"supplied",
"list",
".",
"In",
"the",
"event",
"of",
"a",
"tie",
"any",
"element",
"that",
"is",
"tied",
"as",
"the",
"largest",
"element",
"may",
"be",
"return... | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/zinternaltools/InternalUtilities.java#L100-L121 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java | CommerceCountryPersistenceImpl.countByG_B_A | @Override
public int countByG_B_A(long groupId, boolean billingAllowed, boolean active) {
"""
Returns the number of commerce countries where groupId = ? and billingAllowed = ? and active = ?.
@param groupId the group ID
@param billingAllowed the billing allowed
@param active the active
@return t... | java | @Override
public int countByG_B_A(long groupId, boolean billingAllowed, boolean active) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_G_B_A;
Object[] finderArgs = new Object[] { groupId, billingAllowed, active };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
... | [
"@",
"Override",
"public",
"int",
"countByG_B_A",
"(",
"long",
"groupId",
",",
"boolean",
"billingAllowed",
",",
"boolean",
"active",
")",
"{",
"FinderPath",
"finderPath",
"=",
"FINDER_PATH_COUNT_BY_G_B_A",
";",
"Object",
"[",
"]",
"finderArgs",
"=",
"new",
"Obj... | Returns the number of commerce countries where groupId = ? and billingAllowed = ? and active = ?.
@param groupId the group ID
@param billingAllowed the billing allowed
@param active the active
@return the number of matching commerce countries | [
"Returns",
"the",
"number",
"of",
"commerce",
"countries",
"where",
"groupId",
"=",
"?",
";",
"and",
"billingAllowed",
"=",
"?",
";",
"and",
"active",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java#L3538-L3589 |
alkacon/opencms-core | src/org/opencms/publish/CmsPublishEngine.java | CmsPublishEngine.enqueuePublishJob | public void enqueuePublishJob(CmsObject cms, CmsPublishList publishList, I_CmsReport report) throws CmsException {
"""
Enqueues a new publish job with the given information in publish queue.<p>
All resources should already be locked.<p>
If possible, the publish job starts immediately.<p>
@param cms the cm... | java | public void enqueuePublishJob(CmsObject cms, CmsPublishList publishList, I_CmsReport report) throws CmsException {
// check the driver manager
if ((m_driverManager == null) || (m_dbContextFactory == null)) {
// the resources are unlocked in the driver manager
throw new CmsPublis... | [
"public",
"void",
"enqueuePublishJob",
"(",
"CmsObject",
"cms",
",",
"CmsPublishList",
"publishList",
",",
"I_CmsReport",
"report",
")",
"throws",
"CmsException",
"{",
"// check the driver manager",
"if",
"(",
"(",
"m_driverManager",
"==",
"null",
")",
"||",
"(",
... | Enqueues a new publish job with the given information in publish queue.<p>
All resources should already be locked.<p>
If possible, the publish job starts immediately.<p>
@param cms the cms context to publish for
@param publishList the resources to publish
@param report the report to write to
@throws CmsException if... | [
"Enqueues",
"a",
"new",
"publish",
"job",
"with",
"the",
"given",
"information",
"in",
"publish",
"queue",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/publish/CmsPublishEngine.java#L230-L262 |
uber/NullAway | nullaway/src/main/java/com/uber/nullaway/ErrorBuilder.java | ErrorBuilder.createErrorDescriptionForNullAssignment | Description createErrorDescriptionForNullAssignment(
ErrorMessage errorMessage,
@Nullable Tree suggestTreeIfCastToNonNull,
@Nullable TreePath suggestTreePathIfSuppression,
Description.Builder descriptionBuilder) {
"""
create an error description for a generalized @Nullable value to @NonNull... | java | Description createErrorDescriptionForNullAssignment(
ErrorMessage errorMessage,
@Nullable Tree suggestTreeIfCastToNonNull,
@Nullable TreePath suggestTreePathIfSuppression,
Description.Builder descriptionBuilder) {
final Tree enclosingSuppressTree = suppressibleNode(suggestTreePathIfSuppressi... | [
"Description",
"createErrorDescriptionForNullAssignment",
"(",
"ErrorMessage",
"errorMessage",
",",
"@",
"Nullable",
"Tree",
"suggestTreeIfCastToNonNull",
",",
"@",
"Nullable",
"TreePath",
"suggestTreePathIfSuppression",
",",
"Description",
".",
"Builder",
"descriptionBuilder",... | create an error description for a generalized @Nullable value to @NonNull location assignment.
<p>This includes: field assignments, method arguments and method returns
@param errorMessage the error message object.
@param suggestTreeIfCastToNonNull the location at which a fix suggestion should be made if a
castToNonNu... | [
"create",
"an",
"error",
"description",
"for",
"a",
"generalized",
"@Nullable",
"value",
"to",
"@NonNull",
"location",
"assignment",
"."
] | train | https://github.com/uber/NullAway/blob/c3979b4241f80411dbba6aac3ff653acbb88d00b/nullaway/src/main/java/com/uber/nullaway/ErrorBuilder.java#L147-L158 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java | BoxApiBookmark.getAddToCollectionRequest | public BoxRequestsBookmark.AddBookmarkToCollection getAddToCollectionRequest(String bookmarkId, String collectionId) {
"""
Gets a request that adds a bookmark to a collection
@param bookmarkId id of bookmark to add to collection
@param collectionId id of collection to add the bookmark to
@return ... | java | public BoxRequestsBookmark.AddBookmarkToCollection getAddToCollectionRequest(String bookmarkId, String collectionId) {
BoxRequestsBookmark.AddBookmarkToCollection request = new BoxRequestsBookmark.AddBookmarkToCollection(bookmarkId, collectionId, getBookmarkInfoUrl(bookmarkId), mSession);
return request... | [
"public",
"BoxRequestsBookmark",
".",
"AddBookmarkToCollection",
"getAddToCollectionRequest",
"(",
"String",
"bookmarkId",
",",
"String",
"collectionId",
")",
"{",
"BoxRequestsBookmark",
".",
"AddBookmarkToCollection",
"request",
"=",
"new",
"BoxRequestsBookmark",
".",
"Add... | Gets a request that adds a bookmark to a collection
@param bookmarkId id of bookmark to add to collection
@param collectionId id of collection to add the bookmark to
@return request to add a bookmark to a collection | [
"Gets",
"a",
"request",
"that",
"adds",
"a",
"bookmark",
"to",
"a",
"collection"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiBookmark.java#L237-L240 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesInner.java | PublicIPAddressesInner.listVirtualMachineScaleSetVMPublicIPAddressesWithServiceResponseAsync | public Observable<ServiceResponse<Page<PublicIPAddressInner>>> listVirtualMachineScaleSetVMPublicIPAddressesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) {
"""
... | java | public Observable<ServiceResponse<Page<PublicIPAddressInner>>> listVirtualMachineScaleSetVMPublicIPAddressesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) {
r... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"PublicIPAddressInner",
">",
">",
">",
"listVirtualMachineScaleSetVMPublicIPAddressesWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"virtualMachineScaleSetName",
... | Gets information about all public IP addresses in a virtual machine IP configuration in a virtual machine scale set.
@param resourceGroupName The name of the resource group.
@param virtualMachineScaleSetName The name of the virtual machine scale set.
@param virtualmachineIndex The virtual machine index.
@param network... | [
"Gets",
"information",
"about",
"all",
"public",
"IP",
"addresses",
"in",
"a",
"virtual",
"machine",
"IP",
"configuration",
"in",
"a",
"virtual",
"machine",
"scale",
"set",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesInner.java#L1353-L1365 |
alkacon/opencms-core | src/org/opencms/jsp/util/CmsJspContentAccessValueWrapper.java | CmsJspContentAccessValueWrapper.getToDateSeries | public CmsJspDateSeriesBean getToDateSeries() {
"""
Converts a date series configuration to a date series bean.
@return the date series bean.
"""
if (m_dateSeries == null) {
m_dateSeries = new CmsJspDateSeriesBean(this, m_cms.getRequestContext().getLocale());
}
return m_da... | java | public CmsJspDateSeriesBean getToDateSeries() {
if (m_dateSeries == null) {
m_dateSeries = new CmsJspDateSeriesBean(this, m_cms.getRequestContext().getLocale());
}
return m_dateSeries;
} | [
"public",
"CmsJspDateSeriesBean",
"getToDateSeries",
"(",
")",
"{",
"if",
"(",
"m_dateSeries",
"==",
"null",
")",
"{",
"m_dateSeries",
"=",
"new",
"CmsJspDateSeriesBean",
"(",
"this",
",",
"m_cms",
".",
"getRequestContext",
"(",
")",
".",
"getLocale",
"(",
")"... | Converts a date series configuration to a date series bean.
@return the date series bean. | [
"Converts",
"a",
"date",
"series",
"configuration",
"to",
"a",
"date",
"series",
"bean",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsJspContentAccessValueWrapper.java#L850-L856 |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.sameMonth | public static boolean sameMonth(Date dateOne, Date dateTwo) {
"""
Test to see if two dates are in the same month
@param dateOne first date
@param dateTwo second date
@return true if the two dates are in the same month
"""
if ((dateOne == null) || (dateTwo == null)) {
return false;
... | java | public static boolean sameMonth(Date dateOne, Date dateTwo) {
if ((dateOne == null) || (dateTwo == null)) {
return false;
}
Calendar cal = Calendar.getInstance();
cal.setTime(dateOne);
int year = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH);
... | [
"public",
"static",
"boolean",
"sameMonth",
"(",
"Date",
"dateOne",
",",
"Date",
"dateTwo",
")",
"{",
"if",
"(",
"(",
"dateOne",
"==",
"null",
")",
"||",
"(",
"dateTwo",
"==",
"null",
")",
")",
"{",
"return",
"false",
";",
"}",
"Calendar",
"cal",
"="... | Test to see if two dates are in the same month
@param dateOne first date
@param dateTwo second date
@return true if the two dates are in the same month | [
"Test",
"to",
"see",
"if",
"two",
"dates",
"are",
"in",
"the",
"same",
"month"
] | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L278-L293 |
mikepenz/FastAdapter | library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterDialog.java | FastAdapterDialog.withPositiveButton | public FastAdapterDialog<Item> withPositiveButton(String text, OnClickListener listener) {
"""
Set a listener to be invoked when the positive button of the dialog is pressed.
@param text The text to display in the positive button
@param listener The {@link DialogInterface.OnClickListener} to use.
@return ... | java | public FastAdapterDialog<Item> withPositiveButton(String text, OnClickListener listener) {
return withButton(BUTTON_POSITIVE, text, listener);
} | [
"public",
"FastAdapterDialog",
"<",
"Item",
">",
"withPositiveButton",
"(",
"String",
"text",
",",
"OnClickListener",
"listener",
")",
"{",
"return",
"withButton",
"(",
"BUTTON_POSITIVE",
",",
"text",
",",
"listener",
")",
";",
"}"
] | Set a listener to be invoked when the positive button of the dialog is pressed.
@param text The text to display in the positive button
@param listener The {@link DialogInterface.OnClickListener} to use.
@return This Builder object to allow for chaining of calls to set methods | [
"Set",
"a",
"listener",
"to",
"be",
"invoked",
"when",
"the",
"positive",
"button",
"of",
"the",
"dialog",
"is",
"pressed",
"."
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/dialog/FastAdapterDialog.java#L131-L133 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Widget.java | Widget.setPosition | public void setPosition(float x, float y, float z) {
"""
Set absolute position.
Use {@link #translate(float, float, float)} to <em>move</em> the object.
@param x
'X' component of the absolute position.
@param y
'Y' component of the absolute position.
@param z
'Z' component of the absolute position.
... | java | public void setPosition(float x, float y, float z) {
getTransform().setPosition(x, y, z);
if (mTransformCache.setPosition(x, y, z)) {
onTransformChanged();
}
} | [
"public",
"void",
"setPosition",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"getTransform",
"(",
")",
".",
"setPosition",
"(",
"x",
",",
"y",
",",
"z",
")",
";",
"if",
"(",
"mTransformCache",
".",
"setPosition",
"(",
"x",
",... | Set absolute position.
Use {@link #translate(float, float, float)} to <em>move</em> the object.
@param x
'X' component of the absolute position.
@param y
'Y' component of the absolute position.
@param z
'Z' component of the absolute position. | [
"Set",
"absolute",
"position",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Widget.java#L1259-L1264 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyUtil.java | PropertyUtil.findSetter | public static Method findSetter(String methodName, Object instance, Class<?> valueClass) throws NoSuchMethodException {
"""
Returns the requested setter method from an object instance.
@param methodName Name of the setter method.
@param instance Object instance to search.
@param valueClass The setter paramete... | java | public static Method findSetter(String methodName, Object instance, Class<?> valueClass) throws NoSuchMethodException {
return findMethod(methodName, instance, valueClass, true);
} | [
"public",
"static",
"Method",
"findSetter",
"(",
"String",
"methodName",
",",
"Object",
"instance",
",",
"Class",
"<",
"?",
">",
"valueClass",
")",
"throws",
"NoSuchMethodException",
"{",
"return",
"findMethod",
"(",
"methodName",
",",
"instance",
",",
"valueCla... | Returns the requested setter method from an object instance.
@param methodName Name of the setter method.
@param instance Object instance to search.
@param valueClass The setter parameter type (null if don't care).
@return The setter method.
@throws NoSuchMethodException If method was not found. | [
"Returns",
"the",
"requested",
"setter",
"method",
"from",
"an",
"object",
"instance",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyUtil.java#L46-L48 |
MKLab-ITI/multimedia-indexing | src/main/java/gr/iti/mklab/visual/extraction/SIFTExtractor.java | SIFTExtractor.extractFeaturesInternal | protected double[][] extractFeaturesInternal(BufferedImage image) {
"""
Detects key points inside the image and computes descriptions at those points.
"""
ImageFloat32 boofcvImage = ConvertBufferedImage.convertFromSingle(image, null, ImageFloat32.class);
// create the SIFT detector and descriptor in Boof... | java | protected double[][] extractFeaturesInternal(BufferedImage image) {
ImageFloat32 boofcvImage = ConvertBufferedImage.convertFromSingle(image, null, ImageFloat32.class);
// create the SIFT detector and descriptor in BoofCV v0.15
ConfigSiftDetector conf = new ConfigSiftDetector(2, detectThreshold, maxFeaturesPerS... | [
"protected",
"double",
"[",
"]",
"[",
"]",
"extractFeaturesInternal",
"(",
"BufferedImage",
"image",
")",
"{",
"ImageFloat32",
"boofcvImage",
"=",
"ConvertBufferedImage",
".",
"convertFromSingle",
"(",
"image",
",",
"null",
",",
"ImageFloat32",
".",
"class",
")",
... | Detects key points inside the image and computes descriptions at those points. | [
"Detects",
"key",
"points",
"inside",
"the",
"image",
"and",
"computes",
"descriptions",
"at",
"those",
"points",
"."
] | train | https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/extraction/SIFTExtractor.java#L47-L62 |
JOML-CI/JOML | src/org/joml/Vector4f.java | Vector4f.set | public Vector4f set(int index, ByteBuffer buffer) {
"""
Read this vector from the supplied {@link ByteBuffer} starting at the specified
absolute buffer position/index.
<p>
This method will not increment the position of the given ByteBuffer.
@param index
the absolute position into the ByteBuffer
@param buff... | java | public Vector4f set(int index, ByteBuffer buffer) {
MemUtil.INSTANCE.get(this, index, buffer);
return this;
} | [
"public",
"Vector4f",
"set",
"(",
"int",
"index",
",",
"ByteBuffer",
"buffer",
")",
"{",
"MemUtil",
".",
"INSTANCE",
".",
"get",
"(",
"this",
",",
"index",
",",
"buffer",
")",
";",
"return",
"this",
";",
"}"
] | Read this vector from the supplied {@link ByteBuffer} starting at the specified
absolute buffer position/index.
<p>
This method will not increment the position of the given ByteBuffer.
@param index
the absolute position into the ByteBuffer
@param buffer
values will be read in <code>x, y, z, w</code> order
@return this | [
"Read",
"this",
"vector",
"from",
"the",
"supplied",
"{",
"@link",
"ByteBuffer",
"}",
"starting",
"at",
"the",
"specified",
"absolute",
"buffer",
"position",
"/",
"index",
".",
"<p",
">",
"This",
"method",
"will",
"not",
"increment",
"the",
"position",
"of",... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector4f.java#L459-L462 |
bingoohuang/westcache | src/main/java/com/github/bingoohuang/westcache/utils/Methods.java | Methods.getAllMethodsInHierarchy | public static Set<Method> getAllMethodsInHierarchy(Method method) {
"""
/*
Gets an array of all methods in a class hierarchy walking up to parent classes
"""
LinkedHashSet<Method> allMethods = new LinkedHashSet<>();
val declaringClass = method.getDeclaringClass();
return getAllMethodsI... | java | public static Set<Method> getAllMethodsInHierarchy(Method method) {
LinkedHashSet<Method> allMethods = new LinkedHashSet<>();
val declaringClass = method.getDeclaringClass();
return getAllMethodsInHierarchy(allMethods, declaringClass, method);
} | [
"public",
"static",
"Set",
"<",
"Method",
">",
"getAllMethodsInHierarchy",
"(",
"Method",
"method",
")",
"{",
"LinkedHashSet",
"<",
"Method",
">",
"allMethods",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")",
";",
"val",
"declaringClass",
"=",
"method",
".",
"g... | /*
Gets an array of all methods in a class hierarchy walking up to parent classes | [
"/",
"*",
"Gets",
"an",
"array",
"of",
"all",
"methods",
"in",
"a",
"class",
"hierarchy",
"walking",
"up",
"to",
"parent",
"classes"
] | train | https://github.com/bingoohuang/westcache/blob/09842bf0b9299abe75551c4b51d326fcc96da42d/src/main/java/com/github/bingoohuang/westcache/utils/Methods.java#L28-L32 |
Jasig/spring-portlet-contrib | spring-security-portlet-contrib/src/main/java/org/jasig/springframework/security/portlet/authentication/PortletAuthenticationProcessingFilter.java | PortletAuthenticationProcessingFilter.successfulAuthentication | protected void successfulAuthentication(PortletRequest request, PortletResponse response,
Authentication authResult) {
"""
Puts the Authentication instance returned by the
authentication manager into the secure context.
@param request a {@link javax.portlet.PortletRequest} object.
@param response ... | java | protected void successfulAuthentication(PortletRequest request, PortletResponse response,
Authentication authResult) {
if (logger.isDebugEnabled()) {
logger.debug("Authentication success: " + authResult);
}
SecurityContextHolder.getContext().setAuthentication(authResult);... | [
"protected",
"void",
"successfulAuthentication",
"(",
"PortletRequest",
"request",
",",
"PortletResponse",
"response",
",",
"Authentication",
"authResult",
")",
"{",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"\"... | Puts the Authentication instance returned by the
authentication manager into the secure context.
@param request a {@link javax.portlet.PortletRequest} object.
@param response a {@link javax.portlet.PortletResponse} object.
@param authResult a {@link org.springframework.security.core.Authentication} object. | [
"Puts",
"the",
"Authentication",
"instance",
"returned",
"by",
"the",
"authentication",
"manager",
"into",
"the",
"secure",
"context",
"."
] | train | https://github.com/Jasig/spring-portlet-contrib/blob/719240fa268ddc69900ce9775d9cad3b9c543c6b/spring-security-portlet-contrib/src/main/java/org/jasig/springframework/security/portlet/authentication/PortletAuthenticationProcessingFilter.java#L214-L224 |
alkacon/opencms-core | src/org/opencms/ade/publish/CmsPublishRelationFinder.java | CmsPublishRelationFinder.removeUnchangedTopLevelResources | public void removeUnchangedTopLevelResources(ResourceMap publishRelatedResources, ResourceMap reachability) {
"""
Removes unchanged resources from the top level, and if they have children which do not occur anywhere else,
moves these children to the top level.<p>
@param publishRelatedResources the resource map... | java | public void removeUnchangedTopLevelResources(ResourceMap publishRelatedResources, ResourceMap reachability) {
Set<CmsResource> unchangedParents = Sets.newHashSet();
Set<CmsResource> childrenOfUnchangedParents = Sets.newHashSet();
Set<CmsResource> other = Sets.newHashSet();
for (CmsResou... | [
"public",
"void",
"removeUnchangedTopLevelResources",
"(",
"ResourceMap",
"publishRelatedResources",
",",
"ResourceMap",
"reachability",
")",
"{",
"Set",
"<",
"CmsResource",
">",
"unchangedParents",
"=",
"Sets",
".",
"newHashSet",
"(",
")",
";",
"Set",
"<",
"CmsReso... | Removes unchanged resources from the top level, and if they have children which do not occur anywhere else,
moves these children to the top level.<p>
@param publishRelatedResources the resource map to modify
@param reachability the reachability map | [
"Removes",
"unchanged",
"resources",
"from",
"the",
"top",
"level",
"and",
"if",
"they",
"have",
"children",
"which",
"do",
"not",
"occur",
"anywhere",
"else",
"moves",
"these",
"children",
"to",
"the",
"top",
"level",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/publish/CmsPublishRelationFinder.java#L216-L246 |
jbundle/jbundle | thin/base/util/util/src/main/java/org/jbundle/thin/base/util/Application.java | Application.setProperty | public void setProperty(String strParam, String strValue) {
"""
Set this property.
@param strProperty The property key.
@param strValue The property value.
"""
if (strValue != null)
m_properties.put(strParam, strValue);
else
m_properties.remove(strParam);
} | java | public void setProperty(String strParam, String strValue)
{
if (strValue != null)
m_properties.put(strParam, strValue);
else
m_properties.remove(strParam);
} | [
"public",
"void",
"setProperty",
"(",
"String",
"strParam",
",",
"String",
"strValue",
")",
"{",
"if",
"(",
"strValue",
"!=",
"null",
")",
"m_properties",
".",
"put",
"(",
"strParam",
",",
"strValue",
")",
";",
"else",
"m_properties",
".",
"remove",
"(",
... | Set this property.
@param strProperty The property key.
@param strValue The property value. | [
"Set",
"this",
"property",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/util/util/src/main/java/org/jbundle/thin/base/util/Application.java#L930-L936 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/CompressionUtilities.java | CompressionUtilities.zipFolder | static public void zipFolder( String srcFolder, String destZipFile, boolean addBaseFolder ) throws IOException {
"""
Compress a folder and its contents.
@param srcFolder path to the folder to be compressed.
@param destZipFile path to the final output zip file.
@param addBaseFolder flag to decide whether to ad... | java | static public void zipFolder( String srcFolder, String destZipFile, boolean addBaseFolder ) throws IOException {
if (new File(srcFolder).isDirectory()) {
try (FileOutputStream fileWriter = new FileOutputStream(destZipFile);
ZipOutputStream zip = new ZipOutputStream(fileWriter)) {... | [
"static",
"public",
"void",
"zipFolder",
"(",
"String",
"srcFolder",
",",
"String",
"destZipFile",
",",
"boolean",
"addBaseFolder",
")",
"throws",
"IOException",
"{",
"if",
"(",
"new",
"File",
"(",
"srcFolder",
")",
".",
"isDirectory",
"(",
")",
")",
"{",
... | Compress a folder and its contents.
@param srcFolder path to the folder to be compressed.
@param destZipFile path to the final output zip file.
@param addBaseFolder flag to decide whether to add also the provided base (srcFolder) folder or not.
@throws IOException | [
"Compress",
"a",
"folder",
"and",
"its",
"contents",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/CompressionUtilities.java#L50-L59 |
facebookarchive/hadoop-20 | src/contrib/benchmark/src/java/org/apache/hadoop/mapred/MapOutputCorrectness.java | MapOutputCorrectness.possiblyFail | private static void possiblyFail(float chanceFailure, Random random) {
"""
Should fail?
@param chanceFailure Chances of failure [0.0,1.0]
@param random Pseudo-random variable
"""
float value = random.nextFloat();
if (value < chanceFailure) {
LOG.fatal("shouldFail: Failing with value " + value +... | java | private static void possiblyFail(float chanceFailure, Random random) {
float value = random.nextFloat();
if (value < chanceFailure) {
LOG.fatal("shouldFail: Failing with value " + value +
" < " + chanceFailure);
System.exit(-1);
}
} | [
"private",
"static",
"void",
"possiblyFail",
"(",
"float",
"chanceFailure",
",",
"Random",
"random",
")",
"{",
"float",
"value",
"=",
"random",
".",
"nextFloat",
"(",
")",
";",
"if",
"(",
"value",
"<",
"chanceFailure",
")",
"{",
"LOG",
".",
"fatal",
"(",... | Should fail?
@param chanceFailure Chances of failure [0.0,1.0]
@param random Pseudo-random variable | [
"Should",
"fail?"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/benchmark/src/java/org/apache/hadoop/mapred/MapOutputCorrectness.java#L373-L380 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_trend_microvpx_image.java | xen_trend_microvpx_image.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
xen_trend_microvpx_image_responses result = (xen_trend_microvpx_image_r... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
xen_trend_microvpx_image_responses result = (xen_trend_microvpx_image_responses) service.get_payload_formatter().string_to_resource(xen_trend_microvpx_image_responses.class, response);
if(result.errorcod... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"xen_trend_microvpx_image_responses",
"result",
"=",
"(",
"xen_trend_microvpx_image_responses",
")",
"service",
... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_trend_microvpx_image.java#L264-L281 |
nominanuda/zen-project | zen-rhino/src/main/java/org/mozilla/javascript/HtmlUnitRegExpProxy.java | HtmlUnitRegExpProxy.isEscaped | static boolean isEscaped(final String characters, final int position) {
"""
Indicates if the character at the given position is escaped or not.
@param characters
the characters to consider
@param position
the position
@return <code>true</code> if escaped
"""
int p = position;
int nbBackslash = 0;
... | java | static boolean isEscaped(final String characters, final int position) {
int p = position;
int nbBackslash = 0;
while (p > 0 && characters.charAt(--p) == '\\') {
nbBackslash++;
}
return (nbBackslash % 2 == 1);
} | [
"static",
"boolean",
"isEscaped",
"(",
"final",
"String",
"characters",
",",
"final",
"int",
"position",
")",
"{",
"int",
"p",
"=",
"position",
";",
"int",
"nbBackslash",
"=",
"0",
";",
"while",
"(",
"p",
">",
"0",
"&&",
"characters",
".",
"charAt",
"(... | Indicates if the character at the given position is escaped or not.
@param characters
the characters to consider
@param position
the position
@return <code>true</code> if escaped | [
"Indicates",
"if",
"the",
"character",
"at",
"the",
"given",
"position",
"is",
"escaped",
"or",
"not",
"."
] | train | https://github.com/nominanuda/zen-project/blob/fe48ae8da198eb7066c2b56bf2ffafe4cdfc451d/zen-rhino/src/main/java/org/mozilla/javascript/HtmlUnitRegExpProxy.java#L242-L249 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.leftShift | public static File leftShift(File file, InputStream data) throws IOException {
"""
Append binary data to the file. See {@link #append(java.io.File, java.io.InputStream)}
@param file a File
@param data an InputStream of data to write to the file
@return the file
@throws IOException if an IOException occurs.
... | java | public static File leftShift(File file, InputStream data) throws IOException {
append(file, data);
return file;
} | [
"public",
"static",
"File",
"leftShift",
"(",
"File",
"file",
",",
"InputStream",
"data",
")",
"throws",
"IOException",
"{",
"append",
"(",
"file",
",",
"data",
")",
";",
"return",
"file",
";",
"}"
] | Append binary data to the file. See {@link #append(java.io.File, java.io.InputStream)}
@param file a File
@param data an InputStream of data to write to the file
@return the file
@throws IOException if an IOException occurs.
@since 1.5.0 | [
"Append",
"binary",
"data",
"to",
"the",
"file",
".",
"See",
"{",
"@link",
"#append",
"(",
"java",
".",
"io",
".",
"File",
"java",
".",
"io",
".",
"InputStream",
")",
"}"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L821-L824 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/clique/CLIQUESubspace.java | CLIQUESubspace.leftNeighbor | protected CLIQUEUnit leftNeighbor(CLIQUEUnit unit, int dim) {
"""
Returns the left neighbor of the given unit in the specified dimension.
@param unit the unit to determine the left neighbor for
@param dim the dimension
@return the left neighbor of the given unit in the specified dimension
"""
for(CLIQ... | java | protected CLIQUEUnit leftNeighbor(CLIQUEUnit unit, int dim) {
for(CLIQUEUnit u : denseUnits) {
if(u.containsLeftNeighbor(unit, dim)) {
return u;
}
}
return null;
} | [
"protected",
"CLIQUEUnit",
"leftNeighbor",
"(",
"CLIQUEUnit",
"unit",
",",
"int",
"dim",
")",
"{",
"for",
"(",
"CLIQUEUnit",
"u",
":",
"denseUnits",
")",
"{",
"if",
"(",
"u",
".",
"containsLeftNeighbor",
"(",
"unit",
",",
"dim",
")",
")",
"{",
"return",
... | Returns the left neighbor of the given unit in the specified dimension.
@param unit the unit to determine the left neighbor for
@param dim the dimension
@return the left neighbor of the given unit in the specified dimension | [
"Returns",
"the",
"left",
"neighbor",
"of",
"the",
"given",
"unit",
"in",
"the",
"specified",
"dimension",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/clique/CLIQUESubspace.java#L146-L153 |
openengsb/openengsb | connector/userprojectsfile/src/main/java/org/openengsb/connector/userprojects/file/internal/file/AssignmentFileAccessObject.java | AssignmentFileAccessObject.findAllAssignments | public List<Assignment> findAllAssignments() {
"""
Finds all the available assignments.
@return the list of available assignments
"""
List<Assignment> list = new ArrayList<>();
List<String> assignmentStrings;
try {
assignmentStrings = readLines(assignmentsFile);
}... | java | public List<Assignment> findAllAssignments() {
List<Assignment> list = new ArrayList<>();
List<String> assignmentStrings;
try {
assignmentStrings = readLines(assignmentsFile);
} catch (IOException e) {
throw new FileBasedRuntimeException(e);
}
for... | [
"public",
"List",
"<",
"Assignment",
">",
"findAllAssignments",
"(",
")",
"{",
"List",
"<",
"Assignment",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"List",
"<",
"String",
">",
"assignmentStrings",
";",
"try",
"{",
"assignmentStrings",
"=",... | Finds all the available assignments.
@return the list of available assignments | [
"Finds",
"all",
"the",
"available",
"assignments",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/connector/userprojectsfile/src/main/java/org/openengsb/connector/userprojects/file/internal/file/AssignmentFileAccessObject.java#L45-L71 |
OmarAflak/Fingerprint | fingerprint/src/main/java/me/aflak/libraries/dialog/FingerprintDialog.java | FingerprintDialog.tryLimit | public FingerprintDialog tryLimit(int limit, final FailAuthCounterDialogCallback counterCallback) {
"""
Set a fail limit. Android blocks automatically when 5 attempts failed.
@param limit number of tries
@param counterCallback callback to be triggered when limit is reached
@return FingerprintDialog object
"... | java | public FingerprintDialog tryLimit(int limit, final FailAuthCounterDialogCallback counterCallback){
this.fingerprint.tryLimit(limit, new FailAuthCounterCallback() {
@Override
public void onTryLimitReached(Fingerprint fingerprint) {
counterCallback.onTryLimitReached(Fingerp... | [
"public",
"FingerprintDialog",
"tryLimit",
"(",
"int",
"limit",
",",
"final",
"FailAuthCounterDialogCallback",
"counterCallback",
")",
"{",
"this",
".",
"fingerprint",
".",
"tryLimit",
"(",
"limit",
",",
"new",
"FailAuthCounterCallback",
"(",
")",
"{",
"@",
"Overr... | Set a fail limit. Android blocks automatically when 5 attempts failed.
@param limit number of tries
@param counterCallback callback to be triggered when limit is reached
@return FingerprintDialog object | [
"Set",
"a",
"fail",
"limit",
".",
"Android",
"blocks",
"automatically",
"when",
"5",
"attempts",
"failed",
"."
] | train | https://github.com/OmarAflak/Fingerprint/blob/4a4cd4a8f092a126f4204eea087d845360342a62/fingerprint/src/main/java/me/aflak/libraries/dialog/FingerprintDialog.java#L236-L244 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/DeviceTypesApi.java | DeviceTypesApi.getDeviceTypesByApplicationAsync | public com.squareup.okhttp.Call getDeviceTypesByApplicationAsync(String appId, Boolean productInfo, Integer count, Integer offset, final ApiCallback<DeviceTypesEnvelope> callback) throws ApiException {
"""
Get Device Types by Application (asynchronously)
Get Device Types by Application
@param appId Application I... | java | public com.squareup.okhttp.Call getDeviceTypesByApplicationAsync(String appId, Boolean productInfo, Integer count, Integer offset, final ApiCallback<DeviceTypesEnvelope> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestLis... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"getDeviceTypesByApplicationAsync",
"(",
"String",
"appId",
",",
"Boolean",
"productInfo",
",",
"Integer",
"count",
",",
"Integer",
"offset",
",",
"final",
"ApiCallback",
"<",
"DeviceTypesEnvelope",
">"... | Get Device Types by Application (asynchronously)
Get Device Types by Application
@param appId Application ID. (required)
@param productInfo Flag to include the associated ProductInfo if present (optional)
@param count Desired count of items in the result set. (optional)
@param offset Offset for pagination. (optional)
@... | [
"Get",
"Device",
"Types",
"by",
"Application",
"(",
"asynchronously",
")",
"Get",
"Device",
"Types",
"by",
"Application"
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/DeviceTypesApi.java#L541-L566 |
drewwills/cernunnos | cernunnos-core/src/main/java/org/danann/cernunnos/sql/UpsertTask.java | UpsertTask.doInsert | protected int doInsert(JdbcTemplate jdbcTemplate, TaskRequest req, TaskResponse res) {
"""
Executes the insert and returns the affected row count
Moved to its own method to reduce possibility for variable name confusion
"""
//Setup the insert parameters and setter
final List<Phrase> paramete... | java | protected int doInsert(JdbcTemplate jdbcTemplate, TaskRequest req, TaskResponse res) {
//Setup the insert parameters and setter
final List<Phrase> parametersInUse = insert_parameters != null ? insert_parameters : parameters;
final PreparedStatementSetter preparedStatementSetter = new PhraseParam... | [
"protected",
"int",
"doInsert",
"(",
"JdbcTemplate",
"jdbcTemplate",
",",
"TaskRequest",
"req",
",",
"TaskResponse",
"res",
")",
"{",
"//Setup the insert parameters and setter",
"final",
"List",
"<",
"Phrase",
">",
"parametersInUse",
"=",
"insert_parameters",
"!=",
"n... | Executes the insert and returns the affected row count
Moved to its own method to reduce possibility for variable name confusion | [
"Executes",
"the",
"insert",
"and",
"returns",
"the",
"affected",
"row",
"count"
] | train | https://github.com/drewwills/cernunnos/blob/dc6848e0253775e22b6c869fd06506d4ddb6d728/cernunnos-core/src/main/java/org/danann/cernunnos/sql/UpsertTask.java#L173-L181 |
aws/aws-sdk-java | aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/CreateCrawlerRequest.java | CreateCrawlerRequest.withTags | public CreateCrawlerRequest withTags(java.util.Map<String, String> tags) {
"""
<p>
The tags to use with this crawler request. You may use tags to limit access to the crawler. For more information
about tags in AWS Glue, see <a href="http://docs.aws.amazon.com/glue/latest/dg/monitor-tags.html">AWS Tags in AWS
Gl... | java | public CreateCrawlerRequest withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"CreateCrawlerRequest",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The tags to use with this crawler request. You may use tags to limit access to the crawler. For more information
about tags in AWS Glue, see <a href="http://docs.aws.amazon.com/glue/latest/dg/monitor-tags.html">AWS Tags in AWS
Glue</a> in the developer guide.
</p>
@param tags
The tags to use with this crawler requ... | [
"<p",
">",
"The",
"tags",
"to",
"use",
"with",
"this",
"crawler",
"request",
".",
"You",
"may",
"use",
"tags",
"to",
"limit",
"access",
"to",
"the",
"crawler",
".",
"For",
"more",
"information",
"about",
"tags",
"in",
"AWS",
"Glue",
"see",
"<a",
"href"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/CreateCrawlerRequest.java#L678-L681 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/ComparableExtensions.java | ComparableExtensions.operator_greaterEqualsThan | @Pure /* not guaranteed, since compareTo() is invoked */
@Inline("($1.compareTo($2) >= 0)")
public static <C> boolean operator_greaterEqualsThan(Comparable<? super C> left, C right) {
"""
The comparison operator <code>greater than or equals</code>.
@param left
a comparable
@param right
the value to compare... | java | @Pure /* not guaranteed, since compareTo() is invoked */
@Inline("($1.compareTo($2) >= 0)")
public static <C> boolean operator_greaterEqualsThan(Comparable<? super C> left, C right) {
return left.compareTo(right) >= 0;
} | [
"@",
"Pure",
"/* not guaranteed, since compareTo() is invoked */",
"@",
"Inline",
"(",
"\"($1.compareTo($2) >= 0)\"",
")",
"public",
"static",
"<",
"C",
">",
"boolean",
"operator_greaterEqualsThan",
"(",
"Comparable",
"<",
"?",
"super",
"C",
">",
"left",
",",
"C",
"... | The comparison operator <code>greater than or equals</code>.
@param left
a comparable
@param right
the value to compare with
@return <code>left.compareTo(right) >= 0</code> | [
"The",
"comparison",
"operator",
"<code",
">",
"greater",
"than",
"or",
"equals<",
"/",
"code",
">",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/ComparableExtensions.java#L74-L78 |
sirthias/parboiled | parboiled-core/src/main/java/org/parboiled/support/Filters.java | Filters.onlyMismatches | public static Predicate<Tuple2<Context<?>, Boolean>> onlyMismatches() {
"""
A predicate usable as a filter (element) of a {@link org.parboiled.parserunners.TracingParseRunner}.
Enables printing of rule tracing log messages for all mismatched rules.
@return a predicate
"""
return new Predicate<Tuple... | java | public static Predicate<Tuple2<Context<?>, Boolean>> onlyMismatches() {
return new Predicate<Tuple2<Context<?>, Boolean>>() {
public boolean apply(Tuple2<Context<?>, Boolean> tuple) {
return !tuple.b;
}
};
} | [
"public",
"static",
"Predicate",
"<",
"Tuple2",
"<",
"Context",
"<",
"?",
">",
",",
"Boolean",
">",
">",
"onlyMismatches",
"(",
")",
"{",
"return",
"new",
"Predicate",
"<",
"Tuple2",
"<",
"Context",
"<",
"?",
">",
",",
"Boolean",
">",
">",
"(",
")",
... | A predicate usable as a filter (element) of a {@link org.parboiled.parserunners.TracingParseRunner}.
Enables printing of rule tracing log messages for all mismatched rules.
@return a predicate | [
"A",
"predicate",
"usable",
"as",
"a",
"filter",
"(",
"element",
")",
"of",
"a",
"{",
"@link",
"org",
".",
"parboiled",
".",
"parserunners",
".",
"TracingParseRunner",
"}",
".",
"Enables",
"printing",
"of",
"rule",
"tracing",
"log",
"messages",
"for",
"all... | train | https://github.com/sirthias/parboiled/blob/84f3ed43e3e171b4c6ab5e6ca6297d264a9d686a/parboiled-core/src/main/java/org/parboiled/support/Filters.java#L205-L211 |
Domo42/saga-lib | saga-lib/src/main/java/com/codebullets/sagalib/AbstractSaga.java | AbstractSaga.requestTimeout | protected TimeoutId requestTimeout(final long delay, final TimeUnit unit, @Nullable final Object data) {
"""
Requests a timeout event attaching specific timeout data. This data is returned
with the timeout message received.
"""
return requestTimeout(delay, unit, null, data);
} | java | protected TimeoutId requestTimeout(final long delay, final TimeUnit unit, @Nullable final Object data) {
return requestTimeout(delay, unit, null, data);
} | [
"protected",
"TimeoutId",
"requestTimeout",
"(",
"final",
"long",
"delay",
",",
"final",
"TimeUnit",
"unit",
",",
"@",
"Nullable",
"final",
"Object",
"data",
")",
"{",
"return",
"requestTimeout",
"(",
"delay",
",",
"unit",
",",
"null",
",",
"data",
")",
";... | Requests a timeout event attaching specific timeout data. This data is returned
with the timeout message received. | [
"Requests",
"a",
"timeout",
"event",
"attaching",
"specific",
"timeout",
"data",
".",
"This",
"data",
"is",
"returned",
"with",
"the",
"timeout",
"message",
"received",
"."
] | train | https://github.com/Domo42/saga-lib/blob/c8f232e2a51fcb6a3fe0082cfbf105c1e6bf90ef/saga-lib/src/main/java/com/codebullets/sagalib/AbstractSaga.java#L102-L104 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ChineseCalendar.java | ChineseCalendar.offsetMonth | private void offsetMonth(int newMoon, int dom, int delta) {
"""
Adjust this calendar to be delta months before or after a given
start position, pinning the day of month if necessary. The start
position is given as a local days number for the start of the month
and a day-of-month. Used by add() and roll().
@p... | java | private void offsetMonth(int newMoon, int dom, int delta) {
// Move to the middle of the month before our target month.
newMoon += (int) (CalendarAstronomer.SYNODIC_MONTH * (delta - 0.5));
// Search forward to the target month's new moon
newMoon = newMoonNear(newMoon, true);
//... | [
"private",
"void",
"offsetMonth",
"(",
"int",
"newMoon",
",",
"int",
"dom",
",",
"int",
"delta",
")",
"{",
"// Move to the middle of the month before our target month.",
"newMoon",
"+=",
"(",
"int",
")",
"(",
"CalendarAstronomer",
".",
"SYNODIC_MONTH",
"*",
"(",
"... | Adjust this calendar to be delta months before or after a given
start position, pinning the day of month if necessary. The start
position is given as a local days number for the start of the month
and a day-of-month. Used by add() and roll().
@param newMoon the local days of the first day of the month of the
start po... | [
"Adjust",
"this",
"calendar",
"to",
"be",
"delta",
"months",
"before",
"or",
"after",
"a",
"given",
"start",
"position",
"pinning",
"the",
"day",
"of",
"month",
"if",
"necessary",
".",
"The",
"start",
"position",
"is",
"given",
"as",
"a",
"local",
"days",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ChineseCalendar.java#L514-L539 |
google/closure-compiler | src/com/google/javascript/rhino/jstype/FunctionType.java | FunctionType.tryMergeFunctionPiecewise | private FunctionType tryMergeFunctionPiecewise(FunctionType other, boolean leastSuper) {
"""
Try to get the sup/inf of two functions by looking at the piecewise components.
"""
Node newParamsNode = null;
if (call.hasEqualParameters(other.call, EquivalenceMethod.IDENTITY, EqCache.create())) {
newP... | java | private FunctionType tryMergeFunctionPiecewise(FunctionType other, boolean leastSuper) {
Node newParamsNode = null;
if (call.hasEqualParameters(other.call, EquivalenceMethod.IDENTITY, EqCache.create())) {
newParamsNode = call.parameters;
} else {
// If the parameters are not equal, don't try to ... | [
"private",
"FunctionType",
"tryMergeFunctionPiecewise",
"(",
"FunctionType",
"other",
",",
"boolean",
"leastSuper",
")",
"{",
"Node",
"newParamsNode",
"=",
"null",
";",
"if",
"(",
"call",
".",
"hasEqualParameters",
"(",
"other",
".",
"call",
",",
"EquivalenceMetho... | Try to get the sup/inf of two functions by looking at the piecewise components. | [
"Try",
"to",
"get",
"the",
"sup",
"/",
"inf",
"of",
"two",
"functions",
"by",
"looking",
"at",
"the",
"piecewise",
"components",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/FunctionType.java#L827-L860 |
GwtMaterialDesign/gwt-material-addins | src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java | MaterialComboBox.setSingleValue | public void setSingleValue(T value, boolean fireEvents) {
"""
Set the selected value using a single item, generally used
in single selection mode.
"""
int index = this.values.indexOf(value);
if (index < 0 && value instanceof String) {
index = getIndexByString((String) value);
... | java | public void setSingleValue(T value, boolean fireEvents) {
int index = this.values.indexOf(value);
if (index < 0 && value instanceof String) {
index = getIndexByString((String) value);
}
if (index > -1) {
List<T> before = getValue();
setSelectedIndex(i... | [
"public",
"void",
"setSingleValue",
"(",
"T",
"value",
",",
"boolean",
"fireEvents",
")",
"{",
"int",
"index",
"=",
"this",
".",
"values",
".",
"indexOf",
"(",
"value",
")",
";",
"if",
"(",
"index",
"<",
"0",
"&&",
"value",
"instanceof",
"String",
")",... | Set the selected value using a single item, generally used
in single selection mode. | [
"Set",
"the",
"selected",
"value",
"using",
"a",
"single",
"item",
"generally",
"used",
"in",
"single",
"selection",
"mode",
"."
] | train | https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java#L533-L547 |
threerings/nenya | core/src/main/java/com/threerings/media/tile/TrimmedObjectTileSet.java | TrimmedObjectTileSet.hasConstraint | public boolean hasConstraint (int tileIdx, String constraint) {
"""
Checks whether the tile at the specified index has the given constraint.
"""
return (_bits == null || _bits[tileIdx].constraints == null) ? false :
ListUtil.contains(_bits[tileIdx].constraints, constraint);
} | java | public boolean hasConstraint (int tileIdx, String constraint)
{
return (_bits == null || _bits[tileIdx].constraints == null) ? false :
ListUtil.contains(_bits[tileIdx].constraints, constraint);
} | [
"public",
"boolean",
"hasConstraint",
"(",
"int",
"tileIdx",
",",
"String",
"constraint",
")",
"{",
"return",
"(",
"_bits",
"==",
"null",
"||",
"_bits",
"[",
"tileIdx",
"]",
".",
"constraints",
"==",
"null",
")",
"?",
"false",
":",
"ListUtil",
".",
"cont... | Checks whether the tile at the specified index has the given constraint. | [
"Checks",
"whether",
"the",
"tile",
"at",
"the",
"specified",
"index",
"has",
"the",
"given",
"constraint",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/TrimmedObjectTileSet.java#L96-L100 |
mkotsur/restito | src/main/java/com/xebialabs/restito/builder/verify/VerifyHttp.java | VerifyHttp.times | public VerifySequenced times(int t, Condition... conditions) {
"""
There should be <i>t</i> calls which satisfies given conditions
"""
final List<Call> foundCalls = filterByConditions(conditions);
if (t != foundCalls.size()) {
throw new AssertionError(format("Expected to happen %s t... | java | public VerifySequenced times(int t, Condition... conditions) {
final List<Call> foundCalls = filterByConditions(conditions);
if (t != foundCalls.size()) {
throw new AssertionError(format("Expected to happen %s time(s), but happened %s times instead", t, foundCalls.size()));
}
... | [
"public",
"VerifySequenced",
"times",
"(",
"int",
"t",
",",
"Condition",
"...",
"conditions",
")",
"{",
"final",
"List",
"<",
"Call",
">",
"foundCalls",
"=",
"filterByConditions",
"(",
"conditions",
")",
";",
"if",
"(",
"t",
"!=",
"foundCalls",
".",
"size"... | There should be <i>t</i> calls which satisfies given conditions | [
"There",
"should",
"be",
"<i",
">",
"t<",
"/",
"i",
">",
"calls",
"which",
"satisfies",
"given",
"conditions"
] | train | https://github.com/mkotsur/restito/blob/b999293616ca84fdea1ffe929e92a5db29c7e415/src/main/java/com/xebialabs/restito/builder/verify/VerifyHttp.java#L55-L62 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/trees/GrammaticalStructure.java | GrammaticalStructure.getGrammaticalRelation | public GrammaticalRelation getGrammaticalRelation(int govIndex, int depIndex) {
"""
Get GrammaticalRelation between gov and dep, and null if gov is not the
governor of dep
"""
TreeGraphNode gov = getNodeByIndex(govIndex);
TreeGraphNode dep = getNodeByIndex(depIndex);
return getGrammaticalRelat... | java | public GrammaticalRelation getGrammaticalRelation(int govIndex, int depIndex) {
TreeGraphNode gov = getNodeByIndex(govIndex);
TreeGraphNode dep = getNodeByIndex(depIndex);
return getGrammaticalRelation(gov, dep);
} | [
"public",
"GrammaticalRelation",
"getGrammaticalRelation",
"(",
"int",
"govIndex",
",",
"int",
"depIndex",
")",
"{",
"TreeGraphNode",
"gov",
"=",
"getNodeByIndex",
"(",
"govIndex",
")",
";",
"TreeGraphNode",
"dep",
"=",
"getNodeByIndex",
"(",
"depIndex",
")",
";",... | Get GrammaticalRelation between gov and dep, and null if gov is not the
governor of dep | [
"Get",
"GrammaticalRelation",
"between",
"gov",
"and",
"dep",
"and",
"null",
"if",
"gov",
"is",
"not",
"the",
"governor",
"of",
"dep"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/GrammaticalStructure.java#L468-L472 |
JRebirth/JRebirth | org.jrebirth.af/processor/src/main/java/org/jrebirth/af/processor/ComponentProcessor.java | ComponentProcessor.createModuleStarter | private String createModuleStarter(final Map<Class<?>, Set<? extends Element>> annotationMap, ProcessingEnvironment processingEnv) {
"""
Creates module stater class according to the annotations
@param annotationMap map of annotations to process
@param processingEnv environment to access facilities the tool fra... | java | private String createModuleStarter(final Map<Class<?>, Set<? extends Element>> annotationMap, ProcessingEnvironment processingEnv) {
String moduleName;
try {
moduleName = getModuleStarterName(processingEnv);
final String starterName = moduleName.substring(moduleName.lastIndexOf('... | [
"private",
"String",
"createModuleStarter",
"(",
"final",
"Map",
"<",
"Class",
"<",
"?",
">",
",",
"Set",
"<",
"?",
"extends",
"Element",
">",
">",
"annotationMap",
",",
"ProcessingEnvironment",
"processingEnv",
")",
"{",
"String",
"moduleName",
";",
"try",
... | Creates module stater class according to the annotations
@param annotationMap map of annotations to process
@param processingEnv environment to access facilities the tool framework provides to the processor
@return Module name | [
"Creates",
"module",
"stater",
"class",
"according",
"to",
"the",
"annotations"
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/processor/src/main/java/org/jrebirth/af/processor/ComponentProcessor.java#L146-L200 |
blinkfox/zealot | src/main/java/com/blinkfox/zealot/core/Zealot.java | Zealot.buildSqlInfo | @SuppressWarnings("unchecked")
public static SqlInfo buildSqlInfo(String nameSpace, SqlInfo sqlInfo, Node node, Object paramObj) {
"""
构建完整的SqlInfo对象.
@param nameSpace xml命名空间
@param sqlInfo SqlInfo对象
@param node dom4j对象节点
@param paramObj 参数对象
@return 返回SqlInfo对象
"""
// 获取所有子节点,并分别将其使用String... | java | @SuppressWarnings("unchecked")
public static SqlInfo buildSqlInfo(String nameSpace, SqlInfo sqlInfo, Node node, Object paramObj) {
// 获取所有子节点,并分别将其使用StringBuilder拼接起来
List<Node> nodes = node.selectNodes(ZealotConst.ATTR_CHILD);
for (Node n: nodes) {
if (ZealotConst.NODETYPE_TEXT.... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"SqlInfo",
"buildSqlInfo",
"(",
"String",
"nameSpace",
",",
"SqlInfo",
"sqlInfo",
",",
"Node",
"node",
",",
"Object",
"paramObj",
")",
"{",
"// 获取所有子节点,并分别将其使用StringBuilder拼接起来",
"List",
"<",
... | 构建完整的SqlInfo对象.
@param nameSpace xml命名空间
@param sqlInfo SqlInfo对象
@param node dom4j对象节点
@param paramObj 参数对象
@return 返回SqlInfo对象 | [
"构建完整的SqlInfo对象",
"."
] | train | https://github.com/blinkfox/zealot/blob/21b00fa3e4ed42188eef3116d494e112e7a4194c/src/main/java/com/blinkfox/zealot/core/Zealot.java#L107-L122 |
geomajas/geomajas-project-server | plugin/layer-geotools/geotools/src/main/java/org/geomajas/layer/shapeinmem/ShapeInMemLayer.java | ShapeInMemLayer.getBounds | public Envelope getBounds(Filter filter) throws LayerException {
"""
Retrieve the bounds of the specified features.
@param filter filter
@return the bounds of the specified features
@throws LayerException cannot read features
"""
try {
FeatureCollection<SimpleFeatureType, SimpleFeature> fc = getFeatu... | java | public Envelope getBounds(Filter filter) throws LayerException {
try {
FeatureCollection<SimpleFeatureType, SimpleFeature> fc = getFeatureSource().getFeatures(filter);
return fc.getBounds();
} catch (IOException ioe) {
throw new LayerException(ioe, ExceptionCode.FEATURE_MODEL_PROBLEM);
}
} | [
"public",
"Envelope",
"getBounds",
"(",
"Filter",
"filter",
")",
"throws",
"LayerException",
"{",
"try",
"{",
"FeatureCollection",
"<",
"SimpleFeatureType",
",",
"SimpleFeature",
">",
"fc",
"=",
"getFeatureSource",
"(",
")",
".",
"getFeatures",
"(",
"filter",
")... | Retrieve the bounds of the specified features.
@param filter filter
@return the bounds of the specified features
@throws LayerException cannot read features | [
"Retrieve",
"the",
"bounds",
"of",
"the",
"specified",
"features",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/layer-geotools/geotools/src/main/java/org/geomajas/layer/shapeinmem/ShapeInMemLayer.java#L176-L183 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java | WordVectorSerializer.writeVocabCache | public static void writeVocabCache(@NonNull VocabCache<VocabWord> vocabCache, @NonNull File file)
throws IOException {
"""
This method saves vocab cache to provided File.
Please note: it saves only vocab content, so it's suitable mostly for BagOfWords/TF-IDF vectorizers
@param vocabCache
@param fi... | java | public static void writeVocabCache(@NonNull VocabCache<VocabWord> vocabCache, @NonNull File file)
throws IOException {
try (FileOutputStream fos = new FileOutputStream(file)) {
writeVocabCache(vocabCache, fos);
}
} | [
"public",
"static",
"void",
"writeVocabCache",
"(",
"@",
"NonNull",
"VocabCache",
"<",
"VocabWord",
">",
"vocabCache",
",",
"@",
"NonNull",
"File",
"file",
")",
"throws",
"IOException",
"{",
"try",
"(",
"FileOutputStream",
"fos",
"=",
"new",
"FileOutputStream",
... | This method saves vocab cache to provided File.
Please note: it saves only vocab content, so it's suitable mostly for BagOfWords/TF-IDF vectorizers
@param vocabCache
@param file
@throws UnsupportedEncodingException | [
"This",
"method",
"saves",
"vocab",
"cache",
"to",
"provided",
"File",
".",
"Please",
"note",
":",
"it",
"saves",
"only",
"vocab",
"content",
"so",
"it",
"s",
"suitable",
"mostly",
"for",
"BagOfWords",
"/",
"TF",
"-",
"IDF",
"vectorizers"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java#L2186-L2191 |
softindex/datakernel | core-bytebuf/src/main/java/io/datakernel/bytebuf/ByteBuf.java | ByteBuf.drainTo | public int drainTo(@NotNull byte[] array, int offset, int length) {
"""
Drains bytes from this {@code ByteBuf} starting from current {@link #head}
to a given byte array with specified offset and length.
This {@code ByteBuf} must be not recycled.
@param array array to which bytes will be drained to
@param o... | java | public int drainTo(@NotNull byte[] array, int offset, int length) {
assert !isRecycled() : "Attempt to use recycled bytebuf";
assert length >= 0 && (offset + length) <= array.length;
assert head + length <= tail;
System.arraycopy(this.array, head, array, offset, length);
head += length;
return length;
} | [
"public",
"int",
"drainTo",
"(",
"@",
"NotNull",
"byte",
"[",
"]",
"array",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"assert",
"!",
"isRecycled",
"(",
")",
":",
"\"Attempt to use recycled bytebuf\"",
";",
"assert",
"length",
">=",
"0",
"&&",
... | Drains bytes from this {@code ByteBuf} starting from current {@link #head}
to a given byte array with specified offset and length.
This {@code ByteBuf} must be not recycled.
@param array array to which bytes will be drained to
@param offset starting position in the destination data.
The sum of the value and the {@cod... | [
"Drains",
"bytes",
"from",
"this",
"{",
"@code",
"ByteBuf",
"}",
"starting",
"from",
"current",
"{",
"@link",
"#head",
"}",
"to",
"a",
"given",
"byte",
"array",
"with",
"specified",
"offset",
"and",
"length",
"."
] | train | https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-bytebuf/src/main/java/io/datakernel/bytebuf/ByteBuf.java#L576-L583 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.lockResource | public void lockResource(CmsDbContext dbc, CmsResource resource, CmsLockType type) throws CmsException {
"""
Locks a resource.<p>
The <code>type</code> parameter controls what kind of lock is used.<br>
Possible values for this parameter are: <br>
<ul>
<li><code>{@link org.opencms.lock.CmsLockType#EXCLUSIVE}<... | java | public void lockResource(CmsDbContext dbc, CmsResource resource, CmsLockType type) throws CmsException {
// update the resource cache
m_monitor.clearResourceCache();
CmsProject project = dbc.currentProject();
// add the resource to the lock dispatcher
m_lockManager.addResource... | [
"public",
"void",
"lockResource",
"(",
"CmsDbContext",
"dbc",
",",
"CmsResource",
"resource",
",",
"CmsLockType",
"type",
")",
"throws",
"CmsException",
"{",
"// update the resource cache",
"m_monitor",
".",
"clearResourceCache",
"(",
")",
";",
"CmsProject",
"project"... | Locks a resource.<p>
The <code>type</code> parameter controls what kind of lock is used.<br>
Possible values for this parameter are: <br>
<ul>
<li><code>{@link org.opencms.lock.CmsLockType#EXCLUSIVE}</code></li>
<li><code>{@link org.opencms.lock.CmsLockType#TEMPORARY}</code></li>
<li><code>{@link org.opencms.lock.CmsL... | [
"Locks",
"a",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L5406-L5433 |
Steveice10/OpenNBT | src/main/java/com/github/steveice10/opennbt/NBTIO.java | NBTIO.writeTag | public static void writeTag(DataOutput out, Tag tag) throws IOException {
"""
Writes an NBT tag.
@param out Data output to write to.
@param tag Tag to write.
@throws java.io.IOException If an I/O error occurs.
"""
out.writeByte(TagRegistry.getIdFor(tag.getClass()));
out.writeUTF(tag.getNam... | java | public static void writeTag(DataOutput out, Tag tag) throws IOException {
out.writeByte(TagRegistry.getIdFor(tag.getClass()));
out.writeUTF(tag.getName());
tag.write(out);
} | [
"public",
"static",
"void",
"writeTag",
"(",
"DataOutput",
"out",
",",
"Tag",
"tag",
")",
"throws",
"IOException",
"{",
"out",
".",
"writeByte",
"(",
"TagRegistry",
".",
"getIdFor",
"(",
"tag",
".",
"getClass",
"(",
")",
")",
")",
";",
"out",
".",
"wri... | Writes an NBT tag.
@param out Data output to write to.
@param tag Tag to write.
@throws java.io.IOException If an I/O error occurs. | [
"Writes",
"an",
"NBT",
"tag",
"."
] | train | https://github.com/Steveice10/OpenNBT/blob/9bf4adb2afd206a21bc4309c85d642494d1fb536/src/main/java/com/github/steveice10/opennbt/NBTIO.java#L227-L231 |
js-lib-com/template.xhtml | src/main/java/js/template/xhtml/XhtmlTemplate.java | XhtmlTemplate._serialize | private void _serialize(Writer writer, Object model) throws IOException {
"""
Serialize template with given domain model to a writer. Walk through template document from its root and serialize
every node; if node contains operators execute them. Operators extract values from given domain model and process
them, ... | java | private void _serialize(Writer writer, Object model) throws IOException
{
if(model == null) {
document.serialize(writer);
return;
}
Serializer serializer = new Serializer();
if(serializeOperators) {
serializer.enableOperatorsSerialization();
}
Content content = ... | [
"private",
"void",
"_serialize",
"(",
"Writer",
"writer",
",",
"Object",
"model",
")",
"throws",
"IOException",
"{",
"if",
"(",
"model",
"==",
"null",
")",
"{",
"document",
".",
"serialize",
"(",
"writer",
")",
";",
"return",
";",
"}",
"Serializer",
"ser... | Serialize template with given domain model to a writer. Walk through template document from its root and serialize
every node; if node contains operators execute them. Operators extract values from given domain model and process
them, result going to the same writer.
<p>
Writer parameter does not need to be {@link Buff... | [
"Serialize",
"template",
"with",
"given",
"domain",
"model",
"to",
"a",
"writer",
".",
"Walk",
"through",
"template",
"document",
"from",
"its",
"root",
"and",
"serialize",
"every",
"node",
";",
"if",
"node",
"contains",
"operators",
"execute",
"them",
".",
... | train | https://github.com/js-lib-com/template.xhtml/blob/d50cec08aca9ab9680baebe2a26a341c096564fb/src/main/java/js/template/xhtml/XhtmlTemplate.java#L138-L167 |
mozilla/rhino | src/org/mozilla/javascript/Parser.java | Parser.createScopeNode | protected Scope createScopeNode(int token, int lineno) {
"""
Create a node that can be used to hold lexically scoped variable
definitions (via let declarations).
@param token the token of the node to create
@param lineno line number of source
@return the created node
"""
Scope scope =new Scope();... | java | protected Scope createScopeNode(int token, int lineno) {
Scope scope =new Scope();
scope.setType(token);
scope.setLineno(lineno);
return scope;
} | [
"protected",
"Scope",
"createScopeNode",
"(",
"int",
"token",
",",
"int",
"lineno",
")",
"{",
"Scope",
"scope",
"=",
"new",
"Scope",
"(",
")",
";",
"scope",
".",
"setType",
"(",
"token",
")",
";",
"scope",
".",
"setLineno",
"(",
"lineno",
")",
";",
"... | Create a node that can be used to hold lexically scoped variable
definitions (via let declarations).
@param token the token of the node to create
@param lineno line number of source
@return the created node | [
"Create",
"a",
"node",
"that",
"can",
"be",
"used",
"to",
"hold",
"lexically",
"scoped",
"variable",
"definitions",
"(",
"via",
"let",
"declarations",
")",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/Parser.java#L4175-L4180 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java | TypeEnter.markDeprecated | public void markDeprecated(Symbol sym, List<JCAnnotation> annotations, Env<AttrContext> env) {
"""
Mark sym deprecated if annotations contain @Deprecated annotation.
"""
// In general, we cannot fully process annotations yet, but we
// can attribute the annotation types and then check to see i... | java | public void markDeprecated(Symbol sym, List<JCAnnotation> annotations, Env<AttrContext> env) {
// In general, we cannot fully process annotations yet, but we
// can attribute the annotation types and then check to see if the
// @Deprecated annotation is present.
attr.attribAnnotationTyp... | [
"public",
"void",
"markDeprecated",
"(",
"Symbol",
"sym",
",",
"List",
"<",
"JCAnnotation",
">",
"annotations",
",",
"Env",
"<",
"AttrContext",
">",
"env",
")",
"{",
"// In general, we cannot fully process annotations yet, but we",
"// can attribute the annotation types an... | Mark sym deprecated if annotations contain @Deprecated annotation. | [
"Mark",
"sym",
"deprecated",
"if",
"annotations",
"contain"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java#L1121-L1127 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java | EnhancedBigtableStub.createBulkMutateRowsCallable | private UnaryCallable<BulkMutation, Void> createBulkMutateRowsCallable() {
"""
Creates a callable chain to handle MutatesRows RPCs. This is meant to be used for manual
batching. The chain will:
<ul>
<li>Convert a {@link BulkMutation} into a {@link MutateRowsRequest}.
<li>Process the response and schedule ret... | java | private UnaryCallable<BulkMutation, Void> createBulkMutateRowsCallable() {
UnaryCallable<MutateRowsRequest, Void> baseCallable = createMutateRowsBaseCallable();
return createUserFacingUnaryCallable(
"BulkMutateRows", new BulkMutateRowsUserFacingCallable(baseCallable, requestContext));
} | [
"private",
"UnaryCallable",
"<",
"BulkMutation",
",",
"Void",
">",
"createBulkMutateRowsCallable",
"(",
")",
"{",
"UnaryCallable",
"<",
"MutateRowsRequest",
",",
"Void",
">",
"baseCallable",
"=",
"createMutateRowsBaseCallable",
"(",
")",
";",
"return",
"createUserFaci... | Creates a callable chain to handle MutatesRows RPCs. This is meant to be used for manual
batching. The chain will:
<ul>
<li>Convert a {@link BulkMutation} into a {@link MutateRowsRequest}.
<li>Process the response and schedule retries. At the end of each attempt, entries that have
been applied, are filtered from the n... | [
"Creates",
"a",
"callable",
"chain",
"to",
"handle",
"MutatesRows",
"RPCs",
".",
"This",
"is",
"meant",
"to",
"be",
"used",
"for",
"manual",
"batching",
".",
"The",
"chain",
"will",
":"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java#L316-L321 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.