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 |
|---|---|---|---|---|---|---|---|---|---|---|
ysc/word | src/main/java/org/apdplat/word/analysis/ManhattanDistanceTextSimilarity.java | ManhattanDistanceTextSimilarity.scoreImpl | @Override
protected double scoreImpl(List<Word> words1, List<Word> words2) {
"""
判定相似度的方式:曼哈顿距离
曼哈顿距离原理:
设A(x1, y1),B(x2, y2)是平面上任意两点
两点间的距离dist(A,B)=|x1-x2|+|y1-y2|
@param words1 词列表1
@param words2 词列表2
@return 相似度分值
"""
//用词频来标注词的权重
taggingWeightWithWordFrequency(words1, words2);
... | java | @Override
protected double scoreImpl(List<Word> words1, List<Word> words2) {
//用词频来标注词的权重
taggingWeightWithWordFrequency(words1, words2);
//构造权重快速搜索容器
Map<String, Float> weights1 = toFastSearchMap(words1);
Map<String, Float> weights2 = toFastSearchMap(words2);
//所有的不重... | [
"@",
"Override",
"protected",
"double",
"scoreImpl",
"(",
"List",
"<",
"Word",
">",
"words1",
",",
"List",
"<",
"Word",
">",
"words2",
")",
"{",
"//用词频来标注词的权重",
"taggingWeightWithWordFrequency",
"(",
"words1",
",",
"words2",
")",
";",
"//构造权重快速搜索容器",
"Map",
... | 判定相似度的方式:曼哈顿距离
曼哈顿距离原理:
设A(x1, y1),B(x2, y2)是平面上任意两点
两点间的距离dist(A,B)=|x1-x2|+|y1-y2|
@param words1 词列表1
@param words2 词列表2
@return 相似度分值 | [
"判定相似度的方式:曼哈顿距离",
"曼哈顿距离原理:",
"设A",
"(",
"x1",
"y1",
")",
",B",
"(",
"x2",
"y2",
")",
"是平面上任意两点",
"两点间的距离dist",
"(",
"A",
"B",
")",
"=",
"|x1",
"-",
"x2|",
"+",
"|y1",
"-",
"y2|"
] | train | https://github.com/ysc/word/blob/5e45607f4e97207f55d1e3bc561abda6b34f7c54/src/main/java/org/apdplat/word/analysis/ManhattanDistanceTextSimilarity.java#L50-L95 |
alipay/sofa-hessian | src/main/java/com/caucho/hessian/io/HessianOutput.java | HessianOutput.writeByteBufferPart | public void writeByteBufferPart(byte[] buffer, int offset, int length)
throws IOException {
"""
Writes a byte buffer to the stream.
<code><pre>
b b16 b18 bytes
</pre></code>
"""
while (length > 0) {
int sublen = length;
if (0x8000 < sublen)
sublen =... | java | public void writeByteBufferPart(byte[] buffer, int offset, int length)
throws IOException
{
while (length > 0) {
int sublen = length;
if (0x8000 < sublen)
sublen = 0x8000;
os.write('b');
os.write(sublen >> 8);
os.write(sub... | [
"public",
"void",
"writeByteBufferPart",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"while",
"(",
"length",
">",
"0",
")",
"{",
"int",
"sublen",
"=",
"length",
";",
"if",
"(",
"0x8000... | Writes a byte buffer to the stream.
<code><pre>
b b16 b18 bytes
</pre></code> | [
"Writes",
"a",
"byte",
"buffer",
"to",
"the",
"stream",
"."
] | train | https://github.com/alipay/sofa-hessian/blob/89e4f5af28602101dab7b498995018871616357b/src/main/java/com/caucho/hessian/io/HessianOutput.java#L730-L748 |
alipay/sofa-rpc | core/api/src/main/java/com/alipay/sofa/rpc/message/MessageBuilder.java | MessageBuilder.buildSofaRequest | @Deprecated
public static SofaRequest buildSofaRequest(Class<?> clazz, String method, Class[] argTypes, Object[] args) {
"""
构建请求,常用于代理类拦截
@param clazz 接口类
@param method 方法名
@param argTypes 方法参数类型
@param args 方法参数值
@return 远程调用请求
@deprecated use {@link #buildSofaRequest(Class, Method, Class[],... | java | @Deprecated
public static SofaRequest buildSofaRequest(Class<?> clazz, String method, Class[] argTypes, Object[] args) {
SofaRequest request = new SofaRequest();
request.setInterfaceName(clazz.getName());
request.setMethodName(method);
request.setMethodArgs(args == null ? CodecUtils.... | [
"@",
"Deprecated",
"public",
"static",
"SofaRequest",
"buildSofaRequest",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"method",
",",
"Class",
"[",
"]",
"argTypes",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"SofaRequest",
"request",
"=",
"new",
... | 构建请求,常用于代理类拦截
@param clazz 接口类
@param method 方法名
@param argTypes 方法参数类型
@param args 方法参数值
@return 远程调用请求
@deprecated use {@link #buildSofaRequest(Class, Method, Class[], Object[])} | [
"构建请求,常用于代理类拦截"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/message/MessageBuilder.java#L43-L51 |
stripe/stripe-java | src/main/java/com/stripe/model/SubscriptionItem.java | SubscriptionItem.usageRecordSummaries | public UsageRecordSummaryCollection usageRecordSummaries(
Map<String, Object> params, RequestOptions options) throws StripeException {
"""
For the specified subscription item, returns a list of summary objects. Each object in the list
provides usage information that’s been summarized from multiple usage rec... | java | public UsageRecordSummaryCollection usageRecordSummaries(
Map<String, Object> params, RequestOptions options) throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format(
"/v1/subscription_items/%s/usage_record_sum... | [
"public",
"UsageRecordSummaryCollection",
"usageRecordSummaries",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
",",
"RequestOptions",
"options",
")",
"throws",
"StripeException",
"{",
"String",
"url",
"=",
"String",
".",
"format",
"(",
"\"%s%s\"",
",",... | For the specified subscription item, returns a list of summary objects. Each object in the list
provides usage information that’s been summarized from multiple usage records and over a
subscription billing period (e.g., 15 usage records in the billing plan’s month of September).
<p>The list is sorted in reverse-chrono... | [
"For",
"the",
"specified",
"subscription",
"item",
"returns",
"a",
"list",
"of",
"summary",
"objects",
".",
"Each",
"object",
"in",
"the",
"list",
"provides",
"usage",
"information",
"that’s",
"been",
"summarized",
"from",
"multiple",
"usage",
"records",
"and",
... | train | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/SubscriptionItem.java#L297-L307 |
opencypher/openCypher | tools/grammar/src/main/java/org/opencypher/tools/TypedArgument.java | TypedArgument.typed | public static TypedArgument typed( Class<?> type, Object value ) {
"""
Factory method.
@param type the type of the parameter.
@param value the value of the argument.
@return a new instance.
"""
type = Objects.requireNonNull( type, "type" );
if ( value != null && !type.isInstance( value ) ... | java | public static TypedArgument typed( Class<?> type, Object value )
{
type = Objects.requireNonNull( type, "type" );
if ( value != null && !type.isInstance( value ) )
{
throw new IllegalArgumentException(
value + " (a " + value.getClass().getName() + ") is not an... | [
"public",
"static",
"TypedArgument",
"typed",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Object",
"value",
")",
"{",
"type",
"=",
"Objects",
".",
"requireNonNull",
"(",
"type",
",",
"\"type\"",
")",
";",
"if",
"(",
"value",
"!=",
"null",
"&&",
"!",
"... | Factory method.
@param type the type of the parameter.
@param value the value of the argument.
@return a new instance. | [
"Factory",
"method",
"."
] | train | https://github.com/opencypher/openCypher/blob/eb780caea625900ddbedd28a1eac9a5dbe09c5f0/tools/grammar/src/main/java/org/opencypher/tools/TypedArgument.java#L46-L55 |
jhy/jsoup | src/main/java/org/jsoup/nodes/Attributes.java | Attributes.put | public Attributes put(String key, String value) {
"""
Set a new attribute, or replace an existing one by key.
@param key case sensitive attribute key
@param value attribute value
@return these attributes, for chaining
"""
int i = indexOfKey(key);
if (i != NotFound)
vals[i] = valu... | java | public Attributes put(String key, String value) {
int i = indexOfKey(key);
if (i != NotFound)
vals[i] = value;
else
add(key, value);
return this;
} | [
"public",
"Attributes",
"put",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"int",
"i",
"=",
"indexOfKey",
"(",
"key",
")",
";",
"if",
"(",
"i",
"!=",
"NotFound",
")",
"vals",
"[",
"i",
"]",
"=",
"value",
";",
"else",
"add",
"(",
"key"... | Set a new attribute, or replace an existing one by key.
@param key case sensitive attribute key
@param value attribute value
@return these attributes, for chaining | [
"Set",
"a",
"new",
"attribute",
"or",
"replace",
"an",
"existing",
"one",
"by",
"key",
"."
] | train | https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/nodes/Attributes.java#L128-L135 |
google/closure-compiler | src/com/google/javascript/jscomp/DefaultPassConfig.java | DefaultPassConfig.combineChecks | private static HotSwapCompilerPass combineChecks(AbstractCompiler compiler,
List<Callback> callbacks) {
"""
Executes the given callbacks with a {@link CombinedCompilerPass}.
"""
checkArgument(!callbacks.isEmpty());
return new CombinedCompilerPass(compiler, callbacks);
} | java | private static HotSwapCompilerPass combineChecks(AbstractCompiler compiler,
List<Callback> callbacks) {
checkArgument(!callbacks.isEmpty());
return new CombinedCompilerPass(compiler, callbacks);
} | [
"private",
"static",
"HotSwapCompilerPass",
"combineChecks",
"(",
"AbstractCompiler",
"compiler",
",",
"List",
"<",
"Callback",
">",
"callbacks",
")",
"{",
"checkArgument",
"(",
"!",
"callbacks",
".",
"isEmpty",
"(",
")",
")",
";",
"return",
"new",
"CombinedComp... | Executes the given callbacks with a {@link CombinedCompilerPass}. | [
"Executes",
"the",
"given",
"callbacks",
"with",
"a",
"{"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/DefaultPassConfig.java#L2088-L2092 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/RecommendationsInner.java | RecommendationsInner.listHistoryForWebAppWithServiceResponseAsync | public Observable<ServiceResponse<Page<RecommendationInner>>> listHistoryForWebAppWithServiceResponseAsync(final String resourceGroupName, final String siteName, final String filter) {
"""
Get past recommendations for an app, optionally specified by the time range.
Get past recommendations for an app, optionally ... | java | public Observable<ServiceResponse<Page<RecommendationInner>>> listHistoryForWebAppWithServiceResponseAsync(final String resourceGroupName, final String siteName, final String filter) {
return listHistoryForWebAppSinglePageAsync(resourceGroupName, siteName, filter)
.concatMap(new Func1<ServiceRespons... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"RecommendationInner",
">",
">",
">",
"listHistoryForWebAppWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"siteName",
",",
"final",
"String",
"filter",
"... | Get past recommendations for an app, optionally specified by the time range.
Get past recommendations for an app, optionally specified by the time range.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Name of the app.
@param filter Filter is specified by using OData ... | [
"Get",
"past",
"recommendations",
"for",
"an",
"app",
"optionally",
"specified",
"by",
"the",
"time",
"range",
".",
"Get",
"past",
"recommendations",
"for",
"an",
"app",
"optionally",
"specified",
"by",
"the",
"time",
"range",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/RecommendationsInner.java#L694-L706 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Filtering.java | Filtering.takeLast | public static <E> Iterator<E> takeLast(int howMany, E[] from) {
"""
Creates an iterator yielding last n elements from the source array.
Consuming the resulting iterator yields an IllegalArgumentException if
not enough elements can be fetched. E.g:
<code>takeLast(2, [1, 2, 3]) -> [2, 3]</code>
@param <E> the ... | java | public static <E> Iterator<E> takeLast(int howMany, E[] from) {
return takeLast(howMany, new ArrayIterator<E>(from));
} | [
"public",
"static",
"<",
"E",
">",
"Iterator",
"<",
"E",
">",
"takeLast",
"(",
"int",
"howMany",
",",
"E",
"[",
"]",
"from",
")",
"{",
"return",
"takeLast",
"(",
"howMany",
",",
"new",
"ArrayIterator",
"<",
"E",
">",
"(",
"from",
")",
")",
";",
"... | Creates an iterator yielding last n elements from the source array.
Consuming the resulting iterator yields an IllegalArgumentException if
not enough elements can be fetched. E.g:
<code>takeLast(2, [1, 2, 3]) -> [2, 3]</code>
@param <E> the array element type
@param howMany number of elements to be yielded
@param from... | [
"Creates",
"an",
"iterator",
"yielding",
"last",
"n",
"elements",
"from",
"the",
"source",
"array",
".",
"Consuming",
"the",
"resulting",
"iterator",
"yields",
"an",
"IllegalArgumentException",
"if",
"not",
"enough",
"elements",
"can",
"be",
"fetched",
".",
"E",... | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Filtering.java#L113-L115 |
jenkinsci/jenkins | core/src/main/java/hudson/search/Search.java | Search.getSuggestions | public SearchResult getSuggestions(StaplerRequest req, String query) {
"""
Gets the list of suggestions that match the given query.
@return
can be empty but never null. The size of the list is always smaller than
a certain threshold to avoid showing too many options.
"""
Set<String> paths = new Ha... | java | public SearchResult getSuggestions(StaplerRequest req, String query) {
Set<String> paths = new HashSet<>(); // paths already added, to control duplicates
SearchResultImpl r = new SearchResultImpl();
int max = req.hasParameter("max") ? Integer.parseInt(req.getParameter("max")) : 100;
Sea... | [
"public",
"SearchResult",
"getSuggestions",
"(",
"StaplerRequest",
"req",
",",
"String",
"query",
")",
"{",
"Set",
"<",
"String",
">",
"paths",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"// paths already added, to control duplicates",
"SearchResultImpl",
"r",
"=... | Gets the list of suggestions that match the given query.
@return
can be empty but never null. The size of the list is always smaller than
a certain threshold to avoid showing too many options. | [
"Gets",
"the",
"list",
"of",
"suggestions",
"that",
"match",
"the",
"given",
"query",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/search/Search.java#L144-L158 |
codescape/bitvunit | bitvunit-core/src/main/java/de/codescape/bitvunit/BitvUnit.java | BitvUnit.assertAccessibility | public static void assertAccessibility(InputStream inputStream, Testable testable) {
"""
JUnit Assertion to verify a {@link java.io.InputStream} instance for accessibility.
@param inputStream {@link java.io.InputStream} instance
@param testable rule(s) to apply
"""
assertThat(inputStream, is(com... | java | public static void assertAccessibility(InputStream inputStream, Testable testable) {
assertThat(inputStream, is(compliantTo(testable)));
} | [
"public",
"static",
"void",
"assertAccessibility",
"(",
"InputStream",
"inputStream",
",",
"Testable",
"testable",
")",
"{",
"assertThat",
"(",
"inputStream",
",",
"is",
"(",
"compliantTo",
"(",
"testable",
")",
")",
")",
";",
"}"
] | JUnit Assertion to verify a {@link java.io.InputStream} instance for accessibility.
@param inputStream {@link java.io.InputStream} instance
@param testable rule(s) to apply | [
"JUnit",
"Assertion",
"to",
"verify",
"a",
"{",
"@link",
"java",
".",
"io",
".",
"InputStream",
"}",
"instance",
"for",
"accessibility",
"."
] | train | https://github.com/codescape/bitvunit/blob/cef6d9af60d684e41294981c10b6d92c8f063a4e/bitvunit-core/src/main/java/de/codescape/bitvunit/BitvUnit.java#L78-L80 |
alkacon/opencms-core | src/org/opencms/util/CmsStringUtil.java | CmsStringUtil.changeFileNameSuffixTo | public static String changeFileNameSuffixTo(String filename, String suffix) {
"""
Changes the given filenames suffix from the current suffix to the provided suffix.
<b>Directly exposed for JSP EL</b>, not through {@link org.opencms.jsp.util.CmsJspElFunctions}.<p>
@param filename the filename to be changed
@... | java | public static String changeFileNameSuffixTo(String filename, String suffix) {
int dotPos = filename.lastIndexOf('.');
if (dotPos != -1) {
return filename.substring(0, dotPos + 1) + suffix;
} else {
// the string has no suffix
return filename;
}
} | [
"public",
"static",
"String",
"changeFileNameSuffixTo",
"(",
"String",
"filename",
",",
"String",
"suffix",
")",
"{",
"int",
"dotPos",
"=",
"filename",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"dotPos",
"!=",
"-",
"1",
")",
"{",
"return",
... | Changes the given filenames suffix from the current suffix to the provided suffix.
<b>Directly exposed for JSP EL</b>, not through {@link org.opencms.jsp.util.CmsJspElFunctions}.<p>
@param filename the filename to be changed
@param suffix the new suffix of the file
@return the filename with the replaced suffix | [
"Changes",
"the",
"given",
"filenames",
"suffix",
"from",
"the",
"current",
"suffix",
"to",
"the",
"provided",
"suffix",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsStringUtil.java#L249-L258 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/config/Config.java | Config.setMapEventJournalConfigs | public Config setMapEventJournalConfigs(Map<String, EventJournalConfig> eventJournalConfigs) {
"""
Sets the map of map event journal configurations, mapped by config name.
The config name may be a pattern with which the configuration will be
obtained in the future.
@param eventJournalConfigs the map event jou... | java | public Config setMapEventJournalConfigs(Map<String, EventJournalConfig> eventJournalConfigs) {
this.mapEventJournalConfigs.clear();
this.mapEventJournalConfigs.putAll(eventJournalConfigs);
for (Entry<String, EventJournalConfig> entry : eventJournalConfigs.entrySet()) {
entry.getValue... | [
"public",
"Config",
"setMapEventJournalConfigs",
"(",
"Map",
"<",
"String",
",",
"EventJournalConfig",
">",
"eventJournalConfigs",
")",
"{",
"this",
".",
"mapEventJournalConfigs",
".",
"clear",
"(",
")",
";",
"this",
".",
"mapEventJournalConfigs",
".",
"putAll",
"... | Sets the map of map event journal configurations, mapped by config name.
The config name may be a pattern with which the configuration will be
obtained in the future.
@param eventJournalConfigs the map event journal configuration map to set
@return this config instance | [
"Sets",
"the",
"map",
"of",
"map",
"event",
"journal",
"configurations",
"mapped",
"by",
"config",
"name",
".",
"The",
"config",
"name",
"may",
"be",
"a",
"pattern",
"with",
"which",
"the",
"configuration",
"will",
"be",
"obtained",
"in",
"the",
"future",
... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/Config.java#L3122-L3129 |
actframework/actframework | src/main/java/act/util/ReflectedInvokerHelper.java | ReflectedInvokerHelper.tryGetSingleton | public static Object tryGetSingleton(Class<?> invokerClass, App app) {
"""
If the `invokerClass` specified is singleton, or without field or all fields are
stateless, then return an instance of the invoker class. Otherwise, return null
@param invokerClass the invoker class
@param app the app
@return an instanc... | java | public static Object tryGetSingleton(Class<?> invokerClass, App app) {
Object singleton = app.singleton(invokerClass);
if (null == singleton) {
if (isGlobalOrStateless(invokerClass, new HashSet<Class>())) {
singleton = app.getInstance(invokerClass);
}
}
... | [
"public",
"static",
"Object",
"tryGetSingleton",
"(",
"Class",
"<",
"?",
">",
"invokerClass",
",",
"App",
"app",
")",
"{",
"Object",
"singleton",
"=",
"app",
".",
"singleton",
"(",
"invokerClass",
")",
";",
"if",
"(",
"null",
"==",
"singleton",
")",
"{",... | If the `invokerClass` specified is singleton, or without field or all fields are
stateless, then return an instance of the invoker class. Otherwise, return null
@param invokerClass the invoker class
@param app the app
@return an instance of the invokerClass or `null` if invoker class is stateful class | [
"If",
"the",
"invokerClass",
"specified",
"is",
"singleton",
"or",
"without",
"field",
"or",
"all",
"fields",
"are",
"stateless",
"then",
"return",
"an",
"instance",
"of",
"the",
"invoker",
"class",
".",
"Otherwise",
"return",
"null"
] | train | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/util/ReflectedInvokerHelper.java#L56-L67 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsADECache.java | CmsADECache.setCacheGroupContainer | public void setCacheGroupContainer(String key, CmsXmlGroupContainer groupContainer, boolean online) {
"""
Caches the given group container under the given key and for the given project.<p>
@param key the cache key
@param groupContainer the object to cache
@param online if to cache in online or offline project... | java | public void setCacheGroupContainer(String key, CmsXmlGroupContainer groupContainer, boolean online) {
try {
m_lock.writeLock().lock();
if (online) {
m_groupContainersOnline.put(key, groupContainer);
if (LOG.isDebugEnabled()) {
LOG.debu... | [
"public",
"void",
"setCacheGroupContainer",
"(",
"String",
"key",
",",
"CmsXmlGroupContainer",
"groupContainer",
",",
"boolean",
"online",
")",
"{",
"try",
"{",
"m_lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"if",
"(",
"online",
")",
"{"... | Caches the given group container under the given key and for the given project.<p>
@param key the cache key
@param groupContainer the object to cache
@param online if to cache in online or offline project | [
"Caches",
"the",
"given",
"group",
"container",
"under",
"the",
"given",
"key",
"and",
"for",
"the",
"given",
"project",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsADECache.java#L284-L308 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucState.java | SecStrucState.setTurn | public void setTurn(char c, int t) {
"""
Set the turn column corresponding to 3,4 or 5 helix patterns. If starting
> or ending < was set and the opposite is being set, the value will be
converted to X. If a number was set, it will be overwritten by the new
character.
@param c
character in the column
@param... | java | public void setTurn(char c, int t) {
if (turn[t - 3] == 'X')
return;
else if (turn[t - 3] == '<' && c == '>' || turn[t - 3] == '>'
&& c == '<') {
turn[t - 3] = 'X';
} else if (turn[t - 3] == '<' || turn[t - 3] == '>')
return;
else
turn[t - 3] = c;
} | [
"public",
"void",
"setTurn",
"(",
"char",
"c",
",",
"int",
"t",
")",
"{",
"if",
"(",
"turn",
"[",
"t",
"-",
"3",
"]",
"==",
"'",
"'",
")",
"return",
";",
"else",
"if",
"(",
"turn",
"[",
"t",
"-",
"3",
"]",
"==",
"'",
"'",
"&&",
"c",
"==",... | Set the turn column corresponding to 3,4 or 5 helix patterns. If starting
> or ending < was set and the opposite is being set, the value will be
converted to X. If a number was set, it will be overwritten by the new
character.
@param c
character in the column
@param t
turn of the helix {3,4,5} | [
"Set",
"the",
"turn",
"column",
"corresponding",
"to",
"3",
"4",
"or",
"5",
"helix",
"patterns",
".",
"If",
"starting",
">",
"or",
"ending",
"<",
"was",
"set",
"and",
"the",
"opposite",
"is",
"being",
"set",
"the",
"value",
"will",
"be",
"converted",
"... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucState.java#L117-L127 |
netty/netty | codec/src/main/java/io/netty/handler/codec/ByteToMessageDecoder.java | ByteToMessageDecoder.channelInputClosed | void channelInputClosed(ChannelHandlerContext ctx, List<Object> out) throws Exception {
"""
Called when the input of the channel was closed which may be because it changed to inactive or because of
{@link ChannelInputShutdownEvent}.
"""
if (cumulation != null) {
callDecode(ctx, cumulation,... | java | void channelInputClosed(ChannelHandlerContext ctx, List<Object> out) throws Exception {
if (cumulation != null) {
callDecode(ctx, cumulation, out);
decodeLast(ctx, cumulation, out);
} else {
decodeLast(ctx, Unpooled.EMPTY_BUFFER, out);
}
} | [
"void",
"channelInputClosed",
"(",
"ChannelHandlerContext",
"ctx",
",",
"List",
"<",
"Object",
">",
"out",
")",
"throws",
"Exception",
"{",
"if",
"(",
"cumulation",
"!=",
"null",
")",
"{",
"callDecode",
"(",
"ctx",
",",
"cumulation",
",",
"out",
")",
";",
... | Called when the input of the channel was closed which may be because it changed to inactive or because of
{@link ChannelInputShutdownEvent}. | [
"Called",
"when",
"the",
"input",
"of",
"the",
"channel",
"was",
"closed",
"which",
"may",
"be",
"because",
"it",
"changed",
"to",
"inactive",
"or",
"because",
"of",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/ByteToMessageDecoder.java#L403-L410 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/workspace/VoiceApi.java | VoiceApi.sendUserEvent | public void sendUserEvent(KeyValueCollection userData, String callUuid) throws WorkspaceApiException {
"""
Send EventUserEvent to T-Server with the provided attached data. For details about EventUserEvent, refer to the
[*Genesys Events and Models Reference Manual*](https://docs.genesys.com/Documentation/System/Cu... | java | public void sendUserEvent(KeyValueCollection userData, String callUuid) throws WorkspaceApiException {
this.sendUserEvent(userData, callUuid, null);
} | [
"public",
"void",
"sendUserEvent",
"(",
"KeyValueCollection",
"userData",
",",
"String",
"callUuid",
")",
"throws",
"WorkspaceApiException",
"{",
"this",
".",
"sendUserEvent",
"(",
"userData",
",",
"callUuid",
",",
"null",
")",
";",
"}"
] | Send EventUserEvent to T-Server with the provided attached data. For details about EventUserEvent, refer to the
[*Genesys Events and Models Reference Manual*](https://docs.genesys.com/Documentation/System/Current/GenEM/SpecialEvents).
@param userData The data to send. This is an array of objects with the properties key... | [
"Send",
"EventUserEvent",
"to",
"T",
"-",
"Server",
"with",
"the",
"provided",
"attached",
"data",
".",
"For",
"details",
"about",
"EventUserEvent",
"refer",
"to",
"the",
"[",
"*",
"Genesys",
"Events",
"and",
"Models",
"Reference",
"Manual",
"*",
"]",
"(",
... | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/VoiceApi.java#L1171-L1173 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/OjbMemberTagsHandler.java | OjbMemberTagsHandler.addMembersInclSupertypes | private void addMembersInclSupertypes(Collection memberNames, HashMap members, XClass type, String tagName, String paramName, String paramValue) throws XDocletException {
"""
Retrieves the members of the type and of its super types.
@param memberNames Will receive the names of the members (for sorting)
... | java | private void addMembersInclSupertypes(Collection memberNames, HashMap members, XClass type, String tagName, String paramName, String paramValue) throws XDocletException
{
addMembers(memberNames, members, type, tagName, paramName, paramValue);
if (type.getInterfaces() != null) {
for (... | [
"private",
"void",
"addMembersInclSupertypes",
"(",
"Collection",
"memberNames",
",",
"HashMap",
"members",
",",
"XClass",
"type",
",",
"String",
"tagName",
",",
"String",
"paramName",
",",
"String",
"paramValue",
")",
"throws",
"XDocletException",
"{",
"addMembers"... | Retrieves the members of the type and of its super types.
@param memberNames Will receive the names of the members (for sorting)
@param members Will receive the members
@param type The type to process
@param tagName An optional tag for filtering the types
@param paramName ... | [
"Retrieves",
"the",
"members",
"of",
"the",
"type",
"and",
"of",
"its",
"super",
"types",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/OjbMemberTagsHandler.java#L477-L488 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/PathService.java | PathService.toUri | public URI toUri(URI fileSystemUri, JimfsPath path) {
"""
Returns the URI for the given path. The given file system URI is the base against which the
path is resolved to create the returned URI.
"""
checkArgument(path.isAbsolute(), "path (%s) must be absolute", path);
String root = String.valueOf(path... | java | public URI toUri(URI fileSystemUri, JimfsPath path) {
checkArgument(path.isAbsolute(), "path (%s) must be absolute", path);
String root = String.valueOf(path.root());
Iterable<String> names = Iterables.transform(path.names(), Functions.toStringFunction());
return type.toUri(fileSystemUri, root, names, F... | [
"public",
"URI",
"toUri",
"(",
"URI",
"fileSystemUri",
",",
"JimfsPath",
"path",
")",
"{",
"checkArgument",
"(",
"path",
".",
"isAbsolute",
"(",
")",
",",
"\"path (%s) must be absolute\"",
",",
"path",
")",
";",
"String",
"root",
"=",
"String",
".",
"valueOf... | Returns the URI for the given path. The given file system URI is the base against which the
path is resolved to create the returned URI. | [
"Returns",
"the",
"URI",
"for",
"the",
"given",
"path",
".",
"The",
"given",
"file",
"system",
"URI",
"is",
"the",
"base",
"against",
"which",
"the",
"path",
"is",
"resolved",
"to",
"create",
"the",
"returned",
"URI",
"."
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/PathService.java#L236-L241 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/MessageRouterImpl.java | MessageRouterImpl.removeMsgFromLogHandler | protected void removeMsgFromLogHandler(String msgId, String handlerId) {
"""
Remove the specified log handler from the message ID's routing list.
"""
Set<String> logHandlerIdSet = getOrCreateLogHandlerIdSet(msgId);
logHandlerIdSet.remove(handlerId);
} | java | protected void removeMsgFromLogHandler(String msgId, String handlerId) {
Set<String> logHandlerIdSet = getOrCreateLogHandlerIdSet(msgId);
logHandlerIdSet.remove(handlerId);
} | [
"protected",
"void",
"removeMsgFromLogHandler",
"(",
"String",
"msgId",
",",
"String",
"handlerId",
")",
"{",
"Set",
"<",
"String",
">",
"logHandlerIdSet",
"=",
"getOrCreateLogHandlerIdSet",
"(",
"msgId",
")",
";",
"logHandlerIdSet",
".",
"remove",
"(",
"handlerId... | Remove the specified log handler from the message ID's routing list. | [
"Remove",
"the",
"specified",
"log",
"handler",
"from",
"the",
"message",
"ID",
"s",
"routing",
"list",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/MessageRouterImpl.java#L178-L181 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/lang/ServiceLoaderHelper.java | ServiceLoaderHelper.getFirstSPIImplementation | @Nullable
public static <T> T getFirstSPIImplementation (@Nonnull final Class <T> aSPIClass, @Nullable final Logger aLogger) {
"""
Uses the {@link ServiceLoader} to load all SPI implementations of the
passed class and return only the first instance.
@param <T>
The implementation type to be loaded
@param aS... | java | @Nullable
public static <T> T getFirstSPIImplementation (@Nonnull final Class <T> aSPIClass, @Nullable final Logger aLogger)
{
return getFirstSPIImplementation (aSPIClass, ClassLoaderHelper.getDefaultClassLoader (), aLogger);
} | [
"@",
"Nullable",
"public",
"static",
"<",
"T",
">",
"T",
"getFirstSPIImplementation",
"(",
"@",
"Nonnull",
"final",
"Class",
"<",
"T",
">",
"aSPIClass",
",",
"@",
"Nullable",
"final",
"Logger",
"aLogger",
")",
"{",
"return",
"getFirstSPIImplementation",
"(",
... | Uses the {@link ServiceLoader} to load all SPI implementations of the
passed class and return only the first instance.
@param <T>
The implementation type to be loaded
@param aSPIClass
The SPI interface class. May not be <code>null</code>.
@param aLogger
An optional logger to use. May be <code>null</code>.
@return A co... | [
"Uses",
"the",
"{",
"@link",
"ServiceLoader",
"}",
"to",
"load",
"all",
"SPI",
"implementations",
"of",
"the",
"passed",
"class",
"and",
"return",
"only",
"the",
"first",
"instance",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/lang/ServiceLoaderHelper.java#L225-L229 |
eclipse/hawkbit | hawkbit-security-core/src/main/java/org/eclipse/hawkbit/util/IpUtil.java | IpUtil.createUri | public static URI createUri(final String scheme, final String host) {
"""
Create a {@link URI} with scheme and host.
@param scheme
the scheme
@param host
the host
@return the {@link URI}
@throws IllegalArgumentException
If the given string not parsable
"""
final boolean isIpV6 = host.indexOf('... | java | public static URI createUri(final String scheme, final String host) {
final boolean isIpV6 = host.indexOf(':') >= 0 && host.charAt(0) != '[';
if (isIpV6) {
return URI.create(scheme + SCHEME_SEPERATOR + "[" + host + "]");
}
return URI.create(scheme + SCHEME_SEPERATOR + host);
... | [
"public",
"static",
"URI",
"createUri",
"(",
"final",
"String",
"scheme",
",",
"final",
"String",
"host",
")",
"{",
"final",
"boolean",
"isIpV6",
"=",
"host",
".",
"indexOf",
"(",
"'",
"'",
")",
">=",
"0",
"&&",
"host",
".",
"charAt",
"(",
"0",
")",
... | Create a {@link URI} with scheme and host.
@param scheme
the scheme
@param host
the host
@return the {@link URI}
@throws IllegalArgumentException
If the given string not parsable | [
"Create",
"a",
"{",
"@link",
"URI",
"}",
"with",
"scheme",
"and",
"host",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/util/IpUtil.java#L127-L133 |
groovy/groovy-core | src/main/groovy/ui/GroovyMain.java | GroovyMain.getText | public String getText(String uriOrFilename) throws IOException {
"""
Get the text of the Groovy script at the given location.
If the location is a file path and it does not exist as given,
then {@link GroovyMain#huntForTheScriptFile(String)} is called to try
with some Groovy extensions appended.
This method ... | java | public String getText(String uriOrFilename) throws IOException {
if (uriPattern.matcher(uriOrFilename).matches()) {
try {
return ResourceGroovyMethods.getText(new URL(uriOrFilename));
} catch (Exception e) {
throw new GroovyRuntimeException("Unable to get ... | [
"public",
"String",
"getText",
"(",
"String",
"uriOrFilename",
")",
"throws",
"IOException",
"{",
"if",
"(",
"uriPattern",
".",
"matcher",
"(",
"uriOrFilename",
")",
".",
"matches",
"(",
")",
")",
"{",
"try",
"{",
"return",
"ResourceGroovyMethods",
".",
"get... | Get the text of the Groovy script at the given location.
If the location is a file path and it does not exist as given,
then {@link GroovyMain#huntForTheScriptFile(String)} is called to try
with some Groovy extensions appended.
This method is not used to process scripts and is retained for backward
compatibility. If ... | [
"Get",
"the",
"text",
"of",
"the",
"Groovy",
"script",
"at",
"the",
"given",
"location",
".",
"If",
"the",
"location",
"is",
"a",
"file",
"path",
"and",
"it",
"does",
"not",
"exist",
"as",
"given",
"then",
"{",
"@link",
"GroovyMain#huntForTheScriptFile",
"... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/groovy/ui/GroovyMain.java#L427-L436 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.newPostOpenGraphObjectRequest | public static Request newPostOpenGraphObjectRequest(Session session, String type, String title, String imageUrl,
String url, String description, GraphObject objectProperties, Callback callback) {
"""
Creates a new Request configured to create a user owned Open Graph object.
@param session
the Sessi... | java | public static Request newPostOpenGraphObjectRequest(Session session, String type, String title, String imageUrl,
String url, String description, GraphObject objectProperties, Callback callback) {
OpenGraphObject openGraphObject = OpenGraphObject.Factory.createForPost(OpenGraphObject.class, type, tit... | [
"public",
"static",
"Request",
"newPostOpenGraphObjectRequest",
"(",
"Session",
"session",
",",
"String",
"type",
",",
"String",
"title",
",",
"String",
"imageUrl",
",",
"String",
"url",
",",
"String",
"description",
",",
"GraphObject",
"objectProperties",
",",
"C... | Creates a new Request configured to create a user owned Open Graph object.
@param session
the Session to use, or null; if non-null, the session must be in an opened state
@param type
the fully-specified Open Graph object type (e.g., my_app_namespace:my_object_name); must not be null
@param title
the title of the Open ... | [
"Creates",
"a",
"new",
"Request",
"configured",
"to",
"create",
"a",
"user",
"owned",
"Open",
"Graph",
"object",
"."
] | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L720-L729 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/ContextManager.java | ContextManager.setContextPool | public void setContextPool(boolean enableContextPool, Integer initPoolSize, Integer prefPoolSize, Integer maxPoolSize, Long poolTimeOut,
Long poolWaitTime) throws InvalidInitPropertyException {
"""
Set the context pool configuration.<p/>
The context pool parameters are not require... | java | public void setContextPool(boolean enableContextPool, Integer initPoolSize, Integer prefPoolSize, Integer maxPoolSize, Long poolTimeOut,
Long poolWaitTime) throws InvalidInitPropertyException {
final String METHODNAME = "setContextPool";
this.iContextPoolEnabled = enable... | [
"public",
"void",
"setContextPool",
"(",
"boolean",
"enableContextPool",
",",
"Integer",
"initPoolSize",
",",
"Integer",
"prefPoolSize",
",",
"Integer",
"maxPoolSize",
",",
"Long",
"poolTimeOut",
",",
"Long",
"poolWaitTime",
")",
"throws",
"InvalidInitPropertyException"... | Set the context pool configuration.<p/>
The context pool parameters are not required when <code>enableContextPool == false</code>. If <code>enableContextPool == true</code> and any of the context pool parameters
are null, that parameter will be set to the default value.
@param enableContextPool Whether the context po... | [
"Set",
"the",
"context",
"pool",
"configuration",
".",
"<p",
"/",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/ContextManager.java#L1397-L1426 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/utilities/PHPMethods.java | PHPMethods.preg_replace | public static String preg_replace(String regex, String replacement, String subject) {
"""
Matches a string with a regex and replaces the matched components with
a provided string.
@param regex
@param replacement
@param subject
@return
"""
Pattern p = Pattern.compile(regex);
return preg_r... | java | public static String preg_replace(String regex, String replacement, String subject) {
Pattern p = Pattern.compile(regex);
return preg_replace(p, replacement, subject);
} | [
"public",
"static",
"String",
"preg_replace",
"(",
"String",
"regex",
",",
"String",
"replacement",
",",
"String",
"subject",
")",
"{",
"Pattern",
"p",
"=",
"Pattern",
".",
"compile",
"(",
"regex",
")",
";",
"return",
"preg_replace",
"(",
"p",
",",
"replac... | Matches a string with a regex and replaces the matched components with
a provided string.
@param regex
@param replacement
@param subject
@return | [
"Matches",
"a",
"string",
"with",
"a",
"regex",
"and",
"replaces",
"the",
"matched",
"components",
"with",
"a",
"provided",
"string",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/utilities/PHPMethods.java#L106-L109 |
headius/invokebinder | src/main/java/com/headius/invokebinder/Binder.java | Binder.filterForward | public Binder filterForward(int index, MethodHandle... functions) {
"""
Filter incoming arguments, from the given index, replacing each with the
result of calling the associated function in the given list. This version
guarantees left-to-right evaluation of filter functions, potentially at
the cost of a more co... | java | public Binder filterForward(int index, MethodHandle... functions) {
Binder filtered = this;
for (int i = 0; i < functions.length; i++) {
filtered = filtered.filter(index + i, functions[i]);
}
return filtered;
} | [
"public",
"Binder",
"filterForward",
"(",
"int",
"index",
",",
"MethodHandle",
"...",
"functions",
")",
"{",
"Binder",
"filtered",
"=",
"this",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"functions",
".",
"length",
";",
"i",
"++",
")",
"{"... | Filter incoming arguments, from the given index, replacing each with the
result of calling the associated function in the given list. This version
guarantees left-to-right evaluation of filter functions, potentially at
the cost of a more complex handle tree.
@param index the index of the first argument to filter
@... | [
"Filter",
"incoming",
"arguments",
"from",
"the",
"given",
"index",
"replacing",
"each",
"with",
"the",
"result",
"of",
"calling",
"the",
"associated",
"function",
"in",
"the",
"given",
"list",
".",
"This",
"version",
"guarantees",
"left",
"-",
"to",
"-",
"r... | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1021-L1029 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/Util.java | Util.compareAllowNull | public static int compareAllowNull(final Comparable c1, final Comparable c2) {
"""
Compares two comparable objects where either may be null. Null is regarded as the smallest value, and 2 nulls are
considered equal.
@param c1 the first comparable
@param c2 the second comparable
@return a negative integer, z... | java | public static int compareAllowNull(final Comparable c1, final Comparable c2) {
if (c1 == null && c2 == null) {
return 0;
} else if (c1 == null) {
return -1;
} else if (c2 == null) {
return 1;
} else {
return c1.compareTo(c2);
}
} | [
"public",
"static",
"int",
"compareAllowNull",
"(",
"final",
"Comparable",
"c1",
",",
"final",
"Comparable",
"c2",
")",
"{",
"if",
"(",
"c1",
"==",
"null",
"&&",
"c2",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"else",
"if",
"(",
"c1",
"==",
... | Compares two comparable objects where either may be null. Null is regarded as the smallest value, and 2 nulls are
considered equal.
@param c1 the first comparable
@param c2 the second comparable
@return a negative integer, zero, or a positive integer if c1 is less than, equal to, or greater than the c2. | [
"Compares",
"two",
"comparable",
"objects",
"where",
"either",
"may",
"be",
"null",
".",
"Null",
"is",
"regarded",
"as",
"the",
"smallest",
"value",
"and",
"2",
"nulls",
"are",
"considered",
"equal",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/Util.java#L66-L76 |
pressgang-ccms/PressGangCCMSContentSpecProcessor | src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecProcessor.java | ContentSpecProcessor.processContentSpec | public boolean processContentSpec(final ContentSpec contentSpec, final String username, final ContentSpecParser.ParsingMode mode) {
"""
Process a content specification so that it is parsed, validated and saved.
@param contentSpec The Content Specification that is to be processed.
@param username The user wh... | java | public boolean processContentSpec(final ContentSpec contentSpec, final String username, final ContentSpecParser.ParsingMode mode) {
return processContentSpec(contentSpec, username, mode, null);
} | [
"public",
"boolean",
"processContentSpec",
"(",
"final",
"ContentSpec",
"contentSpec",
",",
"final",
"String",
"username",
",",
"final",
"ContentSpecParser",
".",
"ParsingMode",
"mode",
")",
"{",
"return",
"processContentSpec",
"(",
"contentSpec",
",",
"username",
"... | Process a content specification so that it is parsed, validated and saved.
@param contentSpec The Content Specification that is to be processed.
@param username The user who requested the process operation.
@param mode The mode to parse the content specification in.
@return True if everything was processed s... | [
"Process",
"a",
"content",
"specification",
"so",
"that",
"it",
"is",
"parsed",
"validated",
"and",
"saved",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecProcessor.java#L149-L151 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/FrameworkBeanFactory.java | FrameworkBeanFactory.registerBeanDefinition | @Override
public void registerBeanDefinition(String beanName, BeanDefinition beanDefinition) throws BeanDefinitionStoreException {
"""
Intercepts the call set the override behavior of the bean factory prior to registering the
bean. The override behavior is set to the cwf:override setting of the bean definitio... | java | @Override
public void registerBeanDefinition(String beanName, BeanDefinition beanDefinition) throws BeanDefinitionStoreException {
boolean canOverride = defaultOverriding;
BeanDefinition oldBeanDefinition = containsBeanDefinition(beanName) ? getBeanDefinition(beanName) : null;
String overrid... | [
"@",
"Override",
"public",
"void",
"registerBeanDefinition",
"(",
"String",
"beanName",
",",
"BeanDefinition",
"beanDefinition",
")",
"throws",
"BeanDefinitionStoreException",
"{",
"boolean",
"canOverride",
"=",
"defaultOverriding",
";",
"BeanDefinition",
"oldBeanDefinition... | Intercepts the call set the override behavior of the bean factory prior to registering the
bean. The override behavior is set to the cwf:override setting of the bean definition or, in
the absence of this setting, to the default override behavior for the bean factory and by the
cwf:final setting which can be used to pre... | [
"Intercepts",
"the",
"call",
"set",
"the",
"override",
"behavior",
"of",
"the",
"bean",
"factory",
"prior",
"to",
"registering",
"the",
"bean",
".",
"The",
"override",
"behavior",
"is",
"set",
"to",
"the",
"cwf",
":",
"override",
"setting",
"of",
"the",
"b... | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/FrameworkBeanFactory.java#L143-L174 |
matthewhorridge/mdock | src/main/java/org/coode/mdock/SplitterNode.java | SplitterNode.addChild | protected void addChild(Node child, int index, double split) {
"""
Adds a child of this node.
@param child The child node to be added
@param index The position of the child node.
@param split The amount/weighting of parent node that the child node should
receive
"""
children.add(index, child);
... | java | protected void addChild(Node child, int index, double split) {
children.add(index, child);
nodeSplits.put(child, split);
child.setParent(this);
} | [
"protected",
"void",
"addChild",
"(",
"Node",
"child",
",",
"int",
"index",
",",
"double",
"split",
")",
"{",
"children",
".",
"add",
"(",
"index",
",",
"child",
")",
";",
"nodeSplits",
".",
"put",
"(",
"child",
",",
"split",
")",
";",
"child",
".",
... | Adds a child of this node.
@param child The child node to be added
@param index The position of the child node.
@param split The amount/weighting of parent node that the child node should
receive | [
"Adds",
"a",
"child",
"of",
"this",
"node",
"."
] | train | https://github.com/matthewhorridge/mdock/blob/37839a56f30bdb73d56d82c4d1afe548d66b404b/src/main/java/org/coode/mdock/SplitterNode.java#L217-L221 |
arquillian/arquillian-core | config/impl-base/src/main/java/org/jboss/arquillian/config/impl/extension/PropertiesPropertyResolver.java | PropertiesPropertyResolver.resolveCompositeKey | private String resolveCompositeKey(String key, Properties props) {
"""
Try to resolve a "key" from the provided properties by
checking if it is actually a "key1,key2", in which case
try first "key1", then "key2". If all fails, return null.
<p>
It also accepts "key1," and ",key2".
@param key
the key to reso... | java | private String resolveCompositeKey(String key, Properties props) {
String value = null;
// Look for the comma
int comma = key.indexOf(',');
if (comma > -1) {
// If we have a first part, try resolve it
if (comma > 0) {
// Check the first part
... | [
"private",
"String",
"resolveCompositeKey",
"(",
"String",
"key",
",",
"Properties",
"props",
")",
"{",
"String",
"value",
"=",
"null",
";",
"// Look for the comma",
"int",
"comma",
"=",
"key",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"comma",
... | Try to resolve a "key" from the provided properties by
checking if it is actually a "key1,key2", in which case
try first "key1", then "key2". If all fails, return null.
<p>
It also accepts "key1," and ",key2".
@param key
the key to resolve
@param props
the properties to use
@return the resolved key or null | [
"Try",
"to",
"resolve",
"a",
"key",
"from",
"the",
"provided",
"properties",
"by",
"checking",
"if",
"it",
"is",
"actually",
"a",
"key1",
"key2",
"in",
"which",
"case",
"try",
"first",
"key1",
"then",
"key2",
".",
"If",
"all",
"fails",
"return",
"null",
... | train | https://github.com/arquillian/arquillian-core/blob/a85b91789b80cc77e0f0c2e2abac65c2255c0a81/config/impl-base/src/main/java/org/jboss/arquillian/config/impl/extension/PropertiesPropertyResolver.java#L94-L122 |
apache/groovy | subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/TryWithResourcesASTTransformation.java | TryWithResourcesASTTransformation.createFinallyBlockForNewTryCatchStatement | private BlockStatement createFinallyBlockForNewTryCatchStatement(String primaryExcName, String firstResourceIdentifierName) {
"""
/*
finally {
if (Identifier != null) {
if (#primaryExc != null) {
try {
Identifier.close();
} catch (Throwable #suppressedExc) {
#primaryExc.addSuppressed(#suppressedExc);
}
} ... | java | private BlockStatement createFinallyBlockForNewTryCatchStatement(String primaryExcName, String firstResourceIdentifierName) {
BlockStatement finallyBlock = new BlockStatement();
// primaryExc != null
BooleanExpression conditionExpression =
new BooleanExpression(
... | [
"private",
"BlockStatement",
"createFinallyBlockForNewTryCatchStatement",
"(",
"String",
"primaryExcName",
",",
"String",
"firstResourceIdentifierName",
")",
"{",
"BlockStatement",
"finallyBlock",
"=",
"new",
"BlockStatement",
"(",
")",
";",
"// primaryExc != null",
"BooleanE... | /*
finally {
if (Identifier != null) {
if (#primaryExc != null) {
try {
Identifier.close();
} catch (Throwable #suppressedExc) {
#primaryExc.addSuppressed(#suppressedExc);
}
} else {
Identifier.close();
}
}
}
We can simplify the above code to a Groovy version as follows:
finally {
if (#primaryExc != null)
try {
Ident... | [
"/",
"*",
"finally",
"{",
"if",
"(",
"Identifier",
"!",
"=",
"null",
")",
"{",
"if",
"(",
"#primaryExc",
"!",
"=",
"null",
")",
"{",
"try",
"{",
"Identifier",
".",
"close",
"()",
";",
"}",
"catch",
"(",
"Throwable",
"#suppressedExc",
")",
"{",
"#pr... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/TryWithResourcesASTTransformation.java#L299-L336 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/WorkbookUtil.java | WorkbookUtil.createBook | public static Workbook createBook(File excelFile, String password) {
"""
创建或加载工作簿,只读模式
@param excelFile Excel文件
@param password Excel工作簿密码,如果无密码传{@code null}
@return {@link Workbook}
"""
try {
return WorkbookFactory.create(excelFile, password);
} catch (Exception e) {
throw new POIException(... | java | public static Workbook createBook(File excelFile, String password) {
try {
return WorkbookFactory.create(excelFile, password);
} catch (Exception e) {
throw new POIException(e);
}
} | [
"public",
"static",
"Workbook",
"createBook",
"(",
"File",
"excelFile",
",",
"String",
"password",
")",
"{",
"try",
"{",
"return",
"WorkbookFactory",
".",
"create",
"(",
"excelFile",
",",
"password",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",... | 创建或加载工作簿,只读模式
@param excelFile Excel文件
@param password Excel工作簿密码,如果无密码传{@code null}
@return {@link Workbook} | [
"创建或加载工作簿,只读模式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/WorkbookUtil.java#L58-L64 |
j256/simplejmx | src/main/java/com/j256/simplejmx/common/ObjectNameUtil.java | ObjectNameUtil.makeObjectName | public static ObjectName makeObjectName(String objectNameString) {
"""
Constructs an object-name from a string suitable to be passed to the {@link ObjectName} constructor.
@param objectNameString
The entire object-name string in the form of something like
<tt>your.domain:folder=1,name=beanBean</tt>
@throws I... | java | public static ObjectName makeObjectName(String objectNameString) {
try {
return new ObjectName(objectNameString);
} catch (Exception e) {
throw new IllegalArgumentException("Invalid ObjectName generated: " + objectNameString, e);
}
} | [
"public",
"static",
"ObjectName",
"makeObjectName",
"(",
"String",
"objectNameString",
")",
"{",
"try",
"{",
"return",
"new",
"ObjectName",
"(",
"objectNameString",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"IllegalArgumentExceptio... | Constructs an object-name from a string suitable to be passed to the {@link ObjectName} constructor.
@param objectNameString
The entire object-name string in the form of something like
<tt>your.domain:folder=1,name=beanBean</tt>
@throws IllegalArgumentException
If we had problems building the name | [
"Constructs",
"an",
"object",
"-",
"name",
"from",
"a",
"string",
"suitable",
"to",
"be",
"passed",
"to",
"the",
"{",
"@link",
"ObjectName",
"}",
"constructor",
"."
] | train | https://github.com/j256/simplejmx/blob/1a04f52512dfa0a711ba0cc7023c604dbc82a352/src/main/java/com/j256/simplejmx/common/ObjectNameUtil.java#L131-L137 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.updateInvoice | public Invoice updateInvoice(final String invoiceId, final Invoice invoice) {
"""
Update an invoice
<p>
Updates an existing invoice.
@param invoiceId String Recurly Invoice ID
@return the updated invoice object on success, null otherwise
"""
return doPUT(Invoices.INVOICES_RESOURCE + "/" + invoice... | java | public Invoice updateInvoice(final String invoiceId, final Invoice invoice) {
return doPUT(Invoices.INVOICES_RESOURCE + "/" + invoiceId, invoice, Invoice.class);
} | [
"public",
"Invoice",
"updateInvoice",
"(",
"final",
"String",
"invoiceId",
",",
"final",
"Invoice",
"invoice",
")",
"{",
"return",
"doPUT",
"(",
"Invoices",
".",
"INVOICES_RESOURCE",
"+",
"\"/\"",
"+",
"invoiceId",
",",
"invoice",
",",
"Invoice",
".",
"class",... | Update an invoice
<p>
Updates an existing invoice.
@param invoiceId String Recurly Invoice ID
@return the updated invoice object on success, null otherwise | [
"Update",
"an",
"invoice",
"<p",
">",
"Updates",
"an",
"existing",
"invoice",
"."
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L1009-L1011 |
square/javapoet | src/main/java/com/squareup/javapoet/NameAllocator.java | NameAllocator.newName | public String newName(String suggestion, Object tag) {
"""
Return a new name using {@code suggestion} that will not be a Java identifier or clash with
other names. The returned value can be queried multiple times by passing {@code tag} to
{@link #get(Object)}.
"""
checkNotNull(suggestion, "suggestion");
... | java | public String newName(String suggestion, Object tag) {
checkNotNull(suggestion, "suggestion");
checkNotNull(tag, "tag");
suggestion = toJavaIdentifier(suggestion);
while (SourceVersion.isKeyword(suggestion) || !allocatedNames.add(suggestion)) {
suggestion = suggestion + "_";
}
String re... | [
"public",
"String",
"newName",
"(",
"String",
"suggestion",
",",
"Object",
"tag",
")",
"{",
"checkNotNull",
"(",
"suggestion",
",",
"\"suggestion\"",
")",
";",
"checkNotNull",
"(",
"tag",
",",
"\"tag\"",
")",
";",
"suggestion",
"=",
"toJavaIdentifier",
"(",
... | Return a new name using {@code suggestion} that will not be a Java identifier or clash with
other names. The returned value can be queried multiple times by passing {@code tag} to
{@link #get(Object)}. | [
"Return",
"a",
"new",
"name",
"using",
"{"
] | train | https://github.com/square/javapoet/blob/0f93da9a3d9a1da8d29fc993409fcf83d40452bc/src/main/java/com/squareup/javapoet/NameAllocator.java#L108-L126 |
nakamura5akihito/six-util | src/main/java/jp/go/aist/six/util/core/persist/castor/OQL.java | OQL._buildTextMatchBinding | private void _buildTextMatchBinding(
final TextMatchBinding binding,
final StringBuilder stmt,
final List<Object> params
) {
"""
matchAll == true:
(p LIKE w_1 AND p LIKE w_2 AND ... AND p LIKE w_m)
matchAll == false:
(p LIKE w... | java | private void _buildTextMatchBinding(
final TextMatchBinding binding,
final StringBuilder stmt,
final List<Object> params
)
{
int size = binding.getText().size();
if (size == 1) {
String pattern = _WILDCARD... | [
"private",
"void",
"_buildTextMatchBinding",
"(",
"final",
"TextMatchBinding",
"binding",
",",
"final",
"StringBuilder",
"stmt",
",",
"final",
"List",
"<",
"Object",
">",
"params",
")",
"{",
"int",
"size",
"=",
"binding",
".",
"getText",
"(",
")",
".",
"size... | matchAll == true:
(p LIKE w_1 AND p LIKE w_2 AND ... AND p LIKE w_m)
matchAll == false:
(p LIKE w_1 OR p LIKE w_2 OR ... OR p LIKE w_m) | [
"matchAll",
"==",
"true",
":",
"(",
"p",
"LIKE",
"w_1",
"AND",
"p",
"LIKE",
"w_2",
"AND",
"...",
"AND",
"p",
"LIKE",
"w_m",
")"
] | train | https://github.com/nakamura5akihito/six-util/blob/a6db388a345e220cea2b1fa6324d15c80c6278b6/src/main/java/jp/go/aist/six/util/core/persist/castor/OQL.java#L1010-L1040 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/ringsearch/AllRingsFinder.java | AllRingsFinder.findAllRings | public IRingSet findAllRings(IAtomContainer container, int maxRingSize) throws CDKException {
"""
Compute all rings up to and including the {@literal maxRingSize}. The
container is first partitioned into ring systems which are then processed
separately. If the molecule has already be partitioned, consider using
... | java | public IRingSet findAllRings(IAtomContainer container, int maxRingSize) throws CDKException {
final EdgeToBondMap edges = EdgeToBondMap.withSpaceFor(container);
final int[][] graph = GraphUtil.toAdjList(container, edges);
RingSearch rs = new RingSearch(container, graph);
IRingSet ring... | [
"public",
"IRingSet",
"findAllRings",
"(",
"IAtomContainer",
"container",
",",
"int",
"maxRingSize",
")",
"throws",
"CDKException",
"{",
"final",
"EdgeToBondMap",
"edges",
"=",
"EdgeToBondMap",
".",
"withSpaceFor",
"(",
"container",
")",
";",
"final",
"int",
"[",
... | Compute all rings up to and including the {@literal maxRingSize}. The
container is first partitioned into ring systems which are then processed
separately. If the molecule has already be partitioned, consider using
{@link #findAllRingsInIsolatedRingSystem(IAtomContainer, int)}.
@param container The AtomContainer to ... | [
"Compute",
"all",
"rings",
"up",
"to",
"and",
"including",
"the",
"{",
"@literal",
"maxRingSize",
"}",
".",
"The",
"container",
"is",
"first",
"partitioned",
"into",
"ring",
"systems",
"which",
"are",
"then",
"processed",
"separately",
".",
"If",
"the",
"mol... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/ringsearch/AllRingsFinder.java#L126-L159 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/interest/FactoryDetectPoint.java | FactoryDetectPoint.createMedian | public static <T extends ImageGray<T>, D extends ImageGray<D>>
GeneralFeatureDetector<T, D> createMedian(@Nullable ConfigGeneralDetector configDetector, Class<T> imageType) {
"""
Creates a median filter corner detector.
@param configDetector Configuration for feature detector.
@param imageType Type of i... | java | public static <T extends ImageGray<T>, D extends ImageGray<D>>
GeneralFeatureDetector<T, D> createMedian(@Nullable ConfigGeneralDetector configDetector, Class<T> imageType) {
if( configDetector == null)
configDetector = new ConfigGeneralDetector();
BlurStorageFilter<T> medianFilter = FactoryBlurFilter.median(... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
",",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"GeneralFeatureDetector",
"<",
"T",
",",
"D",
">",
"createMedian",
"(",
"@",
"Nullable",
"ConfigGeneralDetector",
"configDetector",
","... | Creates a median filter corner detector.
@param configDetector Configuration for feature detector.
@param imageType Type of input image.
@see boofcv.alg.feature.detect.intensity.MedianCornerIntensity | [
"Creates",
"a",
"median",
"filter",
"corner",
"detector",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/detect/interest/FactoryDetectPoint.java#L169-L178 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/plugins/RxJavaPlugins.java | RxJavaPlugins.createSingleScheduler | @NonNull
@GwtIncompatible
public static Scheduler createSingleScheduler(@NonNull ThreadFactory threadFactory) {
"""
Create an instance of the default {@link Scheduler} used for {@link Schedulers#single()}
except using {@code threadFactory} for thread creation.
<p>History: 2.0.5 - experimental
@param thr... | java | @NonNull
@GwtIncompatible
public static Scheduler createSingleScheduler(@NonNull ThreadFactory threadFactory) {
return new SingleScheduler(ObjectHelper.requireNonNull(threadFactory, "threadFactory is null"));
} | [
"@",
"NonNull",
"@",
"GwtIncompatible",
"public",
"static",
"Scheduler",
"createSingleScheduler",
"(",
"@",
"NonNull",
"ThreadFactory",
"threadFactory",
")",
"{",
"return",
"new",
"SingleScheduler",
"(",
"ObjectHelper",
".",
"requireNonNull",
"(",
"threadFactory",
","... | Create an instance of the default {@link Scheduler} used for {@link Schedulers#single()}
except using {@code threadFactory} for thread creation.
<p>History: 2.0.5 - experimental
@param threadFactory thread factory to use for creating worker threads. Note that this takes precedence over any
system properties for configu... | [
"Create",
"an",
"instance",
"of",
"the",
"default",
"{"
] | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/plugins/RxJavaPlugins.java#L1254-L1258 |
raydac/java-comment-preprocessor | jcp/src/main/java/com/igormaznitsa/jcp/expression/Expression.java | Expression.evalTree | @Nonnull
public static Value evalTree(@Nonnull final ExpressionTree tree, @Nonnull final PreprocessorContext context) {
"""
Evaluate an expression tree
@param tree an expression tree, it must not be null
@param context a preprocessor context to be used for expression operations
@return the result as a V... | java | @Nonnull
public static Value evalTree(@Nonnull final ExpressionTree tree, @Nonnull final PreprocessorContext context) {
final Expression exp = new Expression(context, tree);
return exp.eval(context.getPreprocessingState());
} | [
"@",
"Nonnull",
"public",
"static",
"Value",
"evalTree",
"(",
"@",
"Nonnull",
"final",
"ExpressionTree",
"tree",
",",
"@",
"Nonnull",
"final",
"PreprocessorContext",
"context",
")",
"{",
"final",
"Expression",
"exp",
"=",
"new",
"Expression",
"(",
"context",
"... | Evaluate an expression tree
@param tree an expression tree, it must not be null
@param context a preprocessor context to be used for expression operations
@return the result as a Value object, it can't be null | [
"Evaluate",
"an",
"expression",
"tree"
] | train | https://github.com/raydac/java-comment-preprocessor/blob/83ac87b575ac084914d77695a8c8673de3b8300c/jcp/src/main/java/com/igormaznitsa/jcp/expression/Expression.java#L99-L103 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java | StyleUtils.setStyle | public static boolean setStyle(PolygonOptions polygonOptions, StyleRow style, float density) {
"""
Set the style into the polygon options
@param polygonOptions polygon options
@param style style row
@param density display density: {@link android.util.DisplayMetrics#density}
@return true if st... | java | public static boolean setStyle(PolygonOptions polygonOptions, StyleRow style, float density) {
if (style != null) {
Color color = style.getColorOrDefault();
polygonOptions.strokeColor(color.getColorWithAlpha());
double width = style.getWidthOrDefault();
polygon... | [
"public",
"static",
"boolean",
"setStyle",
"(",
"PolygonOptions",
"polygonOptions",
",",
"StyleRow",
"style",
",",
"float",
"density",
")",
"{",
"if",
"(",
"style",
"!=",
"null",
")",
"{",
"Color",
"color",
"=",
"style",
".",
"getColorOrDefault",
"(",
")",
... | Set the style into the polygon options
@param polygonOptions polygon options
@param style style row
@param density display density: {@link android.util.DisplayMetrics#density}
@return true if style was set into the polygon options | [
"Set",
"the",
"style",
"into",
"the",
"polygon",
"options"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java#L603-L620 |
zaproxy/zaproxy | src/org/zaproxy/zap/view/DeselectableButtonGroup.java | DeselectableButtonGroup.setSelected | @Override
public void setSelected(ButtonModel m, boolean selected) {
"""
{@inheritDoc}
<p>
Overridden to deselect the button when {@code selected} is {@code false}.
</p>
"""
if (!selected && m == getSelection()) {
clearSelection();
} else {
super.setSelected(m, se... | java | @Override
public void setSelected(ButtonModel m, boolean selected) {
if (!selected && m == getSelection()) {
clearSelection();
} else {
super.setSelected(m, selected);
}
} | [
"@",
"Override",
"public",
"void",
"setSelected",
"(",
"ButtonModel",
"m",
",",
"boolean",
"selected",
")",
"{",
"if",
"(",
"!",
"selected",
"&&",
"m",
"==",
"getSelection",
"(",
")",
")",
"{",
"clearSelection",
"(",
")",
";",
"}",
"else",
"{",
"super"... | {@inheritDoc}
<p>
Overridden to deselect the button when {@code selected} is {@code false}.
</p> | [
"{"
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/view/DeselectableButtonGroup.java#L40-L47 |
j256/ormlite-core | src/main/java/com/j256/ormlite/stmt/mapped/MappedDeleteCollection.java | MappedDeleteCollection.deleteObjects | public static <T, ID> int deleteObjects(Dao<T, ID> dao, TableInfo<T, ID> tableInfo,
DatabaseConnection databaseConnection, Collection<T> datas, ObjectCache objectCache) throws SQLException {
"""
Delete all of the objects in the collection. This builds a {@link MappedDeleteCollection} on the fly because the
dat... | java | public static <T, ID> int deleteObjects(Dao<T, ID> dao, TableInfo<T, ID> tableInfo,
DatabaseConnection databaseConnection, Collection<T> datas, ObjectCache objectCache) throws SQLException {
MappedDeleteCollection<T, ID> deleteCollection = MappedDeleteCollection.build(dao, tableInfo, datas.size());
Object[] fiel... | [
"public",
"static",
"<",
"T",
",",
"ID",
">",
"int",
"deleteObjects",
"(",
"Dao",
"<",
"T",
",",
"ID",
">",
"dao",
",",
"TableInfo",
"<",
"T",
",",
"ID",
">",
"tableInfo",
",",
"DatabaseConnection",
"databaseConnection",
",",
"Collection",
"<",
"T",
">... | Delete all of the objects in the collection. This builds a {@link MappedDeleteCollection} on the fly because the
datas could be variable sized. | [
"Delete",
"all",
"of",
"the",
"objects",
"in",
"the",
"collection",
".",
"This",
"builds",
"a",
"{"
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/mapped/MappedDeleteCollection.java#L30-L41 |
hibernate/hibernate-ogm | infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/impl/PersistenceStrategy.java | PersistenceStrategy.getPerTableStrategy | private static PersistenceStrategy<?, ?, ?> getPerTableStrategy(
EmbeddedCacheManager externalCacheManager,
URL configUrl,
JtaPlatform platform,
Set<EntityKeyMetadata> entityTypes,
Set<AssociationKeyMetadata> associationTypes,
Set<IdSourceKeyMetadata> idSourceTypes) {
"""
Returns the "per-table" ... | java | private static PersistenceStrategy<?, ?, ?> getPerTableStrategy(
EmbeddedCacheManager externalCacheManager,
URL configUrl,
JtaPlatform platform,
Set<EntityKeyMetadata> entityTypes,
Set<AssociationKeyMetadata> associationTypes,
Set<IdSourceKeyMetadata> idSourceTypes) {
PerTableKeyProvider keyProvide... | [
"private",
"static",
"PersistenceStrategy",
"<",
"?",
",",
"?",
",",
"?",
">",
"getPerTableStrategy",
"(",
"EmbeddedCacheManager",
"externalCacheManager",
",",
"URL",
"configUrl",
",",
"JtaPlatform",
"platform",
",",
"Set",
"<",
"EntityKeyMetadata",
">",
"entityType... | Returns the "per-table" persistence strategy, i.e. one dedicated cache will be used for each
entity/association/id source table. | [
"Returns",
"the",
"per",
"-",
"table",
"persistence",
"strategy",
"i",
".",
"e",
".",
"one",
"dedicated",
"cache",
"will",
"be",
"used",
"for",
"each",
"entity",
"/",
"association",
"/",
"id",
"source",
"table",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/impl/PersistenceStrategy.java#L107-L122 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/io/CompressesRasterWriter.java | CompressesRasterWriter.compressAndWriteObj | public boolean compressAndWriteObj( RandomAccessFile theCreatedFile, RandomAccessFile theCreatedNullFile, Object dataObject )
throws RasterWritingFailureException {
"""
Passing the object after defining the type of data that will be written
@param theCreatedFile
@param theCreatedNullFile
@param da... | java | public boolean compressAndWriteObj( RandomAccessFile theCreatedFile, RandomAccessFile theCreatedNullFile, Object dataObject )
throws RasterWritingFailureException {
if (dataObject instanceof double[][]) {
compressAndWrite(theCreatedFile, theCreatedNullFile, (double[][]) dataObject);
... | [
"public",
"boolean",
"compressAndWriteObj",
"(",
"RandomAccessFile",
"theCreatedFile",
",",
"RandomAccessFile",
"theCreatedNullFile",
",",
"Object",
"dataObject",
")",
"throws",
"RasterWritingFailureException",
"{",
"if",
"(",
"dataObject",
"instanceof",
"double",
"[",
"]... | Passing the object after defining the type of data that will be written
@param theCreatedFile
@param theCreatedNullFile
@param dataObject
@return
@throws RasterWritingFailureException | [
"Passing",
"the",
"object",
"after",
"defining",
"the",
"type",
"of",
"data",
"that",
"will",
"be",
"written"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/io/CompressesRasterWriter.java#L81-L87 |
wisdom-framework/wisdom | extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/visitor/RamlControllerVisitor.java | RamlControllerVisitor.ancestorOrIHasParam | private static Boolean ancestorOrIHasParam(final Resource resource, String uriParamName) {
"""
Check if the given resource or its ancestor have the uri param of given name.
@param resource The resource on which to check.
@param uriParamName Name of the uri Param we are looking for.
@return <code>true</cod... | java | private static Boolean ancestorOrIHasParam(final Resource resource, String uriParamName) {
Resource ancestor = resource;
while (ancestor != null) {
if (ancestor.getUriParameters().containsKey(uriParamName)) {
return true;
}
ancestor = ancestor.getPare... | [
"private",
"static",
"Boolean",
"ancestorOrIHasParam",
"(",
"final",
"Resource",
"resource",
",",
"String",
"uriParamName",
")",
"{",
"Resource",
"ancestor",
"=",
"resource",
";",
"while",
"(",
"ancestor",
"!=",
"null",
")",
"{",
"if",
"(",
"ancestor",
".",
... | Check if the given resource or its ancestor have the uri param of given name.
@param resource The resource on which to check.
@param uriParamName Name of the uri Param we are looking for.
@return <code>true</code> if this or its ancestor resource have the param of given name already define. | [
"Check",
"if",
"the",
"given",
"resource",
"or",
"its",
"ancestor",
"have",
"the",
"uri",
"param",
"of",
"given",
"name",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/visitor/RamlControllerVisitor.java#L444-L455 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/datetime/PDTWebDateHelper.java | PDTWebDateHelper.getDateTimeFromW3C | @Nullable
public static OffsetDateTime getDateTimeFromW3C (@Nullable final String sDate) {
"""
Parses a Date out of a String with a date in W3C date-time format. <br>
It parsers the following formats:
<ul>
<li>"uuuu-MM-dd'T'HH:mm:ssz"</li>
<li>"uuuu-MM-dd'T'HH:mmz"</li>
<li>"uuuu-MM-dd"</li>
<li>"uuuu-MM"<... | java | @Nullable
public static OffsetDateTime getDateTimeFromW3C (@Nullable final String sDate)
{
if (StringHelper.hasNoText (sDate))
return null;
return parseOffsetDateTimeUsingMask (W3CDATETIME_MASKS, sDate.trim ());
} | [
"@",
"Nullable",
"public",
"static",
"OffsetDateTime",
"getDateTimeFromW3C",
"(",
"@",
"Nullable",
"final",
"String",
"sDate",
")",
"{",
"if",
"(",
"StringHelper",
".",
"hasNoText",
"(",
"sDate",
")",
")",
"return",
"null",
";",
"return",
"parseOffsetDateTimeUsi... | Parses a Date out of a String with a date in W3C date-time format. <br>
It parsers the following formats:
<ul>
<li>"uuuu-MM-dd'T'HH:mm:ssz"</li>
<li>"uuuu-MM-dd'T'HH:mmz"</li>
<li>"uuuu-MM-dd"</li>
<li>"uuuu-MM"</li>
<li>"uuuu"</li>
</ul>
<p>
Refer to the java.text.SimpleDateFormat javadocs for details on the format
of... | [
"Parses",
"a",
"Date",
"out",
"of",
"a",
"String",
"with",
"a",
"date",
"in",
"W3C",
"date",
"-",
"time",
"format",
".",
"<br",
">",
"It",
"parsers",
"the",
"following",
"formats",
":",
"<ul",
">",
"<li",
">",
"uuuu",
"-",
"MM",
"-",
"dd",
"T",
"... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/datetime/PDTWebDateHelper.java#L312-L319 |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/dicom/SecurityAlertEvent.java | SecurityAlertEvent.addURIParticipantObject | public void addURIParticipantObject(String failedUri, String failureDescription) {
"""
Adds a Participant Object representing the URI resource that was accessed and
generated the Security Alert
@param failedUri The URI accessed
@param failureDescription A description of why the alert was created
"""
Lis... | java | public void addURIParticipantObject(String failedUri, String failureDescription)
{
List<TypeValuePairType> failureDescriptionValue = new LinkedList<>();
if (!EventUtils.isEmptyOrNull(failureDescription)) {
failureDescriptionValue.add(getTypeValuePair("Alert Description", failureDescription.getBytes()));
}
t... | [
"public",
"void",
"addURIParticipantObject",
"(",
"String",
"failedUri",
",",
"String",
"failureDescription",
")",
"{",
"List",
"<",
"TypeValuePairType",
">",
"failureDescriptionValue",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"if",
"(",
"!",
"EventUtils",
... | Adds a Participant Object representing the URI resource that was accessed and
generated the Security Alert
@param failedUri The URI accessed
@param failureDescription A description of why the alert was created | [
"Adds",
"a",
"Participant",
"Object",
"representing",
"the",
"URI",
"resource",
"that",
"was",
"accessed",
"and",
"generated",
"the",
"Security",
"Alert"
] | train | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/dicom/SecurityAlertEvent.java#L90-L106 |
GenesysPureEngage/authentication-client-java | src/main/java/com/genesys/internal/authentication/api/AuthenticationApi.java | AuthenticationApi.tenantInfoWithHttpInfo | public ApiResponse<ModelApiResponse> tenantInfoWithHttpInfo(ApiRequestAuthSchemeLookupData lookupData) throws ApiException {
"""
Get authentication scheme.
Get the authentication scheme by user name or tenant name. The return value is 'saml' if the contact center has [Security Assertion Markup Language]... | java | public ApiResponse<ModelApiResponse> tenantInfoWithHttpInfo(ApiRequestAuthSchemeLookupData lookupData) throws ApiException {
com.squareup.okhttp.Call call = tenantInfoValidateBeforeCall(lookupData, null, null);
Type localVarReturnType = new TypeToken<ModelApiResponse>(){}.getType();
return apiCl... | [
"public",
"ApiResponse",
"<",
"ModelApiResponse",
">",
"tenantInfoWithHttpInfo",
"(",
"ApiRequestAuthSchemeLookupData",
"lookupData",
")",
"throws",
"ApiException",
"{",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"call",
"=",
"tenantInfoValidateBeforeCall",
"("... | Get authentication scheme.
Get the authentication scheme by user name or tenant name. The return value is 'saml' if the contact center has [Security Assertion Markup Language](https://en.wikipedia.org/wiki/Security_Assertion_Markup_Language) (SAML) enabled; otherwise, the return value is 'basic'.
@p... | [
"Get",
"authentication",
"scheme",
".",
"Get",
"the",
"authentication",
"scheme",
"by",
"user",
"name",
"or",
"tenant",
"name",
".",
"The",
"return",
"value",
"is",
"'",
";",
"saml'",
";",
"if",
"the",
"contact",
"center",
"has",
"[",
"Security",
"As... | train | https://github.com/GenesysPureEngage/authentication-client-java/blob/eb0d58343ee42ebd3c037163c1137f611dfcbb3a/src/main/java/com/genesys/internal/authentication/api/AuthenticationApi.java#L1600-L1604 |
cdk/cdk | base/core/src/main/java/org/openscience/cdk/ringsearch/RingSearch.java | RingSearch.ringFragments | public IAtomContainer ringFragments() {
"""
Extract the cyclic atom and bond fragments of the container. Bonds which
join two different isolated/fused cycles (e.g. biphenyl) are not be
included.
@return a new container with only the cyclic atoms and bonds
@see org.openscience.cdk.graph.SpanningTree#getCyclic... | java | public IAtomContainer ringFragments() {
int[] vertices = cyclic();
int n = vertices.length;
IAtom[] atoms = new IAtom[n];
List<IBond> bonds = new ArrayList<IBond>();
for (int i = 0; i < vertices.length; i++) {
atoms[i] = container.getAtom(vertices[i]);
}
... | [
"public",
"IAtomContainer",
"ringFragments",
"(",
")",
"{",
"int",
"[",
"]",
"vertices",
"=",
"cyclic",
"(",
")",
";",
"int",
"n",
"=",
"vertices",
".",
"length",
";",
"IAtom",
"[",
"]",
"atoms",
"=",
"new",
"IAtom",
"[",
"n",
"]",
";",
"List",
"<"... | Extract the cyclic atom and bond fragments of the container. Bonds which
join two different isolated/fused cycles (e.g. biphenyl) are not be
included.
@return a new container with only the cyclic atoms and bonds
@see org.openscience.cdk.graph.SpanningTree#getCyclicFragmentsContainer() | [
"Extract",
"the",
"cyclic",
"atom",
"and",
"bond",
"fragments",
"of",
"the",
"container",
".",
"Bonds",
"which",
"join",
"two",
"different",
"isolated",
"/",
"fused",
"cycles",
"(",
"e",
".",
"g",
".",
"biphenyl",
")",
"are",
"not",
"be",
"included",
"."... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/ringsearch/RingSearch.java#L328-L361 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/recordcount/IngestionRecordCountProvider.java | IngestionRecordCountProvider.constructFilePath | public static String constructFilePath(String oldFilePath, long recordCounts) {
"""
Construct a new file path by appending record count to the filename of the given file path, separated by SEPARATOR.
For example, given path: "/a/b/c/file.avro" and record count: 123,
the new path returned will be: "/a/b/c/file.12... | java | public static String constructFilePath(String oldFilePath, long recordCounts) {
return new Path(new Path(oldFilePath).getParent(), Files.getNameWithoutExtension(oldFilePath).toString() + SEPARATOR
+ recordCounts + SEPARATOR + Files.getFileExtension(oldFilePath)).toString();
} | [
"public",
"static",
"String",
"constructFilePath",
"(",
"String",
"oldFilePath",
",",
"long",
"recordCounts",
")",
"{",
"return",
"new",
"Path",
"(",
"new",
"Path",
"(",
"oldFilePath",
")",
".",
"getParent",
"(",
")",
",",
"Files",
".",
"getNameWithoutExtensio... | Construct a new file path by appending record count to the filename of the given file path, separated by SEPARATOR.
For example, given path: "/a/b/c/file.avro" and record count: 123,
the new path returned will be: "/a/b/c/file.123.avro" | [
"Construct",
"a",
"new",
"file",
"path",
"by",
"appending",
"record",
"count",
"to",
"the",
"filename",
"of",
"the",
"given",
"file",
"path",
"separated",
"by",
"SEPARATOR",
".",
"For",
"example",
"given",
"path",
":",
"/",
"a",
"/",
"b",
"/",
"c",
"/"... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/recordcount/IngestionRecordCountProvider.java#L45-L48 |
wildfly/wildfly-core | launcher/src/main/java/org/wildfly/core/launcher/Launcher.java | Launcher.addEnvironmentVariable | public Launcher addEnvironmentVariable(final String key, final String value) {
"""
Adds an environment variable to the process being created.
@param key they key for the variable
@param value the value for the variable
@return the launcher
"""
env.put(key, value);
return this;
} | java | public Launcher addEnvironmentVariable(final String key, final String value) {
env.put(key, value);
return this;
} | [
"public",
"Launcher",
"addEnvironmentVariable",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"value",
")",
"{",
"env",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds an environment variable to the process being created.
@param key they key for the variable
@param value the value for the variable
@return the launcher | [
"Adds",
"an",
"environment",
"variable",
"to",
"the",
"process",
"being",
"created",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/launcher/src/main/java/org/wildfly/core/launcher/Launcher.java#L218-L221 |
aol/cyclops | cyclops-futurestream/src/main/java/cyclops/futurestream/Pipes.java | Pipes.publishTo | public void publishTo(final K key, final Publisher<V> publisher) {
"""
Synchronously publish data to the Adapter specified by the provided Key, blocking the current thread
@param key for registered cylops-react async.Adapter
@param publisher Reactive Streams publisher to push data onto this pipe
"""
... | java | public void publishTo(final K key, final Publisher<V> publisher) {
registered.get(key).fromStream(Spouts.from(publisher));
} | [
"public",
"void",
"publishTo",
"(",
"final",
"K",
"key",
",",
"final",
"Publisher",
"<",
"V",
">",
"publisher",
")",
"{",
"registered",
".",
"get",
"(",
"key",
")",
".",
"fromStream",
"(",
"Spouts",
".",
"from",
"(",
"publisher",
")",
")",
";",
"}"
] | Synchronously publish data to the Adapter specified by the provided Key, blocking the current thread
@param key for registered cylops-react async.Adapter
@param publisher Reactive Streams publisher to push data onto this pipe | [
"Synchronously",
"publish",
"data",
"to",
"the",
"Adapter",
"specified",
"by",
"the",
"provided",
"Key",
"blocking",
"the",
"current",
"thread"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops-futurestream/src/main/java/cyclops/futurestream/Pipes.java#L584-L586 |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java | BusItinerary.getNearestBusHalt | @Pure
public final BusItineraryHalt getNearestBusHalt(Point2D<?, ?> point) {
"""
Replies the nearest bus halt to the given point.
@param point the point.
@return the nearest bus halt or <code>null</code> if none was found.
"""
return getNearestBusHalt(point.getX(), point.getY());
} | java | @Pure
public final BusItineraryHalt getNearestBusHalt(Point2D<?, ?> point) {
return getNearestBusHalt(point.getX(), point.getY());
} | [
"@",
"Pure",
"public",
"final",
"BusItineraryHalt",
"getNearestBusHalt",
"(",
"Point2D",
"<",
"?",
",",
"?",
">",
"point",
")",
"{",
"return",
"getNearestBusHalt",
"(",
"point",
".",
"getX",
"(",
")",
",",
"point",
".",
"getY",
"(",
")",
")",
";",
"}"
... | Replies the nearest bus halt to the given point.
@param point the point.
@return the nearest bus halt or <code>null</code> if none was found. | [
"Replies",
"the",
"nearest",
"bus",
"halt",
"to",
"the",
"given",
"point",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java#L1006-L1009 |
Graylog2/graylog2-server | graylog2-server/src/main/java/org/graylog2/indexer/indices/Indices.java | Indices.aliasExists | public boolean aliasExists(String alias) {
"""
Check if a given name is an existing alias.
@param alias Name of the alias to check presence for.
@return {@code true} if alias is an existing alias, {@code false} if it is non-existing or an index.
"""
try {
final JestResult result = jestC... | java | public boolean aliasExists(String alias) {
try {
final JestResult result = jestClient.execute(new GetSettings.Builder().addIndex(alias).build());
return result.isSucceeded() && !Iterators.contains(result.getJsonObject().fieldNames(), alias);
} catch (IOException e) {
... | [
"public",
"boolean",
"aliasExists",
"(",
"String",
"alias",
")",
"{",
"try",
"{",
"final",
"JestResult",
"result",
"=",
"jestClient",
".",
"execute",
"(",
"new",
"GetSettings",
".",
"Builder",
"(",
")",
".",
"addIndex",
"(",
"alias",
")",
".",
"build",
"... | Check if a given name is an existing alias.
@param alias Name of the alias to check presence for.
@return {@code true} if alias is an existing alias, {@code false} if it is non-existing or an index. | [
"Check",
"if",
"a",
"given",
"name",
"is",
"an",
"existing",
"alias",
"."
] | train | https://github.com/Graylog2/graylog2-server/blob/50b565dcead6e0a372236d5c2f8530dc5726fa9b/graylog2-server/src/main/java/org/graylog2/indexer/indices/Indices.java#L290-L297 |
line/armeria | core/src/main/java/com/linecorp/armeria/common/SerializationFormat.java | SerializationFormat.isAccepted | public boolean isAccepted(MediaType first, MediaType... rest) {
"""
Returns whether any of the specified media ranges is accepted by any of the {@link #mediaTypes()}
defined by this format.
"""
requireNonNull(first, "first");
requireNonNull(rest, "rest");
return isAccepted(Lists.asList... | java | public boolean isAccepted(MediaType first, MediaType... rest) {
requireNonNull(first, "first");
requireNonNull(rest, "rest");
return isAccepted(Lists.asList(first, rest));
} | [
"public",
"boolean",
"isAccepted",
"(",
"MediaType",
"first",
",",
"MediaType",
"...",
"rest",
")",
"{",
"requireNonNull",
"(",
"first",
",",
"\"first\"",
")",
";",
"requireNonNull",
"(",
"rest",
",",
"\"rest\"",
")",
";",
"return",
"isAccepted",
"(",
"Lists... | Returns whether any of the specified media ranges is accepted by any of the {@link #mediaTypes()}
defined by this format. | [
"Returns",
"whether",
"any",
"of",
"the",
"specified",
"media",
"ranges",
"is",
"accepted",
"by",
"any",
"of",
"the",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/common/SerializationFormat.java#L306-L310 |
geomajas/geomajas-project-client-gwt2 | common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java | StyleUtil.createMark | public static MarkInfo createMark(String wellKnownName, FillInfo fill, StrokeInfo stroke) {
"""
Creates a mark with the specified parameters.
@param wellKnownName the well known name
@param fill the fill
@param stroke the stroke
@return the mark
"""
MarkInfo mark = new MarkInfo();
mark.setFill(fill);... | java | public static MarkInfo createMark(String wellKnownName, FillInfo fill, StrokeInfo stroke) {
MarkInfo mark = new MarkInfo();
mark.setFill(fill);
mark.setStroke(stroke);
WellKnownNameInfo wellKnownNameInfo = new WellKnownNameInfo();
wellKnownNameInfo.setWellKnownName(wellKnownName);
mark.setWellKnownName(well... | [
"public",
"static",
"MarkInfo",
"createMark",
"(",
"String",
"wellKnownName",
",",
"FillInfo",
"fill",
",",
"StrokeInfo",
"stroke",
")",
"{",
"MarkInfo",
"mark",
"=",
"new",
"MarkInfo",
"(",
")",
";",
"mark",
".",
"setFill",
"(",
"fill",
")",
";",
"mark",
... | Creates a mark with the specified parameters.
@param wellKnownName the well known name
@param fill the fill
@param stroke the stroke
@return the mark | [
"Creates",
"a",
"mark",
"with",
"the",
"specified",
"parameters",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java#L253-L261 |
actorapp/actor-platform | actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageDrawing.java | ImageDrawing.drawMasked | public static void drawMasked(Bitmap src, Drawable mask, Bitmap dest, int clearColor) {
"""
Drawing src bitmap to dest bitmap with applied mask.
@param src source bitmap
@param mask bitmap mask
@param dest destination bitmap
@param clearColor clear color
"""
clearBitmap(dest, c... | java | public static void drawMasked(Bitmap src, Drawable mask, Bitmap dest, int clearColor) {
clearBitmap(dest, clearColor);
Canvas canvas = new Canvas(dest);
canvas.drawBitmap(src,
new Rect(0, 0, src.getWidth(), src.getHeight()),
new Rect(0, 0, dest.getWidth(), dest.g... | [
"public",
"static",
"void",
"drawMasked",
"(",
"Bitmap",
"src",
",",
"Drawable",
"mask",
",",
"Bitmap",
"dest",
",",
"int",
"clearColor",
")",
"{",
"clearBitmap",
"(",
"dest",
",",
"clearColor",
")",
";",
"Canvas",
"canvas",
"=",
"new",
"Canvas",
"(",
"d... | Drawing src bitmap to dest bitmap with applied mask.
@param src source bitmap
@param mask bitmap mask
@param dest destination bitmap
@param clearColor clear color | [
"Drawing",
"src",
"bitmap",
"to",
"dest",
"bitmap",
"with",
"applied",
"mask",
"."
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageDrawing.java#L81-L100 |
OpenLiberty/open-liberty | dev/com.ibm.ws.session.cache/src/com/ibm/ws/session/store/cache/TypeConversion.java | TypeConversion.longToBytes | public static void longToBytes(long value, byte[] bytes, int offset) {
"""
A utility method to convert the long into bytes in an array.
@param value
The long.
@param bytes
The byte array to which the long should be copied.
@param offset
The index where the long should start.
"""
for (int i = of... | java | public static void longToBytes(long value, byte[] bytes, int offset) {
for (int i = offset + 7; i >= offset; --i) {
bytes[i] = (byte) value;
value = value >> 8;
}
} | [
"public",
"static",
"void",
"longToBytes",
"(",
"long",
"value",
",",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"offset",
"+",
"7",
";",
"i",
">=",
"offset",
";",
"--",
"i",
")",
"{",
"bytes",
"[",
... | A utility method to convert the long into bytes in an array.
@param value
The long.
@param bytes
The byte array to which the long should be copied.
@param offset
The index where the long should start. | [
"A",
"utility",
"method",
"to",
"convert",
"the",
"long",
"into",
"bytes",
"in",
"an",
"array",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session.cache/src/com/ibm/ws/session/store/cache/TypeConversion.java#L143-L148 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsInner.java | StreamingEndpointsInner.beginCreate | public StreamingEndpointInner beginCreate(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) {
"""
Create StreamingEndpoint.
Creates a StreamingEndpoint.
@param resourceGroupName The name of the resource group within the Azure subsc... | java | public StreamingEndpointInner beginCreate(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters, Boolean autoStart) {
return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters, autoStart).toBlocking().sing... | [
"public",
"StreamingEndpointInner",
"beginCreate",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"streamingEndpointName",
",",
"StreamingEndpointInner",
"parameters",
",",
"Boolean",
"autoStart",
")",
"{",
"return",
"beginCreateWithService... | Create StreamingEndpoint.
Creates a StreamingEndpoint.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param streamingEndpointName The name of the StreamingEndpoint.
@param parameters StreamingEndpoint properties needed for cre... | [
"Create",
"StreamingEndpoint",
".",
"Creates",
"a",
"StreamingEndpoint",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsInner.java#L648-L650 |
wildfly/wildfly-build-tools | provisioning/src/main/java/org/wildfly/build/StandaloneAetherArtifactFileResolver.java | StandaloneAetherArtifactFileResolver.newRepositorySystemSession | private static RepositorySystemSession newRepositorySystemSession(RepositorySystem system, File localRepositoryBaseDir) {
"""
Retrieves a new instance of a standalone {@link org.eclipse.aether.RepositorySystemSession}, which {@link org.eclipse.aether.repository.LocalRepositoryManager} points to 'target/local-repos... | java | private static RepositorySystemSession newRepositorySystemSession(RepositorySystem system, File localRepositoryBaseDir) {
final DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
final LocalRepositoryManager localRepositoryManager = system.newLocalRepositoryManager(session... | [
"private",
"static",
"RepositorySystemSession",
"newRepositorySystemSession",
"(",
"RepositorySystem",
"system",
",",
"File",
"localRepositoryBaseDir",
")",
"{",
"final",
"DefaultRepositorySystemSession",
"session",
"=",
"MavenRepositorySystemUtils",
".",
"newSession",
"(",
"... | Retrieves a new instance of a standalone {@link org.eclipse.aether.RepositorySystemSession}, which {@link org.eclipse.aether.repository.LocalRepositoryManager} points to 'target/local-repository' dir.
@param system
@return | [
"Retrieves",
"a",
"new",
"instance",
"of",
"a",
"standalone",
"{"
] | train | https://github.com/wildfly/wildfly-build-tools/blob/520a5f2e58e6a24097d63fd65c51a8fc29847a61/provisioning/src/main/java/org/wildfly/build/StandaloneAetherArtifactFileResolver.java#L109-L114 |
realexpayments/rxp-hpp-java | src/main/java/com/realexpayments/hpp/sdk/utils/JsonUtils.java | JsonUtils.fromJsonHppResponse | public static HppResponse fromJsonHppResponse(String json) {
"""
Method deserialises JSON to <code>HppResponse</code>.
@param json
@return HppResponse
"""
try {
return hppResponseReader.readValue(json);
} catch (Exception ex) {
LOGGER.error("Error creating HppResponse from JSON.", ex);
throw n... | java | public static HppResponse fromJsonHppResponse(String json) {
try {
return hppResponseReader.readValue(json);
} catch (Exception ex) {
LOGGER.error("Error creating HppResponse from JSON.", ex);
throw new RealexException("Error creating HppResponse from JSON.", ex);
}
} | [
"public",
"static",
"HppResponse",
"fromJsonHppResponse",
"(",
"String",
"json",
")",
"{",
"try",
"{",
"return",
"hppResponseReader",
".",
"readValue",
"(",
"json",
")",
";",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"LOGGER",
".",
"error",
"(",
"\"E... | Method deserialises JSON to <code>HppResponse</code>.
@param json
@return HppResponse | [
"Method",
"deserialises",
"JSON",
"to",
"<code",
">",
"HppResponse<",
"/",
"code",
">",
"."
] | train | https://github.com/realexpayments/rxp-hpp-java/blob/29cc5df036af09a6d8ea16ccd7e02e856f72620f/src/main/java/com/realexpayments/hpp/sdk/utils/JsonUtils.java#L108-L115 |
apache/predictionio-sdk-java | client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java | EventClient.userActionItem | public String userActionItem(String action, String uid, String iid,
Map<String, Object> properties, DateTime eventTime)
throws ExecutionException, InterruptedException, IOException {
"""
Records a user-action-on-item event.
@param action name of the action performed
@param uid ID of the user
@para... | java | public String userActionItem(String action, String uid, String iid,
Map<String, Object> properties, DateTime eventTime)
throws ExecutionException, InterruptedException, IOException {
return createEvent(userActionItemAsFuture(action, uid, iid, properties, eventTime));
} | [
"public",
"String",
"userActionItem",
"(",
"String",
"action",
",",
"String",
"uid",
",",
"String",
"iid",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
",",
"DateTime",
"eventTime",
")",
"throws",
"ExecutionException",
",",
"InterruptedException"... | Records a user-action-on-item event.
@param action name of the action performed
@param uid ID of the user
@param iid ID of the item
@param properties a map of properties associated with this action
@param eventTime timestamp of the event
@return ID of this event | [
"Records",
"a",
"user",
"-",
"action",
"-",
"on",
"-",
"item",
"event",
"."
] | train | https://github.com/apache/predictionio-sdk-java/blob/16052c96b136340c175c3f9c2692e720850df219/client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java#L646-L650 |
craftercms/core | src/main/java/org/craftercms/core/cache/impl/CacheImpl.java | CacheImpl.checkForRefresh | protected boolean checkForRefresh(CacheItem item, List<CacheItem> itemsToRefresh) {
"""
Checks if a given {@link CacheItem} needs to be refreshed. If so, then it is added to the listen of items to
refresh.
@param item
@param itemsToRefresh the list of items where to put the specified item if it needs to be re... | java | protected boolean checkForRefresh(CacheItem item, List<CacheItem> itemsToRefresh) {
if (item.getLoader() != null && item.needsRefresh(ticks.get())) {
itemsToRefresh.add(item);
return true;
} else {
return false;
}
} | [
"protected",
"boolean",
"checkForRefresh",
"(",
"CacheItem",
"item",
",",
"List",
"<",
"CacheItem",
">",
"itemsToRefresh",
")",
"{",
"if",
"(",
"item",
".",
"getLoader",
"(",
")",
"!=",
"null",
"&&",
"item",
".",
"needsRefresh",
"(",
"ticks",
".",
"get",
... | Checks if a given {@link CacheItem} needs to be refreshed. If so, then it is added to the listen of items to
refresh.
@param item
@param itemsToRefresh the list of items where to put the specified item if it needs to be refreshed
@return true if the item will be refreshed, false otherwise | [
"Checks",
"if",
"a",
"given",
"{",
"@link",
"CacheItem",
"}",
"needs",
"to",
"be",
"refreshed",
".",
"If",
"so",
"then",
"it",
"is",
"added",
"to",
"the",
"listen",
"of",
"items",
"to",
"refresh",
"."
] | train | https://github.com/craftercms/core/blob/d3ec74d669d3f8cfcf995177615d5f126edfa237/src/main/java/org/craftercms/core/cache/impl/CacheImpl.java#L400-L408 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.pressImage | public static void pressImage(Image srcImage, ImageOutputStream destImageStream, Image pressImg, int x, int y, float alpha) throws IORuntimeException {
"""
给图片添加图片水印<br>
此方法并不关闭流
@param srcImage 源图像流
@param destImageStream 目标图像流
@param pressImg 水印图片,可以使用{@link ImageIO#read(File)}方法读取文件
@param x 修正值。 默认在中间,偏... | java | public static void pressImage(Image srcImage, ImageOutputStream destImageStream, Image pressImg, int x, int y, float alpha) throws IORuntimeException {
writeJpg(pressImage(srcImage, pressImg, x, y, alpha), destImageStream);
} | [
"public",
"static",
"void",
"pressImage",
"(",
"Image",
"srcImage",
",",
"ImageOutputStream",
"destImageStream",
",",
"Image",
"pressImg",
",",
"int",
"x",
",",
"int",
"y",
",",
"float",
"alpha",
")",
"throws",
"IORuntimeException",
"{",
"writeJpg",
"(",
"pres... | 给图片添加图片水印<br>
此方法并不关闭流
@param srcImage 源图像流
@param destImageStream 目标图像流
@param pressImg 水印图片,可以使用{@link ImageIO#read(File)}方法读取文件
@param x 修正值。 默认在中间,偏移量相对于中间偏移
@param y 修正值。 默认在中间,偏移量相对于中间偏移
@param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字
@throws IORuntimeException IO异常 | [
"给图片添加图片水印<br",
">",
"此方法并不关闭流"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L957-L959 |
osiam/connector4java | src/main/java/org/osiam/client/OsiamConnector.java | OsiamConnector.getGroup | public Group getGroup(String id, AccessToken accessToken, String... attributes) {
"""
Retrieve a single Group with the given id. If no group with the given id can be found a {@link NoResultException}
is thrown.
@param id the id of the wanted group
@param accessToken the access token from OSIAM for th... | java | public Group getGroup(String id, AccessToken accessToken, String... attributes) {
return getGroupService().getGroup(id, accessToken, attributes);
} | [
"public",
"Group",
"getGroup",
"(",
"String",
"id",
",",
"AccessToken",
"accessToken",
",",
"String",
"...",
"attributes",
")",
"{",
"return",
"getGroupService",
"(",
")",
".",
"getGroup",
"(",
"id",
",",
"accessToken",
",",
"attributes",
")",
";",
"}"
] | Retrieve a single Group with the given id. If no group with the given id can be found a {@link NoResultException}
is thrown.
@param id the id of the wanted group
@param accessToken the access token from OSIAM for the current session.
@param attributes the attributes that should be returned in the response. I... | [
"Retrieve",
"a",
"single",
"Group",
"with",
"the",
"given",
"id",
".",
"If",
"no",
"group",
"with",
"the",
"given",
"id",
"can",
"be",
"found",
"a",
"{",
"@link",
"NoResultException",
"}",
"is",
"thrown",
"."
] | train | https://github.com/osiam/connector4java/blob/a5e6ae1e706f4889d662a069fe2f3bf8e3848d12/src/main/java/org/osiam/client/OsiamConnector.java#L330-L332 |
outbrain/ob1k | ob1k-concurrent/src/main/java/com/outbrain/ob1k/concurrent/ComposableFutures.java | ComposableFutures.retry | public static <T> ComposableFuture<T> retry(final int retries, final FutureAction<T> action) {
"""
retries a given operation N times for each computed Failed future.
@param retries max amount of retries
@param action the eager future provider
@param <T> the future type
@return the composed result.
"... | java | public static <T> ComposableFuture<T> retry(final int retries, final FutureAction<T> action) {
return retry(retries, __ -> action.execute());
} | [
"public",
"static",
"<",
"T",
">",
"ComposableFuture",
"<",
"T",
">",
"retry",
"(",
"final",
"int",
"retries",
",",
"final",
"FutureAction",
"<",
"T",
">",
"action",
")",
"{",
"return",
"retry",
"(",
"retries",
",",
"__",
"->",
"action",
".",
"execute"... | retries a given operation N times for each computed Failed future.
@param retries max amount of retries
@param action the eager future provider
@param <T> the future type
@return the composed result. | [
"retries",
"a",
"given",
"operation",
"N",
"times",
"for",
"each",
"computed",
"Failed",
"future",
"."
] | train | https://github.com/outbrain/ob1k/blob/9e43ab39230c5787065053da0f766d822d0fe4e7/ob1k-concurrent/src/main/java/com/outbrain/ob1k/concurrent/ComposableFutures.java#L531-L533 |
stapler/stapler | jelly/src/main/java/org/kohsuke/stapler/jelly/JellyClassTearOff.java | JellyClassTearOff.serveIndexJelly | public boolean serveIndexJelly(StaplerRequest req, StaplerResponse rsp, Object node) throws ServletException, IOException {
"""
Serves <tt>index.jelly</tt> if it's available, and returns true.
"""
try {
Script script = findScript("index.jelly");
if(script!=null) {
... | java | public boolean serveIndexJelly(StaplerRequest req, StaplerResponse rsp, Object node) throws ServletException, IOException {
try {
Script script = findScript("index.jelly");
if(script!=null) {
String src = "index.jelly";
if (script instanceof JellyViewScrip... | [
"public",
"boolean",
"serveIndexJelly",
"(",
"StaplerRequest",
"req",
",",
"StaplerResponse",
"rsp",
",",
"Object",
"node",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"try",
"{",
"Script",
"script",
"=",
"findScript",
"(",
"\"index.jelly\"",
")",
... | Serves <tt>index.jelly</tt> if it's available, and returns true. | [
"Serves",
"<tt",
">",
"index",
".",
"jelly<",
"/",
"tt",
">",
"if",
"it",
"s",
"available",
"and",
"returns",
"true",
"."
] | train | https://github.com/stapler/stapler/blob/11ad5af185e062fb46e01bf9fbed66f3ebf2a8f7/jelly/src/main/java/org/kohsuke/stapler/jelly/JellyClassTearOff.java#L101-L121 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GammaDistribution.java | GammaDistribution.logcdf | public static double logcdf(double val, double k, double theta) {
"""
The log CDF, static version.
@param val Value
@param k Shape k
@param theta Theta = 1.0/Beta aka. "scaling" parameter
@return cdf value
"""
if(val < 0) {
return Double.NEGATIVE_INFINITY;
}
double vt = val * theta;
... | java | public static double logcdf(double val, double k, double theta) {
if(val < 0) {
return Double.NEGATIVE_INFINITY;
}
double vt = val * theta;
return (val == Double.POSITIVE_INFINITY) ? 0. : logregularizedGammaP(k, vt);
} | [
"public",
"static",
"double",
"logcdf",
"(",
"double",
"val",
",",
"double",
"k",
",",
"double",
"theta",
")",
"{",
"if",
"(",
"val",
"<",
"0",
")",
"{",
"return",
"Double",
".",
"NEGATIVE_INFINITY",
";",
"}",
"double",
"vt",
"=",
"val",
"*",
"theta"... | The log CDF, static version.
@param val Value
@param k Shape k
@param theta Theta = 1.0/Beta aka. "scaling" parameter
@return cdf value | [
"The",
"log",
"CDF",
"static",
"version",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GammaDistribution.java#L201-L207 |
Azure/azure-sdk-for-java | datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/TrustedIdProvidersInner.java | TrustedIdProvidersInner.getAsync | public Observable<TrustedIdProviderInner> getAsync(String resourceGroupName, String accountName, String trustedIdProviderName) {
"""
Gets the specified Data Lake Store trusted identity provider.
@param resourceGroupName The name of the Azure resource group.
@param accountName The name of the Data Lake Store ac... | java | public Observable<TrustedIdProviderInner> getAsync(String resourceGroupName, String accountName, String trustedIdProviderName) {
return getWithServiceResponseAsync(resourceGroupName, accountName, trustedIdProviderName).map(new Func1<ServiceResponse<TrustedIdProviderInner>, TrustedIdProviderInner>() {
... | [
"public",
"Observable",
"<",
"TrustedIdProviderInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"trustedIdProviderName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName... | Gets the specified Data Lake Store trusted identity provider.
@param resourceGroupName The name of the Azure resource group.
@param accountName The name of the Data Lake Store account.
@param trustedIdProviderName The name of the trusted identity provider to retrieve.
@throws IllegalArgumentException thrown if paramet... | [
"Gets",
"the",
"specified",
"Data",
"Lake",
"Store",
"trusted",
"identity",
"provider",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/TrustedIdProvidersInner.java#L355-L362 |
james-hu/jabb-core | src/main/java/net/sf/jabb/spring/rest/AbstractRestClient.java | AbstractRestClient.addBasicAuthHeader | protected void addBasicAuthHeader(HttpHeaders headers, String user, String password) {
"""
Add HTTP Basic Auth header
@param headers the headers, it must not be a read-only one, if it is, use {@link #copy(HttpHeaders)} to make a writable copy first
@param user the user name, may be null or empty
@param passwo... | java | protected void addBasicAuthHeader(HttpHeaders headers, String user, String password){
headers.add(HEADER_AUTHORIZATION, buildBasicAuthValue(user, password));
} | [
"protected",
"void",
"addBasicAuthHeader",
"(",
"HttpHeaders",
"headers",
",",
"String",
"user",
",",
"String",
"password",
")",
"{",
"headers",
".",
"add",
"(",
"HEADER_AUTHORIZATION",
",",
"buildBasicAuthValue",
"(",
"user",
",",
"password",
")",
")",
";",
"... | Add HTTP Basic Auth header
@param headers the headers, it must not be a read-only one, if it is, use {@link #copy(HttpHeaders)} to make a writable copy first
@param user the user name, may be null or empty
@param password the password, may be null or empty | [
"Add",
"HTTP",
"Basic",
"Auth",
"header"
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/spring/rest/AbstractRestClient.java#L650-L652 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java | ElementPlugin.registerId | public void registerId(String id, BaseComponent component) {
"""
Allows auto-wire to work even if component is not a child of the container.
@param id BaseComponent id.
@param component BaseComponent to be registered.
"""
if (!StringUtils.isEmpty(id) && !container.hasAttribute(id)) {
co... | java | public void registerId(String id, BaseComponent component) {
if (!StringUtils.isEmpty(id) && !container.hasAttribute(id)) {
container.setAttribute(id, component);
}
} | [
"public",
"void",
"registerId",
"(",
"String",
"id",
",",
"BaseComponent",
"component",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"isEmpty",
"(",
"id",
")",
"&&",
"!",
"container",
".",
"hasAttribute",
"(",
"id",
")",
")",
"{",
"container",
".",
"s... | Allows auto-wire to work even if component is not a child of the container.
@param id BaseComponent id.
@param component BaseComponent to be registered. | [
"Allows",
"auto",
"-",
"wire",
"to",
"work",
"even",
"if",
"component",
"is",
"not",
"a",
"child",
"of",
"the",
"container",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L635-L639 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/classify/LinearClassifierFactory.java | LinearClassifierFactory.crossValidateSetSigma | public void crossValidateSetSigma(GeneralDataset<L, F> dataset,int kfold, final Scorer<L> scorer, LineSearcher minimizer) {
"""
Sets the sigma parameter to a value that optimizes the cross-validation score given by <code>scorer</code>. Search for an optimal value
is carried out by <code>minimizer</code>
@param ... | java | public void crossValidateSetSigma(GeneralDataset<L, F> dataset,int kfold, final Scorer<L> scorer, LineSearcher minimizer) {
System.err.println("##in Cross Validate, folds = " + kfold);
System.err.println("##Scorer is " + scorer);
featureIndex = dataset.featureIndex;
labelIndex = dataset.labelIndex... | [
"public",
"void",
"crossValidateSetSigma",
"(",
"GeneralDataset",
"<",
"L",
",",
"F",
">",
"dataset",
",",
"int",
"kfold",
",",
"final",
"Scorer",
"<",
"L",
">",
"scorer",
",",
"LineSearcher",
"minimizer",
")",
"{",
"System",
".",
"err",
".",
"println",
... | Sets the sigma parameter to a value that optimizes the cross-validation score given by <code>scorer</code>. Search for an optimal value
is carried out by <code>minimizer</code>
@param dataset the data set to optimize sigma on. | [
"Sets",
"the",
"sigma",
"parameter",
"to",
"a",
"value",
"that",
"optimizes",
"the",
"cross",
"-",
"validation",
"score",
"given",
"by",
"<code",
">",
"scorer<",
"/",
"code",
">",
".",
"Search",
"for",
"an",
"optimal",
"value",
"is",
"carried",
"out",
"b... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/classify/LinearClassifierFactory.java#L562-L609 |
YahooArchive/samoa | samoa-api/src/main/java/com/yahoo/labs/samoa/streams/StreamSourceProcessor.java | StreamSourceProcessor.sendEndEvaluationInstance | public void sendEndEvaluationInstance(Stream inputStream) {
"""
Send end evaluation instance.
@param inputStream the input stream
"""
InstanceContentEvent instanceContentEvent = new InstanceContentEvent(-1, firstInstance,false, true);
inputStream.put(instanceContentEvent);
} | java | public void sendEndEvaluationInstance(Stream inputStream) {
InstanceContentEvent instanceContentEvent = new InstanceContentEvent(-1, firstInstance,false, true);
inputStream.put(instanceContentEvent);
} | [
"public",
"void",
"sendEndEvaluationInstance",
"(",
"Stream",
"inputStream",
")",
"{",
"InstanceContentEvent",
"instanceContentEvent",
"=",
"new",
"InstanceContentEvent",
"(",
"-",
"1",
",",
"firstInstance",
",",
"false",
",",
"true",
")",
";",
"inputStream",
".",
... | Send end evaluation instance.
@param inputStream the input stream | [
"Send",
"end",
"evaluation",
"instance",
"."
] | train | https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/streams/StreamSourceProcessor.java#L110-L113 |
jenkinsci/jenkins | core/src/main/java/hudson/FilePath.java | FilePath.createTempFile | public FilePath createTempFile(final String prefix, final String suffix) throws IOException, InterruptedException {
"""
Creates a temporary file in the directory that this {@link FilePath} object designates.
@param prefix
The prefix string to be used in generating the file's name; must be
at least three chara... | java | public FilePath createTempFile(final String prefix, final String suffix) throws IOException, InterruptedException {
try {
return new FilePath(this, act(new CreateTempFile(prefix, suffix)));
} catch (IOException e) {
throw new IOException("Failed to create a temp file on "+remote,... | [
"public",
"FilePath",
"createTempFile",
"(",
"final",
"String",
"prefix",
",",
"final",
"String",
"suffix",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"try",
"{",
"return",
"new",
"FilePath",
"(",
"this",
",",
"act",
"(",
"new",
"CreateTem... | Creates a temporary file in the directory that this {@link FilePath} object designates.
@param prefix
The prefix string to be used in generating the file's name; must be
at least three characters long
@param suffix
The suffix string to be used in generating the file's name; may be
null, in which case the suffix ".tmp"... | [
"Creates",
"a",
"temporary",
"file",
"in",
"the",
"directory",
"that",
"this",
"{",
"@link",
"FilePath",
"}",
"object",
"designates",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/FilePath.java#L1374-L1380 |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/runtime/KnowledgeRuntimeManagerFactory.java | KnowledgeRuntimeManagerFactory.newRuntimeManager | public KnowledgeRuntimeManager newRuntimeManager(KnowledgeRuntimeManagerType type) {
"""
Creates a new KnowledgeRuntimeManager.
@param type the KnowledgeRuntimeManagerType
@return the new KnowledgeRuntimeManager
"""
RuntimeManager runtimeManager;
final String identifier = _identifierRoot + ... | java | public KnowledgeRuntimeManager newRuntimeManager(KnowledgeRuntimeManagerType type) {
RuntimeManager runtimeManager;
final String identifier = _identifierRoot + IDENTIFIER_COUNT.incrementAndGet();
final ClassLoader origTCCL = Classes.setTCCL(_classLoader);
try {
runtimeManager... | [
"public",
"KnowledgeRuntimeManager",
"newRuntimeManager",
"(",
"KnowledgeRuntimeManagerType",
"type",
")",
"{",
"RuntimeManager",
"runtimeManager",
";",
"final",
"String",
"identifier",
"=",
"_identifierRoot",
"+",
"IDENTIFIER_COUNT",
".",
"incrementAndGet",
"(",
")",
";"... | Creates a new KnowledgeRuntimeManager.
@param type the KnowledgeRuntimeManagerType
@return the new KnowledgeRuntimeManager | [
"Creates",
"a",
"new",
"KnowledgeRuntimeManager",
"."
] | train | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/runtime/KnowledgeRuntimeManagerFactory.java#L67-L77 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/asm/AsmUtils.java | AsmUtils.fieldInsnEqual | public static boolean fieldInsnEqual(FieldInsnNode insn1, FieldInsnNode insn2) {
"""
Checks if two {@link FieldInsnNode} are equals.
@param insn1 the insn1
@param insn2 the insn2
@return true, if successful
"""
return insn1.owner.equals(insn2.owner) && insn1.name.equals(insn2.name) && insn1.desc.equals(... | java | public static boolean fieldInsnEqual(FieldInsnNode insn1, FieldInsnNode insn2)
{
return insn1.owner.equals(insn2.owner) && insn1.name.equals(insn2.name) && insn1.desc.equals(insn2.desc);
} | [
"public",
"static",
"boolean",
"fieldInsnEqual",
"(",
"FieldInsnNode",
"insn1",
",",
"FieldInsnNode",
"insn2",
")",
"{",
"return",
"insn1",
".",
"owner",
".",
"equals",
"(",
"insn2",
".",
"owner",
")",
"&&",
"insn1",
".",
"name",
".",
"equals",
"(",
"insn2... | Checks if two {@link FieldInsnNode} are equals.
@param insn1 the insn1
@param insn2 the insn2
@return true, if successful | [
"Checks",
"if",
"two",
"{",
"@link",
"FieldInsnNode",
"}",
"are",
"equals",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/asm/AsmUtils.java#L207-L210 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataMaxCardinalityImpl_CustomFieldSerializer.java | OWLDataMaxCardinalityImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataMaxCardinalityImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.goog... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataMaxCardinalityImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLDataMaxCardinalityImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}"
] | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataMaxCardinalityImpl_CustomFieldSerializer.java#L95-L98 |
Abnaxos/markdown-doclet | doclet/jdk8/src/main/java/ch/raffael/mddoclet/MarkdownDoclet.java | MarkdownDoclet.processTag | @SuppressWarnings("unchecked")
protected void processTag(Tag tag, StringBuilder target) {
"""
Process a tag.
@param tag The tag.
@param target The target string builder.
"""
TagRenderer<Tag> renderer = (TagRenderer<Tag>)tagRenderers.get(tag.kind());
if ( renderer == null ) {
... | java | @SuppressWarnings("unchecked")
protected void processTag(Tag tag, StringBuilder target) {
TagRenderer<Tag> renderer = (TagRenderer<Tag>)tagRenderers.get(tag.kind());
if ( renderer == null ) {
renderer = TagRenderer.VERBATIM;
}
renderer.render(tag, target, this);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"void",
"processTag",
"(",
"Tag",
"tag",
",",
"StringBuilder",
"target",
")",
"{",
"TagRenderer",
"<",
"Tag",
">",
"renderer",
"=",
"(",
"TagRenderer",
"<",
"Tag",
">",
")",
"tagRenderers",
"."... | Process a tag.
@param tag The tag.
@param target The target string builder. | [
"Process",
"a",
"tag",
"."
] | train | https://github.com/Abnaxos/markdown-doclet/blob/e98a9630206fc9c8d813cf2349ff594be8630054/doclet/jdk8/src/main/java/ch/raffael/mddoclet/MarkdownDoclet.java#L407-L414 |
alkacon/opencms-core | src/org/opencms/importexport/A_CmsImport.java | A_CmsImport.readPropertiesFromManifest | protected List<CmsProperty> readPropertiesFromManifest(Element parentElement, List<String> ignoredPropertyKeys) {
"""
Reads all properties below a specified parent element from the <code>manifest.xml</code>.<p>
@param parentElement the current file node
@param ignoredPropertyKeys a list of properties to be ign... | java | protected List<CmsProperty> readPropertiesFromManifest(Element parentElement, List<String> ignoredPropertyKeys) {
// all imported Cms property objects are collected in map first forfaster access
Map<String, CmsProperty> properties = new HashMap<String, CmsProperty>();
CmsProperty property = nul... | [
"protected",
"List",
"<",
"CmsProperty",
">",
"readPropertiesFromManifest",
"(",
"Element",
"parentElement",
",",
"List",
"<",
"String",
">",
"ignoredPropertyKeys",
")",
"{",
"// all imported Cms property objects are collected in map first forfaster access",
"Map",
"<",
"Stri... | Reads all properties below a specified parent element from the <code>manifest.xml</code>.<p>
@param parentElement the current file node
@param ignoredPropertyKeys a list of properties to be ignored
@return a list with all properties | [
"Reads",
"all",
"properties",
"below",
"a",
"specified",
"parent",
"element",
"from",
"the",
"<code",
">",
"manifest",
".",
"xml<",
"/",
"code",
">",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/A_CmsImport.java#L979-L1025 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/server/jobtracker/TaskTracker.java | TaskTracker.unreserveSlots | public void unreserveSlots(TaskType taskType, JobInProgress job) {
"""
Free map slots on this <code>TaskTracker</code> which were reserved for
<code>taskType</code>.
@param taskType {@link TaskType} of the task
@param job job whose slots are being un-reserved
"""
JobID jobId = job.getJobID();
if (ta... | java | public void unreserveSlots(TaskType taskType, JobInProgress job) {
JobID jobId = job.getJobID();
if (taskType == TaskType.MAP) {
if (jobForFallowMapSlot == null ||
!jobForFallowMapSlot.getJobID().equals(jobId)) {
throw new RuntimeException(trackerName + " already has " +
... | [
"public",
"void",
"unreserveSlots",
"(",
"TaskType",
"taskType",
",",
"JobInProgress",
"job",
")",
"{",
"JobID",
"jobId",
"=",
"job",
".",
"getJobID",
"(",
")",
";",
"if",
"(",
"taskType",
"==",
"TaskType",
".",
"MAP",
")",
"{",
"if",
"(",
"jobForFallowM... | Free map slots on this <code>TaskTracker</code> which were reserved for
<code>taskType</code>.
@param taskType {@link TaskType} of the task
@param job job whose slots are being un-reserved | [
"Free",
"map",
"slots",
"on",
"this",
"<code",
">",
"TaskTracker<",
"/",
"code",
">",
"which",
"were",
"reserved",
"for",
"<code",
">",
"taskType<",
"/",
"code",
">",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/server/jobtracker/TaskTracker.java#L157-L183 |
Harium/keel | src/main/java/com/harium/keel/catalano/core/DoublePoint.java | DoublePoint.Multiply | public DoublePoint Multiply(DoublePoint point1, DoublePoint point2) {
"""
Multiply values of two points.
@param point1 DoublePoint.
@param point2 DoublePoint.
@return A new DoublePoint with the multiplication operation.
"""
DoublePoint result = new DoublePoint(point1);
result.Multiply(po... | java | public DoublePoint Multiply(DoublePoint point1, DoublePoint point2) {
DoublePoint result = new DoublePoint(point1);
result.Multiply(point2);
return result;
} | [
"public",
"DoublePoint",
"Multiply",
"(",
"DoublePoint",
"point1",
",",
"DoublePoint",
"point2",
")",
"{",
"DoublePoint",
"result",
"=",
"new",
"DoublePoint",
"(",
"point1",
")",
";",
"result",
".",
"Multiply",
"(",
"point2",
")",
";",
"return",
"result",
";... | Multiply values of two points.
@param point1 DoublePoint.
@param point2 DoublePoint.
@return A new DoublePoint with the multiplication operation. | [
"Multiply",
"values",
"of",
"two",
"points",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/core/DoublePoint.java#L205-L209 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java | AbstractExecutableMemberWriter.addExceptions | protected void addExceptions(ExecutableElement member, Content htmltree, int indentSize) {
"""
Add exceptions for the executable member.
@param member the member to write exceptions for.
@param htmltree the content tree to which the exceptions information will be added.
"""
List<? extends TypeMirro... | java | protected void addExceptions(ExecutableElement member, Content htmltree, int indentSize) {
List<? extends TypeMirror> exceptions = member.getThrownTypes();
if (!exceptions.isEmpty()) {
CharSequence indent = makeSpace(indentSize + 1 - 7);
htmltree.addContent(DocletConstants.NL);
... | [
"protected",
"void",
"addExceptions",
"(",
"ExecutableElement",
"member",
",",
"Content",
"htmltree",
",",
"int",
"indentSize",
")",
"{",
"List",
"<",
"?",
"extends",
"TypeMirror",
">",
"exceptions",
"=",
"member",
".",
"getThrownTypes",
"(",
")",
";",
"if",
... | Add exceptions for the executable member.
@param member the member to write exceptions for.
@param htmltree the content tree to which the exceptions information will be added. | [
"Add",
"exceptions",
"for",
"the",
"executable",
"member",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java#L259-L278 |
mgledi/DRUMS | src/main/java/com/unister/semweb/drums/file/IndexForHeaderIndexFile.java | IndexForHeaderIndexFile.setLargestKey | public void setLargestKey(int chunkIdx, byte[] largestKeyInChunk) {
"""
Sets a new largest key in the chunk with the given index.
@param chunkIdx
@param largestKeyInChunk
"""
maxKeyPerChunk[chunkIdx] = largestKeyInChunk;
filledUpTo = Math.max(filledUpTo, chunkIdx);
indexBuffer.posit... | java | public void setLargestKey(int chunkIdx, byte[] largestKeyInChunk) {
maxKeyPerChunk[chunkIdx] = largestKeyInChunk;
filledUpTo = Math.max(filledUpTo, chunkIdx);
indexBuffer.position(chunkIdx * keySize);
indexBuffer.put(largestKeyInChunk);
} | [
"public",
"void",
"setLargestKey",
"(",
"int",
"chunkIdx",
",",
"byte",
"[",
"]",
"largestKeyInChunk",
")",
"{",
"maxKeyPerChunk",
"[",
"chunkIdx",
"]",
"=",
"largestKeyInChunk",
";",
"filledUpTo",
"=",
"Math",
".",
"max",
"(",
"filledUpTo",
",",
"chunkIdx",
... | Sets a new largest key in the chunk with the given index.
@param chunkIdx
@param largestKeyInChunk | [
"Sets",
"a",
"new",
"largest",
"key",
"in",
"the",
"chunk",
"with",
"the",
"given",
"index",
"."
] | train | https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/file/IndexForHeaderIndexFile.java#L167-L172 |
bazaarvoice/jolt | complete/src/main/java/com/bazaarvoice/jolt/ChainrFactory.java | ChainrFactory.getChainr | private static Chainr getChainr( ChainrInstantiator chainrInstantiator, Object chainrSpec ) {
"""
The main engine in ChainrFactory for building a Chainr Instance.
@param chainrInstantiator The ChainrInstantiator to use. If null it will not be used.
@param chainrSpec The json spec for the chainr transformation
... | java | private static Chainr getChainr( ChainrInstantiator chainrInstantiator, Object chainrSpec ) {
Chainr chainr;
if (chainrInstantiator == null ) {
chainr = Chainr.fromSpec( chainrSpec );
}
else {
chainr = Chainr.fromSpec( chainrSpec, chainrInstantiator );
}
... | [
"private",
"static",
"Chainr",
"getChainr",
"(",
"ChainrInstantiator",
"chainrInstantiator",
",",
"Object",
"chainrSpec",
")",
"{",
"Chainr",
"chainr",
";",
"if",
"(",
"chainrInstantiator",
"==",
"null",
")",
"{",
"chainr",
"=",
"Chainr",
".",
"fromSpec",
"(",
... | The main engine in ChainrFactory for building a Chainr Instance.
@param chainrInstantiator The ChainrInstantiator to use. If null it will not be used.
@param chainrSpec The json spec for the chainr transformation
@return the Chainr instance created from the chainrInstantiator and inputStream | [
"The",
"main",
"engine",
"in",
"ChainrFactory",
"for",
"building",
"a",
"Chainr",
"Instance",
"."
] | train | https://github.com/bazaarvoice/jolt/blob/4cf866a9f4222142da41b50dbcccce022a956bff/complete/src/main/java/com/bazaarvoice/jolt/ChainrFactory.java#L107-L116 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/com/ibm/ws/jsf/extprocessor/JSFExtensionFactory.java | JSFExtensionFactory.createExtensionProcessor | public ExtensionProcessor createExtensionProcessor(IServletContext webapp) throws Exception {
"""
/* private void setValidatorFactoryAttribute(IServletContext ctxt) {
BeanValidation bv = getBeanValidation();
ComponentMetaData cmd = null;
ValidatorFactory vf = null;
if (bv != null) {
cmd = ComponentMetaDataA... | java | public ExtensionProcessor createExtensionProcessor(IServletContext webapp) throws Exception {
applicationName = webapp.getServletContextName();
if (log.isLoggable(Level.FINE)) {
log.logp(Level.FINE, CLASS_NAME, "createExtensionProcessor", "Enter createExtensionProcessor(): webapp =[" + app... | [
"public",
"ExtensionProcessor",
"createExtensionProcessor",
"(",
"IServletContext",
"webapp",
")",
"throws",
"Exception",
"{",
"applicationName",
"=",
"webapp",
".",
"getServletContextName",
"(",
")",
";",
"if",
"(",
"log",
".",
"isLoggable",
"(",
"Level",
".",
"F... | /* private void setValidatorFactoryAttribute(IServletContext ctxt) {
BeanValidation bv = getBeanValidation();
ComponentMetaData cmd = null;
ValidatorFactory vf = null;
if (bv != null) {
cmd = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().getComponentMetaData();
if (cmd != null) {
try {
vf = bv.getValida... | [
"/",
"*",
"private",
"void",
"setValidatorFactoryAttribute",
"(",
"IServletContext",
"ctxt",
")",
"{"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/com/ibm/ws/jsf/extprocessor/JSFExtensionFactory.java#L167-L201 |
morimekta/providence | providence-config/src/main/java/net/morimekta/providence/config/impl/ProvidenceConfigUtil.java | ProvidenceConfigUtil.getInMessage | static Object getInMessage(PMessage message, String key) throws ProvidenceConfigException {
"""
Look up a key in the message structure. If the key is not found, return null.
@param message The message to look up into.
@param key The key to look up.
@return The value found or null.
@throws ProvidenceConfigExc... | java | static Object getInMessage(PMessage message, String key) throws ProvidenceConfigException {
return getInMessage(message, key, null);
} | [
"static",
"Object",
"getInMessage",
"(",
"PMessage",
"message",
",",
"String",
"key",
")",
"throws",
"ProvidenceConfigException",
"{",
"return",
"getInMessage",
"(",
"message",
",",
"key",
",",
"null",
")",
";",
"}"
] | Look up a key in the message structure. If the key is not found, return null.
@param message The message to look up into.
@param key The key to look up.
@return The value found or null.
@throws ProvidenceConfigException When unable to get value from message. | [
"Look",
"up",
"a",
"key",
"in",
"the",
"message",
"structure",
".",
"If",
"the",
"key",
"is",
"not",
"found",
"return",
"null",
"."
] | train | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-config/src/main/java/net/morimekta/providence/config/impl/ProvidenceConfigUtil.java#L103-L105 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/referral/Branch.java | Branch.setIdentity | public void setIdentity(@NonNull String userId, @Nullable BranchReferralInitListener
callback) {
"""
<p>Identifies the current user to the Branch API by supplying a unique identifier as a
{@link String} value, with a callback specified to perform a defined action upon successful
response to request.<... | java | public void setIdentity(@NonNull String userId, @Nullable BranchReferralInitListener
callback) {
ServerRequest req = new ServerRequestIdentifyUserRequest(context_, callback, userId);
if (!req.constructError_ && !req.handleErrors(context_)) {
handleNewRequest(req);
} else ... | [
"public",
"void",
"setIdentity",
"(",
"@",
"NonNull",
"String",
"userId",
",",
"@",
"Nullable",
"BranchReferralInitListener",
"callback",
")",
"{",
"ServerRequest",
"req",
"=",
"new",
"ServerRequestIdentifyUserRequest",
"(",
"context_",
",",
"callback",
",",
"userId... | <p>Identifies the current user to the Branch API by supplying a unique identifier as a
{@link String} value, with a callback specified to perform a defined action upon successful
response to request.</p>
@param userId A {@link String} value containing the unique identifier of the user.
@param callback A {@link Branc... | [
"<p",
">",
"Identifies",
"the",
"current",
"user",
"to",
"the",
"Branch",
"API",
"by",
"supplying",
"a",
"unique",
"identifier",
"as",
"a",
"{",
"@link",
"String",
"}",
"value",
"with",
"a",
"callback",
"specified",
"to",
"perform",
"a",
"defined",
"action... | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/Branch.java#L1773-L1783 |
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/cos/COSBlockOutputStream.java | COSBlockOutputStream.putObject | private void putObject() throws IOException {
"""
Upload the current block as a single PUT request; if the buffer is empty a
0-byte PUT will be invoked, as it is needed to create an entry at the far
end.
@throws IOException any problem
"""
LOG.debug("Executing regular upload for {}", writeOperationHel... | java | private void putObject() throws IOException {
LOG.debug("Executing regular upload for {}", writeOperationHelper);
final COSDataBlocks.DataBlock block = getActiveBlock();
int size = block.dataSize();
final COSDataBlocks.BlockUploadData uploadData = block.startUpload();
final PutObjectRequest putObje... | [
"private",
"void",
"putObject",
"(",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"debug",
"(",
"\"Executing regular upload for {}\"",
",",
"writeOperationHelper",
")",
";",
"final",
"COSDataBlocks",
".",
"DataBlock",
"block",
"=",
"getActiveBlock",
"(",
")",
";... | Upload the current block as a single PUT request; if the buffer is empty a
0-byte PUT will be invoked, as it is needed to create an entry at the far
end.
@throws IOException any problem | [
"Upload",
"the",
"current",
"block",
"as",
"a",
"single",
"PUT",
"request",
";",
"if",
"the",
"buffer",
"is",
"empty",
"a",
"0",
"-",
"byte",
"PUT",
"will",
"be",
"invoked",
"as",
"it",
"is",
"needed",
"to",
"create",
"an",
"entry",
"at",
"the",
"far... | train | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/cos/COSBlockOutputStream.java#L371-L414 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/ScreenField.java | ScreenField.isPrintableControl | public boolean isPrintableControl(ScreenField sField, int iPrintOptions) {
"""
Display this sub-control in html input format?
@param iPrintOptions The view specific print options.
@return True if this sub-control is printable.
"""
if ((sField == null) || (sField == this))
return this.getS... | java | public boolean isPrintableControl(ScreenField sField, int iPrintOptions)
{
if ((sField == null) || (sField == this))
return this.getScreenFieldView().isPrintableControl(iPrintOptions);
return sField.isPrintableControl(null, iPrintOptions);
} | [
"public",
"boolean",
"isPrintableControl",
"(",
"ScreenField",
"sField",
",",
"int",
"iPrintOptions",
")",
"{",
"if",
"(",
"(",
"sField",
"==",
"null",
")",
"||",
"(",
"sField",
"==",
"this",
")",
")",
"return",
"this",
".",
"getScreenFieldView",
"(",
")",... | Display this sub-control in html input format?
@param iPrintOptions The view specific print options.
@return True if this sub-control is printable. | [
"Display",
"this",
"sub",
"-",
"control",
"in",
"html",
"input",
"format?"
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/ScreenField.java#L713-L718 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/PropertiesUtils.java | PropertiesUtils.extractPropertiesWithPrefix | public static Properties extractPropertiesWithPrefix(Properties properties, Optional<String> prefix) {
"""
Extract all the keys that start with a <code>prefix</code> in {@link Properties} to a new {@link Properties}
instance.
@param properties the given {@link Properties} instance
@param prefix of keys to be ... | java | public static Properties extractPropertiesWithPrefix(Properties properties, Optional<String> prefix) {
Preconditions.checkNotNull(properties);
Preconditions.checkNotNull(prefix);
Properties extractedProperties = new Properties();
for (Map.Entry<Object, Object> entry : properties.entrySet()) {
if ... | [
"public",
"static",
"Properties",
"extractPropertiesWithPrefix",
"(",
"Properties",
"properties",
",",
"Optional",
"<",
"String",
">",
"prefix",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"properties",
")",
";",
"Preconditions",
".",
"checkNotNull",
"(",
... | Extract all the keys that start with a <code>prefix</code> in {@link Properties} to a new {@link Properties}
instance.
@param properties the given {@link Properties} instance
@param prefix of keys to be extracted
@return a {@link Properties} instance | [
"Extract",
"all",
"the",
"keys",
"that",
"start",
"with",
"a",
"<code",
">",
"prefix<",
"/",
"code",
">",
"in",
"{",
"@link",
"Properties",
"}",
"to",
"a",
"new",
"{",
"@link",
"Properties",
"}",
"instance",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/PropertiesUtils.java#L80-L92 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/Point.java | Point.getAttributeAsInt | public int getAttributeAsInt(int semantics, int ordinate) {
"""
Returns value of the given vertex attribute's ordinate. The ordinate is
always 0 because integer attributes always have one component.
@param semantics
The attribute semantics.
@param ordinate
The attribute's ordinate. For example, the y coordi... | java | public int getAttributeAsInt(int semantics, int ordinate) {
if (isEmptyImpl())
throw new GeometryException(
"This operation was performed on an Empty Geometry.");
int ncomps = VertexDescription.getComponentCount(semantics);
if (ordinate >= ncomps)
throw new IndexOutOfBoundsException();
int attribut... | [
"public",
"int",
"getAttributeAsInt",
"(",
"int",
"semantics",
",",
"int",
"ordinate",
")",
"{",
"if",
"(",
"isEmptyImpl",
"(",
")",
")",
"throw",
"new",
"GeometryException",
"(",
"\"This operation was performed on an Empty Geometry.\"",
")",
";",
"int",
"ncomps",
... | Returns value of the given vertex attribute's ordinate. The ordinate is
always 0 because integer attributes always have one component.
@param semantics
The attribute semantics.
@param ordinate
The attribute's ordinate. For example, the y coordinate of the
NORMAL has ordinate of 1.
@return The ordinate value truncated ... | [
"Returns",
"value",
"of",
"the",
"given",
"vertex",
"attribute",
"s",
"ordinate",
".",
"The",
"ordinate",
"is",
"always",
"0",
"because",
"integer",
"attributes",
"always",
"have",
"one",
"component",
"."
] | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/Point.java#L312-L327 |
borball/weixin-sdk | weixin-mp/src/main/java/com/riversoft/weixin/mp/media/Materials.java | Materials.addThumb | public Material addThumb(InputStream inputStream, String fileName) {
"""
上传缩略图
@param inputStream 缩略图
@param fileName 文件名
@return 上传结果
"""
return upload(MediaType.thumb, inputStream, fileName);
} | java | public Material addThumb(InputStream inputStream, String fileName) {
return upload(MediaType.thumb, inputStream, fileName);
} | [
"public",
"Material",
"addThumb",
"(",
"InputStream",
"inputStream",
",",
"String",
"fileName",
")",
"{",
"return",
"upload",
"(",
"MediaType",
".",
"thumb",
",",
"inputStream",
",",
"fileName",
")",
";",
"}"
] | 上传缩略图
@param inputStream 缩略图
@param fileName 文件名
@return 上传结果 | [
"上传缩略图"
] | train | https://github.com/borball/weixin-sdk/blob/32bf5e45cdd8d0d28074e83954e1ec62dcf25cb7/weixin-mp/src/main/java/com/riversoft/weixin/mp/media/Materials.java#L175-L177 |
xdcrafts/flower | flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapDotApi.java | MapDotApi.dotGetOptionalUnsafe | public static <T> Optional<T> dotGetOptionalUnsafe(
final Map map, final String pathString, final Class<T> clazz
) {
"""
Get optional value by path.
@param <T> optional value type
@param clazz type of value
@param map subject
@param pathString nodes to walk in map
@return value
"""
... | java | public static <T> Optional<T> dotGetOptionalUnsafe(
final Map map, final String pathString, final Class<T> clazz
) {
return dotGetUnsafe(map, Optional.class, pathString);
} | [
"public",
"static",
"<",
"T",
">",
"Optional",
"<",
"T",
">",
"dotGetOptionalUnsafe",
"(",
"final",
"Map",
"map",
",",
"final",
"String",
"pathString",
",",
"final",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"dotGetUnsafe",
"(",
"map",
",",
... | Get optional value by path.
@param <T> optional value type
@param clazz type of value
@param map subject
@param pathString nodes to walk in map
@return value | [
"Get",
"optional",
"value",
"by",
"path",
"."
] | train | https://github.com/xdcrafts/flower/blob/96a8e49102fea434bd383a3c7852f0ee9545f999/flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapDotApi.java#L268-L272 |
osglworks/java-tool-ext | src/main/java/org/osgl/util/Token.java | Token.generateToken | public static String generateToken(byte[] secret, long seconds, String oid, String... payload) {
"""
Generate a token string with secret key, ID and optionally payloads
@param secret the secret to encrypt to token string
@param seconds the expiration of the token in seconds
@param oid the ID of the token (could... | java | public static String generateToken(byte[] secret, long seconds, String oid, String... payload) {
long due = Life.due(seconds);
List<String> l = new ArrayList<String>(2 + payload.length);
l.add(oid);
l.add(String.valueOf(due));
l.addAll(C.listOf(payload));
String s = S.joi... | [
"public",
"static",
"String",
"generateToken",
"(",
"byte",
"[",
"]",
"secret",
",",
"long",
"seconds",
",",
"String",
"oid",
",",
"String",
"...",
"payload",
")",
"{",
"long",
"due",
"=",
"Life",
".",
"due",
"(",
"seconds",
")",
";",
"List",
"<",
"S... | Generate a token string with secret key, ID and optionally payloads
@param secret the secret to encrypt to token string
@param seconds the expiration of the token in seconds
@param oid the ID of the token (could be customer ID etc)
@param payload the payload optionally indicate more information
@return an encrypted tok... | [
"Generate",
"a",
"token",
"string",
"with",
"secret",
"key",
"ID",
"and",
"optionally",
"payloads"
] | train | https://github.com/osglworks/java-tool-ext/blob/43f034bd0a42e571e437f44aa20487d45248a30b/src/main/java/org/osgl/util/Token.java#L336-L344 |
larsga/Duke | duke-core/src/main/java/no/priv/garshol/duke/utils/NTriplesParser.java | NTriplesParser.parse | public static void parse(Reader src, StatementHandler handler)
throws IOException {
"""
Reads the NTriples file from the reader, pushing statements into
the handler.
"""
new NTriplesParser(src, handler).parse();
} | java | public static void parse(Reader src, StatementHandler handler)
throws IOException {
new NTriplesParser(src, handler).parse();
} | [
"public",
"static",
"void",
"parse",
"(",
"Reader",
"src",
",",
"StatementHandler",
"handler",
")",
"throws",
"IOException",
"{",
"new",
"NTriplesParser",
"(",
"src",
",",
"handler",
")",
".",
"parse",
"(",
")",
";",
"}"
] | Reads the NTriples file from the reader, pushing statements into
the handler. | [
"Reads",
"the",
"NTriples",
"file",
"from",
"the",
"reader",
"pushing",
"statements",
"into",
"the",
"handler",
"."
] | train | https://github.com/larsga/Duke/blob/6263f9c6e984c26362a76241c7c7ea3bb4469bac/duke-core/src/main/java/no/priv/garshol/duke/utils/NTriplesParser.java#L25-L28 |
ManfredTremmel/gwt-bean-validators | gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/StringUtils.java | StringUtils.trimLeadingCharacter | public static String trimLeadingCharacter(final String str, final char leadingCharacter) {
"""
Trim all occurrences of the supplied leading character from the given {@code String}.
@param str the {@code String} to check
@param leadingCharacter the leading character to be trimmed
@return the trimmed {@code Str... | java | public static String trimLeadingCharacter(final String str, final char leadingCharacter) {
if (!StringUtils.hasLength(str)) {
return str;
}
final StringBuilder sb = new StringBuilder(str);
while (sb.length() > 0 && sb.charAt(0) == leadingCharacter) {
sb.deleteCharAt(0);
}
return sb.... | [
"public",
"static",
"String",
"trimLeadingCharacter",
"(",
"final",
"String",
"str",
",",
"final",
"char",
"leadingCharacter",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"hasLength",
"(",
"str",
")",
")",
"{",
"return",
"str",
";",
"}",
"final",
"String... | Trim all occurrences of the supplied leading character from the given {@code String}.
@param str the {@code String} to check
@param leadingCharacter the leading character to be trimmed
@return the trimmed {@code String} | [
"Trim",
"all",
"occurrences",
"of",
"the",
"supplied",
"leading",
"character",
"from",
"the",
"given",
"{",
"@code",
"String",
"}",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/StringUtils.java#L311-L321 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.