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 |
|---|---|---|---|---|---|---|---|---|---|---|
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Entry.java | Entry.isShowing | public final boolean isShowing(LocalDate startDate, LocalDate endDate, ZoneId zoneId) {
"""
Checks whether the entry will be visible within the given start and end dates. This method
takes recurrence into consideration and will return true if any recurrence of this entry
will be displayed inside the given time i... | java | public final boolean isShowing(LocalDate startDate, LocalDate endDate, ZoneId zoneId) {
return isShowing(this, startDate, endDate, zoneId);
} | [
"public",
"final",
"boolean",
"isShowing",
"(",
"LocalDate",
"startDate",
",",
"LocalDate",
"endDate",
",",
"ZoneId",
"zoneId",
")",
"{",
"return",
"isShowing",
"(",
"this",
",",
"startDate",
",",
"endDate",
",",
"zoneId",
")",
";",
"}"
] | Checks whether the entry will be visible within the given start and end dates. This method
takes recurrence into consideration and will return true if any recurrence of this entry
will be displayed inside the given time interval.
@param startDate the start date of the search interval
@param endDate the end date of t... | [
"Checks",
"whether",
"the",
"entry",
"will",
"be",
"visible",
"within",
"the",
"given",
"start",
"and",
"end",
"dates",
".",
"This",
"method",
"takes",
"recurrence",
"into",
"consideration",
"and",
"will",
"return",
"true",
"if",
"any",
"recurrence",
"of",
"... | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Entry.java#L1487-L1489 |
landawn/AbacusUtil | src/com/landawn/abacus/util/SQLExecutor.java | SQLExecutor.streamAll | @SafeVarargs
public final <T> Stream<T> streamAll(final List<String> sqls, final StatementSetter statementSetter,
final JdbcUtil.BiRecordGetter<T, RuntimeException> recordGetter, final JdbcSettings jdbcSettings, final Object... parameters) {
"""
Remember to close the returned <code>Stream</code> ... | java | @SafeVarargs
public final <T> Stream<T> streamAll(final List<String> sqls, final StatementSetter statementSetter,
final JdbcUtil.BiRecordGetter<T, RuntimeException> recordGetter, final JdbcSettings jdbcSettings, final Object... parameters) {
if (sqls.size() == 1) {
return streamA... | [
"@",
"SafeVarargs",
"public",
"final",
"<",
"T",
">",
"Stream",
"<",
"T",
">",
"streamAll",
"(",
"final",
"List",
"<",
"String",
">",
"sqls",
",",
"final",
"StatementSetter",
"statementSetter",
",",
"final",
"JdbcUtil",
".",
"BiRecordGetter",
"<",
"T",
","... | Remember to close the returned <code>Stream</code> list to close the underlying <code>ResultSet</code> list.
{@code stream} operation won't be part of transaction or use the connection created by {@code Transaction} even it's in transaction block/range.
@param sqls
@param statementSetter
@param recordGetter
@param jdb... | [
"Remember",
"to",
"close",
"the",
"returned",
"<code",
">",
"Stream<",
"/",
"code",
">",
"list",
"to",
"close",
"the",
"underlying",
"<code",
">",
"ResultSet<",
"/",
"code",
">",
"list",
".",
"{",
"@code",
"stream",
"}",
"operation",
"won",
"t",
"be",
... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/SQLExecutor.java#L2984-L3004 |
scireum/server-sass | src/main/java/org/serversass/Functions.java | Functions.darken | public static Expression darken(Generator generator, FunctionCall input) {
"""
Decreases the lightness of the given color by N percent.
@param generator the surrounding generator
@param input the function call to evaluate
@return the result of the evaluation
"""
Color color = input.getExpected... | java | public static Expression darken(Generator generator, FunctionCall input) {
Color color = input.getExpectedColorParam(0);
int decrease = input.getExpectedIntParam(1);
return changeLighteness(color, -decrease);
} | [
"public",
"static",
"Expression",
"darken",
"(",
"Generator",
"generator",
",",
"FunctionCall",
"input",
")",
"{",
"Color",
"color",
"=",
"input",
".",
"getExpectedColorParam",
"(",
"0",
")",
";",
"int",
"decrease",
"=",
"input",
".",
"getExpectedIntParam",
"(... | Decreases the lightness of the given color by N percent.
@param generator the surrounding generator
@param input the function call to evaluate
@return the result of the evaluation | [
"Decreases",
"the",
"lightness",
"of",
"the",
"given",
"color",
"by",
"N",
"percent",
"."
] | train | https://github.com/scireum/server-sass/blob/e74af983567f10c43420d70cd31165dd080ba8fc/src/main/java/org/serversass/Functions.java#L130-L134 |
Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/webhook/WebhookUpdater.java | WebhookUpdater.setAvatar | public WebhookUpdater setAvatar(BufferedImage avatar, String fileType) {
"""
Queues the avatar to be updated.
@param avatar The avatar to set.
@param fileType The type of the avatar, e.g. "png" or "jpg".
@return The current instance in order to chain call methods.
"""
delegate.setAvatar(avatar, fi... | java | public WebhookUpdater setAvatar(BufferedImage avatar, String fileType) {
delegate.setAvatar(avatar, fileType);
return this;
} | [
"public",
"WebhookUpdater",
"setAvatar",
"(",
"BufferedImage",
"avatar",
",",
"String",
"fileType",
")",
"{",
"delegate",
".",
"setAvatar",
"(",
"avatar",
",",
"fileType",
")",
";",
"return",
"this",
";",
"}"
] | Queues the avatar to be updated.
@param avatar The avatar to set.
@param fileType The type of the avatar, e.g. "png" or "jpg".
@return The current instance in order to chain call methods. | [
"Queues",
"the",
"avatar",
"to",
"be",
"updated",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/webhook/WebhookUpdater.java#L85-L88 |
alkacon/opencms-core | src/org/opencms/ade/sitemap/CmsModelPageHelper.java | CmsModelPageHelper.setDefaultModelPage | CmsModelInfo setDefaultModelPage(CmsResource configFile, CmsUUID modelId) throws CmsException {
"""
Sets the default model page within the given configuration file.<p>
@param configFile the configuration file
@param modelId the default model id
@return the updated model configuration
@throws CmsException... | java | CmsModelInfo setDefaultModelPage(CmsResource configFile, CmsUUID modelId) throws CmsException {
CmsFile file = m_cms.readFile(configFile);
CmsXmlContent content = CmsXmlContentFactory.unmarshal(m_cms, file);
Locale locale = getLocale(content);
int defaultValueIndex = -1;
String ... | [
"CmsModelInfo",
"setDefaultModelPage",
"(",
"CmsResource",
"configFile",
",",
"CmsUUID",
"modelId",
")",
"throws",
"CmsException",
"{",
"CmsFile",
"file",
"=",
"m_cms",
".",
"readFile",
"(",
"configFile",
")",
";",
"CmsXmlContent",
"content",
"=",
"CmsXmlContentFact... | Sets the default model page within the given configuration file.<p>
@param configFile the configuration file
@param modelId the default model id
@return the updated model configuration
@throws CmsException in case something goes wrong | [
"Sets",
"the",
"default",
"model",
"page",
"within",
"the",
"given",
"configuration",
"file",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/sitemap/CmsModelPageHelper.java#L471-L515 |
sarxos/win-registry | src/main/java/com/github/sarxos/winreg/WindowsRegistry.java | WindowsRegistry.readStringValues | public Map<String, String> readStringValues(HKey hk, String key) throws RegistryException {
"""
Read value(s) and value name(s) form given key
@param hk the HKEY
@param key the key
@return the value name(s) plus the value(s)
@throws RegistryException when something is not right
"""
return readStringVa... | java | public Map<String, String> readStringValues(HKey hk, String key) throws RegistryException {
return readStringValues(hk, key, null);
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"readStringValues",
"(",
"HKey",
"hk",
",",
"String",
"key",
")",
"throws",
"RegistryException",
"{",
"return",
"readStringValues",
"(",
"hk",
",",
"key",
",",
"null",
")",
";",
"}"
] | Read value(s) and value name(s) form given key
@param hk the HKEY
@param key the key
@return the value name(s) plus the value(s)
@throws RegistryException when something is not right | [
"Read",
"value",
"(",
"s",
")",
"and",
"value",
"name",
"(",
"s",
")",
"form",
"given",
"key"
] | train | https://github.com/sarxos/win-registry/blob/5ccbe2157ae0ee894de7c41bec4bd7b1e0f5c437/src/main/java/com/github/sarxos/winreg/WindowsRegistry.java#L75-L77 |
Jasig/uPortal | uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/RDBMEntityGroupStore.java | RDBMEntityGroupStore.primUpdate | private void primUpdate(IEntityGroup group, Connection conn)
throws SQLException, GroupsException {
"""
Update the entity in the database.
@param group IEntityGroup
@param conn the database connection
"""
try {
PreparedStatement ps = conn.prepareStatement(getUpdateGroupSql()... | java | private void primUpdate(IEntityGroup group, Connection conn)
throws SQLException, GroupsException {
try {
PreparedStatement ps = conn.prepareStatement(getUpdateGroupSql());
try {
Integer typeID =
EntityTypesLocator.getEntityTypes()
... | [
"private",
"void",
"primUpdate",
"(",
"IEntityGroup",
"group",
",",
"Connection",
"conn",
")",
"throws",
"SQLException",
",",
"GroupsException",
"{",
"try",
"{",
"PreparedStatement",
"ps",
"=",
"conn",
".",
"prepareStatement",
"(",
"getUpdateGroupSql",
"(",
")",
... | Update the entity in the database.
@param group IEntityGroup
@param conn the database connection | [
"Update",
"the",
"entity",
"in",
"the",
"database",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/RDBMEntityGroupStore.java#L1155-L1201 |
alkacon/opencms-core | src-modules/org/opencms/workplace/list/CmsHtmlList.java | CmsHtmlList.htmlPageSelector | public static String htmlPageSelector(int nrPages, int itemsPage, int nrItems, int curPage, Locale locale) {
"""
Generates the list of html option elements for a html select control to select a page of a list.<p>
@param nrPages the total number of pages
@param itemsPage the maximum number of items per page
@p... | java | public static String htmlPageSelector(int nrPages, int itemsPage, int nrItems, int curPage, Locale locale) {
StringBuffer html = new StringBuffer(256);
for (int i = 0; i < nrPages; i++) {
int displayedFrom = (i * itemsPage) + 1;
int displayedTo = ((i + 1) * itemsPage) < nrItems ... | [
"public",
"static",
"String",
"htmlPageSelector",
"(",
"int",
"nrPages",
",",
"int",
"itemsPage",
",",
"int",
"nrItems",
",",
"int",
"curPage",
",",
"Locale",
"locale",
")",
"{",
"StringBuffer",
"html",
"=",
"new",
"StringBuffer",
"(",
"256",
")",
";",
"fo... | Generates the list of html option elements for a html select control to select a page of a list.<p>
@param nrPages the total number of pages
@param itemsPage the maximum number of items per page
@param nrItems the total number of items
@param curPage the current page
@param locale the locale
@return html code | [
"Generates",
"the",
"list",
"of",
"html",
"option",
"elements",
"for",
"a",
"html",
"select",
"control",
"to",
"select",
"a",
"page",
"of",
"a",
"list",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/list/CmsHtmlList.java#L147-L167 |
landawn/AbacusUtil | src/com/landawn/abacus/util/ShortList.java | ShortList.reduce | public <E extends Exception> short reduce(final short identity, final Try.ShortBinaryOperator<E> accumulator) throws E {
"""
This is equivalent to:
<pre>
<code>
if (isEmpty()) {
return identity;
}
short result = identity;
for (int i = 0; i < size; i++) {
result = accumulator.applyAsShort(result, elemen... | java | public <E extends Exception> short reduce(final short identity, final Try.ShortBinaryOperator<E> accumulator) throws E {
if (isEmpty()) {
return identity;
}
short result = identity;
for (int i = 0; i < size; i++) {
result = accumulator.applyAsShort(resul... | [
"public",
"<",
"E",
"extends",
"Exception",
">",
"short",
"reduce",
"(",
"final",
"short",
"identity",
",",
"final",
"Try",
".",
"ShortBinaryOperator",
"<",
"E",
">",
"accumulator",
")",
"throws",
"E",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"{",
"re... | This is equivalent to:
<pre>
<code>
if (isEmpty()) {
return identity;
}
short result = identity;
for (int i = 0; i < size; i++) {
result = accumulator.applyAsShort(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/ShortList.java#L1121-L1133 |
steveohara/j2mod | src/main/java/com/ghgande/j2mod/modbus/util/BitVector.java | BitVector.setBytes | public void setBytes(byte[] data, int size) {
"""
Sets the <tt>byte[]</tt> which stores
the bits of this <tt>BitVector</tt>.
<p>
@param data a <tt>byte[]</tt>.
@param size Size to set the bit vector to
"""
System.arraycopy(data, 0, this.data, 0, data.length);
this.size = size;
} | java | public void setBytes(byte[] data, int size) {
System.arraycopy(data, 0, this.data, 0, data.length);
this.size = size;
} | [
"public",
"void",
"setBytes",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"size",
")",
"{",
"System",
".",
"arraycopy",
"(",
"data",
",",
"0",
",",
"this",
".",
"data",
",",
"0",
",",
"data",
".",
"length",
")",
";",
"this",
".",
"size",
"=",
"s... | Sets the <tt>byte[]</tt> which stores
the bits of this <tt>BitVector</tt>.
<p>
@param data a <tt>byte[]</tt>.
@param size Size to set the bit vector to | [
"Sets",
"the",
"<tt",
">",
"byte",
"[]",
"<",
"/",
"tt",
">",
"which",
"stores",
"the",
"bits",
"of",
"this",
"<tt",
">",
"BitVector<",
"/",
"tt",
">",
".",
"<p",
">"
] | train | https://github.com/steveohara/j2mod/blob/67162c55d7c02564e50211a9df06b8314953b5f2/src/main/java/com/ghgande/j2mod/modbus/util/BitVector.java#L184-L187 |
UrielCh/ovh-java-sdk | ovh-java-sdk-deskaas/src/main/java/net/minidev/ovh/api/ApiOvhDeskaas.java | ApiOvhDeskaas.serviceName_changeContact_POST | public ArrayList<Long> serviceName_changeContact_POST(String serviceName, String contactAdmin, String contactBilling, String contactTech) throws IOException {
"""
Launch a contact change procedure
REST: POST /deskaas/{serviceName}/changeContact
@param contactAdmin The contact to set as admin contact
@param co... | java | public ArrayList<Long> serviceName_changeContact_POST(String serviceName, String contactAdmin, String contactBilling, String contactTech) throws IOException {
String qPath = "/deskaas/{serviceName}/changeContact";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>(... | [
"public",
"ArrayList",
"<",
"Long",
">",
"serviceName_changeContact_POST",
"(",
"String",
"serviceName",
",",
"String",
"contactAdmin",
",",
"String",
"contactBilling",
",",
"String",
"contactTech",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/desk... | Launch a contact change procedure
REST: POST /deskaas/{serviceName}/changeContact
@param contactAdmin The contact to set as admin contact
@param contactTech The contact to set as tech contact
@param contactBilling The contact to set as billing contact
@param serviceName [required] Domain of the service | [
"Launch",
"a",
"contact",
"change",
"procedure"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-deskaas/src/main/java/net/minidev/ovh/api/ApiOvhDeskaas.java#L301-L310 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/cache/cachepolicylabel.java | cachepolicylabel.get | public static cachepolicylabel get(nitro_service service, String labelname) throws Exception {
"""
Use this API to fetch cachepolicylabel resource of given name .
"""
cachepolicylabel obj = new cachepolicylabel();
obj.set_labelname(labelname);
cachepolicylabel response = (cachepolicylabel) obj.get_resour... | java | public static cachepolicylabel get(nitro_service service, String labelname) throws Exception{
cachepolicylabel obj = new cachepolicylabel();
obj.set_labelname(labelname);
cachepolicylabel response = (cachepolicylabel) obj.get_resource(service);
return response;
} | [
"public",
"static",
"cachepolicylabel",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"labelname",
")",
"throws",
"Exception",
"{",
"cachepolicylabel",
"obj",
"=",
"new",
"cachepolicylabel",
"(",
")",
";",
"obj",
".",
"set_labelname",
"(",
"labelname",
... | Use this API to fetch cachepolicylabel resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"cachepolicylabel",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/cache/cachepolicylabel.java#L325-L330 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/asm/ModifierAdjustment.java | ModifierAdjustment.withTypeModifiers | public ModifierAdjustment withTypeModifiers(ElementMatcher<? super TypeDescription> matcher,
ModifierContributor.ForType... modifierContributor) {
"""
Adjusts an instrumented type's modifiers if it matches the supplied matcher.
@param matcher The match... | java | public ModifierAdjustment withTypeModifiers(ElementMatcher<? super TypeDescription> matcher,
ModifierContributor.ForType... modifierContributor) {
return withTypeModifiers(matcher, Arrays.asList(modifierContributor));
} | [
"public",
"ModifierAdjustment",
"withTypeModifiers",
"(",
"ElementMatcher",
"<",
"?",
"super",
"TypeDescription",
">",
"matcher",
",",
"ModifierContributor",
".",
"ForType",
"...",
"modifierContributor",
")",
"{",
"return",
"withTypeModifiers",
"(",
"matcher",
",",
"A... | Adjusts an instrumented type's modifiers if it matches the supplied matcher.
@param matcher The matcher that determines a type's eligibility.
@param modifierContributor The modifier contributors to enforce.
@return A new modifier adjustment that enforces the given modifier contributors and any previous adj... | [
"Adjusts",
"an",
"instrumented",
"type",
"s",
"modifiers",
"if",
"it",
"matches",
"the",
"supplied",
"matcher",
"."
] | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/asm/ModifierAdjustment.java#L119-L122 |
notnoop/java-apns | src/main/java/com/notnoop/apns/ApnsServiceBuilder.java | ApnsServiceBuilder.withAuthProxy | public ApnsServiceBuilder withAuthProxy(Proxy proxy, String proxyUsername, String proxyPassword) {
"""
Specify the proxy and the authentication parameters to be used
to establish the connections to Apple Servers.
<p>Read the <a href="http://java.sun.com/javase/6/docs/technotes/guides/net/proxies.html">
Java N... | java | public ApnsServiceBuilder withAuthProxy(Proxy proxy, String proxyUsername, String proxyPassword) {
this.proxy = proxy;
this.proxyUsername = proxyUsername;
this.proxyPassword = proxyPassword;
return this;
} | [
"public",
"ApnsServiceBuilder",
"withAuthProxy",
"(",
"Proxy",
"proxy",
",",
"String",
"proxyUsername",
",",
"String",
"proxyPassword",
")",
"{",
"this",
".",
"proxy",
"=",
"proxy",
";",
"this",
".",
"proxyUsername",
"=",
"proxyUsername",
";",
"this",
".",
"pr... | Specify the proxy and the authentication parameters to be used
to establish the connections to Apple Servers.
<p>Read the <a href="http://java.sun.com/javase/6/docs/technotes/guides/net/proxies.html">
Java Networking and Proxies</a> guide to understand the
proxies complexity.
@param proxy the proxy object to be used ... | [
"Specify",
"the",
"proxy",
"and",
"the",
"authentication",
"parameters",
"to",
"be",
"used",
"to",
"establish",
"the",
"connections",
"to",
"Apple",
"Servers",
"."
] | train | https://github.com/notnoop/java-apns/blob/180a190d4cb49458441596ca7c69d50ec7f1dba5/src/main/java/com/notnoop/apns/ApnsServiceBuilder.java#L488-L493 |
bladecoder/blade-ink | src/main/java/com/bladecoder/ink/runtime/Story.java | Story.evaluateFunction | public Object evaluateFunction(String functionName, StringBuilder textOutput, Object[] arguments) throws Exception {
"""
Evaluates a function defined in ink, and gathers the possibly multi-line text
as generated by the function.
@param arguments
The arguments that the ink function takes, if any. Note that we
... | java | public Object evaluateFunction(String functionName, StringBuilder textOutput, Object[] arguments) throws Exception {
ifAsyncWeCant("evaluate a function");
if (functionName == null) {
throw new Exception("Function is null");
} else if (functionName.trim().isEmpty()) {
throw new Exception("Function is empty ... | [
"public",
"Object",
"evaluateFunction",
"(",
"String",
"functionName",
",",
"StringBuilder",
"textOutput",
",",
"Object",
"[",
"]",
"arguments",
")",
"throws",
"Exception",
"{",
"ifAsyncWeCant",
"(",
"\"evaluate a function\"",
")",
";",
"if",
"(",
"functionName",
... | Evaluates a function defined in ink, and gathers the possibly multi-line text
as generated by the function.
@param arguments
The arguments that the ink function takes, if any. Note that we
don't (can't) do any validation on the number of arguments right
now, so make sure you get it right!
@param functionName
The name ... | [
"Evaluates",
"a",
"function",
"defined",
"in",
"ink",
"and",
"gathers",
"the",
"possibly",
"multi",
"-",
"line",
"text",
"as",
"generated",
"by",
"the",
"function",
"."
] | train | https://github.com/bladecoder/blade-ink/blob/930922099f7073f50f956479adaa3cbd47c70225/src/main/java/com/bladecoder/ink/runtime/Story.java#L2419-L2455 |
awslabs/jsii | packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiObject.java | JsiiObject.jsiiGet | @Nullable
protected final <T> T jsiiGet(final String property, final Class<T> type) {
"""
Gets a property value from the object.
@param property The property name.
@param type The Java type of the property.
@param <T> The Java type of the property.
@return The property value.
"""
return JsiiObj... | java | @Nullable
protected final <T> T jsiiGet(final String property, final Class<T> type) {
return JsiiObjectMapper.treeToValue(engine.getClient().getPropertyValue(this.objRef, property), type);
} | [
"@",
"Nullable",
"protected",
"final",
"<",
"T",
">",
"T",
"jsiiGet",
"(",
"final",
"String",
"property",
",",
"final",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"JsiiObjectMapper",
".",
"treeToValue",
"(",
"engine",
".",
"getClient",
"(",
")",... | Gets a property value from the object.
@param property The property name.
@param type The Java type of the property.
@param <T> The Java type of the property.
@return The property value. | [
"Gets",
"a",
"property",
"value",
"from",
"the",
"object",
"."
] | train | https://github.com/awslabs/jsii/blob/6bbf743f5f65e98e5199ad31c93961533ffc40e5/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiObject.java#L105-L108 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webserver.plugin.utility/src/com/ibm/ws/webserver/plugin/utility/utils/CommonMBeanConnection.java | CommonMBeanConnection.getJMXConnector | public JMXConnector getJMXConnector(String controllerHost, int controllerPort, String user, String password) throws NoSuchAlgorithmException, KeyManagementException, MalformedURLException, IOException {
"""
Returns a connected JMXConnector.
@param controllerHost
@param controllerPort
@param user
@param passw... | java | public JMXConnector getJMXConnector(String controllerHost, int controllerPort, String user, String password) throws NoSuchAlgorithmException, KeyManagementException, MalformedURLException, IOException {
HashMap<String, Object> environment = createJMXEnvironment(user, password, setUpSSLContext());
JMXCon... | [
"public",
"JMXConnector",
"getJMXConnector",
"(",
"String",
"controllerHost",
",",
"int",
"controllerPort",
",",
"String",
"user",
",",
"String",
"password",
")",
"throws",
"NoSuchAlgorithmException",
",",
"KeyManagementException",
",",
"MalformedURLException",
",",
"IO... | Returns a connected JMXConnector.
@param controllerHost
@param controllerPort
@param user
@param password
@return
@throws NoSuchAlgorithmException
@throws KeyManagementException
@throws MalformedURLException
@throws IOException | [
"Returns",
"a",
"connected",
"JMXConnector",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webserver.plugin.utility/src/com/ibm/ws/webserver/plugin/utility/utils/CommonMBeanConnection.java#L132-L137 |
maguro/aunit | junit/src/main/java/com/toolazydogs/aunit/Assert.java | Assert.assertTree | public static void assertTree(int rootType, String preorder, ParseResults parseResults) {
"""
Asserts a parse tree.
@param rootType the type of the root of the tree.
@param preorder the preorder traversal of the tree.
@param parseResults a helper class
"""
assertTree(rootType, preorder, pa... | java | public static void assertTree(int rootType, String preorder, ParseResults parseResults)
{
assertTree(rootType, preorder, parseResults.getTree());
} | [
"public",
"static",
"void",
"assertTree",
"(",
"int",
"rootType",
",",
"String",
"preorder",
",",
"ParseResults",
"parseResults",
")",
"{",
"assertTree",
"(",
"rootType",
",",
"preorder",
",",
"parseResults",
".",
"getTree",
"(",
")",
")",
";",
"}"
] | Asserts a parse tree.
@param rootType the type of the root of the tree.
@param preorder the preorder traversal of the tree.
@param parseResults a helper class | [
"Asserts",
"a",
"parse",
"tree",
"."
] | train | https://github.com/maguro/aunit/blob/1f972e35b28327e5e2e7881befc928df0546d74c/junit/src/main/java/com/toolazydogs/aunit/Assert.java#L230-L233 |
Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java | Utils.newBlockingFixedThreadPoolExecutor | public static ExecutorService newBlockingFixedThreadPoolExecutor(int nThreads, int queueSize) {
"""
Returns an instance of ThreadPoolExecutor using an bounded queue and blocking when the worker queue is full.
@param nThreads thread pool size
@param queueSize workers queue size
@return thread pool executor
"... | java | public static ExecutorService newBlockingFixedThreadPoolExecutor(int nThreads, int queueSize) {
BlockingQueue<Runnable> blockingQueue = new ArrayBlockingQueue<>(queueSize);
RejectedExecutionHandler blockingRejectedExecutionHandler = new RejectedExecutionHandler() {
@Override
publ... | [
"public",
"static",
"ExecutorService",
"newBlockingFixedThreadPoolExecutor",
"(",
"int",
"nThreads",
",",
"int",
"queueSize",
")",
"{",
"BlockingQueue",
"<",
"Runnable",
">",
"blockingQueue",
"=",
"new",
"ArrayBlockingQueue",
"<>",
"(",
"queueSize",
")",
";",
"Rejec... | Returns an instance of ThreadPoolExecutor using an bounded queue and blocking when the worker queue is full.
@param nThreads thread pool size
@param queueSize workers queue size
@return thread pool executor | [
"Returns",
"an",
"instance",
"of",
"ThreadPoolExecutor",
"using",
"an",
"bounded",
"queue",
"and",
"blocking",
"when",
"the",
"worker",
"queue",
"is",
"full",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java#L546-L562 |
BioPAX/Paxtools | paxtools-query/src/main/java/org/biopax/paxtools/query/QueryExecuter.java | QueryExecuter.runPathsFromTo | public static Set<BioPAXElement> runPathsFromTo(
Set<BioPAXElement> sourceSet,
Set<BioPAXElement> targetSet,
Model model,
LimitType limitType,
int limit,
Filter... filters) {
"""
Gets paths the graph composed of the paths from a source node, and ends at a target node.
@param sourceSet Seeds for start ... | java | public static Set<BioPAXElement> runPathsFromTo(
Set<BioPAXElement> sourceSet,
Set<BioPAXElement> targetSet,
Model model,
LimitType limitType,
int limit,
Filter... filters)
{
Graph graph;
if (model.getLevel() == BioPAXLevel.L3)
{
graph = new GraphL3(model, filters);
}
else return Collections.... | [
"public",
"static",
"Set",
"<",
"BioPAXElement",
">",
"runPathsFromTo",
"(",
"Set",
"<",
"BioPAXElement",
">",
"sourceSet",
",",
"Set",
"<",
"BioPAXElement",
">",
"targetSet",
",",
"Model",
"model",
",",
"LimitType",
"limitType",
",",
"int",
"limit",
",",
"F... | Gets paths the graph composed of the paths from a source node, and ends at a target node.
@param sourceSet Seeds for start points of paths
@param targetSet Seeds for end points of paths
@param model BioPAX model
@param limitType either NORMAL or SHORTEST_PLUS_K
@param limit Length limit fothe paths to be found
@param f... | [
"Gets",
"paths",
"the",
"graph",
"composed",
"of",
"the",
"paths",
"from",
"a",
"source",
"node",
"and",
"ends",
"at",
"a",
"target",
"node",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/QueryExecuter.java#L195-L217 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/extract/FactoryFeatureExtractor.java | FactoryFeatureExtractor.nonmaxCandidate | public static NonMaxSuppression nonmaxCandidate( @Nullable ConfigExtract config ) {
"""
Non-max feature extractor which saves a candidate list of all the found local maximums..
@param config Configuration for extractor
@return A feature extractor.
"""
if( config == null )
config = new ConfigExtract()... | java | public static NonMaxSuppression nonmaxCandidate( @Nullable ConfigExtract config ) {
if( config == null )
config = new ConfigExtract();
config.checkValidity();
if( BOverrideFactoryFeatureExtractor.nonmaxCandidate != null ) {
return BOverrideFactoryFeatureExtractor.nonmaxCandidate.process(config);
}
No... | [
"public",
"static",
"NonMaxSuppression",
"nonmaxCandidate",
"(",
"@",
"Nullable",
"ConfigExtract",
"config",
")",
"{",
"if",
"(",
"config",
"==",
"null",
")",
"config",
"=",
"new",
"ConfigExtract",
"(",
")",
";",
"config",
".",
"checkValidity",
"(",
")",
";"... | Non-max feature extractor which saves a candidate list of all the found local maximums..
@param config Configuration for extractor
@return A feature extractor. | [
"Non",
"-",
"max",
"feature",
"extractor",
"which",
"saves",
"a",
"candidate",
"list",
"of",
"all",
"the",
"found",
"local",
"maximums",
".."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/extract/FactoryFeatureExtractor.java#L110-L140 |
Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalFile.java | UfsJournalFile.encodeLogFileLocation | static URI encodeLogFileLocation(UfsJournal journal, long start, long end) {
"""
Encodes a log location under the log directory.
@param journal the UFS journal instance
@param start the start sequence number (inclusive)
@param end the end sequence number (exclusive)
@return the location
"""
String fi... | java | static URI encodeLogFileLocation(UfsJournal journal, long start, long end) {
String filename = String.format("0x%x-0x%x", start, end);
URI location = URIUtils.appendPathOrDie(journal.getLogDir(), filename);
return location;
} | [
"static",
"URI",
"encodeLogFileLocation",
"(",
"UfsJournal",
"journal",
",",
"long",
"start",
",",
"long",
"end",
")",
"{",
"String",
"filename",
"=",
"String",
".",
"format",
"(",
"\"0x%x-0x%x\"",
",",
"start",
",",
"end",
")",
";",
"URI",
"location",
"="... | Encodes a log location under the log directory.
@param journal the UFS journal instance
@param start the start sequence number (inclusive)
@param end the end sequence number (exclusive)
@return the location | [
"Encodes",
"a",
"log",
"location",
"under",
"the",
"log",
"directory",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalFile.java#L127-L131 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/authentication/authenticationvserver_binding.java | authenticationvserver_binding.get | public static authenticationvserver_binding get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch authenticationvserver_binding resource of given name .
"""
authenticationvserver_binding obj = new authenticationvserver_binding();
obj.set_name(name);
authenticationvserver_bi... | java | public static authenticationvserver_binding get(nitro_service service, String name) throws Exception{
authenticationvserver_binding obj = new authenticationvserver_binding();
obj.set_name(name);
authenticationvserver_binding response = (authenticationvserver_binding) obj.get_resource(service);
return response;
... | [
"public",
"static",
"authenticationvserver_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"authenticationvserver_binding",
"obj",
"=",
"new",
"authenticationvserver_binding",
"(",
")",
";",
"obj",
".",
"set_na... | Use this API to fetch authenticationvserver_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"authenticationvserver_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/authentication/authenticationvserver_binding.java#L202-L207 |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/lang/Ansi.java | Ansi.outFormat | public void outFormat(String format, Object... args) {
"""
Prints formatted and colorized {@code format} to {@link System#out}
@param format A format string whose output to be colorized
@param args Arguments referenced by the format specifiers in the format
"""
format(System.out, format, args... | java | public void outFormat(String format, Object... args){
format(System.out, format, args);
} | [
"public",
"void",
"outFormat",
"(",
"String",
"format",
",",
"Object",
"...",
"args",
")",
"{",
"format",
"(",
"System",
".",
"out",
",",
"format",
",",
"args",
")",
";",
"}"
] | Prints formatted and colorized {@code format} to {@link System#out}
@param format A format string whose output to be colorized
@param args Arguments referenced by the format specifiers in the format | [
"Prints",
"formatted",
"and",
"colorized",
"{",
"@code",
"format",
"}",
"to",
"{",
"@link",
"System#out",
"}"
] | train | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/lang/Ansi.java#L306-L308 |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/StitchingFromMotion2D.java | StitchingFromMotion2D.getImageCorners | public Corners getImageCorners( int width , int height , Corners corners ) {
"""
Returns the location of the input image's corners inside the stitch image.
@return image corners
"""
if( corners == null )
corners = new Corners();
int w = width;
int h = height;
tranCurrToWorld.compute(0,0,work);... | java | public Corners getImageCorners( int width , int height , Corners corners ) {
if( corners == null )
corners = new Corners();
int w = width;
int h = height;
tranCurrToWorld.compute(0,0,work); corners.p0.set(work.x, work.y);
tranCurrToWorld.compute(w,0,work); corners.p1.set(work.x, work.y);
tranCurrTo... | [
"public",
"Corners",
"getImageCorners",
"(",
"int",
"width",
",",
"int",
"height",
",",
"Corners",
"corners",
")",
"{",
"if",
"(",
"corners",
"==",
"null",
")",
"corners",
"=",
"new",
"Corners",
"(",
")",
";",
"int",
"w",
"=",
"width",
";",
"int",
"h... | Returns the location of the input image's corners inside the stitch image.
@return image corners | [
"Returns",
"the",
"location",
"of",
"the",
"input",
"image",
"s",
"corners",
"inside",
"the",
"stitch",
"image",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d2/StitchingFromMotion2D.java#L299-L313 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/job/internal/UpgradePlanJob.java | UpgradePlanJob.tryInstallExtension | protected boolean tryInstallExtension(ExtensionId extensionId, String namespace) {
"""
Try to install the provided extension and update the plan if it's working.
@param extensionId the extension version to install
@param namespace the namespace where to install the extension
@return true if the installation w... | java | protected boolean tryInstallExtension(ExtensionId extensionId, String namespace)
{
DefaultExtensionPlanTree currentTree = this.extensionTree.clone();
try {
installExtension(extensionId, namespace, currentTree);
setExtensionTree(currentTree);
return true;
... | [
"protected",
"boolean",
"tryInstallExtension",
"(",
"ExtensionId",
"extensionId",
",",
"String",
"namespace",
")",
"{",
"DefaultExtensionPlanTree",
"currentTree",
"=",
"this",
".",
"extensionTree",
".",
"clone",
"(",
")",
";",
"try",
"{",
"installExtension",
"(",
... | Try to install the provided extension and update the plan if it's working.
@param extensionId the extension version to install
@param namespace the namespace where to install the extension
@return true if the installation would succeed, false otherwise | [
"Try",
"to",
"install",
"the",
"provided",
"extension",
"and",
"update",
"the",
"plan",
"if",
"it",
"s",
"working",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/job/internal/UpgradePlanJob.java#L192-L211 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/MetadataStore.java | MetadataStore.deleteSegment | CompletableFuture<Boolean> deleteSegment(String segmentName, Duration timeout) {
"""
Deletes a Segment and any associated information from the Metadata Store.
Notes:
- This method removes both the Segment and its Metadata Store entries.
- {@link #clearSegmentInfo} only removes Metadata Store entries.
This op... | java | CompletableFuture<Boolean> deleteSegment(String segmentName, Duration timeout) {
long traceId = LoggerHelpers.traceEnterWithContext(log, traceObjectId, "deleteSegment", segmentName);
TimeoutTimer timer = new TimeoutTimer(timeout);
// Find the Segment's Id.
long segmentId = this.connecto... | [
"CompletableFuture",
"<",
"Boolean",
">",
"deleteSegment",
"(",
"String",
"segmentName",
",",
"Duration",
"timeout",
")",
"{",
"long",
"traceId",
"=",
"LoggerHelpers",
".",
"traceEnterWithContext",
"(",
"log",
",",
"traceObjectId",
",",
"\"deleteSegment\"",
",",
"... | Deletes a Segment and any associated information from the Metadata Store.
Notes:
- This method removes both the Segment and its Metadata Store entries.
- {@link #clearSegmentInfo} only removes Metadata Store entries.
This operation is made of multiple steps and is restart-able. If it was only able to execute partially... | [
"Deletes",
"a",
"Segment",
"and",
"any",
"associated",
"information",
"from",
"the",
"Metadata",
"Store",
".",
"Notes",
":",
"-",
"This",
"method",
"removes",
"both",
"the",
"Segment",
"and",
"its",
"Metadata",
"Store",
"entries",
".",
"-",
"{",
"@link",
"... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/MetadataStore.java#L163-L195 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java | MDAG.addStringInternal | private void addStringInternal(String str) {
"""
Adds a String to the MDAG (called by addString to do actual MDAG manipulation).
@param str the String to be added to the MDAG
"""
String prefixString = determineLongestPrefixInMDAG(str);
String suffixString = str.substring(prefixString.length(... | java | private void addStringInternal(String str)
{
String prefixString = determineLongestPrefixInMDAG(str);
String suffixString = str.substring(prefixString.length());
//Retrive the data related to the first confluence node (a node with two or more incoming transitions)
//in the _transiti... | [
"private",
"void",
"addStringInternal",
"(",
"String",
"str",
")",
"{",
"String",
"prefixString",
"=",
"determineLongestPrefixInMDAG",
"(",
"str",
")",
";",
"String",
"suffixString",
"=",
"str",
".",
"substring",
"(",
"prefixString",
".",
"length",
"(",
")",
"... | Adds a String to the MDAG (called by addString to do actual MDAG manipulation).
@param str the String to be added to the MDAG | [
"Adds",
"a",
"String",
"to",
"the",
"MDAG",
"(",
"called",
"by",
"addString",
"to",
"do",
"actual",
"MDAG",
"manipulation",
")",
"."
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L682-L712 |
marklogic/java-client-api | marklogic-client-api/src/main/java/com/marklogic/client/example/cookbook/DocumentMetadataRead.java | DocumentMetadataRead.setUpExample | public static void setUpExample(XMLDocumentManager docMgr, String docId, String filename) throws IOException {
"""
set up by writing document metadata and content for the example to read
"""
InputStream docStream = Util.openStream("data"+File.separator+filename);
if (docStream == null)
throw new ... | java | public static void setUpExample(XMLDocumentManager docMgr, String docId, String filename) throws IOException {
InputStream docStream = Util.openStream("data"+File.separator+filename);
if (docStream == null)
throw new IOException("Could not read document example");
DocumentMetadataHandle metadataHandl... | [
"public",
"static",
"void",
"setUpExample",
"(",
"XMLDocumentManager",
"docMgr",
",",
"String",
"docId",
",",
"String",
"filename",
")",
"throws",
"IOException",
"{",
"InputStream",
"docStream",
"=",
"Util",
".",
"openStream",
"(",
"\"data\"",
"+",
"File",
".",
... | set up by writing document metadata and content for the example to read | [
"set",
"up",
"by",
"writing",
"document",
"metadata",
"and",
"content",
"for",
"the",
"example",
"to",
"read"
] | train | https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/example/cookbook/DocumentMetadataRead.java#L93-L109 |
census-instrumentation/opencensus-java | exporters/trace/datadog/src/main/java/io/opencensus/exporter/trace/datadog/DatadogTraceExporter.java | DatadogTraceExporter.createAndRegister | public static void createAndRegister(DatadogTraceConfiguration configuration)
throws MalformedURLException {
"""
Creates and registers the Datadog Trace exporter to the OpenCensus library. Only one Datadog
exporter can be registered at any point.
@param configuration the {@code DatadogTraceConfiguration}... | java | public static void createAndRegister(DatadogTraceConfiguration configuration)
throws MalformedURLException {
synchronized (monitor) {
checkState(handler == null, "Datadog exporter is already registered.");
String agentEndpoint = configuration.getAgentEndpoint();
String service = configurati... | [
"public",
"static",
"void",
"createAndRegister",
"(",
"DatadogTraceConfiguration",
"configuration",
")",
"throws",
"MalformedURLException",
"{",
"synchronized",
"(",
"monitor",
")",
"{",
"checkState",
"(",
"handler",
"==",
"null",
",",
"\"Datadog exporter is already regis... | Creates and registers the Datadog Trace exporter to the OpenCensus library. Only one Datadog
exporter can be registered at any point.
@param configuration the {@code DatadogTraceConfiguration} used to create the exporter.
@throws MalformedURLException if the agent URL is invalid.
@since 0.19 | [
"Creates",
"and",
"registers",
"the",
"Datadog",
"Trace",
"exporter",
"to",
"the",
"OpenCensus",
"library",
".",
"Only",
"one",
"Datadog",
"exporter",
"can",
"be",
"registered",
"at",
"any",
"point",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/exporters/trace/datadog/src/main/java/io/opencensus/exporter/trace/datadog/DatadogTraceExporter.java#L65-L81 |
apache/incubator-heron | heron/api/src/java/org/apache/heron/classification/HeronAnnotationProcessor.java | HeronAnnotationProcessor.process | @Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
"""
If a non-heron class extends from a class annotated as Unstable, Private or LimitedPrivate,
emit a warning.
"""
if (!roundEnv.processingOver()) {
for (TypeElement te : annotations) {
f... | java | @Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
if (!roundEnv.processingOver()) {
for (TypeElement te : annotations) {
for (Element elt : roundEnv.getElementsAnnotatedWith(te)) {
if (!elt.toString().startsWith("org.apache.heron")) {
... | [
"@",
"Override",
"public",
"boolean",
"process",
"(",
"Set",
"<",
"?",
"extends",
"TypeElement",
">",
"annotations",
",",
"RoundEnvironment",
"roundEnv",
")",
"{",
"if",
"(",
"!",
"roundEnv",
".",
"processingOver",
"(",
")",
")",
"{",
"for",
"(",
"TypeElem... | If a non-heron class extends from a class annotated as Unstable, Private or LimitedPrivate,
emit a warning. | [
"If",
"a",
"non",
"-",
"heron",
"class",
"extends",
"from",
"a",
"class",
"annotated",
"as",
"Unstable",
"Private",
"or",
"LimitedPrivate",
"emit",
"a",
"warning",
"."
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/api/src/java/org/apache/heron/classification/HeronAnnotationProcessor.java#L55-L70 |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/RepositoryResolutionException.java | RepositoryResolutionException.getMaximumVersionForMissingProduct | public String getMaximumVersionForMissingProduct(String productId, String version, String edition) {
"""
<p>This will iterate through the products that couldn't be found as supplied by {@link #getMissingProducts()} and look for the maximum version that was searched for. It will
limit it to products that match the... | java | public String getMaximumVersionForMissingProduct(String productId, String version, String edition) {
Collection<LibertyVersionRange> filteredRanges = filterVersionRanges(productId, edition);
Collection<LibertyVersion> maximumVersions = new HashSet<LibertyVersion>();
for (LibertyVersionRange rang... | [
"public",
"String",
"getMaximumVersionForMissingProduct",
"(",
"String",
"productId",
",",
"String",
"version",
",",
"String",
"edition",
")",
"{",
"Collection",
"<",
"LibertyVersionRange",
">",
"filteredRanges",
"=",
"filterVersionRanges",
"(",
"productId",
",",
"edi... | <p>This will iterate through the products that couldn't be found as supplied by {@link #getMissingProducts()} and look for the maximum version that was searched for. It will
limit it to products that match the supplied <code>productId</code>. Note that if the maximum version on a {@link ProductRequirementInformation} i... | [
"<p",
">",
"This",
"will",
"iterate",
"through",
"the",
"products",
"that",
"couldn",
"t",
"be",
"found",
"as",
"supplied",
"by",
"{",
"@link",
"#getMissingProducts",
"()",
"}",
"and",
"look",
"for",
"the",
"maximum",
"version",
"that",
"was",
"searched",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/RepositoryResolutionException.java#L181-L200 |
opendatatrentino/s-match | src/main/java/it/unitn/disi/smatch/matchers/element/MatcherLibrary.java | MatcherLibrary.getRelation | protected char getRelation(IAtomicConceptOfLabel sourceACoL, IAtomicConceptOfLabel targetACoL) throws MatcherLibraryException {
"""
Returns a semantic relation between two atomic concepts.
@param sourceACoL source concept
@param targetACoL target concept
@return relation between concepts
@throws MatcherLibra... | java | protected char getRelation(IAtomicConceptOfLabel sourceACoL, IAtomicConceptOfLabel targetACoL) throws MatcherLibraryException {
try {
char relation = senseMatcher.getRelation(sourceACoL.getSenseList(), targetACoL.getSenseList());
//if WN matcher did not find relation
if... | [
"protected",
"char",
"getRelation",
"(",
"IAtomicConceptOfLabel",
"sourceACoL",
",",
"IAtomicConceptOfLabel",
"targetACoL",
")",
"throws",
"MatcherLibraryException",
"{",
"try",
"{",
"char",
"relation",
"=",
"senseMatcher",
".",
"getRelation",
"(",
"sourceACoL",
".",
... | Returns a semantic relation between two atomic concepts.
@param sourceACoL source concept
@param targetACoL target concept
@return relation between concepts
@throws MatcherLibraryException MatcherLibraryException | [
"Returns",
"a",
"semantic",
"relation",
"between",
"two",
"atomic",
"concepts",
"."
] | train | https://github.com/opendatatrentino/s-match/blob/ba5982ef406b7010c2f92592e43887a485935aa1/src/main/java/it/unitn/disi/smatch/matchers/element/MatcherLibrary.java#L178-L201 |
AgNO3/jcifs-ng | src/main/java/jcifs/internal/smb1/AndXServerMessageBlock.java | AndXServerMessageBlock.encode | @Override
public int encode ( byte[] dst, int dstIndex ) {
"""
/*
We overload this method from ServerMessageBlock because
we want writeAndXWireFormat to write the parameterWords
and bytes. This is so we can write batched smbs because
all but the first smb of the chaain do not have a header
and therefore w... | java | @Override
public int encode ( byte[] dst, int dstIndex ) {
int start = this.headerStart = dstIndex;
dstIndex += writeHeaderWireFormat(dst, dstIndex);
dstIndex += writeAndXWireFormat(dst, dstIndex);
this.length = dstIndex - start;
if ( this.digest != null ) {
thi... | [
"@",
"Override",
"public",
"int",
"encode",
"(",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstIndex",
")",
"{",
"int",
"start",
"=",
"this",
".",
"headerStart",
"=",
"dstIndex",
";",
"dstIndex",
"+=",
"writeHeaderWireFormat",
"(",
"dst",
",",
"dstIndex",
")"... | /*
We overload this method from ServerMessageBlock because
we want writeAndXWireFormat to write the parameterWords
and bytes. This is so we can write batched smbs because
all but the first smb of the chaain do not have a header
and therefore we do not want to writeHeaderWireFormat. We
just recursivly call writeAndXWire... | [
"/",
"*",
"We",
"overload",
"this",
"method",
"from",
"ServerMessageBlock",
"because",
"we",
"want",
"writeAndXWireFormat",
"to",
"write",
"the",
"parameterWords",
"and",
"bytes",
".",
"This",
"is",
"so",
"we",
"can",
"write",
"batched",
"smbs",
"because",
"al... | train | https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/internal/smb1/AndXServerMessageBlock.java#L135-L148 |
alkacon/opencms-core | src/org/opencms/flex/CmsFlexCacheKey.java | CmsFlexCacheKey.getKeyName | public static String getKeyName(String resourcename, boolean online) {
"""
Calculates the cache key name that is used as key in
the first level of the FlexCache.<p>
@param resourcename the full name of the resource including site root
@param online must be true for an online resource, false for offline resour... | java | public static String getKeyName(String resourcename, boolean online) {
return resourcename.concat(online ? CmsFlexCache.CACHE_ONLINESUFFIX : CmsFlexCache.CACHE_OFFLINESUFFIX);
} | [
"public",
"static",
"String",
"getKeyName",
"(",
"String",
"resourcename",
",",
"boolean",
"online",
")",
"{",
"return",
"resourcename",
".",
"concat",
"(",
"online",
"?",
"CmsFlexCache",
".",
"CACHE_ONLINESUFFIX",
":",
"CmsFlexCache",
".",
"CACHE_OFFLINESUFFIX",
... | Calculates the cache key name that is used as key in
the first level of the FlexCache.<p>
@param resourcename the full name of the resource including site root
@param online must be true for an online resource, false for offline resources
@return the FlexCache key name | [
"Calculates",
"the",
"cache",
"key",
"name",
"that",
"is",
"used",
"as",
"key",
"in",
"the",
"first",
"level",
"of",
"the",
"FlexCache",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/flex/CmsFlexCacheKey.java#L263-L266 |
dkpro/dkpro-statistics | dkpro-statistics-significance/src/main/java/org/dkpro/statistics/significance/Significance.java | Significance.getSignificance | public static double getSignificance(double[] sample1, double[] sample2) throws IllegalArgumentException, MathException {
"""
Uses a paired t-test to test whether the correlation value computed from these datasets is significant.
@param sample1 The first dataset vector.
@param sample2 The second dataset vector.
... | java | public static double getSignificance(double[] sample1, double[] sample2) throws IllegalArgumentException, MathException {
double alpha = TestUtils.pairedTTest(sample1, sample2);
boolean significance = TestUtils.pairedTTest(sample1, sample2, .30);
System.err.println("sig: " + significance);
... | [
"public",
"static",
"double",
"getSignificance",
"(",
"double",
"[",
"]",
"sample1",
",",
"double",
"[",
"]",
"sample2",
")",
"throws",
"IllegalArgumentException",
",",
"MathException",
"{",
"double",
"alpha",
"=",
"TestUtils",
".",
"pairedTTest",
"(",
"sample1"... | Uses a paired t-test to test whether the correlation value computed from these datasets is significant.
@param sample1 The first dataset vector.
@param sample2 The second dataset vector.
@return The significance value p.
@throws MathException
@throws IllegalArgumentException | [
"Uses",
"a",
"paired",
"t",
"-",
"test",
"to",
"test",
"whether",
"the",
"correlation",
"value",
"computed",
"from",
"these",
"datasets",
"is",
"significant",
"."
] | train | https://github.com/dkpro/dkpro-statistics/blob/0b0e93dc49223984964411cbc6df420ba796a8cb/dkpro-statistics-significance/src/main/java/org/dkpro/statistics/significance/Significance.java#L93-L98 |
zaproxy/zaproxy | src/org/parosproxy/paros/db/DbUtils.java | DbUtils.hasTable | public static boolean hasTable(final Connection connection, final String tableName) throws SQLException {
"""
Tells whether the table {@code tableName} exists in the database, or not.
@param connection
the connection to the database
@param tableName
the name of the table that will be checked
@return {@code ... | java | public static boolean hasTable(final Connection connection, final String tableName) throws SQLException {
boolean hasTable = false;
ResultSet rs = null;
try {
rs = connection.getMetaData().getTables(null, null, tableName, null);
if (rs.next()) {
... | [
"public",
"static",
"boolean",
"hasTable",
"(",
"final",
"Connection",
"connection",
",",
"final",
"String",
"tableName",
")",
"throws",
"SQLException",
"{",
"boolean",
"hasTable",
"=",
"false",
";",
"ResultSet",
"rs",
"=",
"null",
";",
"try",
"{",
"rs",
"="... | Tells whether the table {@code tableName} exists in the database, or not.
@param connection
the connection to the database
@param tableName
the name of the table that will be checked
@return {@code true} if the table {@code tableName} exists in the
database, {@code false} otherwise.
@throws SQLException
if an error oc... | [
"Tells",
"whether",
"the",
"table",
"{",
"@code",
"tableName",
"}",
"exists",
"in",
"the",
"database",
"or",
"not",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/db/DbUtils.java#L48-L70 |
molgenis/molgenis | molgenis-data-import/src/main/java/org/molgenis/data/importer/ImportServiceFactory.java | ImportServiceFactory.getImportService | public ImportService getImportService(File file, RepositoryCollection source) {
"""
Finds a suitable ImportService for a FileRepositoryCollection.
<p>Import of mixed backend types in one FileRepositoryCollection isn't supported.
@return ImportService
@throws MolgenisDataException if no suitable ImportServic... | java | public ImportService getImportService(File file, RepositoryCollection source) {
final Map<String, ImportService> importServicesMappedToExtensions = Maps.newHashMap();
importServices
.stream()
.filter(importService -> importService.canImport(file, source))
.forEach(
importServ... | [
"public",
"ImportService",
"getImportService",
"(",
"File",
"file",
",",
"RepositoryCollection",
"source",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"ImportService",
">",
"importServicesMappedToExtensions",
"=",
"Maps",
".",
"newHashMap",
"(",
")",
";",
"impor... | Finds a suitable ImportService for a FileRepositoryCollection.
<p>Import of mixed backend types in one FileRepositoryCollection isn't supported.
@return ImportService
@throws MolgenisDataException if no suitable ImportService is found for the
FileRepositoryCollection | [
"Finds",
"a",
"suitable",
"ImportService",
"for",
"a",
"FileRepositoryCollection",
"."
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-data-import/src/main/java/org/molgenis/data/importer/ImportServiceFactory.java#L35-L57 |
dnault/therapi-runtime-javadoc | therapi-runtime-javadoc/src/main/java/com/github/therapi/runtimejavadoc/RuntimeJavadoc.java | RuntimeJavadoc.getJavadoc | public static ClassJavadoc getJavadoc(String qualifiedClassName, Class loader) {
"""
Gets the Javadoc of the given class, using the given {@link Class} object to load the Javadoc resource.
<p>
The return value is always non-null. If no Javadoc is available, the returned object's
{@link BaseJavadoc#isEmpty isEmp... | java | public static ClassJavadoc getJavadoc(String qualifiedClassName, Class loader) {
final String resourceName = getResourceName(qualifiedClassName);
try (InputStream is = loader.getResourceAsStream("/" + resourceName)) {
return parseJavadocResource(qualifiedClassName, is);
} catch (IOEx... | [
"public",
"static",
"ClassJavadoc",
"getJavadoc",
"(",
"String",
"qualifiedClassName",
",",
"Class",
"loader",
")",
"{",
"final",
"String",
"resourceName",
"=",
"getResourceName",
"(",
"qualifiedClassName",
")",
";",
"try",
"(",
"InputStream",
"is",
"=",
"loader",... | Gets the Javadoc of the given class, using the given {@link Class} object to load the Javadoc resource.
<p>
The return value is always non-null. If no Javadoc is available, the returned object's
{@link BaseJavadoc#isEmpty isEmpty()} method will return {@code true}.
@param qualifiedClassName the fully qualified name of... | [
"Gets",
"the",
"Javadoc",
"of",
"the",
"given",
"class",
"using",
"the",
"given",
"{",
"@link",
"Class",
"}",
"object",
"to",
"load",
"the",
"Javadoc",
"resource",
".",
"<p",
">",
"The",
"return",
"value",
"is",
"always",
"non",
"-",
"null",
".",
"If",... | train | https://github.com/dnault/therapi-runtime-javadoc/blob/74902191dcf74b870e296653b2adf7dbb747c189/therapi-runtime-javadoc/src/main/java/com/github/therapi/runtimejavadoc/RuntimeJavadoc.java#L82-L89 |
burberius/eve-esi | src/main/java/net/troja/eve/esi/api/MetaApi.java | MetaApi.getStatusAsync | public com.squareup.okhttp.Call getStatusAsync(String version, final ApiCallback<List<EsiStatusResponse>> callback)
throws ApiException {
"""
ESI health status (asynchronously) Provides a general health indicator
per route and method
@param version
The version of metrics to request. Note that alte... | java | public com.squareup.okhttp.Call getStatusAsync(String version, final ApiCallback<List<EsiStatusResponse>> callback)
throws ApiException {
com.squareup.okhttp.Call call = getStatusValidateBeforeCall(version, callback);
Type localVarReturnType = new TypeToken<List<EsiStatusResponse>>() {
... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"getStatusAsync",
"(",
"String",
"version",
",",
"final",
"ApiCallback",
"<",
"List",
"<",
"EsiStatusResponse",
">",
">",
"callback",
")",
"throws",
"ApiException",
"{",
"com",
".",
"squareup",
".... | ESI health status (asynchronously) Provides a general health indicator
per route and method
@param version
The version of metrics to request. Note that alternate
versions are grouped together (optional, default to latest)
@param callback
The callback to be executed when the API call finishes
@return The request call
@... | [
"ESI",
"health",
"status",
"(",
"asynchronously",
")",
"Provides",
"a",
"general",
"health",
"indicator",
"per",
"route",
"and",
"method"
] | train | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/MetaApi.java#L346-L354 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalReader.java | JournalReader.getJournalEntryStartTag | private StartElement getJournalEntryStartTag(XMLEventReader reader)
throws XMLStreamException, JournalException {
"""
Get the next event and complain if it isn't a JournalEntry start tag.
"""
XMLEvent event = reader.nextTag();
if (!isStartTagEvent(event, QNAME_TAG_JOURNAL_ENTRY)) {
... | java | private StartElement getJournalEntryStartTag(XMLEventReader reader)
throws XMLStreamException, JournalException {
XMLEvent event = reader.nextTag();
if (!isStartTagEvent(event, QNAME_TAG_JOURNAL_ENTRY)) {
throw getNotStartTagException(QNAME_TAG_JOURNAL_ENTRY, event);
}
... | [
"private",
"StartElement",
"getJournalEntryStartTag",
"(",
"XMLEventReader",
"reader",
")",
"throws",
"XMLStreamException",
",",
"JournalException",
"{",
"XMLEvent",
"event",
"=",
"reader",
".",
"nextTag",
"(",
")",
";",
"if",
"(",
"!",
"isStartTagEvent",
"(",
"ev... | Get the next event and complain if it isn't a JournalEntry start tag. | [
"Get",
"the",
"next",
"event",
"and",
"complain",
"if",
"it",
"isn",
"t",
"a",
"JournalEntry",
"start",
"tag",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalReader.java#L218-L225 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/ArrayIterate.java | ArrayIterate.indexOf | public static <T> int indexOf(T[] objectArray, T elem) {
"""
Searches for the first occurrence of the given argument, testing
for equality using the <tt>equals</tt> method.
"""
return InternalArrayIterate.indexOf(objectArray, objectArray.length, elem);
} | java | public static <T> int indexOf(T[] objectArray, T elem)
{
return InternalArrayIterate.indexOf(objectArray, objectArray.length, elem);
} | [
"public",
"static",
"<",
"T",
">",
"int",
"indexOf",
"(",
"T",
"[",
"]",
"objectArray",
",",
"T",
"elem",
")",
"{",
"return",
"InternalArrayIterate",
".",
"indexOf",
"(",
"objectArray",
",",
"objectArray",
".",
"length",
",",
"elem",
")",
";",
"}"
] | Searches for the first occurrence of the given argument, testing
for equality using the <tt>equals</tt> method. | [
"Searches",
"for",
"the",
"first",
"occurrence",
"of",
"the",
"given",
"argument",
"testing",
"for",
"equality",
"using",
"the",
"<tt",
">",
"equals<",
"/",
"tt",
">",
"method",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/ArrayIterate.java#L1094-L1097 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/externallink/CmsEditExternalLinkDialog.java | CmsEditExternalLinkDialog.setOkEnabled | protected void setOkEnabled(boolean enabled, String message) {
"""
Enables or disables the OK button.<p>
@param enabled <code>true</code> to enable the button
@param message the disabled reason
"""
if (enabled) {
m_okButton.enable();
} else {
m_okButton.disable(mess... | java | protected void setOkEnabled(boolean enabled, String message) {
if (enabled) {
m_okButton.enable();
} else {
m_okButton.disable(message);
}
} | [
"protected",
"void",
"setOkEnabled",
"(",
"boolean",
"enabled",
",",
"String",
"message",
")",
"{",
"if",
"(",
"enabled",
")",
"{",
"m_okButton",
".",
"enable",
"(",
")",
";",
"}",
"else",
"{",
"m_okButton",
".",
"disable",
"(",
"message",
")",
";",
"}... | Enables or disables the OK button.<p>
@param enabled <code>true</code> to enable the button
@param message the disabled reason | [
"Enables",
"or",
"disables",
"the",
"OK",
"button",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/externallink/CmsEditExternalLinkDialog.java#L371-L378 |
jwtk/jjwt | api/src/main/java/io/jsonwebtoken/lang/Assert.java | Assert.notEmpty | public static void notEmpty(Map map, String message) {
"""
Assert that a Map has entries; that is, it must not be <code>null</code>
and must have at least one entry.
<pre class="code">Assert.notEmpty(map, "Map must have entries");</pre>
@param map the map to check
@param message the exception message to use if... | java | public static void notEmpty(Map map, String message) {
if (Collections.isEmpty(map)) {
throw new IllegalArgumentException(message);
}
} | [
"public",
"static",
"void",
"notEmpty",
"(",
"Map",
"map",
",",
"String",
"message",
")",
"{",
"if",
"(",
"Collections",
".",
"isEmpty",
"(",
"map",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"message",
")",
";",
"}",
"}"
] | Assert that a Map has entries; that is, it must not be <code>null</code>
and must have at least one entry.
<pre class="code">Assert.notEmpty(map, "Map must have entries");</pre>
@param map the map to check
@param message the exception message to use if the assertion fails
@throws IllegalArgumentException if the map is ... | [
"Assert",
"that",
"a",
"Map",
"has",
"entries",
";",
"that",
"is",
"it",
"must",
"not",
"be",
"<code",
">",
"null<",
"/",
"code",
">",
"and",
"must",
"have",
"at",
"least",
"one",
"entry",
".",
"<pre",
"class",
"=",
"code",
">",
"Assert",
".",
"not... | train | https://github.com/jwtk/jjwt/blob/86b6096946752cffcfbc9b0a5503f1ea195cc140/api/src/main/java/io/jsonwebtoken/lang/Assert.java#L268-L272 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/requests/restaction/MessageAction.java | MessageAction.addFile | @CheckReturnValue
public MessageAction addFile(final byte[] data, final String name) {
"""
Adds the provided byte[] as file data.
<p>To reset all files use {@link #clearFiles()}
@param data
The byte[] that will be interpreted as file data
@param name
The file name that should be used to interpret th... | java | @CheckReturnValue
public MessageAction addFile(final byte[] data, final String name)
{
Checks.notNull(data, "Data");
final long maxSize = getJDA().getSelfUser().getAllowedFileSize();
Checks.check(data.length <= maxSize, "File may not exceed the maximum file length of %d bytes!", maxSize)... | [
"@",
"CheckReturnValue",
"public",
"MessageAction",
"addFile",
"(",
"final",
"byte",
"[",
"]",
"data",
",",
"final",
"String",
"name",
")",
"{",
"Checks",
".",
"notNull",
"(",
"data",
",",
"\"Data\"",
")",
";",
"final",
"long",
"maxSize",
"=",
"getJDA",
... | Adds the provided byte[] as file data.
<p>To reset all files use {@link #clearFiles()}
@param data
The byte[] that will be interpreted as file data
@param name
The file name that should be used to interpret the type of the given data
using the file-name extension. This name is similar to what will be visible
throug... | [
"Adds",
"the",
"provided",
"byte",
"[]",
"as",
"file",
"data",
"."
] | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/requests/restaction/MessageAction.java#L404-L411 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalDateTime.java | LocalDateTime.plusYears | public LocalDateTime plusYears(long years) {
"""
Returns a copy of this {@code LocalDateTime} with the specified number of years added.
<p>
This method adds the specified amount to the years field in three steps:
<ol>
<li>Add the input years to the year field</li>
<li>Check if the resulting date would be inva... | java | public LocalDateTime plusYears(long years) {
LocalDate newDate = date.plusYears(years);
return with(newDate, time);
} | [
"public",
"LocalDateTime",
"plusYears",
"(",
"long",
"years",
")",
"{",
"LocalDate",
"newDate",
"=",
"date",
".",
"plusYears",
"(",
"years",
")",
";",
"return",
"with",
"(",
"newDate",
",",
"time",
")",
";",
"}"
] | Returns a copy of this {@code LocalDateTime} with the specified number of years added.
<p>
This method adds the specified amount to the years field in three steps:
<ol>
<li>Add the input years to the year field</li>
<li>Check if the resulting date would be invalid</li>
<li>Adjust the day-of-month to the last valid day ... | [
"Returns",
"a",
"copy",
"of",
"this",
"{",
"@code",
"LocalDateTime",
"}",
"with",
"the",
"specified",
"number",
"of",
"years",
"added",
".",
"<p",
">",
"This",
"method",
"adds",
"the",
"specified",
"amount",
"to",
"the",
"years",
"field",
"in",
"three",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalDateTime.java#L1214-L1217 |
eclipse/xtext-core | org.eclipse.xtext.util/src/org/eclipse/xtext/util/concurrent/AbstractReadWriteAcces.java | AbstractReadWriteAcces.process | public <Result> Result process(IUnitOfWork<Result, State> work) {
"""
Upgrades a read transaction to a write transaction, executes the work then downgrades to a read transaction
again.
@since 2.4
@noreference
"""
releaseReadLock();
acquireWriteLock();
try {
if (log.isTraceEnabled())
log.trace... | java | public <Result> Result process(IUnitOfWork<Result, State> work) {
releaseReadLock();
acquireWriteLock();
try {
if (log.isTraceEnabled())
log.trace("process - " + Thread.currentThread().getName());
return modify(work);
} finally {
if (log.isTraceEnabled())
log.trace("Downgrading from write lock ... | [
"public",
"<",
"Result",
">",
"Result",
"process",
"(",
"IUnitOfWork",
"<",
"Result",
",",
"State",
">",
"work",
")",
"{",
"releaseReadLock",
"(",
")",
";",
"acquireWriteLock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"log",
".",
"isTraceEnabled",
"(",
")... | Upgrades a read transaction to a write transaction, executes the work then downgrades to a read transaction
again.
@since 2.4
@noreference | [
"Upgrades",
"a",
"read",
"transaction",
"to",
"a",
"write",
"transaction",
"executes",
"the",
"work",
"then",
"downgrades",
"to",
"a",
"read",
"transaction",
"again",
"."
] | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext.util/src/org/eclipse/xtext/util/concurrent/AbstractReadWriteAcces.java#L107-L120 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/EntityAttribute.java | EntityAttribute.setNames | public void setNames(int i, Name v) {
"""
indexed setter for names - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array
"""
if (EntityAttribute_Type.featOkTst && ((EntityAttribute_Type)jcasType).casFeat_names == null)
jcasType.jcas.throwFeat... | java | public void setNames(int i, Name v) {
if (EntityAttribute_Type.featOkTst && ((EntityAttribute_Type)jcasType).casFeat_names == null)
jcasType.jcas.throwFeatMissing("names", "de.julielab.jules.types.ace.EntityAttribute");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((EntityAttribute... | [
"public",
"void",
"setNames",
"(",
"int",
"i",
",",
"Name",
"v",
")",
"{",
"if",
"(",
"EntityAttribute_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"EntityAttribute_Type",
")",
"jcasType",
")",
".",
"casFeat_names",
"==",
"null",
")",
"jcasType",
".",
"jcas",
... | indexed setter for names - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"names",
"-",
"sets",
"an",
"indexed",
"value",
"-"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/EntityAttribute.java#L116-L120 |
moleculer-java/moleculer-java | src/main/java/services/moleculer/eventbus/EventEmitter.java | EventEmitter.broadcastLocal | public void broadcastLocal(String name, Object... params) {
"""
Emits a <b>LOCAL</b> event to <b>ALL</b> listeners from ALL (or the
specified) event group(s), who are listening this event. Sample code:<br>
<br>
ctx.broadcastLocal("user.deleted", "a", 1, "b", 2);<br>
<br>
...or send event to (one or more) loca... | java | public void broadcastLocal(String name, Object... params) {
ParseResult res = parseParams(params);
eventbus.broadcast(name, res.data, res.groups, true);
} | [
"public",
"void",
"broadcastLocal",
"(",
"String",
"name",
",",
"Object",
"...",
"params",
")",
"{",
"ParseResult",
"res",
"=",
"parseParams",
"(",
"params",
")",
";",
"eventbus",
".",
"broadcast",
"(",
"name",
",",
"res",
".",
"data",
",",
"res",
".",
... | Emits a <b>LOCAL</b> event to <b>ALL</b> listeners from ALL (or the
specified) event group(s), who are listening this event. Sample code:<br>
<br>
ctx.broadcastLocal("user.deleted", "a", 1, "b", 2);<br>
<br>
...or send event to (one or more) local listener group(s):<br>
<br>
ctx.broadcastLocal("user.deleted", "a", 1, "... | [
"Emits",
"a",
"<b",
">",
"LOCAL<",
"/",
"b",
">",
"event",
"to",
"<b",
">",
"ALL<",
"/",
"b",
">",
"listeners",
"from",
"ALL",
"(",
"or",
"the",
"specified",
")",
"event",
"group",
"(",
"s",
")",
"who",
"are",
"listening",
"this",
"event",
".",
"... | train | https://github.com/moleculer-java/moleculer-java/blob/27575c44b9ecacc17c4456ceacf5d1851abf1cc4/src/main/java/services/moleculer/eventbus/EventEmitter.java#L199-L202 |
ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java | EsClient.getDocument | public EsRequest getDocument(String name, String type, String id) throws IOException {
"""
Searches indexed document.
@param name index name.
@param type index type.
@param id document identifier.
@return document if it was found or null.
@throws IOException
"""
CloseableHttpClient client = Http... | java | public EsRequest getDocument(String name, String type, String id) throws IOException {
CloseableHttpClient client = HttpClients.createDefault();
HttpGet method = new HttpGet(String.format("http://%s:%d/%s/%s/%s", host, port, name, type, id));
try {
CloseableHttpResponse resp = client... | [
"public",
"EsRequest",
"getDocument",
"(",
"String",
"name",
",",
"String",
"type",
",",
"String",
"id",
")",
"throws",
"IOException",
"{",
"CloseableHttpClient",
"client",
"=",
"HttpClients",
".",
"createDefault",
"(",
")",
";",
"HttpGet",
"method",
"=",
"new... | Searches indexed document.
@param name index name.
@param type index type.
@param id document identifier.
@return document if it was found or null.
@throws IOException | [
"Searches",
"indexed",
"document",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java#L149-L168 |
albfernandez/itext2 | src/main/java/com/lowagie/text/FontFactory.java | FontFactory.registerFamily | public void registerFamily(String familyName, String fullName, String path) {
"""
Register a font by giving explicitly the font family and name.
@param familyName the font family
@param fullName the font name
@param path the font path
"""
fontImp.registerFamily(familyName, fullName, path);
} | java | public void registerFamily(String familyName, String fullName, String path) {
fontImp.registerFamily(familyName, fullName, path);
} | [
"public",
"void",
"registerFamily",
"(",
"String",
"familyName",
",",
"String",
"fullName",
",",
"String",
"path",
")",
"{",
"fontImp",
".",
"registerFamily",
"(",
"familyName",
",",
"fullName",
",",
"path",
")",
";",
"}"
] | Register a font by giving explicitly the font family and name.
@param familyName the font family
@param fullName the font name
@param path the font path | [
"Register",
"a",
"font",
"by",
"giving",
"explicitly",
"the",
"font",
"family",
"and",
"name",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/FontFactory.java#L338-L340 |
devcon5io/common | classutils/src/main/java/io/devcon5/classutils/JarScanner.java | JarScanner.toUri | private static URI toUri(final URL u) {
"""
Converts a url to uri without throwing a checked exception. In case an URI syntax exception occurs, an
IllegalArgumentException is thrown.
@param u
the url to be converted
@return
the converted uri
"""
try {
return u.toURI();
} catch... | java | private static URI toUri(final URL u) {
try {
return u.toURI();
} catch (URISyntaxException e) {
throw new IllegalArgumentException("Could not convert URL "+u+" to uri",e);
}
} | [
"private",
"static",
"URI",
"toUri",
"(",
"final",
"URL",
"u",
")",
"{",
"try",
"{",
"return",
"u",
".",
"toURI",
"(",
")",
";",
"}",
"catch",
"(",
"URISyntaxException",
"e",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Could not convert U... | Converts a url to uri without throwing a checked exception. In case an URI syntax exception occurs, an
IllegalArgumentException is thrown.
@param u
the url to be converted
@return
the converted uri | [
"Converts",
"a",
"url",
"to",
"uri",
"without",
"throwing",
"a",
"checked",
"exception",
".",
"In",
"case",
"an",
"URI",
"syntax",
"exception",
"occurs",
"an",
"IllegalArgumentException",
"is",
"thrown",
"."
] | train | https://github.com/devcon5io/common/blob/363688e0dc904d559682bf796bd6c836b4e0efc7/classutils/src/main/java/io/devcon5/classutils/JarScanner.java#L124-L131 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/clustering/CBLOF.java | CBLOF.getClusterBoundary | private int getClusterBoundary(Relation<O> relation, List<? extends Cluster<MeanModel>> clusters) {
"""
Compute the boundary index separating the large cluster from the small
cluster.
@param relation Data to process
@param clusters All clusters that were found
@return Index of boundary between large and smal... | java | private int getClusterBoundary(Relation<O> relation, List<? extends Cluster<MeanModel>> clusters) {
int totalSize = relation.size();
int clusterBoundary = clusters.size() - 1;
int cumulativeSize = 0;
for(int i = 0; i < clusters.size() - 1; i++) {
cumulativeSize += clusters.get(i).size();
//... | [
"private",
"int",
"getClusterBoundary",
"(",
"Relation",
"<",
"O",
">",
"relation",
",",
"List",
"<",
"?",
"extends",
"Cluster",
"<",
"MeanModel",
">",
">",
"clusters",
")",
"{",
"int",
"totalSize",
"=",
"relation",
".",
"size",
"(",
")",
";",
"int",
"... | Compute the boundary index separating the large cluster from the small
cluster.
@param relation Data to process
@param clusters All clusters that were found
@return Index of boundary between large and small cluster. | [
"Compute",
"the",
"boundary",
"index",
"separating",
"the",
"large",
"cluster",
"from",
"the",
"small",
"cluster",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/clustering/CBLOF.java#L191-L211 |
cubedtear/aritzh | aritzh-core/src/main/java/io/github/aritzhack/aritzh/util/ARGBColorUtil.java | ARGBColorUtil.composite | public static int composite(final int foreground, final int background) {
"""
Composes two colors with the ARGB format: <br>
The format of the color integer is as follows: 0xAARRGGBB
Where:
<ol>
<li>AA is the alpha component (0-255)</li>
<li>RR is the red component (0-255)</li>
<li>GG is the green component ... | java | public static int composite(final int foreground, final int background) {
double fA = getAlpha(foreground) / 255.0;
double bA = getAlpha(background) / 255.0;
if (bA <= 0.0001) return foreground;
else if (fA <= 0.0001) return background;
final double alphaA = bA * (1 - fA);
return getColor(
(int) (255... | [
"public",
"static",
"int",
"composite",
"(",
"final",
"int",
"foreground",
",",
"final",
"int",
"background",
")",
"{",
"double",
"fA",
"=",
"getAlpha",
"(",
"foreground",
")",
"/",
"255.0",
";",
"double",
"bA",
"=",
"getAlpha",
"(",
"background",
")",
"... | Composes two colors with the ARGB format: <br>
The format of the color integer is as follows: 0xAARRGGBB
Where:
<ol>
<li>AA is the alpha component (0-255)</li>
<li>RR is the red component (0-255)</li>
<li>GG is the green component (0-255)</li>
<li>BB is the blue component (0-255)</li>
</ol>
NOTE: The source of this met... | [
"Composes",
"two",
"colors",
"with",
"the",
"ARGB",
"format",
":",
"<br",
">",
"The",
"format",
"of",
"the",
"color",
"integer",
"is",
"as",
"follows",
":",
"0xAARRGGBB",
"Where",
":",
"<ol",
">",
"<li",
">",
"AA",
"is",
"the",
"alpha",
"component",
"(... | train | https://github.com/cubedtear/aritzh/blob/bc7493447a1a6088c4a7306ca4d0f0c20278364f/aritzh-core/src/main/java/io/github/aritzhack/aritzh/util/ARGBColorUtil.java#L89-L103 |
tvesalainen/util | rpm/src/main/java/org/vesalainen/pm/deb/DEBBuilder.java | DEBBuilder.addConflict | @Override
public DEBBuilder addConflict(String name, String version, Condition... dependency) {
"""
Add debian/control Conflicts field.
@param name
@param version
@param dependency
@return
"""
control.addConflict(release, version, dependency);
return this;
} | java | @Override
public DEBBuilder addConflict(String name, String version, Condition... dependency)
{
control.addConflict(release, version, dependency);
return this;
} | [
"@",
"Override",
"public",
"DEBBuilder",
"addConflict",
"(",
"String",
"name",
",",
"String",
"version",
",",
"Condition",
"...",
"dependency",
")",
"{",
"control",
".",
"addConflict",
"(",
"release",
",",
"version",
",",
"dependency",
")",
";",
"return",
"t... | Add debian/control Conflicts field.
@param name
@param version
@param dependency
@return | [
"Add",
"debian",
"/",
"control",
"Conflicts",
"field",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/rpm/src/main/java/org/vesalainen/pm/deb/DEBBuilder.java#L161-L166 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/easydl/AipEasyDL.java | AipEasyDL.sendImageRequest | public JSONObject sendImageRequest(String url, String image, HashMap<String, Object> options) {
"""
easyDL通用请求方法
@param url 服务的url
@param image 图片本地路径
@param options 可选参数
@return Json返回
"""
try {
byte[] data = Util.readFileByBytes(image);
return sendImageRequest(url, data, o... | java | public JSONObject sendImageRequest(String url, String image, HashMap<String, Object> options) {
try {
byte[] data = Util.readFileByBytes(image);
return sendImageRequest(url, data, options);
} catch (IOException e) {
e.printStackTrace();
return AipError.IMA... | [
"public",
"JSONObject",
"sendImageRequest",
"(",
"String",
"url",
",",
"String",
"image",
",",
"HashMap",
"<",
"String",
",",
"Object",
">",
"options",
")",
"{",
"try",
"{",
"byte",
"[",
"]",
"data",
"=",
"Util",
".",
"readFileByBytes",
"(",
"image",
")"... | easyDL通用请求方法
@param url 服务的url
@param image 图片本地路径
@param options 可选参数
@return Json返回 | [
"easyDL通用请求方法"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/easydl/AipEasyDL.java#L30-L38 |
softindex/datakernel | core-http/src/main/java/io/datakernel/http/HttpUtils.java | HttpUtils.renderQueryString | public static String renderQueryString(Map<String, String> q, String enc) {
"""
Method which creates string with parameters and its value in format URL
@param q map in which keys if name of parameters, value - value of parameters.
@param enc encoding of this string
@return string with parameters and its val... | java | public static String renderQueryString(Map<String, String> q, String enc) {
StringBuilder sb = new StringBuilder();
for (Map.Entry<String, String> e : q.entrySet()) {
String name = urlEncode(e.getKey(), enc);
sb.append(name);
if (e.getValue() != null) {
sb.append('=');
sb.append(urlEncode(e.getValu... | [
"public",
"static",
"String",
"renderQueryString",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"q",
",",
"String",
"enc",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",... | Method which creates string with parameters and its value in format URL
@param q map in which keys if name of parameters, value - value of parameters.
@param enc encoding of this string
@return string with parameters and its value in format URL | [
"Method",
"which",
"creates",
"string",
"with",
"parameters",
"and",
"its",
"value",
"in",
"format",
"URL"
] | train | https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-http/src/main/java/io/datakernel/http/HttpUtils.java#L190-L204 |
querydsl/querydsl | querydsl-collections/src/main/java/com/querydsl/collections/DefaultEvaluatorFactory.java | DefaultEvaluatorFactory.createEvaluator | public <T> Evaluator<List<T>> createEvaluator(QueryMetadata metadata,
Expression<? extends T> source, Predicate filter) {
"""
Create an Evaluator for the given source and filter
@param <T>
@param source source of the query
@param filter filter of the query
@return evaluator
"""
String... | java | public <T> Evaluator<List<T>> createEvaluator(QueryMetadata metadata,
Expression<? extends T> source, Predicate filter) {
String typeName = ClassUtils.getName(source.getType());
CollQuerySerializer ser = new CollQuerySerializer(templates);
ser.append("java.util.List<" + typeName + ">... | [
"public",
"<",
"T",
">",
"Evaluator",
"<",
"List",
"<",
"T",
">",
">",
"createEvaluator",
"(",
"QueryMetadata",
"metadata",
",",
"Expression",
"<",
"?",
"extends",
"T",
">",
"source",
",",
"Predicate",
"filter",
")",
"{",
"String",
"typeName",
"=",
"Clas... | Create an Evaluator for the given source and filter
@param <T>
@param source source of the query
@param filter filter of the query
@return evaluator | [
"Create",
"an",
"Evaluator",
"for",
"the",
"given",
"source",
"and",
"filter"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-collections/src/main/java/com/querydsl/collections/DefaultEvaluatorFactory.java#L131-L158 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/rank/TopNBuffer.java | TopNBuffer.put | public int put(BaseRow sortKey, BaseRow value) {
"""
Appends a record into the buffer.
@param sortKey sort key with which the specified value is to be associated
@param value record which is to be appended
@return the size of the collection under the sortKey.
"""
currentTopNum += 1;
// update treeMap
... | java | public int put(BaseRow sortKey, BaseRow value) {
currentTopNum += 1;
// update treeMap
Collection<BaseRow> collection = treeMap.get(sortKey);
if (collection == null) {
collection = valueSupplier.get();
treeMap.put(sortKey, collection);
}
collection.add(value);
return collection.size();
} | [
"public",
"int",
"put",
"(",
"BaseRow",
"sortKey",
",",
"BaseRow",
"value",
")",
"{",
"currentTopNum",
"+=",
"1",
";",
"// update treeMap",
"Collection",
"<",
"BaseRow",
">",
"collection",
"=",
"treeMap",
".",
"get",
"(",
"sortKey",
")",
";",
"if",
"(",
... | Appends a record into the buffer.
@param sortKey sort key with which the specified value is to be associated
@param value record which is to be appended
@return the size of the collection under the sortKey. | [
"Appends",
"a",
"record",
"into",
"the",
"buffer",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/rank/TopNBuffer.java#L58-L68 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java | SARLJvmModelInferrer.cloneWithProxiesFromOtherResource | protected JvmTypeReference cloneWithProxiesFromOtherResource(JvmTypeReference type, JvmOperation target) {
"""
Clone the given type reference that is associated to another Xtext resource.
<p>This function ensures that the resource of the reference clone is not pointing
to the resource of the original reference... | java | protected JvmTypeReference cloneWithProxiesFromOtherResource(JvmTypeReference type, JvmOperation target) {
if (type == null) {
return this._typeReferenceBuilder.typeRef(Void.TYPE);
}
// Do not clone inferred types because they are not yet resolved and it is located within the current resource.
if (InferredTy... | [
"protected",
"JvmTypeReference",
"cloneWithProxiesFromOtherResource",
"(",
"JvmTypeReference",
"type",
",",
"JvmOperation",
"target",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"return",
"this",
".",
"_typeReferenceBuilder",
".",
"typeRef",
"(",
"Void",
... | Clone the given type reference that is associated to another Xtext resource.
<p>This function ensures that the resource of the reference clone is not pointing
to the resource of the original reference.
<p>This function calls {@link JvmTypesBuilder#cloneWithProxies(JvmTypeReference)} or
{@link #cloneWithTypeParameters... | [
"Clone",
"the",
"given",
"type",
"reference",
"that",
"is",
"associated",
"to",
"another",
"Xtext",
"resource",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java#L3324-L3345 |
apache/flink | flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/MetricConfig.java | MetricConfig.getFloat | public float getFloat(String key, float defaultValue) {
"""
Searches for the property with the specified key in this property list.
If the key is not found in this property list, the default property list,
and its defaults, recursively, are then checked. The method returns the
default value argument if the prop... | java | public float getFloat(String key, float defaultValue) {
String argument = getProperty(key, null);
return argument == null
? defaultValue
: Float.parseFloat(argument);
} | [
"public",
"float",
"getFloat",
"(",
"String",
"key",
",",
"float",
"defaultValue",
")",
"{",
"String",
"argument",
"=",
"getProperty",
"(",
"key",
",",
"null",
")",
";",
"return",
"argument",
"==",
"null",
"?",
"defaultValue",
":",
"Float",
".",
"parseFloa... | Searches for the property with the specified key in this property list.
If the key is not found in this property list, the default property list,
and its defaults, recursively, are then checked. The method returns the
default value argument if the property is not found.
@param key the hashtable key.
@param de... | [
"Searches",
"for",
"the",
"property",
"with",
"the",
"specified",
"key",
"in",
"this",
"property",
"list",
".",
"If",
"the",
"key",
"is",
"not",
"found",
"in",
"this",
"property",
"list",
"the",
"default",
"property",
"list",
"and",
"its",
"defaults",
"rec... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/MetricConfig.java#L76-L81 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/preferences/ExtraLanguagePreferenceAccess.java | ExtraLanguagePreferenceAccess.getBoolean | public boolean getBoolean(String preferenceContainerID, IProject project, String preferenceName) {
"""
Replies the preference value.
<p>This function takes care of the specific options that are associated to the given project.
If the given project is {@code null} or has no specific options, according to
{@lin... | java | public boolean getBoolean(String preferenceContainerID, IProject project, String preferenceName) {
assert preferenceName != null;
final IProject prj = ifSpecificConfiguration(preferenceContainerID, project);
final IPreferenceStore store = getPreferenceStore(prj);
return getBoolean(store, preferenceContainerID, ... | [
"public",
"boolean",
"getBoolean",
"(",
"String",
"preferenceContainerID",
",",
"IProject",
"project",
",",
"String",
"preferenceName",
")",
"{",
"assert",
"preferenceName",
"!=",
"null",
";",
"final",
"IProject",
"prj",
"=",
"ifSpecificConfiguration",
"(",
"prefere... | Replies the preference value.
<p>This function takes care of the specific options that are associated to the given project.
If the given project is {@code null} or has no specific options, according to
{@link #ifSpecificConfiguration(String, IProject)}, then the global preferences are used.
@param preferenceContainer... | [
"Replies",
"the",
"preference",
"value",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/preferences/ExtraLanguagePreferenceAccess.java#L167-L172 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/RequestIdTable.java | RequestIdTable.getListener | public synchronized ReceiveListener getListener(int requestId) {
"""
Returns the receive listener associated with the specified request ID.
The request ID must be present in the table otherwise a runtime
exception will be thrown.
@param requestId The request ID to retrieve the receive listener for.
@return Rec... | java | public synchronized ReceiveListener getListener(int requestId)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getListener", ""+requestId);
if (!containsId(requestId))
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) debugTraceTable("... | [
"public",
"synchronized",
"ReceiveListener",
"getListener",
"(",
"int",
"requestId",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",... | Returns the receive listener associated with the specified request ID.
The request ID must be present in the table otherwise a runtime
exception will be thrown.
@param requestId The request ID to retrieve the receive listener for.
@return ReceiveListener The receive listener received. | [
"Returns",
"the",
"receive",
"listener",
"associated",
"with",
"the",
"specified",
"request",
"ID",
".",
"The",
"request",
"ID",
"must",
"be",
"present",
"in",
"the",
"table",
"otherwise",
"a",
"runtime",
"exception",
"will",
"be",
"thrown",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/RequestIdTable.java#L188-L203 |
icode/ameba | src/main/java/ameba/mvc/template/internal/AbstractTemplateProcessor.java | AbstractTemplateProcessor.setContentType | protected Charset setContentType(MediaType mediaType, MultivaluedMap<String, Object> httpHeaders) {
"""
<p>setContentType.</p>
@param mediaType a {@link javax.ws.rs.core.MediaType} object.
@param httpHeaders a {@link javax.ws.rs.core.MultivaluedMap} object.
@return a {@link java.nio.charset.Charset} object.... | java | protected Charset setContentType(MediaType mediaType, MultivaluedMap<String, Object> httpHeaders) {
String charset = mediaType.getParameters().get("charset");
Charset encoding;
MediaType finalMediaType;
if (charset == null) {
encoding = this.getEncoding();
HashMap... | [
"protected",
"Charset",
"setContentType",
"(",
"MediaType",
"mediaType",
",",
"MultivaluedMap",
"<",
"String",
",",
"Object",
">",
"httpHeaders",
")",
"{",
"String",
"charset",
"=",
"mediaType",
".",
"getParameters",
"(",
")",
".",
"get",
"(",
"\"charset\"",
"... | <p>setContentType.</p>
@param mediaType a {@link javax.ws.rs.core.MediaType} object.
@param httpHeaders a {@link javax.ws.rs.core.MultivaluedMap} object.
@return a {@link java.nio.charset.Charset} object.
@since 0.1.6e | [
"<p",
">",
"setContentType",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/mvc/template/internal/AbstractTemplateProcessor.java#L166-L188 |
Squarespace/cldr | runtime/src/main/java/com/squarespace/cldr/dates/CalendarFormatterBase.java | CalendarFormatterBase.formatTimeZone_X | void formatTimeZone_X(StringBuilder b, ZonedDateTime d, int width, char ch) {
"""
Format timezone in ISO8601 basic or extended format for field 'x' or 'X'.
http://www.unicode.org/reports/tr35/tr35-dates.html#dfst-zone
"""
int[] tz = getTzComponents(d);
// Emit a 'Z' by itself for X if time is exa... | java | void formatTimeZone_X(StringBuilder b, ZonedDateTime d, int width, char ch) {
int[] tz = getTzComponents(d);
// Emit a 'Z' by itself for X if time is exactly GMT
if (ch == 'X' && tz[TZOFFSET] == 0) {
b.append('Z');
return;
}
switch (width) {
case 5:
case 4:
case 3... | [
"void",
"formatTimeZone_X",
"(",
"StringBuilder",
"b",
",",
"ZonedDateTime",
"d",
",",
"int",
"width",
",",
"char",
"ch",
")",
"{",
"int",
"[",
"]",
"tz",
"=",
"getTzComponents",
"(",
"d",
")",
";",
"// Emit a 'Z' by itself for X if time is exactly GMT",
"if",
... | Format timezone in ISO8601 basic or extended format for field 'x' or 'X'.
http://www.unicode.org/reports/tr35/tr35-dates.html#dfst-zone | [
"Format",
"timezone",
"in",
"ISO8601",
"basic",
"or",
"extended",
"format",
"for",
"field",
"x",
"or",
"X",
".",
"http",
":",
"//",
"www",
".",
"unicode",
".",
"org",
"/",
"reports",
"/",
"tr35",
"/",
"tr35",
"-",
"dates",
".",
"html#dfst",
"-",
"zon... | train | https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/runtime/src/main/java/com/squarespace/cldr/dates/CalendarFormatterBase.java#L876-L911 |
overturetool/overture | core/codegen/platform/src/main/java/org/overture/codegen/analysis/vdm/VarShadowingRenameCollector.java | VarShadowingRenameCollector.visitModuleDefs | private void visitModuleDefs(List<PDefinition> defs, INode module)
throws AnalysisException {
"""
Note that this methods is intended to work both for SL modules and PP/RT classes
"""
DefinitionInfo defInfo = getStateDefs(defs, module);
if (defInfo != null)
{
addLocalDefs(defInfo);
handleExecuta... | java | private void visitModuleDefs(List<PDefinition> defs, INode module)
throws AnalysisException
{
DefinitionInfo defInfo = getStateDefs(defs, module);
if (defInfo != null)
{
addLocalDefs(defInfo);
handleExecutables(defs);
removeLocalDefs(defInfo);
} else
{
handleExecutables(defs);
}
} | [
"private",
"void",
"visitModuleDefs",
"(",
"List",
"<",
"PDefinition",
">",
"defs",
",",
"INode",
"module",
")",
"throws",
"AnalysisException",
"{",
"DefinitionInfo",
"defInfo",
"=",
"getStateDefs",
"(",
"defs",
",",
"module",
")",
";",
"if",
"(",
"defInfo",
... | Note that this methods is intended to work both for SL modules and PP/RT classes | [
"Note",
"that",
"this",
"methods",
"is",
"intended",
"to",
"work",
"both",
"for",
"SL",
"modules",
"and",
"PP",
"/",
"RT",
"classes"
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/codegen/platform/src/main/java/org/overture/codegen/analysis/vdm/VarShadowingRenameCollector.java#L720-L734 |
Azure/azure-sdk-for-java | policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java | PolicyStatesInner.summarizeForSubscriptionLevelPolicyAssignmentAsync | public Observable<SummarizeResultsInner> summarizeForSubscriptionLevelPolicyAssignmentAsync(String subscriptionId, String policyAssignmentName) {
"""
Summarizes policy states for the subscription level policy assignment.
@param subscriptionId Microsoft Azure subscription ID.
@param policyAssignmentName Policy ... | java | public Observable<SummarizeResultsInner> summarizeForSubscriptionLevelPolicyAssignmentAsync(String subscriptionId, String policyAssignmentName) {
return summarizeForSubscriptionLevelPolicyAssignmentWithServiceResponseAsync(subscriptionId, policyAssignmentName).map(new Func1<ServiceResponse<SummarizeResultsInner... | [
"public",
"Observable",
"<",
"SummarizeResultsInner",
">",
"summarizeForSubscriptionLevelPolicyAssignmentAsync",
"(",
"String",
"subscriptionId",
",",
"String",
"policyAssignmentName",
")",
"{",
"return",
"summarizeForSubscriptionLevelPolicyAssignmentWithServiceResponseAsync",
"(",
... | Summarizes policy states for the subscription level policy assignment.
@param subscriptionId Microsoft Azure subscription ID.
@param policyAssignmentName Policy assignment name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the SummarizeResultsInner object | [
"Summarizes",
"policy",
"states",
"for",
"the",
"subscription",
"level",
"policy",
"assignment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java#L2714-L2721 |
jblas-project/jblas | src/main/java/org/jblas/ComplexDouble.java | ComplexDouble.subi | public ComplexDouble subi(ComplexDouble c, ComplexDouble result) {
"""
Subtract two complex numbers, in-place
@param c complex number to subtract
@param result resulting complex number
@return same as result
"""
if (this == result) {
r -= c.r;
i -= c.i;
} else {
result.r = r... | java | public ComplexDouble subi(ComplexDouble c, ComplexDouble result) {
if (this == result) {
r -= c.r;
i -= c.i;
} else {
result.r = r - c.r;
result.i = i - c.i;
}
return this;
} | [
"public",
"ComplexDouble",
"subi",
"(",
"ComplexDouble",
"c",
",",
"ComplexDouble",
"result",
")",
"{",
"if",
"(",
"this",
"==",
"result",
")",
"{",
"r",
"-=",
"c",
".",
"r",
";",
"i",
"-=",
"c",
".",
"i",
";",
"}",
"else",
"{",
"result",
".",
"r... | Subtract two complex numbers, in-place
@param c complex number to subtract
@param result resulting complex number
@return same as result | [
"Subtract",
"two",
"complex",
"numbers",
"in",
"-",
"place"
] | train | https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/ComplexDouble.java#L176-L185 |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java | SearchPortletController.cleanAndTrimString | private String cleanAndTrimString(String text, int maxTextLength) {
"""
for slower network connections and makes autocomplete UI results smaller/shorter.
"""
if (StringUtils.isNotBlank(text)) {
String cleaned = text.trim().replaceAll("[\\s]+", " ");
return cleaned.length() <= ma... | java | private String cleanAndTrimString(String text, int maxTextLength) {
if (StringUtils.isNotBlank(text)) {
String cleaned = text.trim().replaceAll("[\\s]+", " ");
return cleaned.length() <= maxTextLength
? cleaned
: cleaned.substring(0, maxTextLength)... | [
"private",
"String",
"cleanAndTrimString",
"(",
"String",
"text",
",",
"int",
"maxTextLength",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"text",
")",
")",
"{",
"String",
"cleaned",
"=",
"text",
".",
"trim",
"(",
")",
".",
"replaceAll",
... | for slower network connections and makes autocomplete UI results smaller/shorter. | [
"for",
"slower",
"network",
"connections",
"and",
"makes",
"autocomplete",
"UI",
"results",
"smaller",
"/",
"shorter",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/search/SearchPortletController.java#L771-L779 |
sdaschner/jaxrs-analyzer | src/main/java/com/sebastian_daschner/jaxrs_analyzer/analysis/bytecode/simulation/MethodSimulator.java | MethodSimulator.simulateStore | private void simulateStore(final StoreInstruction instruction) {
"""
Simulates the store instruction.
@param instruction The instruction to simulate
"""
final int index = instruction.getNumber();
final Element elementToStore = runtimeStack.pop();
if (elementToStore instanceof Method... | java | private void simulateStore(final StoreInstruction instruction) {
final int index = instruction.getNumber();
final Element elementToStore = runtimeStack.pop();
if (elementToStore instanceof MethodHandle)
mergeMethodHandleStore(index, (MethodHandle) elementToStore);
else
... | [
"private",
"void",
"simulateStore",
"(",
"final",
"StoreInstruction",
"instruction",
")",
"{",
"final",
"int",
"index",
"=",
"instruction",
".",
"getNumber",
"(",
")",
";",
"final",
"Element",
"elementToStore",
"=",
"runtimeStack",
".",
"pop",
"(",
")",
";",
... | Simulates the store instruction.
@param instruction The instruction to simulate | [
"Simulates",
"the",
"store",
"instruction",
"."
] | train | https://github.com/sdaschner/jaxrs-analyzer/blob/4ac62942202d05632977d6c14d3cd7e2d27e2b9b/src/main/java/com/sebastian_daschner/jaxrs_analyzer/analysis/bytecode/simulation/MethodSimulator.java#L205-L213 |
ModeShape/modeshape | modeshape-schematic/src/main/java/org/modeshape/schematic/Schematic.java | Schematic.getDb | public static <T extends SchematicDb> T getDb(Document document) throws RuntimeException {
"""
Returns a DB with the given configuration document {@code Document}. This document is expected to contain
a {@link Schematic#TYPE_FIELD type field} to indicate the type of DB.
@see #getDb(Document, ClassLoader)
"... | java | public static <T extends SchematicDb> T getDb(Document document) throws RuntimeException {
return getDb(document, Schematic.class.getClassLoader());
} | [
"public",
"static",
"<",
"T",
"extends",
"SchematicDb",
">",
"T",
"getDb",
"(",
"Document",
"document",
")",
"throws",
"RuntimeException",
"{",
"return",
"getDb",
"(",
"document",
",",
"Schematic",
".",
"class",
".",
"getClassLoader",
"(",
")",
")",
";",
"... | Returns a DB with the given configuration document {@code Document}. This document is expected to contain
a {@link Schematic#TYPE_FIELD type field} to indicate the type of DB.
@see #getDb(Document, ClassLoader) | [
"Returns",
"a",
"DB",
"with",
"the",
"given",
"configuration",
"document",
"{",
"@code",
"Document",
"}",
".",
"This",
"document",
"is",
"expected",
"to",
"contain",
"a",
"{",
"@link",
"Schematic#TYPE_FIELD",
"type",
"field",
"}",
"to",
"indicate",
"the",
"t... | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-schematic/src/main/java/org/modeshape/schematic/Schematic.java#L52-L54 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/tree/GISTreeSetUtil.java | GISTreeSetUtil.computeCutPoint | private static <P extends GISPrimitive, N extends AbstractGISTreeSetNode<P, N>>
Point2d computeCutPoint(IcosepQuadTreeZone region, N parent) {
"""
Computes the cut planes' position of the given region.
@param region is the id of the region for which the cut plane position must be computed
@param parent is th... | java | private static <P extends GISPrimitive, N extends AbstractGISTreeSetNode<P, N>>
Point2d computeCutPoint(IcosepQuadTreeZone region, N parent) {
final double w = parent.nodeWidth / 4.;
final double h = parent.nodeHeight / 4.;
final double x;
final double y;
switch (region) {
case SOUTH_WEST:
x = parent.v... | [
"private",
"static",
"<",
"P",
"extends",
"GISPrimitive",
",",
"N",
"extends",
"AbstractGISTreeSetNode",
"<",
"P",
",",
"N",
">",
">",
"Point2d",
"computeCutPoint",
"(",
"IcosepQuadTreeZone",
"region",
",",
"N",
"parent",
")",
"{",
"final",
"double",
"w",
"=... | Computes the cut planes' position of the given region.
@param region is the id of the region for which the cut plane position must be computed
@param parent is the parent node.
@return the cut planes' position of the region, or <code>null</code> if
the cut planes' position could not be computed (because the region is ... | [
"Computes",
"the",
"cut",
"planes",
"position",
"of",
"the",
"given",
"region",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/tree/GISTreeSetUtil.java#L512-L540 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSRdbManagedConnectionImpl.java | WSRdbManagedConnectionImpl.setAutoCommit | public final void setAutoCommit(boolean value) throws SQLException {
"""
/*
Sets the requested autocommit value for the underlying connection if different than
the currently requested value or if required to always set the autocommit value as
a workaround. 346032.2
@param value the newly requested autocommit... | java | public final void setAutoCommit(boolean value) throws SQLException
{
if (value != currentAutoCommit || helper.alwaysSetAutoCommit())
{
if( (dsConfig.get().isolationLevel == Connection.TRANSACTION_NONE) && (value == false) )
throw new SQLException(AdapterUtil.getNLSMessa... | [
"public",
"final",
"void",
"setAutoCommit",
"(",
"boolean",
"value",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"value",
"!=",
"currentAutoCommit",
"||",
"helper",
".",
"alwaysSetAutoCommit",
"(",
")",
")",
"{",
"if",
"(",
"(",
"dsConfig",
".",
"get",
... | /*
Sets the requested autocommit value for the underlying connection if different than
the currently requested value or if required to always set the autocommit value as
a workaround. 346032.2
@param value the newly requested autocommit value. | [
"/",
"*",
"Sets",
"the",
"requested",
"autocommit",
"value",
"for",
"the",
"underlying",
"connection",
"if",
"different",
"than",
"the",
"currently",
"requested",
"value",
"or",
"if",
"required",
"to",
"always",
"set",
"the",
"autocommit",
"value",
"as",
"a",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSRdbManagedConnectionImpl.java#L3950-L3967 |
alkacon/opencms-core | src/org/opencms/search/CmsSearch.java | CmsSearch.addFieldQueryMustNot | public void addFieldQueryMustNot(String fieldName, String searchQuery) {
"""
Adds an individual query for a search field that MUST NOT occur.<p>
If this is used, any setting made with {@link #setQuery(String)} and {@link #setField(String[])}
will be ignored and only the individual field search settings will be... | java | public void addFieldQueryMustNot(String fieldName, String searchQuery) {
addFieldQuery(fieldName, searchQuery, BooleanClause.Occur.MUST_NOT);
} | [
"public",
"void",
"addFieldQueryMustNot",
"(",
"String",
"fieldName",
",",
"String",
"searchQuery",
")",
"{",
"addFieldQuery",
"(",
"fieldName",
",",
"searchQuery",
",",
"BooleanClause",
".",
"Occur",
".",
"MUST_NOT",
")",
";",
"}"
] | Adds an individual query for a search field that MUST NOT occur.<p>
If this is used, any setting made with {@link #setQuery(String)} and {@link #setField(String[])}
will be ignored and only the individual field search settings will be used.<p>
When combining occurrences of SHOULD, MUST and MUST_NOT, keep the followin... | [
"Adds",
"an",
"individual",
"query",
"for",
"a",
"search",
"field",
"that",
"MUST",
"NOT",
"occur",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearch.java#L209-L212 |
mbeiter/util | db/src/main/java/org/beiter/michael/db/ConnectionFactory.java | ConnectionFactory.getConnection | public static Connection getConnection(final String jndiName)
throws FactoryException {
"""
Return a Connection instance for a JNDI managed JDBC connection.
@param jndiName The JNDI connection name
@return a JDBC connection
@throws FactoryException When the connection cannot be retrieved f... | java | public static Connection getConnection(final String jndiName)
throws FactoryException {
Validate.notBlank(jndiName, "The validated character sequence 'jndiName' is null or empty");
// no need for defensive copies of Strings
try {
return DataSourceFactory.getDataSource(... | [
"public",
"static",
"Connection",
"getConnection",
"(",
"final",
"String",
"jndiName",
")",
"throws",
"FactoryException",
"{",
"Validate",
".",
"notBlank",
"(",
"jndiName",
",",
"\"The validated character sequence 'jndiName' is null or empty\"",
")",
";",
"// no need for de... | Return a Connection instance for a JNDI managed JDBC connection.
@param jndiName The JNDI connection name
@return a JDBC connection
@throws FactoryException When the connection cannot be retrieved from JNDI
@throws NullPointerException When {@code jndiName} is null
@throws IllegalArgumentException When {@c... | [
"Return",
"a",
"Connection",
"instance",
"for",
"a",
"JNDI",
"managed",
"JDBC",
"connection",
"."
] | train | https://github.com/mbeiter/util/blob/490fcebecb936e00c2f2ce2096b679b2fd10865e/db/src/main/java/org/beiter/michael/db/ConnectionFactory.java#L71-L85 |
menacher/java-game-server | jetclient/src/main/java/org/menacheri/jetclient/util/NettyUtils.java | NettyUtils.readStrings | public static String[] readStrings(ChannelBuffer buffer, int numOfStrings) {
"""
This method will read multiple strings of the buffer and return them as a
string array. It internally uses the readString(ChannelBuffer buffer) to
accomplish this task. The strings are read back in the order they are
written.
@p... | java | public static String[] readStrings(ChannelBuffer buffer, int numOfStrings)
{
return readStrings(buffer,numOfStrings,CharsetUtil.UTF_8);
} | [
"public",
"static",
"String",
"[",
"]",
"readStrings",
"(",
"ChannelBuffer",
"buffer",
",",
"int",
"numOfStrings",
")",
"{",
"return",
"readStrings",
"(",
"buffer",
",",
"numOfStrings",
",",
"CharsetUtil",
".",
"UTF_8",
")",
";",
"}"
] | This method will read multiple strings of the buffer and return them as a
string array. It internally uses the readString(ChannelBuffer buffer) to
accomplish this task. The strings are read back in the order they are
written.
@param buffer
The buffer containing the strings, with each string being a
strlength-strbytes ... | [
"This",
"method",
"will",
"read",
"multiple",
"strings",
"of",
"the",
"buffer",
"and",
"return",
"them",
"as",
"a",
"string",
"array",
".",
"It",
"internally",
"uses",
"the",
"readString",
"(",
"ChannelBuffer",
"buffer",
")",
"to",
"accomplish",
"this",
"tas... | train | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetclient/src/main/java/org/menacheri/jetclient/util/NettyUtils.java#L65-L68 |
greatman/GreatmancodeTools | src/main/java/com/greatmancode/tools/utils/Vector.java | Vector.isInAABB | public boolean isInAABB(Vector min, Vector max) {
"""
Returns whether this vector is in an axis-aligned bounding box.
<p>
The minimum and maximum vectors given must be truly the minimum and
maximum X, Y and Z components.
@param min Minimum vector
@param max Maximum vector
@return whether this vector is in ... | java | public boolean isInAABB(Vector min, Vector max) {
return x >= min.x && x <= max.x && y >= min.y && y <= max.y && z >= min.z && z <= max.z;
} | [
"public",
"boolean",
"isInAABB",
"(",
"Vector",
"min",
",",
"Vector",
"max",
")",
"{",
"return",
"x",
">=",
"min",
".",
"x",
"&&",
"x",
"<=",
"max",
".",
"x",
"&&",
"y",
">=",
"min",
".",
"y",
"&&",
"y",
"<=",
"max",
".",
"y",
"&&",
"z",
">="... | Returns whether this vector is in an axis-aligned bounding box.
<p>
The minimum and maximum vectors given must be truly the minimum and
maximum X, Y and Z components.
@param min Minimum vector
@param max Maximum vector
@return whether this vector is in the AABB | [
"Returns",
"whether",
"this",
"vector",
"is",
"in",
"an",
"axis",
"-",
"aligned",
"bounding",
"box",
".",
"<p",
">",
"The",
"minimum",
"and",
"maximum",
"vectors",
"given",
"must",
"be",
"truly",
"the",
"minimum",
"and",
"maximum",
"X",
"Y",
"and",
"Z",
... | train | https://github.com/greatman/GreatmancodeTools/blob/4c9d2656c5c8298ff9e1f235c9be8b148e43c9f1/src/main/java/com/greatmancode/tools/utils/Vector.java#L357-L359 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java | SerializedFormBuilder.buildSerializableFields | public void buildSerializableFields(XMLNode node, Content classContentTree)
throws DocletException {
"""
Build the summaries for the fields that belong to the given class.
@param node the XML element that specifies which components to document
@param classContentTree content tree to which the docum... | java | public void buildSerializableFields(XMLNode node, Content classContentTree)
throws DocletException {
SortedSet<VariableElement> members = utils.serializableFields(currentTypeElement);
if (!members.isEmpty()) {
Content serializableFieldsTree = fieldWriter.getSerializableFieldsHead... | [
"public",
"void",
"buildSerializableFields",
"(",
"XMLNode",
"node",
",",
"Content",
"classContentTree",
")",
"throws",
"DocletException",
"{",
"SortedSet",
"<",
"VariableElement",
">",
"members",
"=",
"utils",
".",
"serializableFields",
"(",
"currentTypeElement",
")"... | Build the summaries for the fields that belong to the given class.
@param node the XML element that specifies which components to document
@param classContentTree content tree to which the documentation will be added
@throws DocletException if there is a problem while building the documentation | [
"Build",
"the",
"summaries",
"for",
"the",
"fields",
"that",
"belong",
"to",
"the",
"given",
"class",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java#L426-L446 |
remkop/picocli | src/main/java/picocli/CommandLine.java | CommandLine.addSubcommand | public CommandLine addSubcommand(String name, Object command, String... aliases) {
"""
Registers a subcommand with the specified name and all specified aliases. See also {@link #addSubcommand(String, Object)}.
@param name the string to recognize on the command line as a subcommand
@param command the object t... | java | public CommandLine addSubcommand(String name, Object command, String... aliases) {
CommandLine subcommandLine = toCommandLine(command, factory);
subcommandLine.getCommandSpec().aliases.addAll(Arrays.asList(aliases));
getCommandSpec().addSubcommand(name, subcommandLine);
CommandLine.Model... | [
"public",
"CommandLine",
"addSubcommand",
"(",
"String",
"name",
",",
"Object",
"command",
",",
"String",
"...",
"aliases",
")",
"{",
"CommandLine",
"subcommandLine",
"=",
"toCommandLine",
"(",
"command",
",",
"factory",
")",
";",
"subcommandLine",
".",
"getComm... | Registers a subcommand with the specified name and all specified aliases. See also {@link #addSubcommand(String, Object)}.
@param name the string to recognize on the command line as a subcommand
@param command the object to initialize with command line arguments following the subcommand name.
This may be a {@code Com... | [
"Registers",
"a",
"subcommand",
"with",
"the",
"specified",
"name",
"and",
"all",
"specified",
"aliases",
".",
"See",
"also",
"{",
"@link",
"#addSubcommand",
"(",
"String",
"Object",
")",
"}",
"."
] | train | https://github.com/remkop/picocli/blob/3c5384f0d12817401d1921c3013c1282e2edcab2/src/main/java/picocli/CommandLine.java#L313-L319 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/style/PropertiesBasedStyleLibrary.java | PropertiesBasedStyleLibrary.getCached | private <T> T getCached(String prefix, String postfix, Class<T> cls) {
"""
Get a value from the cache (to avoid repeated parsing)
@param <T> Type
@param prefix Tree name
@param postfix Property name
@param cls Class restriction
@return Resulting value
"""
return cls.cast(cache.get(prefix + '.' + pos... | java | private <T> T getCached(String prefix, String postfix, Class<T> cls) {
return cls.cast(cache.get(prefix + '.' + postfix));
} | [
"private",
"<",
"T",
">",
"T",
"getCached",
"(",
"String",
"prefix",
",",
"String",
"postfix",
",",
"Class",
"<",
"T",
">",
"cls",
")",
"{",
"return",
"cls",
".",
"cast",
"(",
"cache",
".",
"get",
"(",
"prefix",
"+",
"'",
"'",
"+",
"postfix",
")"... | Get a value from the cache (to avoid repeated parsing)
@param <T> Type
@param prefix Tree name
@param postfix Property name
@param cls Class restriction
@return Resulting value | [
"Get",
"a",
"value",
"from",
"the",
"cache",
"(",
"to",
"avoid",
"repeated",
"parsing",
")"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/style/PropertiesBasedStyleLibrary.java#L169-L171 |
strator-dev/greenpepper | greenpepper/core/src/main/java/com/greenpepper/util/DuckType.java | DuckType.instanceOf | public static boolean instanceOf(Class type, Object object) {
"""
Indicates if object is a (DuckType) instance of a type (interface). That is,
is every method in type is present on object.
@param type The interface to implement
@param object The object to test
@return true if every method in type is prese... | java | public static boolean instanceOf(Class type, Object object)
{
if (type.isInstance(object)) return true;
Class<?> candidate = object.getClass();
for (Method method : type.getMethods())
{
try
{
candidate.getMethod(method.getName(), (Class[])meth... | [
"public",
"static",
"boolean",
"instanceOf",
"(",
"Class",
"type",
",",
"Object",
"object",
")",
"{",
"if",
"(",
"type",
".",
"isInstance",
"(",
"object",
")",
")",
"return",
"true",
";",
"Class",
"<",
"?",
">",
"candidate",
"=",
"object",
".",
"getCla... | Indicates if object is a (DuckType) instance of a type (interface). That is,
is every method in type is present on object.
@param type The interface to implement
@param object The object to test
@return true if every method in type is present on object, false otherwise | [
"Indicates",
"if",
"object",
"is",
"a",
"(",
"DuckType",
")",
"instance",
"of",
"a",
"type",
"(",
"interface",
")",
".",
"That",
"is",
"is",
"every",
"method",
"in",
"type",
"is",
"present",
"on",
"object",
"."
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/core/src/main/java/com/greenpepper/util/DuckType.java#L51-L68 |
redkale/redkale | src/org/redkale/source/EntityInfo.java | EntityInfo.formatSQLValue | protected CharSequence formatSQLValue(String col, Attribute<T, Serializable> attr, final ColumnValue cv) {
"""
拼接UPDATE给字段赋值的SQL片段
@param col 表字段名
@param attr Attribute
@param cv ColumnValue
@return CharSequence
"""
if (cv == null) return null;
Object val = cv.getValue();
... | java | protected CharSequence formatSQLValue(String col, Attribute<T, Serializable> attr, final ColumnValue cv) {
if (cv == null) return null;
Object val = cv.getValue();
CryptHandler handler = attr.attach();
if (handler != null) val = handler.encrypt(val);
switch (cv.getExpress())... | [
"protected",
"CharSequence",
"formatSQLValue",
"(",
"String",
"col",
",",
"Attribute",
"<",
"T",
",",
"Serializable",
">",
"attr",
",",
"final",
"ColumnValue",
"cv",
")",
"{",
"if",
"(",
"cv",
"==",
"null",
")",
"return",
"null",
";",
"Object",
"val",
"=... | 拼接UPDATE给字段赋值的SQL片段
@param col 表字段名
@param attr Attribute
@param cv ColumnValue
@return CharSequence | [
"拼接UPDATE给字段赋值的SQL片段"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/source/EntityInfo.java#L956-L974 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.readChildResources | public List<CmsResource> readChildResources(
CmsRequestContext context,
CmsResource resource,
CmsResourceFilter filter,
boolean getFolders,
boolean getFiles)
throws CmsException, CmsSecurityException {
"""
Returns the child resources of a resource, that is the resources
... | java | public List<CmsResource> readChildResources(
CmsRequestContext context,
CmsResource resource,
CmsResourceFilter filter,
boolean getFolders,
boolean getFiles)
throws CmsException, CmsSecurityException {
List<CmsResource> result = null;
CmsDbContext dbc = m_dbC... | [
"public",
"List",
"<",
"CmsResource",
">",
"readChildResources",
"(",
"CmsRequestContext",
"context",
",",
"CmsResource",
"resource",
",",
"CmsResourceFilter",
"filter",
",",
"boolean",
"getFolders",
",",
"boolean",
"getFiles",
")",
"throws",
"CmsException",
",",
"C... | Returns the child resources of a resource, that is the resources
contained in a folder.<p>
With the parameters <code>getFolders</code> and <code>getFiles</code>
you can control what type of resources you want in the result list:
files, folders, or both.<p>
This method is mainly used by the workplace explorer.<p>
@pa... | [
"Returns",
"the",
"child",
"resources",
"of",
"a",
"resource",
"that",
"is",
"the",
"resources",
"contained",
"in",
"a",
"folder",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L4134-L4157 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/util/Environment.java | Environment.getAs | public <T> T getAs(String environmentVariableName, Class<T> type, T defaultValue) {
"""
Returns the value set for the environment variable identified by the given name as the given {@link Class} type.
Returns the {@code defaultValue} if the named environment variable is not set.
@param <T> {@link Class} type t... | java | public <T> T getAs(String environmentVariableName, Class<T> type, T defaultValue) {
return environmentVariables().getAsType(environmentVariableName, type, defaultValue);
} | [
"public",
"<",
"T",
">",
"T",
"getAs",
"(",
"String",
"environmentVariableName",
",",
"Class",
"<",
"T",
">",
"type",
",",
"T",
"defaultValue",
")",
"{",
"return",
"environmentVariables",
"(",
")",
".",
"getAsType",
"(",
"environmentVariableName",
",",
"type... | Returns the value set for the environment variable identified by the given name as the given {@link Class} type.
Returns the {@code defaultValue} if the named environment variable is not set.
@param <T> {@link Class} type to convert the environment variable value to.
@param environmentVariableName {@link String} name ... | [
"Returns",
"the",
"value",
"set",
"for",
"the",
"environment",
"variable",
"identified",
"by",
"the",
"given",
"name",
"as",
"the",
"given",
"{",
"@link",
"Class",
"}",
"type",
".",
"Returns",
"the",
"{",
"@code",
"defaultValue",
"}",
"if",
"the",
"named",... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/util/Environment.java#L263-L265 |
nostra13/Android-Universal-Image-Loader | library/src/main/java/com/nostra13/universalimageloader/core/ImageLoader.java | ImageLoader.displayImage | public void displayImage(String uri, ImageView imageView, DisplayImageOptions options,
ImageLoadingListener listener) {
"""
Adds display image task to execution pool. Image will be set to ImageView when it's turn.<br />
<b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this meth... | java | public void displayImage(String uri, ImageView imageView, DisplayImageOptions options,
ImageLoadingListener listener) {
displayImage(uri, imageView, options, listener, null);
} | [
"public",
"void",
"displayImage",
"(",
"String",
"uri",
",",
"ImageView",
"imageView",
",",
"DisplayImageOptions",
"options",
",",
"ImageLoadingListener",
"listener",
")",
"{",
"displayImage",
"(",
"uri",
",",
"imageView",
",",
"options",
",",
"listener",
",",
"... | Adds display image task to execution pool. Image will be set to ImageView when it's turn.<br />
<b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call
@param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png")
@param imageView {@link ImageV... | [
"Adds",
"display",
"image",
"task",
"to",
"execution",
"pool",
".",
"Image",
"will",
"be",
"set",
"to",
"ImageView",
"when",
"it",
"s",
"turn",
".",
"<br",
"/",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"{",
"@link",
"#init",
"(",
"ImageLoad... | train | https://github.com/nostra13/Android-Universal-Image-Loader/blob/fc3c5f6779bb4f702e233653b61bd9d559e345cc/library/src/main/java/com/nostra13/universalimageloader/core/ImageLoader.java#L383-L386 |
soi-toolkit/soi-toolkit-mule | commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/monitor/MonitorEndpointHelper.java | MonitorEndpointHelper.pingJmsBackoutQueue | public static String pingJmsBackoutQueue(MuleContext muleContext, String queueName) {
"""
Verify access to a JMS backout queue by browsing the backout queue and ensure that no messages exists.
@param queueName
@return
"""
return pingJmsBackoutQueue(muleContext, DEFAULT_MULE_JMS_CONNECTOR, queueName);
} | java | public static String pingJmsBackoutQueue(MuleContext muleContext, String queueName) {
return pingJmsBackoutQueue(muleContext, DEFAULT_MULE_JMS_CONNECTOR, queueName);
} | [
"public",
"static",
"String",
"pingJmsBackoutQueue",
"(",
"MuleContext",
"muleContext",
",",
"String",
"queueName",
")",
"{",
"return",
"pingJmsBackoutQueue",
"(",
"muleContext",
",",
"DEFAULT_MULE_JMS_CONNECTOR",
",",
"queueName",
")",
";",
"}"
] | Verify access to a JMS backout queue by browsing the backout queue and ensure that no messages exists.
@param queueName
@return | [
"Verify",
"access",
"to",
"a",
"JMS",
"backout",
"queue",
"by",
"browsing",
"the",
"backout",
"queue",
"and",
"ensure",
"that",
"no",
"messages",
"exists",
"."
] | train | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/monitor/MonitorEndpointHelper.java#L142-L144 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.convertPixelToNorm | public static Point2D_F64 convertPixelToNorm( DMatrixRMaj K , Point2D_F64 pixel , Point2D_F64 norm ) {
"""
<p>
Convenient function for converting from original image pixel coordinate to normalized< image coordinates.
If speed is a concern then {@link PinholePtoN_F64} should be used instead.
</p>
NOTE: norm a... | java | public static Point2D_F64 convertPixelToNorm( DMatrixRMaj K , Point2D_F64 pixel , Point2D_F64 norm ) {
return ImplPerspectiveOps_F64.convertPixelToNorm(K, pixel, norm);
} | [
"public",
"static",
"Point2D_F64",
"convertPixelToNorm",
"(",
"DMatrixRMaj",
"K",
",",
"Point2D_F64",
"pixel",
",",
"Point2D_F64",
"norm",
")",
"{",
"return",
"ImplPerspectiveOps_F64",
".",
"convertPixelToNorm",
"(",
"K",
",",
"pixel",
",",
"norm",
")",
";",
"}"... | <p>
Convenient function for converting from original image pixel coordinate to normalized< image coordinates.
If speed is a concern then {@link PinholePtoN_F64} should be used instead.
</p>
NOTE: norm and pixel can be the same instance.
@param K Intrinsic camera calibration matrix
@param pixel Pixel coordinate.
@para... | [
"<p",
">",
"Convenient",
"function",
"for",
"converting",
"from",
"original",
"image",
"pixel",
"coordinate",
"to",
"normalized<",
"image",
"coordinates",
".",
"If",
"speed",
"is",
"a",
"concern",
"then",
"{",
"@link",
"PinholePtoN_F64",
"}",
"should",
"be",
"... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L479-L481 |
lucee/Lucee | core/src/main/java/lucee/transformer/library/function/FunctionLibFactory.java | FunctionLibFactory.loadFromSystem | public static FunctionLib[] loadFromSystem(Identification id) throws FunctionLibException {
"""
Laedt die Systeminterne FLD.
@param saxParser Definition des Sax Parser mit dem die FunctionLib eingelsesen werden soll.
@return FunctionLib
@throws FunctionLibException
"""
if (systemFLDs[CFMLEngine.DIALECT_C... | java | public static FunctionLib[] loadFromSystem(Identification id) throws FunctionLibException {
if (systemFLDs[CFMLEngine.DIALECT_CFML] == null) {
FunctionLib cfml = new FunctionLibFactory(null, FLD_BASE, id, true).getLib();
FunctionLib lucee = cfml.duplicate(false);
systemFLDs[CFMLEngine.DIALECT_CFML] = ne... | [
"public",
"static",
"FunctionLib",
"[",
"]",
"loadFromSystem",
"(",
"Identification",
"id",
")",
"throws",
"FunctionLibException",
"{",
"if",
"(",
"systemFLDs",
"[",
"CFMLEngine",
".",
"DIALECT_CFML",
"]",
"==",
"null",
")",
"{",
"FunctionLib",
"cfml",
"=",
"n... | Laedt die Systeminterne FLD.
@param saxParser Definition des Sax Parser mit dem die FunctionLib eingelsesen werden soll.
@return FunctionLib
@throws FunctionLibException | [
"Laedt",
"die",
"Systeminterne",
"FLD",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/function/FunctionLibFactory.java#L410-L418 |
EXIficient/exificient-core | src/main/java/com/siemens/ct/exi/core/values/DateTimeValue.java | DateTimeValue.parse | public static DateTimeValue parse(Calendar cal, DateTimeType type) {
"""
Encode Date-Time as a sequence of values representing the individual
components of the Date-Time.
@param cal
calendar
@param type
date-time type
@return date-time value
"""
int sYear = 0;
int sMonthDay = 0;
int sTime = 0;
... | java | public static DateTimeValue parse(Calendar cal, DateTimeType type) {
int sYear = 0;
int sMonthDay = 0;
int sTime = 0;
int sFractionalSecs = 0;
boolean sPresenceTimezone = false;
int sTimezone;
switch (type) {
case gYear: // gYear Year, [Time-Zone]
case gYearMonth: // gYearMonth Year, MonthDay, [Time... | [
"public",
"static",
"DateTimeValue",
"parse",
"(",
"Calendar",
"cal",
",",
"DateTimeType",
"type",
")",
"{",
"int",
"sYear",
"=",
"0",
";",
"int",
"sMonthDay",
"=",
"0",
";",
"int",
"sTime",
"=",
"0",
";",
"int",
"sFractionalSecs",
"=",
"0",
";",
"bool... | Encode Date-Time as a sequence of values representing the individual
components of the Date-Time.
@param cal
calendar
@param type
date-time type
@return date-time value | [
"Encode",
"Date",
"-",
"Time",
"as",
"a",
"sequence",
"of",
"values",
"representing",
"the",
"individual",
"components",
"of",
"the",
"Date",
"-",
"Time",
"."
] | train | https://github.com/EXIficient/exificient-core/blob/b6026c5fd39e9cc3d7874caa20f084e264e0ddc7/src/main/java/com/siemens/ct/exi/core/values/DateTimeValue.java#L365-L406 |
flow/commons | src/main/java/com/flowpowered/commons/typechecker/TypeChecker.java | TypeChecker.tMap | public static <K, V> TypeChecker<Map<? extends K, ? extends V>> tMap(TypeChecker<? extends K> keyChecker, Class<? extends V> valueType) {
"""
Creates a recursing type checker for a {@link java.util.Map}.
@param keyChecker The typechecker to check the keys with
@param valueType The typechecker to check the valu... | java | public static <K, V> TypeChecker<Map<? extends K, ? extends V>> tMap(TypeChecker<? extends K> keyChecker, Class<? extends V> valueType) {
return tMap(keyChecker, tSimple(valueType));
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"TypeChecker",
"<",
"Map",
"<",
"?",
"extends",
"K",
",",
"?",
"extends",
"V",
">",
">",
"tMap",
"(",
"TypeChecker",
"<",
"?",
"extends",
"K",
">",
"keyChecker",
",",
"Class",
"<",
"?",
"extends",
"V",
... | Creates a recursing type checker for a {@link java.util.Map}.
@param keyChecker The typechecker to check the keys with
@param valueType The typechecker to check the values with
@return a typechecker for a Map containing keys passing the specified type checker and values of the specified type | [
"Creates",
"a",
"recursing",
"type",
"checker",
"for",
"a",
"{",
"@link",
"java",
".",
"util",
".",
"Map",
"}",
"."
] | train | https://github.com/flow/commons/blob/0690efdac06fd728fcd7e9cf10f2b1319379c45b/src/main/java/com/flowpowered/commons/typechecker/TypeChecker.java#L216-L218 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.rotateLocalZ | public Matrix4d rotateLocalZ(double ang, Matrix4d dest) {
"""
Pre-multiply a rotation around the Z axis to this matrix by rotating the given amount of radians
about the Z axis and store the result in <code>dest</code>.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vect... | java | public Matrix4d rotateLocalZ(double ang, Matrix4d dest) {
double sin = Math.sin(ang);
double cos = Math.cosFromSin(sin, ang);
double nm00 = cos * m00 - sin * m01;
double nm01 = sin * m00 + cos * m01;
double nm10 = cos * m10 - sin * m11;
double nm11 = sin * m10 + cos * m11... | [
"public",
"Matrix4d",
"rotateLocalZ",
"(",
"double",
"ang",
",",
"Matrix4d",
"dest",
")",
"{",
"double",
"sin",
"=",
"Math",
".",
"sin",
"(",
"ang",
")",
";",
"double",
"cos",
"=",
"Math",
".",
"cosFromSin",
"(",
"sin",
",",
"ang",
")",
";",
"double"... | Pre-multiply a rotation around the Z axis to this matrix by rotating the given amount of radians
about the Z axis and store the result in <code>dest</code>.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter-clockwise around the rotation axis, when viewing along the ... | [
"Pre",
"-",
"multiply",
"a",
"rotation",
"around",
"the",
"Z",
"axis",
"to",
"this",
"matrix",
"by",
"rotating",
"the",
"given",
"amount",
"of",
"radians",
"about",
"the",
"Z",
"axis",
"and",
"store",
"the",
"result",
"in",
"<code",
">",
"dest<",
"/",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L5926-L5955 |
lucmoreau/ProvToolbox | prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java | ProvFactory.newEntry | public Entry newEntry(Key key, QualifiedName entity) {
"""
Factory method for Key-entity entries. Key-entity entries are used to identify the members of a dictionary.
@param key indexing the entity in the dictionary
@param entity a {@link QualifiedName} denoting an entity
@return an instance of {@link Entry}
... | java | public Entry newEntry(Key key, QualifiedName entity) {
Entry res = of.createEntry();
res.setKey(key);
res.setEntity(entity);
return res;
} | [
"public",
"Entry",
"newEntry",
"(",
"Key",
"key",
",",
"QualifiedName",
"entity",
")",
"{",
"Entry",
"res",
"=",
"of",
".",
"createEntry",
"(",
")",
";",
"res",
".",
"setKey",
"(",
"key",
")",
";",
"res",
".",
"setEntity",
"(",
"entity",
")",
";",
... | Factory method for Key-entity entries. Key-entity entries are used to identify the members of a dictionary.
@param key indexing the entity in the dictionary
@param entity a {@link QualifiedName} denoting an entity
@return an instance of {@link Entry} | [
"Factory",
"method",
"for",
"Key",
"-",
"entity",
"entries",
".",
"Key",
"-",
"entity",
"entries",
"are",
"used",
"to",
"identify",
"the",
"members",
"of",
"a",
"dictionary",
"."
] | train | https://github.com/lucmoreau/ProvToolbox/blob/f865952868ffb69432937b08728c86bebbe4678a/prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java#L661-L666 |
datasift/datasift-java | src/main/java/com/datasift/client/FutureData.java | FutureData.sync | public T sync() {
"""
/*
Forces the client to wait until a response is received before returning
@return a result instance - if an interrupt exception is thrown it is possible that a response isn't available
yet the user must check to ensure null isn't returned
"""
//if data is present there's no ... | java | public T sync() {
//if data is present there's no need to block
if (data != null) {
return data;
}
synchronized (this) {
try {
// wait();
block.take();
} catch (InterruptedException e) {
if (interruptCaus... | [
"public",
"T",
"sync",
"(",
")",
"{",
"//if data is present there's no need to block",
"if",
"(",
"data",
"!=",
"null",
")",
"{",
"return",
"data",
";",
"}",
"synchronized",
"(",
"this",
")",
"{",
"try",
"{",
"// wait();",
"block",
".",
"take",
"(",
")",
... | /*
Forces the client to wait until a response is received before returning
@return a result instance - if an interrupt exception is thrown it is possible that a response isn't available
yet the user must check to ensure null isn't returned | [
"/",
"*",
"Forces",
"the",
"client",
"to",
"wait",
"until",
"a",
"response",
"is",
"received",
"before",
"returning"
] | train | https://github.com/datasift/datasift-java/blob/09de124f2a1a507ff6181e59875c6f325290850e/src/main/java/com/datasift/client/FutureData.java#L89-L112 |
nmorel/gwt-jackson | gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/JsonSerializationContext.java | JsonSerializationContext.addObjectId | public void addObjectId( Object object, ObjectIdSerializer<?> id ) {
"""
<p>addObjectId</p>
@param object a {@link java.lang.Object} object.
@param id a {@link com.github.nmorel.gwtjackson.client.ser.bean.ObjectIdSerializer} object.
"""
if ( null == mapObjectId ) {
if ( useEqualityForOb... | java | public void addObjectId( Object object, ObjectIdSerializer<?> id ) {
if ( null == mapObjectId ) {
if ( useEqualityForObjectId ) {
mapObjectId = new HashMap<Object, ObjectIdSerializer<?>>();
} else {
mapObjectId = new IdentityHashMap<Object, ObjectIdSeriali... | [
"public",
"void",
"addObjectId",
"(",
"Object",
"object",
",",
"ObjectIdSerializer",
"<",
"?",
">",
"id",
")",
"{",
"if",
"(",
"null",
"==",
"mapObjectId",
")",
"{",
"if",
"(",
"useEqualityForObjectId",
")",
"{",
"mapObjectId",
"=",
"new",
"HashMap",
"<",
... | <p>addObjectId</p>
@param object a {@link java.lang.Object} object.
@param id a {@link com.github.nmorel.gwtjackson.client.ser.bean.ObjectIdSerializer} object. | [
"<p",
">",
"addObjectId<",
"/",
"p",
">"
] | train | https://github.com/nmorel/gwt-jackson/blob/3fdc4350a27a9b64fc437d5fe516bf9191b74824/gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/JsonSerializationContext.java#L574-L583 |
jbundle/jbundle | app/program/project/src/main/java/org/jbundle/app/program/project/report/ProjectReportScreen.java | ProjectReportScreen.getNextGridRecord | public Record getNextGridRecord(boolean bFirstTime) throws DBException {
"""
Get the next grid record.
@param bFirstTime If true, I want the first record.
@return the next record (or null if EOF).
"""
Record record = this.getMainRecord();
Record recNew = null;
if (bFirstTime)
... | java | public Record getNextGridRecord(boolean bFirstTime) throws DBException
{
Record record = this.getMainRecord();
Record recNew = null;
if (bFirstTime)
{
String mainString = this.getScreenRecord().getField(ProjectTaskScreenRecord.PROJECT_TASK_ID).toString();
recN... | [
"public",
"Record",
"getNextGridRecord",
"(",
"boolean",
"bFirstTime",
")",
"throws",
"DBException",
"{",
"Record",
"record",
"=",
"this",
".",
"getMainRecord",
"(",
")",
";",
"Record",
"recNew",
"=",
"null",
";",
"if",
"(",
"bFirstTime",
")",
"{",
"String",... | Get the next grid record.
@param bFirstTime If true, I want the first record.
@return the next record (or null if EOF). | [
"Get",
"the",
"next",
"grid",
"record",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/app/program/project/src/main/java/org/jbundle/app/program/project/report/ProjectReportScreen.java#L122-L155 |
tminglei/form-binder-java | src/main/java/com/github/tminglei/bind/Mappings.java | Mappings.bigInt | public static Mapping<BigInteger> bigInt(Constraint... constraints) {
"""
(convert to BigInteger) mapping
@param constraints constraints
@return new created mapping
"""
return new FieldMapping(
InputMode.SINGLE,
mkSimpleConverter(s ->
isEmptyStr(s) ... | java | public static Mapping<BigInteger> bigInt(Constraint... constraints) {
return new FieldMapping(
InputMode.SINGLE,
mkSimpleConverter(s ->
isEmptyStr(s) ? BigInteger.ZERO : new BigInteger(s)
), new MappingMeta(MAPPING_BIG_INTEGER, BigInteger.class... | [
"public",
"static",
"Mapping",
"<",
"BigInteger",
">",
"bigInt",
"(",
"Constraint",
"...",
"constraints",
")",
"{",
"return",
"new",
"FieldMapping",
"(",
"InputMode",
".",
"SINGLE",
",",
"mkSimpleConverter",
"(",
"s",
"->",
"isEmptyStr",
"(",
"s",
")",
"?",
... | (convert to BigInteger) mapping
@param constraints constraints
@return new created mapping | [
"(",
"convert",
"to",
"BigInteger",
")",
"mapping"
] | train | https://github.com/tminglei/form-binder-java/blob/4c0bd1e8f81ae56b21142bb525ee6b4deb7f92ab/src/main/java/com/github/tminglei/bind/Mappings.java#L137-L145 |
RestComm/jdiameter | core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/helpers/IPConverter.java | IPConverter.InetAddressByIPv4 | public static InetAddress InetAddressByIPv4(String address) {
"""
Convert defined string to IPv4 object instance
@param address string representation of ip address
@return IPv4 object instance
"""
StringTokenizer addressTokens = new StringTokenizer(address, ".");
byte[] bytes;
if (addressToken... | java | public static InetAddress InetAddressByIPv4(String address) {
StringTokenizer addressTokens = new StringTokenizer(address, ".");
byte[] bytes;
if (addressTokens.countTokens() == 4) {
bytes = new byte[]{
getByBytes(addressTokens),
getByBytes(addressTokens),
getByByt... | [
"public",
"static",
"InetAddress",
"InetAddressByIPv4",
"(",
"String",
"address",
")",
"{",
"StringTokenizer",
"addressTokens",
"=",
"new",
"StringTokenizer",
"(",
"address",
",",
"\".\"",
")",
";",
"byte",
"[",
"]",
"bytes",
";",
"if",
"(",
"addressTokens",
"... | Convert defined string to IPv4 object instance
@param address string representation of ip address
@return IPv4 object instance | [
"Convert",
"defined",
"string",
"to",
"IPv4",
"object",
"instance"
] | train | https://github.com/RestComm/jdiameter/blob/672134c378ea9704bf06dbe1985872ad4ebf4640/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/helpers/IPConverter.java#L63-L83 |
adminfaces/admin-persistence | src/main/java/com/github/adminfaces/persistence/service/CrudService.java | CrudService.exampleLike | public Criteria exampleLike(T example, SingularAttribute<T, String>... usingAttributes) {
"""
A 'criteria by example' will be created using an example entity. ONLY <code>String</code> attributes will be considered.
It will use 'likeIgnoreCase' for comparing STRING attributes of the example entity.
@param examp... | java | public Criteria exampleLike(T example, SingularAttribute<T, String>... usingAttributes) {
return exampleLike(criteria(), example, usingAttributes);
} | [
"public",
"Criteria",
"exampleLike",
"(",
"T",
"example",
",",
"SingularAttribute",
"<",
"T",
",",
"String",
">",
"...",
"usingAttributes",
")",
"{",
"return",
"exampleLike",
"(",
"criteria",
"(",
")",
",",
"example",
",",
"usingAttributes",
")",
";",
"}"
] | A 'criteria by example' will be created using an example entity. ONLY <code>String</code> attributes will be considered.
It will use 'likeIgnoreCase' for comparing STRING attributes of the example entity.
@param example An entity whose attribute's value will be used for creating a criteria
@param usingAttribut... | [
"A",
"criteria",
"by",
"example",
"will",
"be",
"created",
"using",
"an",
"example",
"entity",
".",
"ONLY",
"<code",
">",
"String<",
"/",
"code",
">",
"attributes",
"will",
"be",
"considered",
".",
"It",
"will",
"use",
"likeIgnoreCase",
"for",
"comparing",
... | train | https://github.com/adminfaces/admin-persistence/blob/fe065eed73781d01f14a4eb11910acc6a4150b9e/src/main/java/com/github/adminfaces/persistence/service/CrudService.java#L314-L316 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/FDBigInteger.java | FDBigInteger.mult | private static void mult(int[] s1, int s1Len, int[] s2, int s2Len, int[] dst) {
"""
/*@
@ requires s1 != dst && s2 != dst;
@ requires s1.length >= s1Len && s2.length >= s2Len && dst.length >= s1Len + s2Len;
@ assignable dst[0 .. s1Len + s2Len - 1];
@ ensures AP(dst, s1Len + s2Len) == \old(AP(s1, s1Len) * AP(s2... | java | private static void mult(int[] s1, int s1Len, int[] s2, int s2Len, int[] dst) {
for (int i = 0; i < s1Len; i++) {
long v = s1[i] & LONG_MASK;
long p = 0L;
for (int j = 0; j < s2Len; j++) {
p += (dst[i + j] & LONG_MASK) + v * (s2[j] & LONG_MASK);
... | [
"private",
"static",
"void",
"mult",
"(",
"int",
"[",
"]",
"s1",
",",
"int",
"s1Len",
",",
"int",
"[",
"]",
"s2",
",",
"int",
"s2Len",
",",
"int",
"[",
"]",
"dst",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"s1Len",
";",
"i"... | /*@
@ requires s1 != dst && s2 != dst;
@ requires s1.length >= s1Len && s2.length >= s2Len && dst.length >= s1Len + s2Len;
@ assignable dst[0 .. s1Len + s2Len - 1];
@ ensures AP(dst, s1Len + s2Len) == \old(AP(s1, s1Len) * AP(s2, s2Len));
@ | [
"/",
"*"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/FDBigInteger.java#L745-L756 |
maddingo/sojo | src/main/java/net/sf/sojo/core/ConversionIterator.java | ConversionIterator.fireBeforeConvertRecursion | private ConversionContext fireBeforeConvertRecursion(int pvNumberOfIteration, Object pvKey, Object pvValue) {
"""
Create a new ConversionContext and fire "before convert recursion" event.
@param pvNumberOfIteration Counter for the number of recursion.
@param pvKey The key can be the key by the <code>Map</code>... | java | private ConversionContext fireBeforeConvertRecursion(int pvNumberOfIteration, Object pvKey, Object pvValue) {
ConversionContext lvContext = new ConversionContext(pvNumberOfIteration, pvKey, pvValue);
getConverterInterceptorHandler().fireBeforeConvertRecursion(lvContext);
return lvContext;
} | [
"private",
"ConversionContext",
"fireBeforeConvertRecursion",
"(",
"int",
"pvNumberOfIteration",
",",
"Object",
"pvKey",
",",
"Object",
"pvValue",
")",
"{",
"ConversionContext",
"lvContext",
"=",
"new",
"ConversionContext",
"(",
"pvNumberOfIteration",
",",
"pvKey",
",",... | Create a new ConversionContext and fire "before convert recursion" event.
@param pvNumberOfIteration Counter for the number of recursion.
@param pvKey The key can be the key by the <code>Map</code> or the property name by a JavaBean.
@param pvValue The value is the map-value or the value in a list or the property-valu... | [
"Create",
"a",
"new",
"ConversionContext",
"and",
"fire",
"before",
"convert",
"recursion",
"event",
"."
] | train | https://github.com/maddingo/sojo/blob/99e9e0a146b502deb7f507fe0623227402ed675b/src/main/java/net/sf/sojo/core/ConversionIterator.java#L146-L150 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.