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 |
|---|---|---|---|---|---|---|---|---|---|---|
jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/JBasePanel.java | JBasePanel.getTargetScreen | public Container getTargetScreen(Container component, Class<?> targetClass) {
"""
Climb up through the panel hierarchy until you find a component of this class.
@param component The (non-inclusive) component to start climbing up to find this class.
@param targetClass The class type to find (or inherited).
@retu... | java | public Container getTargetScreen(Container component, Class<?> targetClass)
{
Container container = this.getTargetScreen(component, targetClass, true);
if (container == null)
if (component instanceof JBasePanel)
if (component != this) // Special case, need to look from t... | [
"public",
"Container",
"getTargetScreen",
"(",
"Container",
"component",
",",
"Class",
"<",
"?",
">",
"targetClass",
")",
"{",
"Container",
"container",
"=",
"this",
".",
"getTargetScreen",
"(",
"component",
",",
"targetClass",
",",
"true",
")",
";",
"if",
"... | Climb up through the panel hierarchy until you find a component of this class.
@param component The (non-inclusive) component to start climbing up to find this class.
@param targetClass The class type to find (or inherited).
@return The first parent up the tree to match this class (or null). | [
"Climb",
"up",
"through",
"the",
"panel",
"hierarchy",
"until",
"you",
"find",
"a",
"component",
"of",
"this",
"class",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/JBasePanel.java#L348-L356 |
netplex/json-smart-v2 | accessors-smart/src/main/java/net/minidev/asm/DynamicClassLoader.java | DynamicClassLoader.defineClass | Class<?> defineClass(String name, byte[] bytes) throws ClassFormatError {
"""
Call defineClass into the parent classLoader using the
method.setAccessible(boolean) hack
@see ClassLoader#defineClass(String, byte[], int, int)
"""
try {
// Attempt to load the access class in the same loader, which makes
... | java | Class<?> defineClass(String name, byte[] bytes) throws ClassFormatError {
try {
// Attempt to load the access class in the same loader, which makes
// protected and default access members accessible.
Method method = ClassLoader.class.getDeclaredMethod("defineClass", DEF_CLASS_SIG);
method.setAccessible(tr... | [
"Class",
"<",
"?",
">",
"defineClass",
"(",
"String",
"name",
",",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"ClassFormatError",
"{",
"try",
"{",
"// Attempt to load the access class in the same loader, which makes",
"// protected and default access members accessible.",
"M... | Call defineClass into the parent classLoader using the
method.setAccessible(boolean) hack
@see ClassLoader#defineClass(String, byte[], int, int) | [
"Call",
"defineClass",
"into",
"the",
"parent",
"classLoader",
"using",
"the",
"method",
".",
"setAccessible",
"(",
"boolean",
")",
"hack"
] | train | https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/accessors-smart/src/main/java/net/minidev/asm/DynamicClassLoader.java#L77-L87 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/TypeUtil.java | TypeUtil.getParamType | public static Type getParamType(Method method, int index) {
"""
获取方法的参数类型<br>
优先获取方法的GenericParameterTypes,如果获取不到,则获取ParameterTypes
@param method 方法
@param index 第几个参数的索引,从0开始计数
@return {@link Type},可能为{@code null}
"""
Type[] types = getParamTypes(method);
if (null != types && types.length > index)... | java | public static Type getParamType(Method method, int index) {
Type[] types = getParamTypes(method);
if (null != types && types.length > index) {
return types[index];
}
return null;
} | [
"public",
"static",
"Type",
"getParamType",
"(",
"Method",
"method",
",",
"int",
"index",
")",
"{",
"Type",
"[",
"]",
"types",
"=",
"getParamTypes",
"(",
"method",
")",
";",
"if",
"(",
"null",
"!=",
"types",
"&&",
"types",
".",
"length",
">",
"index",
... | 获取方法的参数类型<br>
优先获取方法的GenericParameterTypes,如果获取不到,则获取ParameterTypes
@param method 方法
@param index 第几个参数的索引,从0开始计数
@return {@link Type},可能为{@code null} | [
"获取方法的参数类型<br",
">",
"优先获取方法的GenericParameterTypes,如果获取不到,则获取ParameterTypes"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/TypeUtil.java#L112-L118 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/util/GwtEventUtil.java | GwtEventUtil.getPosition | public static Coordinate getPosition(MouseEvent<?> event, int offsetX, int offsetY) {
"""
Get the position of a mouse event.
@param event
The mouse event itself.
@param offsetX
An extra value to be added to the X axis.
@param offsetY
An extra value to be added to the Y axis.
@return Returns a coordinate h... | java | public static Coordinate getPosition(MouseEvent<?> event, int offsetX, int offsetY) {
return new Coordinate(event.getX() + offsetX, event.getY() + offsetY);
} | [
"public",
"static",
"Coordinate",
"getPosition",
"(",
"MouseEvent",
"<",
"?",
">",
"event",
",",
"int",
"offsetX",
",",
"int",
"offsetY",
")",
"{",
"return",
"new",
"Coordinate",
"(",
"event",
".",
"getX",
"(",
")",
"+",
"offsetX",
",",
"event",
".",
"... | Get the position of a mouse event.
@param event
The mouse event itself.
@param offsetX
An extra value to be added to the X axis.
@param offsetY
An extra value to be added to the Y axis.
@return Returns a coordinate holding the event's X and Y ordinate, where the origin is the upper left corner of
the DOM element catch... | [
"Get",
"the",
"position",
"of",
"a",
"mouse",
"event",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/util/GwtEventUtil.java#L65-L67 |
airlift/slice | src/main/java/io/airlift/slice/Slices.java | Slices.wrappedShortArray | public static Slice wrappedShortArray(short[] array, int offset, int length) {
"""
Creates a slice over the specified array range.
@param offset the array position at which the slice begins
@param length the number of array positions to include in the slice
"""
if (length == 0) {
return... | java | public static Slice wrappedShortArray(short[] array, int offset, int length)
{
if (length == 0) {
return EMPTY_SLICE;
}
return new Slice(array, offset, length);
} | [
"public",
"static",
"Slice",
"wrappedShortArray",
"(",
"short",
"[",
"]",
"array",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"if",
"(",
"length",
"==",
"0",
")",
"{",
"return",
"EMPTY_SLICE",
";",
"}",
"return",
"new",
"Slice",
"(",
"array"... | Creates a slice over the specified array range.
@param offset the array position at which the slice begins
@param length the number of array positions to include in the slice | [
"Creates",
"a",
"slice",
"over",
"the",
"specified",
"array",
"range",
"."
] | train | https://github.com/airlift/slice/blob/7166cb0319e3655f8ba15f5a7ccf3d2f721c1242/src/main/java/io/airlift/slice/Slices.java#L193-L199 |
banq/jdonframework | src/main/java/com/jdon/container/annotation/type/ModelConsumerLoader.java | ModelConsumerLoader.loadMehtodAnnotations | public void loadMehtodAnnotations(Class cclass, ContainerWrapper containerWrapper) {
"""
add the class to consumers annotated with @OnCommand
@param cclass
@param containerWrapper
"""
try {
for (Method method : ClassUtil.getAllDecaredMethods(cclass)) {
if (method.isAnnotationPresent(OnCommand... | java | public void loadMehtodAnnotations(Class cclass, ContainerWrapper containerWrapper) {
try {
for (Method method : ClassUtil.getAllDecaredMethods(cclass)) {
if (method.isAnnotationPresent(OnCommand.class)) {
addConsumerMethod(method, cclass, containerWrapper);
}
}
} catch (Exception e) {
... | [
"public",
"void",
"loadMehtodAnnotations",
"(",
"Class",
"cclass",
",",
"ContainerWrapper",
"containerWrapper",
")",
"{",
"try",
"{",
"for",
"(",
"Method",
"method",
":",
"ClassUtil",
".",
"getAllDecaredMethods",
"(",
"cclass",
")",
")",
"{",
"if",
"(",
"metho... | add the class to consumers annotated with @OnCommand
@param cclass
@param containerWrapper | [
"add",
"the",
"class",
"to",
"consumers",
"annotated",
"with",
"@OnCommand"
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/container/annotation/type/ModelConsumerLoader.java#L58-L70 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/FailoverStrategyLoader.java | FailoverStrategyLoader.loadFailoverStrategy | public static FailoverStrategy.Factory loadFailoverStrategy(Configuration config, @Nullable Logger logger) {
"""
Loads a FailoverStrategy Factory from the given configuration.
"""
final String strategyParam = config.getString(JobManagerOptions.EXECUTION_FAILOVER_STRATEGY);
if (StringUtils.isNullOrWhitespa... | java | public static FailoverStrategy.Factory loadFailoverStrategy(Configuration config, @Nullable Logger logger) {
final String strategyParam = config.getString(JobManagerOptions.EXECUTION_FAILOVER_STRATEGY);
if (StringUtils.isNullOrWhitespaceOnly(strategyParam)) {
if (logger != null) {
logger.warn("Null config v... | [
"public",
"static",
"FailoverStrategy",
".",
"Factory",
"loadFailoverStrategy",
"(",
"Configuration",
"config",
",",
"@",
"Nullable",
"Logger",
"logger",
")",
"{",
"final",
"String",
"strategyParam",
"=",
"config",
".",
"getString",
"(",
"JobManagerOptions",
".",
... | Loads a FailoverStrategy Factory from the given configuration. | [
"Loads",
"a",
"FailoverStrategy",
"Factory",
"from",
"the",
"given",
"configuration",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/FailoverStrategyLoader.java#L49-L77 |
jenkinsci/jenkins | core/src/main/java/hudson/EnvVars.java | EnvVars.overrideAll | public EnvVars overrideAll(Map<String,String> all) {
"""
Overrides all values in the map by the given map.
See {@link #override(String, String)}.
@return this
"""
for (Map.Entry<String, String> e : all.entrySet()) {
override(e.getKey(),e.getValue());
}
return this;
} | java | public EnvVars overrideAll(Map<String,String> all) {
for (Map.Entry<String, String> e : all.entrySet()) {
override(e.getKey(),e.getValue());
}
return this;
} | [
"public",
"EnvVars",
"overrideAll",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"all",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"e",
":",
"all",
".",
"entrySet",
"(",
")",
")",
"{",
"override",
"(",
"e",
".... | Overrides all values in the map by the given map.
See {@link #override(String, String)}.
@return this | [
"Overrides",
"all",
"values",
"in",
"the",
"map",
"by",
"the",
"given",
"map",
".",
"See",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/EnvVars.java#L175-L180 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/util/Utils.java | Utils.addListWithIndex | public static <P> void addListWithIndex(final List<P> list, final P element, final int index) {
"""
リストに要素のインデックスを指定して追加します。
<p>リストのサイズが足りない場合は、サイズを自動的に変更します。</p>
@since 2.0
@param list リスト
@param element 追加する要素。値はnullでもよい。
@param index 追加する要素のインデックス番号(0以上)
@throws IllegalArgumentException {@literal list == ... | java | public static <P> void addListWithIndex(final List<P> list, final P element, final int index) {
ArgUtils.notNull(list, "list");
ArgUtils.notMin(index, 0, "index");
final int listSize = list.size();
if(listSize < index) {
// 足りない場合は、要素を追加する。
final int lackS... | [
"public",
"static",
"<",
"P",
">",
"void",
"addListWithIndex",
"(",
"final",
"List",
"<",
"P",
">",
"list",
",",
"final",
"P",
"element",
",",
"final",
"int",
"index",
")",
"{",
"ArgUtils",
".",
"notNull",
"(",
"list",
",",
"\"list\"",
")",
";",
"Arg... | リストに要素のインデックスを指定して追加します。
<p>リストのサイズが足りない場合は、サイズを自動的に変更します。</p>
@since 2.0
@param list リスト
@param element 追加する要素。値はnullでもよい。
@param index 追加する要素のインデックス番号(0以上)
@throws IllegalArgumentException {@literal list == null.}
@throws IllegalArgumentException {@literal index < 0.} | [
"リストに要素のインデックスを指定して追加します。",
"<p",
">",
"リストのサイズが足りない場合は、サイズを自動的に変更します。<",
"/",
"p",
">"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/util/Utils.java#L612-L634 |
beihaifeiwu/dolphin | dolphin-mybatis-generator/src/main/java/com/freetmp/mbg/plugin/ContentMergePlugin.java | ContentMergePlugin.visitAndMerge | private void visitAndMerge(final Document document, File targetFile) throws IOException, DocumentException {
"""
访问并合并mapper的xml文件
@param document generate xml dom tree
@param targetFile the file for writing xml content
@throws java.io.IOException
@throws org.dom4j.DocumentException
"""
SAXReader r... | java | private void visitAndMerge(final Document document, File targetFile) throws IOException, DocumentException {
SAXReader reader = new SAXReader();
reader.setValidation(false);
org.dom4j.Document doc = reader.read(targetFile);
final org.dom4j.Element rootElement = doc.getRootElement();
rootElement.acce... | [
"private",
"void",
"visitAndMerge",
"(",
"final",
"Document",
"document",
",",
"File",
"targetFile",
")",
"throws",
"IOException",
",",
"DocumentException",
"{",
"SAXReader",
"reader",
"=",
"new",
"SAXReader",
"(",
")",
";",
"reader",
".",
"setValidation",
"(",
... | 访问并合并mapper的xml文件
@param document generate xml dom tree
@param targetFile the file for writing xml content
@throws java.io.IOException
@throws org.dom4j.DocumentException | [
"访问并合并mapper的xml文件"
] | train | https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-mybatis-generator/src/main/java/com/freetmp/mbg/plugin/ContentMergePlugin.java#L93-L124 |
arakelian/more-commons | src/main/java/com/arakelian/core/utils/XmlStreamReaderUtils.java | XmlStreamReaderUtils.requiredByteAttribute | public static byte requiredByteAttribute(final XMLStreamReader reader, final String localName)
throws XMLStreamException {
"""
Returns the value of an attribute as a byte. If the attribute is empty, this method throws an
exception.
@param reader
<code>XMLStreamReader</code> that contains attribute... | java | public static byte requiredByteAttribute(final XMLStreamReader reader, final String localName)
throws XMLStreamException {
return requiredByteAttribute(reader, null, localName);
} | [
"public",
"static",
"byte",
"requiredByteAttribute",
"(",
"final",
"XMLStreamReader",
"reader",
",",
"final",
"String",
"localName",
")",
"throws",
"XMLStreamException",
"{",
"return",
"requiredByteAttribute",
"(",
"reader",
",",
"null",
",",
"localName",
")",
";",
... | Returns the value of an attribute as a byte. If the attribute is empty, this method throws an
exception.
@param reader
<code>XMLStreamReader</code> that contains attribute values.
@param localName
local name of attribute (the namespace is ignored).
@return value of attribute as byte
@throws XMLStreamException
if attri... | [
"Returns",
"the",
"value",
"of",
"an",
"attribute",
"as",
"a",
"byte",
".",
"If",
"the",
"attribute",
"is",
"empty",
"this",
"method",
"throws",
"an",
"exception",
"."
] | train | https://github.com/arakelian/more-commons/blob/83c607044f64a7f6c005a67866c0ef7cb68d6e29/src/main/java/com/arakelian/core/utils/XmlStreamReaderUtils.java#L1038-L1041 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/style/stylers/Image.java | Image.draw | @Override
protected final void draw(PdfContentByte canvas, float x, float y, float width, float height, String genericTag) throws VectorPrintException {
"""
Calls {@link #createImage(com.itextpdf.text.pdf.PdfContentByte, java.lang.Object, float) }, {@link #applySettings(com.itextpdf.text.Image) },
{@link com.i... | java | @Override
protected final void draw(PdfContentByte canvas, float x, float y, float width, float height, String genericTag) throws VectorPrintException {
com.itextpdf.text.Image img;
try {
img = createImage(canvas, getData(), getValue((isDrawShadow()) ? SHADOWOPACITY : OPACITY, Float.class));
... | [
"@",
"Override",
"protected",
"final",
"void",
"draw",
"(",
"PdfContentByte",
"canvas",
",",
"float",
"x",
",",
"float",
"y",
",",
"float",
"width",
",",
"float",
"height",
",",
"String",
"genericTag",
")",
"throws",
"VectorPrintException",
"{",
"com",
".",
... | Calls {@link #createImage(com.itextpdf.text.pdf.PdfContentByte, java.lang.Object, float) }, {@link #applySettings(com.itextpdf.text.Image) },
{@link com.itextpdf.text.Image#setAbsolutePosition(float, float) } and
{@link #addToCanvas(float[], com.itextpdf.text.Image, com.itextpdf.text.pdf.PdfContentByte)
}.
@param canv... | [
"Calls",
"{",
"@link",
"#createImage",
"(",
"com",
".",
"itextpdf",
".",
"text",
".",
"pdf",
".",
"PdfContentByte",
"java",
".",
"lang",
".",
"Object",
"float",
")",
"}",
"{",
"@link",
"#applySettings",
"(",
"com",
".",
"itextpdf",
".",
"text",
".",
"I... | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/style/stylers/Image.java#L106-L123 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/query/TaskKvStateRegistry.java | TaskKvStateRegistry.registerKvState | public void registerKvState(KeyGroupRange keyGroupRange, String registrationName, InternalKvState<?, ?, ?> kvState) {
"""
Registers the KvState instance at the KvStateRegistry.
@param keyGroupRange Key group range the KvState instance belongs to
@param registrationName The registration name (not necessarily... | java | public void registerKvState(KeyGroupRange keyGroupRange, String registrationName, InternalKvState<?, ?, ?> kvState) {
KvStateID kvStateId = registry.registerKvState(jobId, jobVertexId, keyGroupRange, registrationName, kvState);
registeredKvStates.add(new KvStateInfo(keyGroupRange, registrationName, kvStateId));
} | [
"public",
"void",
"registerKvState",
"(",
"KeyGroupRange",
"keyGroupRange",
",",
"String",
"registrationName",
",",
"InternalKvState",
"<",
"?",
",",
"?",
",",
"?",
">",
"kvState",
")",
"{",
"KvStateID",
"kvStateId",
"=",
"registry",
".",
"registerKvState",
"(",... | Registers the KvState instance at the KvStateRegistry.
@param keyGroupRange Key group range the KvState instance belongs to
@param registrationName The registration name (not necessarily the same
as the KvState name defined in the state
descriptor used to create the KvState instance)
@param kvState The | [
"Registers",
"the",
"KvState",
"instance",
"at",
"the",
"KvStateRegistry",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/query/TaskKvStateRegistry.java#L63-L66 |
percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/ToastUtils.java | ToastUtils.quickToast | public static Toast quickToast(Context context, String message, boolean longLength) {
"""
Display a toast with the given message.
@param context The current Context or Activity that this method is called from
@param message Message to display
@param longLength if true, will use Toast.LENGTH_LONG (approx... | java | public static Toast quickToast(Context context, String message, boolean longLength) {
final Toast toast;
if (longLength) {
toast = Toast.makeText(context, message, Toast.LENGTH_LONG);
} else {
toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
}
... | [
"public",
"static",
"Toast",
"quickToast",
"(",
"Context",
"context",
",",
"String",
"message",
",",
"boolean",
"longLength",
")",
"{",
"final",
"Toast",
"toast",
";",
"if",
"(",
"longLength",
")",
"{",
"toast",
"=",
"Toast",
".",
"makeText",
"(",
"context... | Display a toast with the given message.
@param context The current Context or Activity that this method is called from
@param message Message to display
@param longLength if true, will use Toast.LENGTH_LONG (approx 3.5 sec) instead of
@return Toast object that is being displayed. Note,show() has already been cal... | [
"Display",
"a",
"toast",
"with",
"the",
"given",
"message",
"."
] | train | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/ToastUtils.java#L33-L42 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/Strs.java | Strs.endAny | public static boolean endAny(String target, String... endWith) {
"""
Check if target string ends with any of an array of specified strings.
@param target
@param endWith
@return
"""
return endAny(target, Arrays.asList(endWith));
} | java | public static boolean endAny(String target, String... endWith) {
return endAny(target, Arrays.asList(endWith));
} | [
"public",
"static",
"boolean",
"endAny",
"(",
"String",
"target",
",",
"String",
"...",
"endWith",
")",
"{",
"return",
"endAny",
"(",
"target",
",",
"Arrays",
".",
"asList",
"(",
"endWith",
")",
")",
";",
"}"
] | Check if target string ends with any of an array of specified strings.
@param target
@param endWith
@return | [
"Check",
"if",
"target",
"string",
"ends",
"with",
"any",
"of",
"an",
"array",
"of",
"specified",
"strings",
"."
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/Strs.java#L303-L305 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksInner.java | WebhooksInner.listEventsWithServiceResponseAsync | public Observable<ServiceResponse<Page<EventInner>>> listEventsWithServiceResponseAsync(final String resourceGroupName, final String registryName, final String webhookName) {
"""
Lists recent events for the specified webhook.
@param resourceGroupName The name of the resource group to which the container registr... | java | public Observable<ServiceResponse<Page<EventInner>>> listEventsWithServiceResponseAsync(final String resourceGroupName, final String registryName, final String webhookName) {
return listEventsSinglePageAsync(resourceGroupName, registryName, webhookName)
.concatMap(new Func1<ServiceResponse<Page<Even... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"EventInner",
">",
">",
">",
"listEventsWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"registryName",
",",
"final",
"String",
"webhookName",
")",
"{",... | Lists recent events for the specified webhook.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param webhookName The name of the webhook.
@throws IllegalArgumentException thrown if parameters fail the validation
@... | [
"Lists",
"recent",
"events",
"for",
"the",
"specified",
"webhook",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksInner.java#L1116-L1128 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/StatementDML.java | StatementDML.voltGetStatementXML | @Override
VoltXMLElement voltGetStatementXML(Session session)
throws org.hsqldb_voltpatches.HSQLInterface.HSQLParseException {
"""
VoltDB added method to get a non-catalog-dependent
representation of this HSQLDB object.
@param session The current Session object may be needed to resolve
some names.
@ret... | java | @Override
VoltXMLElement voltGetStatementXML(Session session)
throws org.hsqldb_voltpatches.HSQLInterface.HSQLParseException
{
VoltXMLElement xml;
switch (type) {
case StatementTypes.INSERT :
xml = new VoltXMLElement("insert");
assert(insertExpression != nul... | [
"@",
"Override",
"VoltXMLElement",
"voltGetStatementXML",
"(",
"Session",
"session",
")",
"throws",
"org",
".",
"hsqldb_voltpatches",
".",
"HSQLInterface",
".",
"HSQLParseException",
"{",
"VoltXMLElement",
"xml",
";",
"switch",
"(",
"type",
")",
"{",
"case",
"Stat... | VoltDB added method to get a non-catalog-dependent
representation of this HSQLDB object.
@param session The current Session object may be needed to resolve
some names.
@return XML, correctly indented, representing this object.
@throws HSQLParseException | [
"VoltDB",
"added",
"method",
"to",
"get",
"a",
"non",
"-",
"catalog",
"-",
"dependent",
"representation",
"of",
"this",
"HSQLDB",
"object",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/StatementDML.java#L1395-L1451 |
jparsec/jparsec | jparsec/src/main/java/org/jparsec/pattern/Patterns.java | Patterns.atMost | public static Pattern atMost(final int max, final CharPredicate predicate) {
"""
Returns a {@link Pattern} that matches up to {@code max} number of characters satisfying
{@code predicate}.
@since 2.2
"""
Checks.checkMax(max);
return new Pattern() {
@Override
public int match(CharSequence ... | java | public static Pattern atMost(final int max, final CharPredicate predicate) {
Checks.checkMax(max);
return new Pattern() {
@Override
public int match(CharSequence src, int begin, int end) {
return matchSome(max, predicate, src, end, begin, 0);
}
};
} | [
"public",
"static",
"Pattern",
"atMost",
"(",
"final",
"int",
"max",
",",
"final",
"CharPredicate",
"predicate",
")",
"{",
"Checks",
".",
"checkMax",
"(",
"max",
")",
";",
"return",
"new",
"Pattern",
"(",
")",
"{",
"@",
"Override",
"public",
"int",
"matc... | Returns a {@link Pattern} that matches up to {@code max} number of characters satisfying
{@code predicate}.
@since 2.2 | [
"Returns",
"a",
"{"
] | train | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/pattern/Patterns.java#L439-L447 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/concurrent/ConcurrentUtils.java | ConcurrentUtils.createIfAbsentUnchecked | public static <K, V> V createIfAbsentUnchecked(final ConcurrentMap<K, V> map,
final K key, final ConcurrentInitializer<V> init) {
"""
Checks if a concurrent map contains a key and creates a corresponding
value if not, suppressing checked exceptions. This method calls
{@code createIfAbsent()}. If a {@... | java | public static <K, V> V createIfAbsentUnchecked(final ConcurrentMap<K, V> map,
final K key, final ConcurrentInitializer<V> init) {
try {
return createIfAbsent(map, key, init);
} catch (final ConcurrentException cex) {
throw new ConcurrentRuntimeException(cex.getCause()... | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"V",
"createIfAbsentUnchecked",
"(",
"final",
"ConcurrentMap",
"<",
"K",
",",
"V",
">",
"map",
",",
"final",
"K",
"key",
",",
"final",
"ConcurrentInitializer",
"<",
"V",
">",
"init",
")",
"{",
"try",
"{",
... | Checks if a concurrent map contains a key and creates a corresponding
value if not, suppressing checked exceptions. This method calls
{@code createIfAbsent()}. If a {@link ConcurrentException} is thrown, it
is caught and re-thrown as a {@link ConcurrentRuntimeException}.
@param <K> the type of the keys of the map
@par... | [
"Checks",
"if",
"a",
"concurrent",
"map",
"contains",
"a",
"key",
"and",
"creates",
"a",
"corresponding",
"value",
"if",
"not",
"suppressing",
"checked",
"exceptions",
".",
"This",
"method",
"calls",
"{",
"@code",
"createIfAbsent",
"()",
"}",
".",
"If",
"a",... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/concurrent/ConcurrentUtils.java#L302-L309 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_ssl_certkey.java | ns_ssl_certkey.add | public static ns_ssl_certkey add(nitro_service client, ns_ssl_certkey resource) throws Exception {
"""
<pre>
Use this operation to install certificates on NetScaler Instance(s).
</pre>
"""
resource.validate("add");
return ((ns_ssl_certkey[]) resource.perform_operation(client, "add"))[0];
} | java | public static ns_ssl_certkey add(nitro_service client, ns_ssl_certkey resource) throws Exception
{
resource.validate("add");
return ((ns_ssl_certkey[]) resource.perform_operation(client, "add"))[0];
} | [
"public",
"static",
"ns_ssl_certkey",
"add",
"(",
"nitro_service",
"client",
",",
"ns_ssl_certkey",
"resource",
")",
"throws",
"Exception",
"{",
"resource",
".",
"validate",
"(",
"\"add\"",
")",
";",
"return",
"(",
"(",
"ns_ssl_certkey",
"[",
"]",
")",
"resour... | <pre>
Use this operation to install certificates on NetScaler Instance(s).
</pre> | [
"<pre",
">",
"Use",
"this",
"operation",
"to",
"install",
"certificates",
"on",
"NetScaler",
"Instance",
"(",
"s",
")",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_ssl_certkey.java#L430-L434 |
lightblueseas/vintage-time | src/main/java/de/alpharogroup/date/CalculateDateExtensions.java | CalculateDateExtensions.addDays | public static Date addDays(final Date date, final int addDays) {
"""
Adds days to the given Date object and returns it. Note: you can add negative values too for
get date in past.
@param date
The Date object to add the days.
@param addDays
The days to add.
@return The resulted Date object.
"""
final ... | java | public static Date addDays(final Date date, final int addDays)
{
final Calendar dateOnCalendar = Calendar.getInstance();
dateOnCalendar.setTime(date);
dateOnCalendar.add(Calendar.DATE, addDays);
return dateOnCalendar.getTime();
} | [
"public",
"static",
"Date",
"addDays",
"(",
"final",
"Date",
"date",
",",
"final",
"int",
"addDays",
")",
"{",
"final",
"Calendar",
"dateOnCalendar",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"dateOnCalendar",
".",
"setTime",
"(",
"date",
")",
";... | Adds days to the given Date object and returns it. Note: you can add negative values too for
get date in past.
@param date
The Date object to add the days.
@param addDays
The days to add.
@return The resulted Date object. | [
"Adds",
"days",
"to",
"the",
"given",
"Date",
"object",
"and",
"returns",
"it",
".",
"Note",
":",
"you",
"can",
"add",
"negative",
"values",
"too",
"for",
"get",
"date",
"in",
"past",
"."
] | train | https://github.com/lightblueseas/vintage-time/blob/fbf201e679d9f9b92e7b5771f3eea1413cc2e113/src/main/java/de/alpharogroup/date/CalculateDateExtensions.java#L56-L62 |
alkacon/opencms-core | src/org/opencms/ui/apps/A_CmsWorkplaceApp.java | A_CmsWorkplaceApp.getParamFromState | public static String getParamFromState(String state, String paramName) {
"""
Parses the requested parameter from the given state.<p>
@param state the state
@param paramName the parameter name
@return the parameter value
"""
String prefix = PARAM_SEPARATOR + paramName + PARAM_ASSIGN;
if ... | java | public static String getParamFromState(String state, String paramName) {
String prefix = PARAM_SEPARATOR + paramName + PARAM_ASSIGN;
if (state.contains(prefix)) {
String result = state.substring(state.indexOf(prefix) + prefix.length());
if (result.contains(PARAM_SEPARATOR)) {
... | [
"public",
"static",
"String",
"getParamFromState",
"(",
"String",
"state",
",",
"String",
"paramName",
")",
"{",
"String",
"prefix",
"=",
"PARAM_SEPARATOR",
"+",
"paramName",
"+",
"PARAM_ASSIGN",
";",
"if",
"(",
"state",
".",
"contains",
"(",
"prefix",
")",
... | Parses the requested parameter from the given state.<p>
@param state the state
@param paramName the parameter name
@return the parameter value | [
"Parses",
"the",
"requested",
"parameter",
"from",
"the",
"given",
"state",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/A_CmsWorkplaceApp.java#L183-L194 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.spare_brands_GET | public ArrayList<String> spare_brands_GET() throws IOException {
"""
Get all available spare brands
REST: GET /telephony/spare/brands
"""
String qPath = "/telephony/spare/brands";
StringBuilder sb = path(qPath);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, t4);
} | java | public ArrayList<String> spare_brands_GET() throws IOException {
String qPath = "/telephony/spare/brands";
StringBuilder sb = path(qPath);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, t4);
} | [
"public",
"ArrayList",
"<",
"String",
">",
"spare_brands_GET",
"(",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/spare/brands\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"String",
"resp",
"=",
"execN",
"(",
... | Get all available spare brands
REST: GET /telephony/spare/brands | [
"Get",
"all",
"available",
"spare",
"brands"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L9102-L9107 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/JobConfigurationUtils.java | JobConfigurationUtils.putPropertiesIntoConfiguration | public static void putPropertiesIntoConfiguration(Properties properties, Configuration configuration) {
"""
Put all configuration properties in a given {@link Properties} object into a given
{@link Configuration} object.
@param properties the given {@link Properties} object
@param configuration the given {@li... | java | public static void putPropertiesIntoConfiguration(Properties properties, Configuration configuration) {
for (String name : properties.stringPropertyNames()) {
configuration.set(name, properties.getProperty(name));
}
} | [
"public",
"static",
"void",
"putPropertiesIntoConfiguration",
"(",
"Properties",
"properties",
",",
"Configuration",
"configuration",
")",
"{",
"for",
"(",
"String",
"name",
":",
"properties",
".",
"stringPropertyNames",
"(",
")",
")",
"{",
"configuration",
".",
"... | Put all configuration properties in a given {@link Properties} object into a given
{@link Configuration} object.
@param properties the given {@link Properties} object
@param configuration the given {@link Configuration} object | [
"Put",
"all",
"configuration",
"properties",
"in",
"a",
"given",
"{",
"@link",
"Properties",
"}",
"object",
"into",
"a",
"given",
"{",
"@link",
"Configuration",
"}",
"object",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/JobConfigurationUtils.java#L66-L70 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java | MarkerUtil.createMarkers | public static void createMarkers(final IJavaProject javaProject, final SortedBugCollection theCollection, final ISchedulingRule rule, IProgressMonitor monitor) {
"""
Create an Eclipse marker for given BugInstance.
@param javaProject
the project
@param monitor
"""
if (monitor.isCanceled()) {
... | java | public static void createMarkers(final IJavaProject javaProject, final SortedBugCollection theCollection, final ISchedulingRule rule, IProgressMonitor monitor) {
if (monitor.isCanceled()) {
return;
}
final List<MarkerParameter> bugParameters = createBugParameters(javaProject, theColl... | [
"public",
"static",
"void",
"createMarkers",
"(",
"final",
"IJavaProject",
"javaProject",
",",
"final",
"SortedBugCollection",
"theCollection",
",",
"final",
"ISchedulingRule",
"rule",
",",
"IProgressMonitor",
"monitor",
")",
"{",
"if",
"(",
"monitor",
".",
"isCance... | Create an Eclipse marker for given BugInstance.
@param javaProject
the project
@param monitor | [
"Create",
"an",
"Eclipse",
"marker",
"for",
"given",
"BugInstance",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/reporter/MarkerUtil.java#L119-L145 |
OpenTSDB/opentsdb | src/uid/UniqueId.java | UniqueId.uidToLong | public static long uidToLong(final byte[] uid, final short uid_length) {
"""
Converts a UID to an integer value. The array must be the same length as
uid_length or an exception will be thrown.
@param uid The byte array to convert
@param uid_length Length the array SHOULD be according to the UID config
@return ... | java | public static long uidToLong(final byte[] uid, final short uid_length) {
if (uid.length != uid_length) {
throw new IllegalArgumentException("UID was " + uid.length
+ " bytes long but expected to be " + uid_length);
}
final byte[] uid_raw = new byte[8];
System.arraycopy(uid, 0, uid_... | [
"public",
"static",
"long",
"uidToLong",
"(",
"final",
"byte",
"[",
"]",
"uid",
",",
"final",
"short",
"uid_length",
")",
"{",
"if",
"(",
"uid",
".",
"length",
"!=",
"uid_length",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"UID was \"",
"... | Converts a UID to an integer value. The array must be the same length as
uid_length or an exception will be thrown.
@param uid The byte array to convert
@param uid_length Length the array SHOULD be according to the UID config
@return The UID converted to an integer
@throws IllegalArgumentException if the length of the ... | [
"Converts",
"a",
"UID",
"to",
"an",
"integer",
"value",
".",
"The",
"array",
"must",
"be",
"the",
"same",
"length",
"as",
"uid_length",
"or",
"an",
"exception",
"will",
"be",
"thrown",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/uid/UniqueId.java#L1457-L1466 |
wanglinsong/th-lipermi | src/main/java/net/sf/lipermi/handler/CallProxy.java | CallProxy.invoke | @Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
"""
Delegates call to this proxy to it's ConnectionHandler
@throws java.lang.Throwable any error
"""
return connectionHandler.remoteInvocation(proxy, method, args);
} | java | @Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
return connectionHandler.remoteInvocation(proxy, method, args);
} | [
"@",
"Override",
"public",
"Object",
"invoke",
"(",
"Object",
"proxy",
",",
"Method",
"method",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"Throwable",
"{",
"return",
"connectionHandler",
".",
"remoteInvocation",
"(",
"proxy",
",",
"method",
",",
"args"... | Delegates call to this proxy to it's ConnectionHandler
@throws java.lang.Throwable any error | [
"Delegates",
"call",
"to",
"this",
"proxy",
"to",
"it",
"s",
"ConnectionHandler"
] | train | https://github.com/wanglinsong/th-lipermi/blob/5fa9ab1d7085b5133dc37ce3ba201d44a7bf25f0/src/main/java/net/sf/lipermi/handler/CallProxy.java#L58-L61 |
JadiraOrg/jadira | bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java | BasicBinder.registerConverter | public final <S, T> void registerConverter(Class<S> input, Class<T> output, Converter<S, T> converter) {
"""
Register a Converter with the given input and output classes. Instances of the input class can be converted into
instances of the output class
@param input The input class
@param output The output class
... | java | public final <S, T> void registerConverter(Class<S> input, Class<T> output, Converter<S, T> converter) {
Class<? extends Annotation> scope = matchImplementationToScope(converter.getClass());
registerConverter(new ConverterKey<S,T>(input, output, scope == null ? DefaultBinding.class : scope), converter... | [
"public",
"final",
"<",
"S",
",",
"T",
">",
"void",
"registerConverter",
"(",
"Class",
"<",
"S",
">",
"input",
",",
"Class",
"<",
"T",
">",
"output",
",",
"Converter",
"<",
"S",
",",
"T",
">",
"converter",
")",
"{",
"Class",
"<",
"?",
"extends",
... | Register a Converter with the given input and output classes. Instances of the input class can be converted into
instances of the output class
@param input The input class
@param output The output class
@param converter The Converter to be registered | [
"Register",
"a",
"Converter",
"with",
"the",
"given",
"input",
"and",
"output",
"classes",
".",
"Instances",
"of",
"the",
"input",
"class",
"can",
"be",
"converted",
"into",
"instances",
"of",
"the",
"output",
"class"
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java#L580-L583 |
diffplug/durian | src/com/diffplug/common/base/TreeComparison.java | TreeComparison.createAssertionError | private AssertionError createAssertionError() {
"""
Returns an {@link AssertionError} containing the contents of the
two trees. Attempts to throw a JUnit ComparisonFailure if JUnit
is on the class path, but it fails to a plain old {@code java.lang.AssertionError}
if the reflection calls fail.
"""
// conve... | java | private AssertionError createAssertionError() {
// convert both sides to strings
String expected = TreeQuery.toString(expectedDef, expectedRoot, expectedToString);
String actual = TreeQuery.toString(actualDef, actualRoot, actualToString);
// try to create a junit ComparisonFailure
for (String exceptionType : ... | [
"private",
"AssertionError",
"createAssertionError",
"(",
")",
"{",
"// convert both sides to strings",
"String",
"expected",
"=",
"TreeQuery",
".",
"toString",
"(",
"expectedDef",
",",
"expectedRoot",
",",
"expectedToString",
")",
";",
"String",
"actual",
"=",
"TreeQ... | Returns an {@link AssertionError} containing the contents of the
two trees. Attempts to throw a JUnit ComparisonFailure if JUnit
is on the class path, but it fails to a plain old {@code java.lang.AssertionError}
if the reflection calls fail. | [
"Returns",
"an",
"{"
] | train | https://github.com/diffplug/durian/blob/10631a3480e5491eb6eb6ee06e752d8596914232/src/com/diffplug/common/base/TreeComparison.java#L119-L133 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/URLConnection.java | URLConnection.addRequestProperty | public void addRequestProperty(String key, String value) {
"""
Adds a general request property specified by a
key-value pair. This method will not overwrite
existing values associated with the same key.
@param key the keyword by which the request is known
(e.g., "<code>Accept</code>").
@param value... | java | public void addRequestProperty(String key, String value) {
if (connected)
throw new IllegalStateException("Already connected");
if (key == null)
throw new NullPointerException ("key is null");
if (requests == null)
requests = new MessageHeader();
req... | [
"public",
"void",
"addRequestProperty",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"connected",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Already connected\"",
")",
";",
"if",
"(",
"key",
"==",
"null",
")",
"throw",
"new",... | Adds a general request property specified by a
key-value pair. This method will not overwrite
existing values associated with the same key.
@param key the keyword by which the request is known
(e.g., "<code>Accept</code>").
@param value the value associated with it.
@throws IllegalStateException if already c... | [
"Adds",
"a",
"general",
"request",
"property",
"specified",
"by",
"a",
"key",
"-",
"value",
"pair",
".",
"This",
"method",
"will",
"not",
"overwrite",
"existing",
"values",
"associated",
"with",
"the",
"same",
"key",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/URLConnection.java#L1093-L1103 |
qiujiayu/AutoLoadCache | src/main/java/com/jarvis/cache/script/AbstractScriptParser.java | AbstractScriptParser.isCacheable | public boolean isCacheable(Cache cache, Object target, Object[] arguments, Object result) throws Exception {
"""
是否可以缓存
@param cache Cache
@param target AOP 拦截到的实例
@param arguments 参数
@param result 执行结果
@return cacheAble 是否可以进行缓存
@throws Exception 异常
"""
boolean rv = true;
i... | java | public boolean isCacheable(Cache cache, Object target, Object[] arguments, Object result) throws Exception {
boolean rv = true;
if (null != cache.condition() && cache.condition().length() > 0) {
rv = this.getElValue(cache.condition(), target, arguments, result, true, Boolean.class);
... | [
"public",
"boolean",
"isCacheable",
"(",
"Cache",
"cache",
",",
"Object",
"target",
",",
"Object",
"[",
"]",
"arguments",
",",
"Object",
"result",
")",
"throws",
"Exception",
"{",
"boolean",
"rv",
"=",
"true",
";",
"if",
"(",
"null",
"!=",
"cache",
".",
... | 是否可以缓存
@param cache Cache
@param target AOP 拦截到的实例
@param arguments 参数
@param result 执行结果
@return cacheAble 是否可以进行缓存
@throws Exception 异常 | [
"是否可以缓存"
] | train | https://github.com/qiujiayu/AutoLoadCache/blob/8121c146f1a420fa6d6832e849acadb547c13622/src/main/java/com/jarvis/cache/script/AbstractScriptParser.java#L109-L115 |
elki-project/elki | addons/uncertain/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/uncertain/RepresentativeUncertainClustering.java | RepresentativeUncertainClustering.runClusteringAlgorithm | protected Clustering<?> runClusteringAlgorithm(ResultHierarchy hierarchy, Result parent, DBIDs ids, DataStore<DoubleVector> store, int dim, String title) {
"""
Run a clustering algorithm on a single instance.
@param parent Parent result to attach to
@param ids Object IDs to process
@param store Input data
@p... | java | protected Clustering<?> runClusteringAlgorithm(ResultHierarchy hierarchy, Result parent, DBIDs ids, DataStore<DoubleVector> store, int dim, String title) {
SimpleTypeInformation<DoubleVector> t = new VectorFieldTypeInformation<>(DoubleVector.FACTORY, dim);
Relation<DoubleVector> sample = new MaterializedRelatio... | [
"protected",
"Clustering",
"<",
"?",
">",
"runClusteringAlgorithm",
"(",
"ResultHierarchy",
"hierarchy",
",",
"Result",
"parent",
",",
"DBIDs",
"ids",
",",
"DataStore",
"<",
"DoubleVector",
">",
"store",
",",
"int",
"dim",
",",
"String",
"title",
")",
"{",
"... | Run a clustering algorithm on a single instance.
@param parent Parent result to attach to
@param ids Object IDs to process
@param store Input data
@param dim Dimensionality
@param title Title of relation
@return Clustering result | [
"Run",
"a",
"clustering",
"algorithm",
"on",
"a",
"single",
"instance",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/uncertain/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/uncertain/RepresentativeUncertainClustering.java#L310-L320 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/outbound/HttpOutboundServiceContextImpl.java | HttpOutboundServiceContextImpl.sendRequestBody | @Override
public VirtualConnection sendRequestBody(WsByteBuffer[] body, InterChannelCallback callback, boolean bForce) throws MessageSentException {
"""
Send the given body buffers for the outgoing request asynchronously.
If chunked encoding is set, then each call to this method will be
considered a "chunk" ... | java | @Override
public VirtualConnection sendRequestBody(WsByteBuffer[] body, InterChannelCallback callback, boolean bForce) throws MessageSentException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "sendRequestBody(async)");
}
if (isMessageSent()) ... | [
"@",
"Override",
"public",
"VirtualConnection",
"sendRequestBody",
"(",
"WsByteBuffer",
"[",
"]",
"body",
",",
"InterChannelCallback",
"callback",
",",
"boolean",
"bForce",
")",
"throws",
"MessageSentException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnab... | Send the given body buffers for the outgoing request asynchronously.
If chunked encoding is set, then each call to this method will be
considered a "chunk" and encoded as such. If the message is
Content-Length defined, then the buffers will simply be sent out with no
modifications.
Note: if headers have not already be... | [
"Send",
"the",
"given",
"body",
"buffers",
"for",
"the",
"outgoing",
"request",
"asynchronously",
".",
"If",
"chunked",
"encoding",
"is",
"set",
"then",
"each",
"call",
"to",
"this",
"method",
"will",
"be",
"considered",
"a",
"chunk",
"and",
"encoded",
"as",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/outbound/HttpOutboundServiceContextImpl.java#L1022-L1051 |
mikepenz/FastAdapter | app/src/main/java/com/mikepenz/fastadapter/app/helpers/CustomStickyRecyclerHeadersDecoration.java | CustomStickyRecyclerHeadersDecoration.findHeaderPositionUnder | public int findHeaderPositionUnder(int x, int y) {
"""
Gets the position of the header under the specified (x, y) coordinates.
@param x x-coordinate
@param y y-coordinate
@return position of header, or -1 if not found
"""
for (int i = 0; i < mHeaderRects.size(); i++) {
Rect rect = mHea... | java | public int findHeaderPositionUnder(int x, int y) {
for (int i = 0; i < mHeaderRects.size(); i++) {
Rect rect = mHeaderRects.get(mHeaderRects.keyAt(i));
if (rect.contains(x, y)) {
return mHeaderRects.keyAt(i);
}
}
return -1;
} | [
"public",
"int",
"findHeaderPositionUnder",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"mHeaderRects",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"Rect",
"rect",
"=",
"mHeaderRects",
".",
"g... | Gets the position of the header under the specified (x, y) coordinates.
@param x x-coordinate
@param y y-coordinate
@return position of header, or -1 if not found | [
"Gets",
"the",
"position",
"of",
"the",
"header",
"under",
"the",
"specified",
"(",
"x",
"y",
")",
"coordinates",
"."
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/app/src/main/java/com/mikepenz/fastadapter/app/helpers/CustomStickyRecyclerHeadersDecoration.java#L134-L142 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/FeatureLaplacePyramid.java | FeatureLaplacePyramid.detect | @Override
public void detect(PyramidFloat<T> ss) {
"""
Searches for features inside the provided scale space
@param ss Scale space of an image
"""
spaceIndex = 0;
foundPoints.clear();
// compute feature intensity in each level
for (int i = 1; i < ss.getNumLayers()-1; i++) {
// detect features i... | java | @Override
public void detect(PyramidFloat<T> ss) {
spaceIndex = 0;
foundPoints.clear();
// compute feature intensity in each level
for (int i = 1; i < ss.getNumLayers()-1; i++) {
// detect features in 2D space. Don't need to compute features at the tail ends of scale-space
// if (i > 0 && i < ss.getNumL... | [
"@",
"Override",
"public",
"void",
"detect",
"(",
"PyramidFloat",
"<",
"T",
">",
"ss",
")",
"{",
"spaceIndex",
"=",
"0",
";",
"foundPoints",
".",
"clear",
"(",
")",
";",
"// compute feature intensity in each level",
"for",
"(",
"int",
"i",
"=",
"1",
";",
... | Searches for features inside the provided scale space
@param ss Scale space of an image | [
"Searches",
"for",
"features",
"inside",
"the",
"provided",
"scale",
"space"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/FeatureLaplacePyramid.java#L101-L127 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/style/StyleHelper.java | StyleHelper.delayedStyle | public static void delayedStyle(Chunk c, String tag, Collection<? extends Advanced> stylers, EventHelper eventHelper, Image img) {
"""
register advanced stylers with the EventHelper to do the styling later
@param c
@param tag
@param stylers
@param eventHelper
@param img the value of rect
@see EventHelper#o... | java | public static void delayedStyle(Chunk c, String tag, Collection<? extends Advanced> stylers, EventHelper eventHelper, Image img) {
// add to pagehelper and set generic tag
eventHelper.addDelayedStyler(tag, stylers, c, img);
c.setGenericTag(tag);
} | [
"public",
"static",
"void",
"delayedStyle",
"(",
"Chunk",
"c",
",",
"String",
"tag",
",",
"Collection",
"<",
"?",
"extends",
"Advanced",
">",
"stylers",
",",
"EventHelper",
"eventHelper",
",",
"Image",
"img",
")",
"{",
"// add to pagehelper and set generic tag",
... | register advanced stylers with the EventHelper to do the styling later
@param c
@param tag
@param stylers
@param eventHelper
@param img the value of rect
@see EventHelper#onGenericTag(com.itextpdf.text.pdf.PdfWriter, com.itextpdf.text.Document,
com.itextpdf.text.Rectangle, java.lang.String) | [
"register",
"advanced",
"stylers",
"with",
"the",
"EventHelper",
"to",
"do",
"the",
"styling",
"later"
] | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/style/StyleHelper.java#L229-L233 |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/controller/impl/PartitionedStepControllerImpl.java | PartitionedStepControllerImpl.validatePlanNumberOfPartitions | private void validatePlanNumberOfPartitions(PartitionPlanDescriptor currentPlan) {
"""
Verify the number of partitions in the plan makes sense.
@throws IllegalArgumentException if it doesn't make sense.
"""
int numPreviousPartitions = getTopLevelStepInstance().getPartitionPlanSize();
int nu... | java | private void validatePlanNumberOfPartitions(PartitionPlanDescriptor currentPlan) {
int numPreviousPartitions = getTopLevelStepInstance().getPartitionPlanSize();
int numCurrentPartitions = currentPlan.getNumPartitionsInPlan();
if (logger.isLoggable(Level.FINE)) {
logger.fine("For st... | [
"private",
"void",
"validatePlanNumberOfPartitions",
"(",
"PartitionPlanDescriptor",
"currentPlan",
")",
"{",
"int",
"numPreviousPartitions",
"=",
"getTopLevelStepInstance",
"(",
")",
".",
"getPartitionPlanSize",
"(",
")",
";",
"int",
"numCurrentPartitions",
"=",
"current... | Verify the number of partitions in the plan makes sense.
@throws IllegalArgumentException if it doesn't make sense. | [
"Verify",
"the",
"number",
"of",
"partitions",
"in",
"the",
"plan",
"makes",
"sense",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/controller/impl/PartitionedStepControllerImpl.java#L465-L486 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/externaltask/LockedExternalTaskImpl.java | LockedExternalTaskImpl.fromEntity | public static LockedExternalTaskImpl fromEntity(ExternalTaskEntity externalTaskEntity, List<String> variablesToFetch, boolean isLocal, boolean deserializeVariables) {
"""
Construct representation of locked ExternalTask from corresponding entity.
During mapping variables will be collected,during collection variabl... | java | public static LockedExternalTaskImpl fromEntity(ExternalTaskEntity externalTaskEntity, List<String> variablesToFetch, boolean isLocal, boolean deserializeVariables) {
LockedExternalTaskImpl result = new LockedExternalTaskImpl();
result.id = externalTaskEntity.getId();
result.topicName = externalTaskEntity.g... | [
"public",
"static",
"LockedExternalTaskImpl",
"fromEntity",
"(",
"ExternalTaskEntity",
"externalTaskEntity",
",",
"List",
"<",
"String",
">",
"variablesToFetch",
",",
"boolean",
"isLocal",
",",
"boolean",
"deserializeVariables",
")",
"{",
"LockedExternalTaskImpl",
"result... | Construct representation of locked ExternalTask from corresponding entity.
During mapping variables will be collected,during collection variables will not be deserialized
and scope will not be set to local.
@see {@link org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope#collectVariables(VariableMapIm... | [
"Construct",
"representation",
"of",
"locked",
"ExternalTask",
"from",
"corresponding",
"entity",
".",
"During",
"mapping",
"variables",
"will",
"be",
"collected",
"during",
"collection",
"variables",
"will",
"not",
"be",
"deserialized",
"and",
"scope",
"will",
"not... | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/externaltask/LockedExternalTaskImpl.java#L137-L162 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.license_virtuozzo_new_GET | public ArrayList<String> license_virtuozzo_new_GET(OvhOrderableVirtuozzoContainerNumberEnum containerNumber, String ip, OvhLicenseTypeEnum serviceType, OvhOrderableVirtuozzoVersionEnum version) throws IOException {
"""
Get allowed durations for 'new' option
REST: GET /order/license/virtuozzo/new
@param version... | java | public ArrayList<String> license_virtuozzo_new_GET(OvhOrderableVirtuozzoContainerNumberEnum containerNumber, String ip, OvhLicenseTypeEnum serviceType, OvhOrderableVirtuozzoVersionEnum version) throws IOException {
String qPath = "/order/license/virtuozzo/new";
StringBuilder sb = path(qPath);
query(sb, "container... | [
"public",
"ArrayList",
"<",
"String",
">",
"license_virtuozzo_new_GET",
"(",
"OvhOrderableVirtuozzoContainerNumberEnum",
"containerNumber",
",",
"String",
"ip",
",",
"OvhLicenseTypeEnum",
"serviceType",
",",
"OvhOrderableVirtuozzoVersionEnum",
"version",
")",
"throws",
"IOExc... | Get allowed durations for 'new' option
REST: GET /order/license/virtuozzo/new
@param version [required] This license version
@param ip [required] Ip on which this license would be installed
@param containerNumber [required] How much container is this license able to manage ...
@param serviceType [required] # DEPRECATE... | [
"Get",
"allowed",
"durations",
"for",
"new",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L1159-L1168 |
alibaba/canal | server/src/main/java/com/alibaba/otter/canal/server/embedded/CanalServerWithEmbedded.java | CanalServerWithEmbedded.getWithoutAck | @Override
public Message getWithoutAck(ClientIdentity clientIdentity, int batchSize) throws CanalServerException {
"""
不指定 position 获取事件。canal 会记住此 client 最新的 position。 <br/>
如果是第一次 fetch,则会从 canal 中保存的最老一条数据开始输出。
<pre>
注意: meta获取和数据的获取需要保证顺序性,优先拿到meta的,一定也会是优先拿到数据,所以需要加同步. (不能出现先拿到meta,拿到第二批数据,这样就会导致数据顺序... | java | @Override
public Message getWithoutAck(ClientIdentity clientIdentity, int batchSize) throws CanalServerException {
return getWithoutAck(clientIdentity, batchSize, null, null);
} | [
"@",
"Override",
"public",
"Message",
"getWithoutAck",
"(",
"ClientIdentity",
"clientIdentity",
",",
"int",
"batchSize",
")",
"throws",
"CanalServerException",
"{",
"return",
"getWithoutAck",
"(",
"clientIdentity",
",",
"batchSize",
",",
"null",
",",
"null",
")",
... | 不指定 position 获取事件。canal 会记住此 client 最新的 position。 <br/>
如果是第一次 fetch,则会从 canal 中保存的最老一条数据开始输出。
<pre>
注意: meta获取和数据的获取需要保证顺序性,优先拿到meta的,一定也会是优先拿到数据,所以需要加同步. (不能出现先拿到meta,拿到第二批数据,这样就会导致数据顺序性出现问题)
</pre> | [
"不指定",
"position",
"获取事件。canal",
"会记住此",
"client",
"最新的",
"position。",
"<br",
"/",
">",
"如果是第一次",
"fetch,则会从",
"canal",
"中保存的最老一条数据开始输出。"
] | train | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/server/src/main/java/com/alibaba/otter/canal/server/embedded/CanalServerWithEmbedded.java#L288-L291 |
OpenBEL/openbel-framework | org.openbel.framework.ws/src/main/java/org/openbel/framework/ws/endpoint/PathFindEndPoint.java | PathFindEndPoint.lookupKam | private Kam lookupKam(KamNode kamNode, Dialect dialect,
final String errorMsg)
throws KamCacheServiceException, InvalidIdException,
RequestException {
"""
Lookup the {@link Kam} associated with the {@link KamNode}.
@param kamNode {@link KamNode}, the kam node
@param dialect ... | java | private Kam lookupKam(KamNode kamNode, Dialect dialect,
final String errorMsg)
throws KamCacheServiceException, InvalidIdException,
RequestException {
KamStoreObjectRef kamNodeRef = Converter.decodeNode(kamNode);
KamInfo kamInfo = null;
try {
kamIn... | [
"private",
"Kam",
"lookupKam",
"(",
"KamNode",
"kamNode",
",",
"Dialect",
"dialect",
",",
"final",
"String",
"errorMsg",
")",
"throws",
"KamCacheServiceException",
",",
"InvalidIdException",
",",
"RequestException",
"{",
"KamStoreObjectRef",
"kamNodeRef",
"=",
"Conver... | Lookup the {@link Kam} associated with the {@link KamNode}.
@param kamNode {@link KamNode}, the kam node
@param dialect {@link Dialect} to apply to the kam, potentially <code>null</code>
@return the {@link Kam} associated with the {@link KamNode}, which
might be null
@throws KamCacheServiceException Thrown if an error... | [
"Lookup",
"the",
"{",
"@link",
"Kam",
"}",
"associated",
"with",
"the",
"{",
"@link",
"KamNode",
"}",
"."
] | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.ws/src/main/java/org/openbel/framework/ws/endpoint/PathFindEndPoint.java#L284-L303 |
lastaflute/lastaflute | src/main/java/org/lastaflute/web/hook/GodHandEpilogue.java | GodHandEpilogue.handleTooManySqlExecution | protected void handleTooManySqlExecution(ActionRuntime runtime, ExecutedSqlCounter sqlCounter, int sqlExecutionCountLimit) {
"""
Handle too many SQL executions.
@param runtime The runtime meta of action execute. (NotNull)
@param sqlCounter The counter object for SQL executions. (NotNull)
@param sqlExecutionCoun... | java | protected void handleTooManySqlExecution(ActionRuntime runtime, ExecutedSqlCounter sqlCounter, int sqlExecutionCountLimit) {
final int totalCountOfSql = sqlCounter.getTotalCountOfSql();
final String actionDisp = buildActionDisp(runtime);
logger.warn("*Too many SQL executions: {}/{} in {}", total... | [
"protected",
"void",
"handleTooManySqlExecution",
"(",
"ActionRuntime",
"runtime",
",",
"ExecutedSqlCounter",
"sqlCounter",
",",
"int",
"sqlExecutionCountLimit",
")",
"{",
"final",
"int",
"totalCountOfSql",
"=",
"sqlCounter",
".",
"getTotalCountOfSql",
"(",
")",
";",
... | Handle too many SQL executions.
@param runtime The runtime meta of action execute. (NotNull)
@param sqlCounter The counter object for SQL executions. (NotNull)
@param sqlExecutionCountLimit The limit of SQL execution count for the action execute. (NotMinus: already checked here) | [
"Handle",
"too",
"many",
"SQL",
"executions",
"."
] | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/hook/GodHandEpilogue.java#L114-L118 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GroupApi.java | GroupApi.deleteVariable | public void deleteVariable(Object groupIdOrPath, String key) throws GitLabApiException {
"""
Deletes a group variable.
<pre><code>DELETE /groups/:id/variables/:key</code></pre>
@param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path, required
@param key the key... | java | public void deleteVariable(Object groupIdOrPath, String key) throws GitLabApiException {
delete(Response.Status.NO_CONTENT, null, "groups", getGroupIdOrPath(groupIdOrPath), "variables", key);
} | [
"public",
"void",
"deleteVariable",
"(",
"Object",
"groupIdOrPath",
",",
"String",
"key",
")",
"throws",
"GitLabApiException",
"{",
"delete",
"(",
"Response",
".",
"Status",
".",
"NO_CONTENT",
",",
"null",
",",
"\"groups\"",
",",
"getGroupIdOrPath",
"(",
"groupI... | Deletes a group variable.
<pre><code>DELETE /groups/:id/variables/:key</code></pre>
@param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path, required
@param key the key of an existing variable, required
@throws GitLabApiException if any exception occurs | [
"Deletes",
"a",
"group",
"variable",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GroupApi.java#L1133-L1135 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/menu/MenuFlyoutExample.java | MenuFlyoutExample.buildMenu | private WMenu buildMenu(final WText selectedMenuText) {
"""
Builds up a menu bar for inclusion in the example.
@param selectedMenuText the WText to display the selected menu item.
@return a menu for the example.
"""
WMenu menu = new WMenu(WMenu.MenuType.FLYOUT);
// The Colours menu just shows simple t... | java | private WMenu buildMenu(final WText selectedMenuText) {
WMenu menu = new WMenu(WMenu.MenuType.FLYOUT);
// The Colours menu just shows simple text
WSubMenu colourMenu = new WSubMenu("Colours");
addMenuItem(colourMenu, "Red", selectedMenuText);
addMenuItem(colourMenu, "Green", selectedMenuText);
addMenuItem(... | [
"private",
"WMenu",
"buildMenu",
"(",
"final",
"WText",
"selectedMenuText",
")",
"{",
"WMenu",
"menu",
"=",
"new",
"WMenu",
"(",
"WMenu",
".",
"MenuType",
".",
"FLYOUT",
")",
";",
"// The Colours menu just shows simple text",
"WSubMenu",
"colourMenu",
"=",
"new",
... | Builds up a menu bar for inclusion in the example.
@param selectedMenuText the WText to display the selected menu item.
@return a menu for the example. | [
"Builds",
"up",
"a",
"menu",
"bar",
"for",
"inclusion",
"in",
"the",
"example",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/menu/MenuFlyoutExample.java#L64-L129 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/EnumUtils.java | EnumUtils.getEnum | public static <E extends Enum<E>> E getEnum(final Class<E> enumClass, final String enumName) {
"""
<p>Gets the enum for the class, returning {@code null} if not found.</p>
<p>This method differs from {@link Enum#valueOf} in that it does not throw an exception
for an invalid enum name.</p>
@param <E> the typ... | java | public static <E extends Enum<E>> E getEnum(final Class<E> enumClass, final String enumName) {
if (enumName == null) {
return null;
}
try {
return Enum.valueOf(enumClass, enumName);
} catch (final IllegalArgumentException ex) {
return null;
}
... | [
"public",
"static",
"<",
"E",
"extends",
"Enum",
"<",
"E",
">",
">",
"E",
"getEnum",
"(",
"final",
"Class",
"<",
"E",
">",
"enumClass",
",",
"final",
"String",
"enumName",
")",
"{",
"if",
"(",
"enumName",
"==",
"null",
")",
"{",
"return",
"null",
"... | <p>Gets the enum for the class, returning {@code null} if not found.</p>
<p>This method differs from {@link Enum#valueOf} in that it does not throw an exception
for an invalid enum name.</p>
@param <E> the type of the enumeration
@param enumClass the class of the enum to query, not null
@param enumName the enum na... | [
"<p",
">",
"Gets",
"the",
"enum",
"for",
"the",
"class",
"returning",
"{",
"@code",
"null",
"}",
"if",
"not",
"found",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/EnumUtils.java#L114-L123 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/utils/WidgetUtil.java | WidgetUtil.getWidgetBanner | public static String getWidgetBanner(String guildId, BannerType type) {
"""
Gets the banner image for the specified guild of the specified type.
<br>This banner will only be available if the guild in question has the
Widget enabled. Additionally, this method can be used independently of
being on the guild in qu... | java | public static String getWidgetBanner(String guildId, BannerType type)
{
Checks.notNull(guildId, "GuildId");
Checks.notNull(type, "BannerType");
return String.format(WIDGET_PNG, guildId, type.name().toLowerCase());
} | [
"public",
"static",
"String",
"getWidgetBanner",
"(",
"String",
"guildId",
",",
"BannerType",
"type",
")",
"{",
"Checks",
".",
"notNull",
"(",
"guildId",
",",
"\"GuildId\"",
")",
";",
"Checks",
".",
"notNull",
"(",
"type",
",",
"\"BannerType\"",
")",
";",
... | Gets the banner image for the specified guild of the specified type.
<br>This banner will only be available if the guild in question has the
Widget enabled. Additionally, this method can be used independently of
being on the guild in question.
@param guildId
the guild ID
@param type
The type (visual style) of the ba... | [
"Gets",
"the",
"banner",
"image",
"for",
"the",
"specified",
"guild",
"of",
"the",
"specified",
"type",
".",
"<br",
">",
"This",
"banner",
"will",
"only",
"be",
"available",
"if",
"the",
"guild",
"in",
"question",
"has",
"the",
"Widget",
"enabled",
".",
... | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/utils/WidgetUtil.java#L83-L88 |
weld/core | impl/src/main/java/org/jboss/weld/config/WeldConfiguration.java | WeldConfiguration.processKeyValue | private void processKeyValue(Map<ConfigurationKey, Object> properties, ConfigurationKey key, Object value) {
"""
Process the given key and value. First validate the value and check if there's no different value for the same key in the same source - invalid and
different values are treated as a deployment problem.... | java | private void processKeyValue(Map<ConfigurationKey, Object> properties, ConfigurationKey key, Object value) {
if (value instanceof String) {
value = key.convertValue((String) value);
}
if (key.isValidValue(value)) {
Object previous = properties.put(key, value);
... | [
"private",
"void",
"processKeyValue",
"(",
"Map",
"<",
"ConfigurationKey",
",",
"Object",
">",
"properties",
",",
"ConfigurationKey",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"instanceof",
"String",
")",
"{",
"value",
"=",
"key",
".",
"... | Process the given key and value. First validate the value and check if there's no different value for the same key in the same source - invalid and
different values are treated as a deployment problem.
@param properties
@param key
@param value | [
"Process",
"the",
"given",
"key",
"and",
"value",
".",
"First",
"validate",
"the",
"value",
"and",
"check",
"if",
"there",
"s",
"no",
"different",
"value",
"for",
"the",
"same",
"key",
"in",
"the",
"same",
"source",
"-",
"invalid",
"and",
"different",
"v... | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/config/WeldConfiguration.java#L427-L439 |
apereo/cas | support/cas-server-support-pm-webflow/src/main/java/org/apereo/cas/pm/web/flow/PasswordManagementWebflowUtils.java | PasswordManagementWebflowUtils.putPasswordResetSecurityQuestionsEnabled | public static void putPasswordResetSecurityQuestionsEnabled(final RequestContext requestContext, final boolean value) {
"""
Put password reset security questions enabled.
@param requestContext the request context
@param value the value
"""
val flowScope = requestContext.getFlowScope();
... | java | public static void putPasswordResetSecurityQuestionsEnabled(final RequestContext requestContext, final boolean value) {
val flowScope = requestContext.getFlowScope();
flowScope.put("questionsEnabled", value);
} | [
"public",
"static",
"void",
"putPasswordResetSecurityQuestionsEnabled",
"(",
"final",
"RequestContext",
"requestContext",
",",
"final",
"boolean",
"value",
")",
"{",
"val",
"flowScope",
"=",
"requestContext",
".",
"getFlowScope",
"(",
")",
";",
"flowScope",
".",
"pu... | Put password reset security questions enabled.
@param requestContext the request context
@param value the value | [
"Put",
"password",
"reset",
"security",
"questions",
"enabled",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-pm-webflow/src/main/java/org/apereo/cas/pm/web/flow/PasswordManagementWebflowUtils.java#L68-L71 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/config/ConfigValidator.java | ConfigValidator.checkQueueConfig | public static void checkQueueConfig(QueueConfig queueConfig, SplitBrainMergePolicyProvider mergePolicyProvider) {
"""
Validates the given {@link QueueConfig}.
@param queueConfig the {@link QueueConfig} to check
@param mergePolicyProvider the {@link SplitBrainMergePolicyProvider} to resolve merge policy... | java | public static void checkQueueConfig(QueueConfig queueConfig, SplitBrainMergePolicyProvider mergePolicyProvider) {
checkMergePolicy(queueConfig, mergePolicyProvider, queueConfig.getMergePolicyConfig().getPolicy());
} | [
"public",
"static",
"void",
"checkQueueConfig",
"(",
"QueueConfig",
"queueConfig",
",",
"SplitBrainMergePolicyProvider",
"mergePolicyProvider",
")",
"{",
"checkMergePolicy",
"(",
"queueConfig",
",",
"mergePolicyProvider",
",",
"queueConfig",
".",
"getMergePolicyConfig",
"("... | Validates the given {@link QueueConfig}.
@param queueConfig the {@link QueueConfig} to check
@param mergePolicyProvider the {@link SplitBrainMergePolicyProvider} to resolve merge policy classes | [
"Validates",
"the",
"given",
"{",
"@link",
"QueueConfig",
"}",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/config/ConfigValidator.java#L402-L404 |
azkaban/azkaban | azkaban-common/src/main/java/azkaban/executor/selector/CandidateFilter.java | CandidateFilter.registerFactorFilter | protected void registerFactorFilter(final FactorFilter<T, V> filter) {
"""
function to register a factorFilter to the internal Map for future reference.
@param factorfilter : the Filter object to be registered.
"""
if (null == filter) {
throw new IllegalArgumentException("unable to register factor... | java | protected void registerFactorFilter(final FactorFilter<T, V> filter) {
if (null == filter) {
throw new IllegalArgumentException("unable to register factor filter. " +
"The passed comaractor is null or has an invalid weight value.");
}
// add or replace the filter.
this.factorFilterList.... | [
"protected",
"void",
"registerFactorFilter",
"(",
"final",
"FactorFilter",
"<",
"T",
",",
"V",
">",
"filter",
")",
"{",
"if",
"(",
"null",
"==",
"filter",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"unable to register factor filter. \"",
"+",
"... | function to register a factorFilter to the internal Map for future reference.
@param factorfilter : the Filter object to be registered. | [
"function",
"to",
"register",
"a",
"factorFilter",
"to",
"the",
"internal",
"Map",
"for",
"future",
"reference",
"."
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/executor/selector/CandidateFilter.java#L50-L60 |
doanduyhai/Achilles | achilles-common/src/main/java/info/archinnov/achilles/script/ScriptExecutor.java | ScriptExecutor.executeScriptTemplate | public void executeScriptTemplate(String scriptTemplateLocation, Map<String, Object> values) {
"""
Execute a CQL script template located in the class path and
inject provided values into the template to produce the actual script
@param scriptTemplateLocation the location of the script template in the class pat... | java | public void executeScriptTemplate(String scriptTemplateLocation, Map<String, Object> values) {
final List<SimpleStatement> statements = buildStatements(loadScriptAsLines(scriptTemplateLocation, values));
for (SimpleStatement statement : statements) {
if (isDMLStatement(statement)) {
... | [
"public",
"void",
"executeScriptTemplate",
"(",
"String",
"scriptTemplateLocation",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"values",
")",
"{",
"final",
"List",
"<",
"SimpleStatement",
">",
"statements",
"=",
"buildStatements",
"(",
"loadScriptAsLines",
"("... | Execute a CQL script template located in the class path and
inject provided values into the template to produce the actual script
@param scriptTemplateLocation the location of the script template in the class path
@param values template values | [
"Execute",
"a",
"CQL",
"script",
"template",
"located",
"in",
"the",
"class",
"path",
"and",
"inject",
"provided",
"values",
"into",
"the",
"template",
"to",
"produce",
"the",
"actual",
"script"
] | train | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-common/src/main/java/info/archinnov/achilles/script/ScriptExecutor.java#L86-L96 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODDynacache.java | HTODDynacache.readTemplatesByRange | public Result readTemplatesByRange(int index, int length) {
"""
***********************************************************************
readTemplatesByRange()
This method is used by CacheMonitor to retrive the templates from the disk.
If index = 0, it starts the beginning. If index = 1, it means "next". If Inde... | java | public Result readTemplatesByRange(int index, int length) {
Result result = getFromResultPool();
if (!this.disableDependencyId) {
Result other = readByRange(TEMPLATE_ID_DATA, index, length, !CHECK_EXPIRED, !FILTER);
result.copy(other);
returnToResultPool(other);
... | [
"public",
"Result",
"readTemplatesByRange",
"(",
"int",
"index",
",",
"int",
"length",
")",
"{",
"Result",
"result",
"=",
"getFromResultPool",
"(",
")",
";",
"if",
"(",
"!",
"this",
".",
"disableDependencyId",
")",
"{",
"Result",
"other",
"=",
"readByRange",... | ***********************************************************************
readTemplatesByRange()
This method is used by CacheMonitor to retrive the templates from the disk.
If index = 0, it starts the beginning. If index = 1, it means "next". If Index = -1, it means "previous".
The length of the max number of templates t... | [
"***********************************************************************",
"readTemplatesByRange",
"()",
"This",
"method",
"is",
"used",
"by",
"CacheMonitor",
"to",
"retrive",
"the",
"templates",
"from",
"the",
"disk",
".",
"If",
"index",
"=",
"0",
"it",
"starts",
"the"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODDynacache.java#L1401-L1409 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java | DirectoryServiceClient.unregisterServiceInstance | public void unregisterServiceInstance(String serviceName, String instanceId, final RegistrationCallback cb, Object context) {
"""
Unregister the ServiceInstance in Callback.
@param serviceName
the service name.
@param instanceId
the instanceId.
@param cb
the Callback.
@param context
the Callback context ... | java | public void unregisterServiceInstance(String serviceName, String instanceId, final RegistrationCallback cb, Object context){
ProtocolHeader header = new ProtocolHeader();
header.setType(ProtocolType.UnregisterServiceInstance);
UnregisterServiceInstanceProtocol p = new UnregisterServiceInstanceP... | [
"public",
"void",
"unregisterServiceInstance",
"(",
"String",
"serviceName",
",",
"String",
"instanceId",
",",
"final",
"RegistrationCallback",
"cb",
",",
"Object",
"context",
")",
"{",
"ProtocolHeader",
"header",
"=",
"new",
"ProtocolHeader",
"(",
")",
";",
"head... | Unregister the ServiceInstance in Callback.
@param serviceName
the service name.
@param instanceId
the instanceId.
@param cb
the Callback.
@param context
the Callback context object. | [
"Unregister",
"the",
"ServiceInstance",
"in",
"Callback",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java#L659-L674 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/taglib/el/EvalHelper.java | EvalHelper.evalBoolean | public static Boolean evalBoolean(String propertyName, String propertyValue, Tag tag, PageContext pageContext) throws JspException {
"""
Evaluate the boolean EL expression passed as parameter
@param propertyName the property name
@param propertyValue the property value
@param tag the tag
@param pageContext the... | java | public static Boolean evalBoolean(String propertyName, String propertyValue, Tag tag, PageContext pageContext) throws JspException{
return (Boolean) ExpressionEvaluatorManager.evaluate(propertyName,
propertyValue, Boolean.class, tag, pageContext);
} | [
"public",
"static",
"Boolean",
"evalBoolean",
"(",
"String",
"propertyName",
",",
"String",
"propertyValue",
",",
"Tag",
"tag",
",",
"PageContext",
"pageContext",
")",
"throws",
"JspException",
"{",
"return",
"(",
"Boolean",
")",
"ExpressionEvaluatorManager",
".",
... | Evaluate the boolean EL expression passed as parameter
@param propertyName the property name
@param propertyValue the property value
@param tag the tag
@param pageContext the page context
@return the value corresponding to the EL expression passed as parameter
@throws JspException if an exception occurs | [
"Evaluate",
"the",
"boolean",
"EL",
"expression",
"passed",
"as",
"parameter"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/taglib/el/EvalHelper.java#L54-L58 |
OpenBEL/openbel-framework | org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/cache/CacheUtil.java | CacheUtil.copyToDirectory | public static File copyToDirectory(File resource,
final String resourceLocation, final File copy)
throws ResourceDownloadError {
"""
Copies the resolved resource to the system's temporary directory pointed
to by the system property <tt>java.io.tmpdir</tt>.
<p>
GZIP Decompression occur on... | java | public static File copyToDirectory(File resource,
final String resourceLocation, final File copy)
throws ResourceDownloadError {
copy.getParentFile().mkdirs();
return copyWithDecompression(resource, resourceLocation, copy);
} | [
"public",
"static",
"File",
"copyToDirectory",
"(",
"File",
"resource",
",",
"final",
"String",
"resourceLocation",
",",
"final",
"File",
"copy",
")",
"throws",
"ResourceDownloadError",
"{",
"copy",
".",
"getParentFile",
"(",
")",
".",
"mkdirs",
"(",
")",
";",... | Copies the resolved resource to the system's temporary directory pointed
to by the system property <tt>java.io.tmpdir</tt>.
<p>
GZIP Decompression occur on the file if the cached resource is found to
contain the {@link #GZIP_MAGIC_NUMBER}. See
{@link CacheUtil#copyWithDecompression(File, String, File)}.
</p>
@param re... | [
"Copies",
"the",
"resolved",
"resource",
"to",
"the",
"system",
"s",
"temporary",
"directory",
"pointed",
"to",
"by",
"the",
"system",
"property",
"<tt",
">",
"java",
".",
"io",
".",
"tmpdir<",
"/",
"tt",
">",
".",
"<p",
">",
"GZIP",
"Decompression",
"oc... | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/cache/CacheUtil.java#L280-L285 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Graphics.java | Graphics.fillRoundRect | public void fillRoundRect(float x, float y, float width, float height,
int cornerRadius, int segs) {
"""
Fill a rounded rectangle
@param x
The x coordinate of the top left corner of the rectangle
@param y
The y coordinate of the top left corner of the rectangle
@param width
The width of the rectangle
... | java | public void fillRoundRect(float x, float y, float width, float height,
int cornerRadius, int segs) {
if (cornerRadius < 0)
throw new IllegalArgumentException("corner radius must be > 0");
if (cornerRadius == 0) {
fillRect(x, y, width, height);
return;
}
int mr = (int) Math.min(width, heigh... | [
"public",
"void",
"fillRoundRect",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"width",
",",
"float",
"height",
",",
"int",
"cornerRadius",
",",
"int",
"segs",
")",
"{",
"if",
"(",
"cornerRadius",
"<",
"0",
")",
"throw",
"new",
"IllegalArgumentEx... | Fill a rounded rectangle
@param x
The x coordinate of the top left corner of the rectangle
@param y
The y coordinate of the top left corner of the rectangle
@param width
The width of the rectangle
@param height
The height of the rectangle
@param cornerRadius
The radius of the rounded edges on the corners
@param segs
T... | [
"Fill",
"a",
"rounded",
"rectangle"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Graphics.java#L1255-L1288 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.refundInvoice | public Invoice refundInvoice(final String invoiceId, final InvoiceRefund refundOptions) {
"""
Refund an invoice given some options
<p/>
Returns the refunded invoice
@param invoiceId The id of the invoice to refund
@param refundOptions The options for the refund
@return the refunded invoice
"""
r... | java | public Invoice refundInvoice(final String invoiceId, final InvoiceRefund refundOptions) {
return doPOST(Invoices.INVOICES_RESOURCE + "/" + invoiceId + "/refund", refundOptions, Invoice.class);
} | [
"public",
"Invoice",
"refundInvoice",
"(",
"final",
"String",
"invoiceId",
",",
"final",
"InvoiceRefund",
"refundOptions",
")",
"{",
"return",
"doPOST",
"(",
"Invoices",
".",
"INVOICES_RESOURCE",
"+",
"\"/\"",
"+",
"invoiceId",
"+",
"\"/refund\"",
",",
"refundOpti... | Refund an invoice given some options
<p/>
Returns the refunded invoice
@param invoiceId The id of the invoice to refund
@param refundOptions The options for the refund
@return the refunded invoice | [
"Refund",
"an",
"invoice",
"given",
"some",
"options",
"<p",
"/",
">",
"Returns",
"the",
"refunded",
"invoice"
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L1167-L1169 |
wisdom-framework/wisdom | extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/DefaultCSRFErrorHandler.java | DefaultCSRFErrorHandler.onError | @Override
public Result onError(Context context, String reason) {
"""
Returns a {@code FORBIDDEN} result.
@param context the current context
@param reason the error message
@return a {@code FORBIDDEN} result
"""
return Results.forbidden(reason);
} | java | @Override
public Result onError(Context context, String reason) {
return Results.forbidden(reason);
} | [
"@",
"Override",
"public",
"Result",
"onError",
"(",
"Context",
"context",
",",
"String",
"reason",
")",
"{",
"return",
"Results",
".",
"forbidden",
"(",
"reason",
")",
";",
"}"
] | Returns a {@code FORBIDDEN} result.
@param context the current context
@param reason the error message
@return a {@code FORBIDDEN} result | [
"Returns",
"a",
"{",
"@code",
"FORBIDDEN",
"}",
"result",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/DefaultCSRFErrorHandler.java#L39-L42 |
agapsys/embedded-servlet-container | src/main/java/com/agapsys/jee/ServletContainer.java | ServletContainer.registerFilter | public final SC registerFilter(Class<? extends Filter> filterClass) {
"""
Registers a filter.
@param filterClass filter class to be registered. This class must be annotated with {@linkplain WebFilter}.
@return this.
"""
WebFilter webFilter = filterClass.getAnnotation(WebFilter.class);
if (... | java | public final SC registerFilter(Class<? extends Filter> filterClass) {
WebFilter webFilter = filterClass.getAnnotation(WebFilter.class);
if (webFilter == null)
throw new IllegalArgumentException(String.format("Missing annotation '%s' for class '%s'", WebFilter.class.getName(), filterClass.ge... | [
"public",
"final",
"SC",
"registerFilter",
"(",
"Class",
"<",
"?",
"extends",
"Filter",
">",
"filterClass",
")",
"{",
"WebFilter",
"webFilter",
"=",
"filterClass",
".",
"getAnnotation",
"(",
"WebFilter",
".",
"class",
")",
";",
"if",
"(",
"webFilter",
"==",
... | Registers a filter.
@param filterClass filter class to be registered. This class must be annotated with {@linkplain WebFilter}.
@return this. | [
"Registers",
"a",
"filter",
"."
] | train | https://github.com/agapsys/embedded-servlet-container/blob/28314a2600ad8550ed2c901d8e35d86583c26bb0/src/main/java/com/agapsys/jee/ServletContainer.java#L316-L335 |
jfinal/jfinal | src/main/java/com/jfinal/render/FreeMarkerRender.java | FreeMarkerRender.setProperty | public static void setProperty(String propertyName, String propertyValue) {
"""
Set freemarker's property.
The value of template_update_delay is 5 seconds.
Example: FreeMarkerRender.setProperty("template_update_delay", "1600");
"""
try {
FreeMarkerRender.getConfiguration().setSetting(propertyName, pro... | java | public static void setProperty(String propertyName, String propertyValue) {
try {
FreeMarkerRender.getConfiguration().setSetting(propertyName, propertyValue);
} catch (TemplateException e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"void",
"setProperty",
"(",
"String",
"propertyName",
",",
"String",
"propertyValue",
")",
"{",
"try",
"{",
"FreeMarkerRender",
".",
"getConfiguration",
"(",
")",
".",
"setSetting",
"(",
"propertyName",
",",
"propertyValue",
")",
";",
"}",
... | Set freemarker's property.
The value of template_update_delay is 5 seconds.
Example: FreeMarkerRender.setProperty("template_update_delay", "1600"); | [
"Set",
"freemarker",
"s",
"property",
".",
"The",
"value",
"of",
"template_update_delay",
"is",
"5",
"seconds",
".",
"Example",
":",
"FreeMarkerRender",
".",
"setProperty",
"(",
"template_update_delay",
"1600",
")",
";"
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/render/FreeMarkerRender.java#L57-L63 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/markup/DamVideoMediaMarkupBuilder.java | DamVideoMediaMarkupBuilder.buildFlashVarsString | protected String buildFlashVarsString(Map<String, String> flashVars) {
"""
Build flashvars string to be used on HTML object element for flash embedding.
@param flashVars flashvars map
@return flashvars string with proper encoding
"""
try {
StringBuilder flashvarsString = new StringBuilder();
... | java | protected String buildFlashVarsString(Map<String, String> flashVars) {
try {
StringBuilder flashvarsString = new StringBuilder();
Iterator<Map.Entry<String, String>> flashvarsIterator = flashVars.entrySet().iterator();
while (flashvarsIterator.hasNext()) {
Map.Entry<String, String> entry =... | [
"protected",
"String",
"buildFlashVarsString",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"flashVars",
")",
"{",
"try",
"{",
"StringBuilder",
"flashvarsString",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Iterator",
"<",
"Map",
".",
"Entry",
"<",
"Strin... | Build flashvars string to be used on HTML object element for flash embedding.
@param flashVars flashvars map
@return flashvars string with proper encoding | [
"Build",
"flashvars",
"string",
"to",
"be",
"used",
"on",
"HTML",
"object",
"element",
"for",
"flash",
"embedding",
"."
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/markup/DamVideoMediaMarkupBuilder.java#L233-L251 |
ziccardi/jnrpe | jnrpe-lib/src/main/java/it/jnrpe/plugins/MetricBuilder.java | MetricBuilder.withMaxValue | public MetricBuilder withMaxValue(Number value, String prettyPrintFormat) {
"""
Sets the maximum value of the metric to be built.
@param value the maximum value of the metric
@param prettyPrintFormat the format of the output (@see {@link DecimalFormat})
@return this
"""
max = new MetricValue(value... | java | public MetricBuilder withMaxValue(Number value, String prettyPrintFormat) {
max = new MetricValue(value.toString(), prettyPrintFormat);
return this;
} | [
"public",
"MetricBuilder",
"withMaxValue",
"(",
"Number",
"value",
",",
"String",
"prettyPrintFormat",
")",
"{",
"max",
"=",
"new",
"MetricValue",
"(",
"value",
".",
"toString",
"(",
")",
",",
"prettyPrintFormat",
")",
";",
"return",
"this",
";",
"}"
] | Sets the maximum value of the metric to be built.
@param value the maximum value of the metric
@param prettyPrintFormat the format of the output (@see {@link DecimalFormat})
@return this | [
"Sets",
"the",
"maximum",
"value",
"of",
"the",
"metric",
"to",
"be",
"built",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-lib/src/main/java/it/jnrpe/plugins/MetricBuilder.java#L127-L130 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/converters/DeployerResolverOverriderConverter.java | DeployerResolverOverriderConverter.overrideDeployerDetails | private void overrideDeployerDetails(T overrider, Class overriderClass) {
"""
Convert the (ServerDetails)details to (ServerDetails)deployerDetails if it doesn't exists already
This convertion comes after a name change (details -> deployerDetails)
"""
if (overrider instanceof DeployerOverrider) {
... | java | private void overrideDeployerDetails(T overrider, Class overriderClass) {
if (overrider instanceof DeployerOverrider) {
try {
Field deployerDetailsField = overriderClass.getDeclaredField("deployerDetails");
deployerDetailsField.setAccessible(true);
Obj... | [
"private",
"void",
"overrideDeployerDetails",
"(",
"T",
"overrider",
",",
"Class",
"overriderClass",
")",
"{",
"if",
"(",
"overrider",
"instanceof",
"DeployerOverrider",
")",
"{",
"try",
"{",
"Field",
"deployerDetailsField",
"=",
"overriderClass",
".",
"getDeclaredF... | Convert the (ServerDetails)details to (ServerDetails)deployerDetails if it doesn't exists already
This convertion comes after a name change (details -> deployerDetails) | [
"Convert",
"the",
"(",
"ServerDetails",
")",
"details",
"to",
"(",
"ServerDetails",
")",
"deployerDetails",
"if",
"it",
"doesn",
"t",
"exists",
"already",
"This",
"convertion",
"comes",
"after",
"a",
"name",
"change",
"(",
"details",
"-",
">",
"deployerDetails... | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/converters/DeployerResolverOverriderConverter.java#L156-L176 |
thymeleaf/thymeleaf | src/main/java/org/thymeleaf/expression/Uris.java | Uris.escapePathSegment | public String escapePathSegment(final String text, final String encoding) {
"""
<p>
Perform am URI path segment <strong>escape</strong> operation
on a {@code String} input.
</p>
<p>
This method simply calls the equivalent method in the {@code UriEscape} class from the
<a href="http://www.unbescape.org">Unbes... | java | public String escapePathSegment(final String text, final String encoding) {
return UriEscape.escapeUriPathSegment(text, encoding);
} | [
"public",
"String",
"escapePathSegment",
"(",
"final",
"String",
"text",
",",
"final",
"String",
"encoding",
")",
"{",
"return",
"UriEscape",
".",
"escapeUriPathSegment",
"(",
"text",
",",
"encoding",
")",
";",
"}"
] | <p>
Perform am URI path segment <strong>escape</strong> operation
on a {@code String} input.
</p>
<p>
This method simply calls the equivalent method in the {@code UriEscape} class from the
<a href="http://www.unbescape.org">Unbescape</a> library.
</p>
<p>
The following are the only allowed chars in an URI path segment ... | [
"<p",
">",
"Perform",
"am",
"URI",
"path",
"segment",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"{",
"@code",
"String",
"}",
"input",
".",
"<",
"/",
"p",
">",
"<p",
">",
"This",
"method",
"simply",
"calls",
"the",
"equiva... | train | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/expression/Uris.java#L297-L299 |
google/auto | service/processor/src/main/java/com/google/auto/service/processor/ServicesFiles.java | ServicesFiles.writeServiceFile | static void writeServiceFile(Collection<String> services, OutputStream output)
throws IOException {
"""
Writes the set of service class names to a service file.
@param output not {@code null}. Not closed after use.
@param services a not {@code null Collection} of service class names.
@throws IOException... | java | static void writeServiceFile(Collection<String> services, OutputStream output)
throws IOException {
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(output, UTF_8));
for (String service : services) {
writer.write(service);
writer.newLine();
}
writer.flush();
} | [
"static",
"void",
"writeServiceFile",
"(",
"Collection",
"<",
"String",
">",
"services",
",",
"OutputStream",
"output",
")",
"throws",
"IOException",
"{",
"BufferedWriter",
"writer",
"=",
"new",
"BufferedWriter",
"(",
"new",
"OutputStreamWriter",
"(",
"output",
",... | Writes the set of service class names to a service file.
@param output not {@code null}. Not closed after use.
@param services a not {@code null Collection} of service class names.
@throws IOException | [
"Writes",
"the",
"set",
"of",
"service",
"class",
"names",
"to",
"a",
"service",
"file",
"."
] | train | https://github.com/google/auto/blob/4158a5fa71f1ef763e683b627f4d29bc04cfde9d/service/processor/src/main/java/com/google/auto/service/processor/ServicesFiles.java#L90-L98 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/windows/WindowsJNIFaxClientSpi.java | WindowsJNIFaxClientSpi.submitFaxJobImpl | @Override
protected void submitFaxJobImpl(FaxJob faxJob) {
"""
This function will submit a new fax job.<br>
The fax job ID may be populated by this method in the provided
fax job object.
@param faxJob
The fax job object containing the needed information
"""
//get fax job values
Stri... | java | @Override
protected void submitFaxJobImpl(FaxJob faxJob)
{
//get fax job values
String targetAddress=faxJob.getTargetAddress();
String targetName=faxJob.getTargetName();
if(targetName==null)
{
targetName="";
}
String senderName=faxJob.getSender... | [
"@",
"Override",
"protected",
"void",
"submitFaxJobImpl",
"(",
"FaxJob",
"faxJob",
")",
"{",
"//get fax job values",
"String",
"targetAddress",
"=",
"faxJob",
".",
"getTargetAddress",
"(",
")",
";",
"String",
"targetName",
"=",
"faxJob",
".",
"getTargetName",
"(",... | This function will submit a new fax job.<br>
The fax job ID may be populated by this method in the provided
fax job object.
@param faxJob
The fax job object containing the needed information | [
"This",
"function",
"will",
"submit",
"a",
"new",
"fax",
"job",
".",
"<br",
">",
"The",
"fax",
"job",
"ID",
"may",
"be",
"populated",
"by",
"this",
"method",
"in",
"the",
"provided",
"fax",
"job",
"object",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/windows/WindowsJNIFaxClientSpi.java#L136-L172 |
denisneuling/cctrl.jar | cctrl-api-client/src/main/java/com/cloudcontrolled/api/client/support/CloudControlClientSupport.java | CloudControlClientSupport.toBase64 | protected String toBase64(String user, String password) {
"""
<p>
toBase64.
</p>
@param user
a {@link java.lang.String} object.
@param password
a {@link java.lang.String} object.
@return a {@link java.lang.String} object.
"""
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(user... | java | protected String toBase64(String user, String password) {
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(user);
stringBuffer.append(":");
stringBuffer.append(password);
return Base64Utility.encode(stringBuffer.toString().getBytes());
} | [
"protected",
"String",
"toBase64",
"(",
"String",
"user",
",",
"String",
"password",
")",
"{",
"StringBuffer",
"stringBuffer",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"stringBuffer",
".",
"append",
"(",
"user",
")",
";",
"stringBuffer",
".",
"append",
"("... | <p>
toBase64.
</p>
@param user
a {@link java.lang.String} object.
@param password
a {@link java.lang.String} object.
@return a {@link java.lang.String} object. | [
"<p",
">",
"toBase64",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/denisneuling/cctrl.jar/blob/37450d824f4dc5ecbcc81c61e48f1ec876ca2de8/cctrl-api-client/src/main/java/com/cloudcontrolled/api/client/support/CloudControlClientSupport.java#L167-L173 |
EXIficient/exificient-core | src/main/java/com/siemens/ct/exi/core/util/sort/QNameSort.java | QNameSort.compare | public static int compare(String ns1, String ln1, String ns2, String ln2) {
"""
Sort lexicographically by qname local-name, then by qname uri
@param ns1
qname1 namespace
@param ln1
qname1 local-name
@param ns2
qname2 namespace
@param ln2
qname2 local-name
@return a negative integer, zero, or a positive ... | java | public static int compare(String ns1, String ln1, String ns2, String ln2) {
if (ns1 == null) {
ns1 = Constants.XML_NULL_NS_URI;
}
if (ns2 == null) {
ns2 = Constants.XML_NULL_NS_URI;
}
int cLocalPart = ln1.compareTo(ln2);
return (cLocalPart == 0 ? ns1.compareTo(ns2) : cLocalPart);
} | [
"public",
"static",
"int",
"compare",
"(",
"String",
"ns1",
",",
"String",
"ln1",
",",
"String",
"ns2",
",",
"String",
"ln2",
")",
"{",
"if",
"(",
"ns1",
"==",
"null",
")",
"{",
"ns1",
"=",
"Constants",
".",
"XML_NULL_NS_URI",
";",
"}",
"if",
"(",
... | Sort lexicographically by qname local-name, then by qname uri
@param ns1
qname1 namespace
@param ln1
qname1 local-name
@param ns2
qname2 namespace
@param ln2
qname2 local-name
@return a negative integer, zero, or a positive integer as the first
qname is less than, equal to, or greater than the second. | [
"Sort",
"lexicographically",
"by",
"qname",
"local",
"-",
"name",
"then",
"by",
"qname",
"uri"
] | train | https://github.com/EXIficient/exificient-core/blob/b6026c5fd39e9cc3d7874caa20f084e264e0ddc7/src/main/java/com/siemens/ct/exi/core/util/sort/QNameSort.java#L63-L72 |
dustin/java-memcached-client | src/main/java/net/spy/memcached/util/StringUtils.java | StringUtils.validateKey | public static void validateKey(final String key, final boolean binary) {
"""
Check if a given key is valid to transmit.
@param key the key to check.
@param binary if binary protocol is used.
"""
byte[] keyBytes = KeyUtil.getKeyBytes(key);
int keyLength = keyBytes.length;
if (keyLength > MAX_KE... | java | public static void validateKey(final String key, final boolean binary) {
byte[] keyBytes = KeyUtil.getKeyBytes(key);
int keyLength = keyBytes.length;
if (keyLength > MAX_KEY_LENGTH) {
throw KEY_TOO_LONG_EXCEPTION;
}
if (keyLength == 0) {
throw KEY_EMPTY_EXCEPTION;
}
if(!binary... | [
"public",
"static",
"void",
"validateKey",
"(",
"final",
"String",
"key",
",",
"final",
"boolean",
"binary",
")",
"{",
"byte",
"[",
"]",
"keyBytes",
"=",
"KeyUtil",
".",
"getKeyBytes",
"(",
"key",
")",
";",
"int",
"keyLength",
"=",
"keyBytes",
".",
"leng... | Check if a given key is valid to transmit.
@param key the key to check.
@param binary if binary protocol is used. | [
"Check",
"if",
"a",
"given",
"key",
"is",
"valid",
"to",
"transmit",
"."
] | train | https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/util/StringUtils.java#L122-L143 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/zinternaltools/InternalUtilities.java | InternalUtilities.areObjectsEqual | public static boolean areObjectsEqual(Object a, Object b) {
"""
areObjectsEqual, This function exists as a workaround for the fact that Objects.equals() did
not exist in Java 1.6.
Returns {@code true} if the arguments are equal to each other and {@code false} otherwise.
Consequently, if both arguments are {@c... | java | public static boolean areObjectsEqual(Object a, Object b) {
return (a == b) || (a != null && a.equals(b));
} | [
"public",
"static",
"boolean",
"areObjectsEqual",
"(",
"Object",
"a",
",",
"Object",
"b",
")",
"{",
"return",
"(",
"a",
"==",
"b",
")",
"||",
"(",
"a",
"!=",
"null",
"&&",
"a",
".",
"equals",
"(",
"b",
")",
")",
";",
"}"
] | areObjectsEqual, This function exists as a workaround for the fact that Objects.equals() did
not exist in Java 1.6.
Returns {@code true} if the arguments are equal to each other and {@code false} otherwise.
Consequently, if both arguments are {@code null}, {@code true} is returned and if exactly one
argument is {@code... | [
"areObjectsEqual",
"This",
"function",
"exists",
"as",
"a",
"workaround",
"for",
"the",
"fact",
"that",
"Objects",
".",
"equals",
"()",
"did",
"not",
"exist",
"in",
"Java",
"1",
".",
"6",
"."
] | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/zinternaltools/InternalUtilities.java#L57-L59 |
javalite/activejdbc | app-config/src/main/java/org/javalite/app_config/AppConfig.java | AppConfig.setProperty | public static String setProperty(String name, String value) {
"""
Sets a property in memory. If property exists, it will be overwritten, if not, a new one will be created.
@param name - name of property
@param value - value of property
@return old value
"""
String val = null;
if(props.co... | java | public static String setProperty(String name, String value) {
String val = null;
if(props.containsKey(name)){
val = props.get(name).getValue();
}
props.put(name, new Property(name, value, "dynamically added"));
LOGGER.warn("Temporary overriding property: " + name + ".... | [
"public",
"static",
"String",
"setProperty",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"String",
"val",
"=",
"null",
";",
"if",
"(",
"props",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"val",
"=",
"props",
".",
"get",
"(",
"name",... | Sets a property in memory. If property exists, it will be overwritten, if not, a new one will be created.
@param name - name of property
@param value - value of property
@return old value | [
"Sets",
"a",
"property",
"in",
"memory",
".",
"If",
"property",
"exists",
"it",
"will",
"be",
"overwritten",
"if",
"not",
"a",
"new",
"one",
"will",
"be",
"created",
"."
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/app-config/src/main/java/org/javalite/app_config/AppConfig.java#L231-L239 |
morimekta/utils | io-util/src/main/java/net/morimekta/util/Slice.java | Slice.strEquals | public final boolean strEquals(byte[] a, int aOff, int aLen) {
"""
Checks if the slice is equal to a portion of a given byte array.
@param a The array to compare with.
@param aOff The offset to compare with in the array.
@param aLen The length to compare with.
@return True if equal.
"""
if (aLen ... | java | public final boolean strEquals(byte[] a, int aOff, int aLen) {
if (aLen != len) {
return false;
}
for (int i = 0; i < len; ++i) {
if (a[aOff + i] != fb[off + i]) {
return false;
}
}
return true;
} | [
"public",
"final",
"boolean",
"strEquals",
"(",
"byte",
"[",
"]",
"a",
",",
"int",
"aOff",
",",
"int",
"aLen",
")",
"{",
"if",
"(",
"aLen",
"!=",
"len",
")",
"{",
"return",
"false",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"... | Checks if the slice is equal to a portion of a given byte array.
@param a The array to compare with.
@param aOff The offset to compare with in the array.
@param aLen The length to compare with.
@return True if equal. | [
"Checks",
"if",
"the",
"slice",
"is",
"equal",
"to",
"a",
"portion",
"of",
"a",
"given",
"byte",
"array",
"."
] | train | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/io-util/src/main/java/net/morimekta/util/Slice.java#L173-L183 |
alkacon/opencms-core | src/org/opencms/report/CmsHtmlReport.java | CmsHtmlReport.getExceptionElement | private StringBuffer getExceptionElement(Throwable throwable) {
"""
Output helper method to format a reported {@link Throwable} element.<p>
This method ensures that exception stack traces are properly escaped
when they are added to the report.<p>
There is a member variable {@link #m_showExceptionStackTrace}... | java | private StringBuffer getExceptionElement(Throwable throwable) {
StringBuffer buf = new StringBuffer(256);
if (!m_writeHtml) {
if (m_showExceptionStackTrace) {
buf.append("aT('");
buf.append(getMessages().key(Messages.RPT_EXCEPTION_0));
String... | [
"private",
"StringBuffer",
"getExceptionElement",
"(",
"Throwable",
"throwable",
")",
"{",
"StringBuffer",
"buf",
"=",
"new",
"StringBuffer",
"(",
"256",
")",
";",
"if",
"(",
"!",
"m_writeHtml",
")",
"{",
"if",
"(",
"m_showExceptionStackTrace",
")",
"{",
"buf"... | Output helper method to format a reported {@link Throwable} element.<p>
This method ensures that exception stack traces are properly escaped
when they are added to the report.<p>
There is a member variable {@link #m_showExceptionStackTrace} in this
class that controls if the stack track is shown or not.
In a later ve... | [
"Output",
"helper",
"method",
"to",
"format",
"a",
"reported",
"{",
"@link",
"Throwable",
"}",
"element",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/report/CmsHtmlReport.java#L280-L326 |
BioPAX/Paxtools | paxtools-console/src/main/java/org/biopax/paxtools/examples/UseOfReflection.java | UseOfReflection.getBiopaxPropertyValues | public static Set getBiopaxPropertyValues(BioPAXElement bpe, String property) {
"""
Example 2.
How to get values from a biopax property if the type of the biopax object
is not known at runtime, and you do not want to always remember the
domain and range of the property nor write many if-else statements to
fi... | java | public static Set getBiopaxPropertyValues(BioPAXElement bpe, String property) {
// get the BioPAX L3 property editors map
EditorMap em = SimpleEditorMap.L3;
// get the 'organism' biopax property editor,
// if exists for this type of bpe
@SuppressWarnings("unchecked") PropertyEditor<BioPAXElement, Object> e... | [
"public",
"static",
"Set",
"getBiopaxPropertyValues",
"(",
"BioPAXElement",
"bpe",
",",
"String",
"property",
")",
"{",
"// get the BioPAX L3 property editors map",
"EditorMap",
"em",
"=",
"SimpleEditorMap",
".",
"L3",
";",
"// get the 'organism' biopax property editor, ",
... | Example 2.
How to get values from a biopax property if the type of the biopax object
is not known at runtime, and you do not want to always remember the
domain and range of the property nor write many if-else statements to
find out.
@param bpe BioPAX object
@param property BioPAX property
@return the BioPAX property ... | [
"Example",
"2",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-console/src/main/java/org/biopax/paxtools/examples/UseOfReflection.java#L68-L84 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/SerializationUtils.java | SerializationUtils.toJson | public static JsonNode toJson(Object obj, ClassLoader classLoader) {
"""
Serialize an object to {@link JsonNode}, with a custom class loader.
@param obj
@param classLoader
@return
@since 0.6.2
"""
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
if (classLoader... | java | public static JsonNode toJson(Object obj, ClassLoader classLoader) {
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
if (classLoader != null) {
Thread.currentThread().setContextClassLoader(classLoader);
}
try {
if (obj == null) {
... | [
"public",
"static",
"JsonNode",
"toJson",
"(",
"Object",
"obj",
",",
"ClassLoader",
"classLoader",
")",
"{",
"ClassLoader",
"oldClassLoader",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
";",
"if",
"(",
"classLoader",
... | Serialize an object to {@link JsonNode}, with a custom class loader.
@param obj
@param classLoader
@return
@since 0.6.2 | [
"Serialize",
"an",
"object",
"to",
"{",
"@link",
"JsonNode",
"}",
"with",
"a",
"custom",
"class",
"loader",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/SerializationUtils.java#L412-L436 |
JOML-CI/JOML | src/org/joml/Quaternionf.java | Quaternionf.lookAlong | public Quaternionf lookAlong(float dirX, float dirY, float dirZ, float upX, float upY, float upZ) {
"""
Apply a rotation to this quaternion that maps the given direction to the positive Z axis.
<p>
Because there are multiple possibilities for such a rotation, this method will choose the one that ensures the give... | java | public Quaternionf lookAlong(float dirX, float dirY, float dirZ, float upX, float upY, float upZ) {
return lookAlong(dirX, dirY, dirZ, upX, upY, upZ, this);
} | [
"public",
"Quaternionf",
"lookAlong",
"(",
"float",
"dirX",
",",
"float",
"dirY",
",",
"float",
"dirZ",
",",
"float",
"upX",
",",
"float",
"upY",
",",
"float",
"upZ",
")",
"{",
"return",
"lookAlong",
"(",
"dirX",
",",
"dirY",
",",
"dirZ",
",",
"upX",
... | Apply a rotation to this quaternion that maps the given direction to the positive Z axis.
<p>
Because there are multiple possibilities for such a rotation, this method will choose the one that ensures the given up direction to remain
parallel to the plane spanned by the <code>up</code> and <code>dir</code> vectors.
<p>... | [
"Apply",
"a",
"rotation",
"to",
"this",
"quaternion",
"that",
"maps",
"the",
"given",
"direction",
"to",
"the",
"positive",
"Z",
"axis",
".",
"<p",
">",
"Because",
"there",
"are",
"multiple",
"possibilities",
"for",
"such",
"a",
"rotation",
"this",
"method",... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Quaternionf.java#L2131-L2133 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/style/Color.java | Color.setColor | public void setColor(float red, float green, float blue, float opacity) {
"""
Set the color with arithmetic RGB values
@param red
red float color inclusively between 0.0 and 1.0
@param green
green float color inclusively between 0.0 and 1.0
@param blue
blue float color inclusively between 0.0 and 1.0
@par... | java | public void setColor(float red, float green, float blue, float opacity) {
setColor(red, green, blue);
setOpacity(opacity);
} | [
"public",
"void",
"setColor",
"(",
"float",
"red",
",",
"float",
"green",
",",
"float",
"blue",
",",
"float",
"opacity",
")",
"{",
"setColor",
"(",
"red",
",",
"green",
",",
"blue",
")",
";",
"setOpacity",
"(",
"opacity",
")",
";",
"}"
] | Set the color with arithmetic RGB values
@param red
red float color inclusively between 0.0 and 1.0
@param green
green float color inclusively between 0.0 and 1.0
@param blue
blue float color inclusively between 0.0 and 1.0
@param opacity
opacity float inclusively between 0.0 and 1.0 | [
"Set",
"the",
"color",
"with",
"arithmetic",
"RGB",
"values"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/style/Color.java#L409-L412 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/PlacesApi.java | PlacesApi.getTopPlaces | public Places getTopPlaces(JinxConstants.PlaceTypeId placeTypeId, Date date, String placeId, String woeId) throws JinxException {
"""
Return the top 100 most geotagged places for a day.
Authentication
This method does not require authentication.
@param placeTypeId The type ID for a specific place type to ... | java | public Places getTopPlaces(JinxConstants.PlaceTypeId placeTypeId, Date date, String placeId, String woeId) throws JinxException {
JinxUtils.validateParams(placeTypeId);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.places.getTopPlacesList");
params.put("place_type_id", place... | [
"public",
"Places",
"getTopPlaces",
"(",
"JinxConstants",
".",
"PlaceTypeId",
"placeTypeId",
",",
"Date",
"date",
",",
"String",
"placeId",
",",
"String",
"woeId",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"placeTypeId",
")",
... | Return the top 100 most geotagged places for a day.
Authentication
This method does not require authentication.
@param placeTypeId The type ID for a specific place type to cluster photos by. (Required)
@param date a valid date in YYYY-MM-DD format. The default is yesterday. (Optional)
@param placeId limit... | [
"Return",
"the",
"top",
"100",
"most",
"geotagged",
"places",
"for",
"a",
"day",
"."
] | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PlacesApi.java#L250-L265 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/HeapCompactOrderedSketch.java | HeapCompactOrderedSketch.heapifyInstance | static CompactSketch heapifyInstance(final Memory srcMem, final long seed) {
"""
Heapifies the given source Memory with seed
@param srcMem <a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a>
@param seed <a href="{@docRoot}/resources/dictionary.html#seed">See Update Hash Seed</a>.
@return a Compact... | java | static CompactSketch heapifyInstance(final Memory srcMem, final long seed) {
final short memSeedHash = (short) extractSeedHash(srcMem);
final short computedSeedHash = computeSeedHash(seed);
checkSeedHashes(memSeedHash, computedSeedHash);
final int preLongs = extractPreLongs(srcMem);
final boolean e... | [
"static",
"CompactSketch",
"heapifyInstance",
"(",
"final",
"Memory",
"srcMem",
",",
"final",
"long",
"seed",
")",
"{",
"final",
"short",
"memSeedHash",
"=",
"(",
"short",
")",
"extractSeedHash",
"(",
"srcMem",
")",
";",
"final",
"short",
"computedSeedHash",
"... | Heapifies the given source Memory with seed
@param srcMem <a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a>
@param seed <a href="{@docRoot}/resources/dictionary.html#seed">See Update Hash Seed</a>.
@return a CompactSketch | [
"Heapifies",
"the",
"given",
"source",
"Memory",
"with",
"seed"
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/HeapCompactOrderedSketch.java#L45-L72 |
aws/aws-sdk-java | aws-java-sdk-batch/src/main/java/com/amazonaws/services/batch/model/SubmitJobRequest.java | SubmitJobRequest.withParameters | public SubmitJobRequest withParameters(java.util.Map<String, String> parameters) {
"""
<p>
Additional parameters passed to the job that replace parameter substitution placeholders that are set in the job
definition. Parameters are specified as a key and value pair mapping. Parameters in a <code>SubmitJob</code>
... | java | public SubmitJobRequest withParameters(java.util.Map<String, String> parameters) {
setParameters(parameters);
return this;
} | [
"public",
"SubmitJobRequest",
"withParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"setParameters",
"(",
"parameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Additional parameters passed to the job that replace parameter substitution placeholders that are set in the job
definition. Parameters are specified as a key and value pair mapping. Parameters in a <code>SubmitJob</code>
request override any corresponding parameter defaults from the job definition.
</p>
@param pa... | [
"<p",
">",
"Additional",
"parameters",
"passed",
"to",
"the",
"job",
"that",
"replace",
"parameter",
"substitution",
"placeholders",
"that",
"are",
"set",
"in",
"the",
"job",
"definition",
".",
"Parameters",
"are",
"specified",
"as",
"a",
"key",
"and",
"value"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-batch/src/main/java/com/amazonaws/services/batch/model/SubmitJobRequest.java#L457-L460 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_support_replace_hardDiskDrive_POST | public OvhNewMessageInfo serviceName_support_replace_hardDiskDrive_POST(String serviceName, String comment, OvhSupportReplaceHddInfo[] disks, Boolean inverse) throws IOException {
"""
Ask for a broken HDD replacement
REST: POST /dedicated/server/{serviceName}/support/replace/hardDiskDrive
@param inverse [requi... | java | public OvhNewMessageInfo serviceName_support_replace_hardDiskDrive_POST(String serviceName, String comment, OvhSupportReplaceHddInfo[] disks, Boolean inverse) throws IOException {
String qPath = "/dedicated/server/{serviceName}/support/replace/hardDiskDrive";
StringBuilder sb = path(qPath, serviceName);
HashMap<S... | [
"public",
"OvhNewMessageInfo",
"serviceName_support_replace_hardDiskDrive_POST",
"(",
"String",
"serviceName",
",",
"String",
"comment",
",",
"OvhSupportReplaceHddInfo",
"[",
"]",
"disks",
",",
"Boolean",
"inverse",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
... | Ask for a broken HDD replacement
REST: POST /dedicated/server/{serviceName}/support/replace/hardDiskDrive
@param inverse [required] If set to 'true', replace only NON LISTED DISKS
@param disks [required] If 'inverse' is set as 'false', the list of HDD TO REPLACE. If 'inverse' is set as 'true', the list of HDD TO NOT R... | [
"Ask",
"for",
"a",
"broken",
"HDD",
"replacement"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L2023-L2032 |
dkpro/dkpro-argumentation | dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java | JCasUtil2.haveSameSpan | public static boolean haveSameSpan(final Annotation anno1, final Annotation anno2) {
"""
Returns whether two annotations share the same span
<p>
The method checks the spans based on the begin and end indices and not based on the
covered text.
</p>
@param anno1 first annotation
@param anno2 second annotat... | java | public static boolean haveSameSpan(final Annotation anno1, final Annotation anno2)
{
return anno1.getBegin() == anno2.getBegin() && anno1.getEnd() == anno2.getEnd();
} | [
"public",
"static",
"boolean",
"haveSameSpan",
"(",
"final",
"Annotation",
"anno1",
",",
"final",
"Annotation",
"anno2",
")",
"{",
"return",
"anno1",
".",
"getBegin",
"(",
")",
"==",
"anno2",
".",
"getBegin",
"(",
")",
"&&",
"anno1",
".",
"getEnd",
"(",
... | Returns whether two annotations share the same span
<p>
The method checks the spans based on the begin and end indices and not based on the
covered text.
</p>
@param anno1 first annotation
@param anno2 second annotation
@return whether the spans are identical | [
"Returns",
"whether",
"two",
"annotations",
"share",
"the",
"same",
"span"
] | train | https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L199-L202 |
taskadapter/redmine-java-api | src/main/java/com/taskadapter/redmineapi/ProjectManager.java | ProjectManager.getProjects | public List<Project> getProjects() throws RedmineException {
"""
Load the list of projects available to the user, which is represented by the API access key.
<p>
Redmine ignores "get trackers info" parameter for "get projects" request. see bug
http://www.redmine.org/issues/8545
The field is already accessible ... | java | public List<Project> getProjects() throws RedmineException {
try {
return transport.getObjectsList(Project.class,
new BasicNameValuePair("include", "trackers"));
} catch (NotFoundException e) {
throw new RedmineInternalError("NotFoundException received, which ... | [
"public",
"List",
"<",
"Project",
">",
"getProjects",
"(",
")",
"throws",
"RedmineException",
"{",
"try",
"{",
"return",
"transport",
".",
"getObjectsList",
"(",
"Project",
".",
"class",
",",
"new",
"BasicNameValuePair",
"(",
"\"include\"",
",",
"\"trackers\"",
... | Load the list of projects available to the user, which is represented by the API access key.
<p>
Redmine ignores "get trackers info" parameter for "get projects" request. see bug
http://www.redmine.org/issues/8545
The field is already accessible for a specific project for a long time (GET /projects/:id)
but in the proj... | [
"Load",
"the",
"list",
"of",
"projects",
"available",
"to",
"the",
"user",
"which",
"is",
"represented",
"by",
"the",
"API",
"access",
"key",
".",
"<p",
">",
"Redmine",
"ignores",
"get",
"trackers",
"info",
"parameter",
"for",
"get",
"projects",
"request",
... | train | https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/ProjectManager.java#L64-L71 |
lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java | Descriptor.replaceAllCalls | public Descriptor replaceAllCalls(PSequence<Call<?, ?>> calls) {
"""
Replace all the service calls provided by this descriptor with the the given service calls.
@param calls The calls to replace the existing ones with.
@return A copy of this descriptor with the new calls.
"""
return new Descriptor(... | java | public Descriptor replaceAllCalls(PSequence<Call<?, ?>> calls) {
return new Descriptor(name, calls, pathParamSerializers, messageSerializers, serializerFactory, exceptionSerializer, autoAcl, acls, headerFilter, locatableService, circuitBreaker, topicCalls);
} | [
"public",
"Descriptor",
"replaceAllCalls",
"(",
"PSequence",
"<",
"Call",
"<",
"?",
",",
"?",
">",
">",
"calls",
")",
"{",
"return",
"new",
"Descriptor",
"(",
"name",
",",
"calls",
",",
"pathParamSerializers",
",",
"messageSerializers",
",",
"serializerFactory... | Replace all the service calls provided by this descriptor with the the given service calls.
@param calls The calls to replace the existing ones with.
@return A copy of this descriptor with the new calls. | [
"Replace",
"all",
"the",
"service",
"calls",
"provided",
"by",
"this",
"descriptor",
"with",
"the",
"the",
"given",
"service",
"calls",
"."
] | train | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/Descriptor.java#L720-L722 |
netty/netty | resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java | DnsNameResolver.newRedirectDnsServerStream | protected DnsServerAddressStream newRedirectDnsServerStream(
@SuppressWarnings("unused") String hostname, List<InetSocketAddress> nameservers) {
"""
Creates a new {@link DnsServerAddressStream} to following a redirected DNS query. By overriding this
it provides the opportunity to sort the name servers... | java | protected DnsServerAddressStream newRedirectDnsServerStream(
@SuppressWarnings("unused") String hostname, List<InetSocketAddress> nameservers) {
DnsServerAddressStream cached = authoritativeDnsServerCache().get(hostname);
if (cached == null || cached.size() == 0) {
// If there is... | [
"protected",
"DnsServerAddressStream",
"newRedirectDnsServerStream",
"(",
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"String",
"hostname",
",",
"List",
"<",
"InetSocketAddress",
">",
"nameservers",
")",
"{",
"DnsServerAddressStream",
"cached",
"=",
"authoritativeDns... | Creates a new {@link DnsServerAddressStream} to following a redirected DNS query. By overriding this
it provides the opportunity to sort the name servers before following a redirected DNS query.
@param hostname the hostname.
@param nameservers The addresses of the DNS servers which are used in the event of a redirect.... | [
"Creates",
"a",
"new",
"{",
"@link",
"DnsServerAddressStream",
"}",
"to",
"following",
"a",
"redirected",
"DNS",
"query",
".",
"By",
"overriding",
"this",
"it",
"provides",
"the",
"opportunity",
"to",
"sort",
"the",
"name",
"servers",
"before",
"following",
"a... | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java#L477-L487 |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/support/pagefactory/AjaxElementLocator.java | AjaxElementLocator.findElements | @Override
public List<WebElement> findElements() {
"""
{@inheritDoc}
Will poll the interface on a regular basis until at least one element is present.
"""
SlowLoadingElementList list = new SlowLoadingElementList(clock, timeOutInSeconds);
try {
return list.get().getElements();
} catch (No... | java | @Override
public List<WebElement> findElements() {
SlowLoadingElementList list = new SlowLoadingElementList(clock, timeOutInSeconds);
try {
return list.get().getElements();
} catch (NoSuchElementError e) {
return new ArrayList<>();
}
} | [
"@",
"Override",
"public",
"List",
"<",
"WebElement",
">",
"findElements",
"(",
")",
"{",
"SlowLoadingElementList",
"list",
"=",
"new",
"SlowLoadingElementList",
"(",
"clock",
",",
"timeOutInSeconds",
")",
";",
"try",
"{",
"return",
"list",
".",
"get",
"(",
... | {@inheritDoc}
Will poll the interface on a regular basis until at least one element is present. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/pagefactory/AjaxElementLocator.java#L108-L116 |
rjeschke/txtmark | src/main/java/com/github/rjeschke/txtmark/Emitter.java | Emitter.checkHtml | private int checkHtml(final StringBuilder out, final String in, final int start) {
"""
Check if there is a valid HTML tag here. This method also transforms auto
links and mailto auto links.
@param out
The StringBuilder to write to.
@param in
Input String.
@param start
Starting position.
@return The new p... | java | private int checkHtml(final StringBuilder out, final String in, final int start)
{
final StringBuilder temp = new StringBuilder();
int pos;
// Check for auto links
temp.setLength(0);
pos = Utils.readUntil(temp, in, start + 1, ':', ' ', '>', '\n');
if (pos != -1 && in... | [
"private",
"int",
"checkHtml",
"(",
"final",
"StringBuilder",
"out",
",",
"final",
"String",
"in",
",",
"final",
"int",
"start",
")",
"{",
"final",
"StringBuilder",
"temp",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"int",
"pos",
";",
"// Check for auto lin... | Check if there is a valid HTML tag here. This method also transforms auto
links and mailto auto links.
@param out
The StringBuilder to write to.
@param in
Input String.
@param start
Starting position.
@return The new position or -1 if nothing valid has been found. | [
"Check",
"if",
"there",
"is",
"a",
"valid",
"HTML",
"tag",
"here",
".",
"This",
"method",
"also",
"transforms",
"auto",
"links",
"and",
"mailto",
"auto",
"links",
"."
] | train | https://github.com/rjeschke/txtmark/blob/108cee6b209a362843729c032c2d982625d12d98/src/main/java/com/github/rjeschke/txtmark/Emitter.java#L409-L461 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/LookupTableHelper.java | LookupTableHelper.registerList | public static void registerList(final String key, final Request request) {
"""
Registers a data list with the servlet.
@param key the list key.
@param request the current request being responded to.
"""
request.setSessionAttribute(DATA_LIST_UIC_SESSION_KEY, UIContextHolder.getCurrentPrimaryUIContext());
... | java | public static void registerList(final String key, final Request request) {
request.setSessionAttribute(DATA_LIST_UIC_SESSION_KEY, UIContextHolder.getCurrentPrimaryUIContext());
} | [
"public",
"static",
"void",
"registerList",
"(",
"final",
"String",
"key",
",",
"final",
"Request",
"request",
")",
"{",
"request",
".",
"setSessionAttribute",
"(",
"DATA_LIST_UIC_SESSION_KEY",
",",
"UIContextHolder",
".",
"getCurrentPrimaryUIContext",
"(",
")",
")"... | Registers a data list with the servlet.
@param key the list key.
@param request the current request being responded to. | [
"Registers",
"a",
"data",
"list",
"with",
"the",
"servlet",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/LookupTableHelper.java#L35-L37 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java | ObjectArrayList.replaceFromToWithFrom | public void replaceFromToWithFrom(int from, int to, ObjectArrayList other, int otherFrom) {
"""
Replaces a number of elements in the receiver with the same number of elements of another list.
Replaces elements in the receiver, between <code>from</code> (inclusive) and <code>to</code> (inclusive),
with elements o... | java | public void replaceFromToWithFrom(int from, int to, ObjectArrayList other, int otherFrom) {
int length=to-from+1;
if (length>0) {
checkRangeFromTo(from, to, size);
checkRangeFromTo(otherFrom,otherFrom+length-1,other.size);
System.arraycopy(other.elements, otherFrom, elements, from, length);
}
} | [
"public",
"void",
"replaceFromToWithFrom",
"(",
"int",
"from",
",",
"int",
"to",
",",
"ObjectArrayList",
"other",
",",
"int",
"otherFrom",
")",
"{",
"int",
"length",
"=",
"to",
"-",
"from",
"+",
"1",
";",
"if",
"(",
"length",
">",
"0",
")",
"{",
"che... | Replaces a number of elements in the receiver with the same number of elements of another list.
Replaces elements in the receiver, between <code>from</code> (inclusive) and <code>to</code> (inclusive),
with elements of <code>other</code>, starting from <code>otherFrom</code> (inclusive).
@param from the position of th... | [
"Replaces",
"a",
"number",
"of",
"elements",
"in",
"the",
"receiver",
"with",
"the",
"same",
"number",
"of",
"elements",
"of",
"another",
"list",
".",
"Replaces",
"elements",
"in",
"the",
"receiver",
"between",
"<code",
">",
"from<",
"/",
"code",
">",
"(",... | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java#L685-L692 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/streamrecord/StreamRecord.java | StreamRecord.copyTo | public void copyTo(T valueCopy, StreamRecord<T> target) {
"""
Copies this record into the new stream record. Uses the copied value as the value for the new
record, i.e., only copies timestamp fields.
"""
target.value = valueCopy;
target.timestamp = this.timestamp;
target.hasTimestamp = this.hasTimestamp... | java | public void copyTo(T valueCopy, StreamRecord<T> target) {
target.value = valueCopy;
target.timestamp = this.timestamp;
target.hasTimestamp = this.hasTimestamp;
} | [
"public",
"void",
"copyTo",
"(",
"T",
"valueCopy",
",",
"StreamRecord",
"<",
"T",
">",
"target",
")",
"{",
"target",
".",
"value",
"=",
"valueCopy",
";",
"target",
".",
"timestamp",
"=",
"this",
".",
"timestamp",
";",
"target",
".",
"hasTimestamp",
"=",
... | Copies this record into the new stream record. Uses the copied value as the value for the new
record, i.e., only copies timestamp fields. | [
"Copies",
"this",
"record",
"into",
"the",
"new",
"stream",
"record",
".",
"Uses",
"the",
"copied",
"value",
"as",
"the",
"value",
"for",
"the",
"new",
"record",
"i",
".",
"e",
".",
"only",
"copies",
"timestamp",
"fields",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/streamrecord/StreamRecord.java#L156-L160 |
opendatatrentino/s-match | src/main/java/it/unitn/disi/smatch/filters/RedundantMappingFilter.java | RedundantMappingFilter.isRedundant | private boolean isRedundant(IContextMapping<INode> mapping, IMappingElement<INode> e) {
"""
Checks the relation between source and target is redundant or not for minimal mapping.
@param mapping a mapping
@param e a mapping element
@return true for redundant relation
"""
switch (e.getRelatio... | java | private boolean isRedundant(IContextMapping<INode> mapping, IMappingElement<INode> e) {
switch (e.getRelation()) {
case IMappingElement.LESS_GENERAL: {
if (verifyCondition1(mapping, e)) {
return true;
}
break;
}
... | [
"private",
"boolean",
"isRedundant",
"(",
"IContextMapping",
"<",
"INode",
">",
"mapping",
",",
"IMappingElement",
"<",
"INode",
">",
"e",
")",
"{",
"switch",
"(",
"e",
".",
"getRelation",
"(",
")",
")",
"{",
"case",
"IMappingElement",
".",
"LESS_GENERAL",
... | Checks the relation between source and target is redundant or not for minimal mapping.
@param mapping a mapping
@param e a mapping element
@return true for redundant relation | [
"Checks",
"the",
"relation",
"between",
"source",
"and",
"target",
"is",
"redundant",
"or",
"not",
"for",
"minimal",
"mapping",
"."
] | train | https://github.com/opendatatrentino/s-match/blob/ba5982ef406b7010c2f92592e43887a485935aa1/src/main/java/it/unitn/disi/smatch/filters/RedundantMappingFilter.java#L65-L98 |
mnlipp/jgrapes | org.jgrapes.http/src/org/jgrapes/http/HttpConnector.java | HttpConnector.onInput | @Handler(channels = NetworkChannel.class)
public void onInput(Input<ByteBuffer> event, TcpChannel netConnChannel)
throws InterruptedException, ProtocolException {
"""
Processes any input from the network layer.
@param event the event
@param netConnChannel the network layer channel
@throws Inte... | java | @Handler(channels = NetworkChannel.class)
public void onInput(Input<ByteBuffer> event, TcpChannel netConnChannel)
throws InterruptedException, ProtocolException {
Optional<WebAppMsgChannel> appChannel
= netConnChannel.associated(WebAppMsgChannel.class);
if (appChannel.isPrese... | [
"@",
"Handler",
"(",
"channels",
"=",
"NetworkChannel",
".",
"class",
")",
"public",
"void",
"onInput",
"(",
"Input",
"<",
"ByteBuffer",
">",
"event",
",",
"TcpChannel",
"netConnChannel",
")",
"throws",
"InterruptedException",
",",
"ProtocolException",
"{",
"Opt... | Processes any input from the network layer.
@param event the event
@param netConnChannel the network layer channel
@throws InterruptedException if the thread is interrupted
@throws ProtocolException if the protocol is violated | [
"Processes",
"any",
"input",
"from",
"the",
"network",
"layer",
"."
] | train | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.http/src/org/jgrapes/http/HttpConnector.java#L239-L247 |
Wadpam/guja | guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java | GeneratedDContactDaoImpl.findByUniqueTag | public DContact findByUniqueTag(Object parent, java.lang.String uniqueTag) {
"""
find-by method for unique field uniqueTag
@param uniqueTag the unique attribute
@return the unique DContact for the specified uniqueTag
"""
return queryUniqueByField(parent, DContactMapper.Field.UNIQUETAG.getFieldName(), uni... | java | public DContact findByUniqueTag(Object parent, java.lang.String uniqueTag) {
return queryUniqueByField(parent, DContactMapper.Field.UNIQUETAG.getFieldName(), uniqueTag);
} | [
"public",
"DContact",
"findByUniqueTag",
"(",
"Object",
"parent",
",",
"java",
".",
"lang",
".",
"String",
"uniqueTag",
")",
"{",
"return",
"queryUniqueByField",
"(",
"parent",
",",
"DContactMapper",
".",
"Field",
".",
"UNIQUETAG",
".",
"getFieldName",
"(",
")... | find-by method for unique field uniqueTag
@param uniqueTag the unique attribute
@return the unique DContact for the specified uniqueTag | [
"find",
"-",
"by",
"method",
"for",
"unique",
"field",
"uniqueTag"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java#L286-L288 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java | Aggregations.doubleMax | public static <Key, Value> Aggregation<Key, Double, Double> doubleMax() {
"""
Returns an aggregation to find the double maximum of all supplied values.<br/>
This aggregation is similar to: <pre>SELECT MAX(value) FROM x</pre>
@param <Key> the input key type
@param <Value> the supplied value type
@return the... | java | public static <Key, Value> Aggregation<Key, Double, Double> doubleMax() {
return new AggregationAdapter(new DoubleMaxAggregation<Key, Value>());
} | [
"public",
"static",
"<",
"Key",
",",
"Value",
">",
"Aggregation",
"<",
"Key",
",",
"Double",
",",
"Double",
">",
"doubleMax",
"(",
")",
"{",
"return",
"new",
"AggregationAdapter",
"(",
"new",
"DoubleMaxAggregation",
"<",
"Key",
",",
"Value",
">",
"(",
")... | Returns an aggregation to find the double maximum of all supplied values.<br/>
This aggregation is similar to: <pre>SELECT MAX(value) FROM x</pre>
@param <Key> the input key type
@param <Value> the supplied value type
@return the maximum value over all supplied values | [
"Returns",
"an",
"aggregation",
"to",
"find",
"the",
"double",
"maximum",
"of",
"all",
"supplied",
"values",
".",
"<br",
"/",
">",
"This",
"aggregation",
"is",
"similar",
"to",
":",
"<pre",
">",
"SELECT",
"MAX",
"(",
"value",
")",
"FROM",
"x<",
"/",
"p... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java#L234-L236 |
wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/message/Http2PushPromise.java | Http2PushPromise.addHeader | public void addHeader(String name, String value) {
"""
Adds a header to the push promise.
This will not replace the value of an already exists header.
@param name the header name
@param value value of the header
"""
httpRequest.headers().add(name, value);
} | java | public void addHeader(String name, String value) {
httpRequest.headers().add(name, value);
} | [
"public",
"void",
"addHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"httpRequest",
".",
"headers",
"(",
")",
".",
"add",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Adds a header to the push promise.
This will not replace the value of an already exists header.
@param name the header name
@param value value of the header | [
"Adds",
"a",
"header",
"to",
"the",
"push",
"promise",
".",
"This",
"will",
"not",
"replace",
"the",
"value",
"of",
"an",
"already",
"exists",
"header",
"."
] | train | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/message/Http2PushPromise.java#L98-L100 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TransliteratorIDParser.java | TransliteratorIDParser.specsToID | private static SingleID specsToID(Specs specs, int dir) {
"""
Givens a Spec object, convert it to a SingleID object. The
Spec object is a more unprocessed parse result. The SingleID
object contains information about canonical and basic IDs.
@return a SingleID; never returns null. Returned object always
has ... | java | private static SingleID specsToID(Specs specs, int dir) {
String canonID = "";
String basicID = "";
String basicPrefix = "";
if (specs != null) {
StringBuilder buf = new StringBuilder();
if (dir == FORWARD) {
if (specs.sawSource) {
... | [
"private",
"static",
"SingleID",
"specsToID",
"(",
"Specs",
"specs",
",",
"int",
"dir",
")",
"{",
"String",
"canonID",
"=",
"\"\"",
";",
"String",
"basicID",
"=",
"\"\"",
";",
"String",
"basicPrefix",
"=",
"\"\"",
";",
"if",
"(",
"specs",
"!=",
"null",
... | Givens a Spec object, convert it to a SingleID object. The
Spec object is a more unprocessed parse result. The SingleID
object contains information about canonical and basic IDs.
@return a SingleID; never returns null. Returned object always
has 'filter' field of null. | [
"Givens",
"a",
"Spec",
"object",
"convert",
"it",
"to",
"a",
"SingleID",
"object",
".",
"The",
"Spec",
"object",
"is",
"a",
"more",
"unprocessed",
"parse",
"result",
".",
"The",
"SingleID",
"object",
"contains",
"information",
"about",
"canonical",
"and",
"b... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TransliteratorIDParser.java#L701-L727 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java | HttpHeaders.setHeader | @Deprecated
public static void setHeader(HttpMessage message, String name, Iterable<?> values) {
"""
@deprecated Use {@link #set(CharSequence, Iterable)} instead.
@see #setHeader(HttpMessage, CharSequence, Iterable)
"""
message.headers().set(name, values);
} | java | @Deprecated
public static void setHeader(HttpMessage message, String name, Iterable<?> values) {
message.headers().set(name, values);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"setHeader",
"(",
"HttpMessage",
"message",
",",
"String",
"name",
",",
"Iterable",
"<",
"?",
">",
"values",
")",
"{",
"message",
".",
"headers",
"(",
")",
".",
"set",
"(",
"name",
",",
"values",
")",
";",... | @deprecated Use {@link #set(CharSequence, Iterable)} instead.
@see #setHeader(HttpMessage, CharSequence, Iterable) | [
"@deprecated",
"Use",
"{",
"@link",
"#set",
"(",
"CharSequence",
"Iterable",
")",
"}",
"instead",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L624-L627 |
JadiraOrg/jadira | cloning/src/main/java/org/jadira/reflection/access/unsafe/UnsafeOperations.java | UnsafeOperations.putChar | public final void putChar(Object parent, long offset, char value) {
"""
Puts the value at the given offset of the supplied parent object
@param parent The Object's parent
@param offset The offset
@param value char to be put
"""
THE_UNSAFE.putChar(parent, offset, value);
} | java | public final void putChar(Object parent, long offset, char value) {
THE_UNSAFE.putChar(parent, offset, value);
} | [
"public",
"final",
"void",
"putChar",
"(",
"Object",
"parent",
",",
"long",
"offset",
",",
"char",
"value",
")",
"{",
"THE_UNSAFE",
".",
"putChar",
"(",
"parent",
",",
"offset",
",",
"value",
")",
";",
"}"
] | Puts the value at the given offset of the supplied parent object
@param parent The Object's parent
@param offset The offset
@param value char to be put | [
"Puts",
"the",
"value",
"at",
"the",
"given",
"offset",
"of",
"the",
"supplied",
"parent",
"object"
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/cloning/src/main/java/org/jadira/reflection/access/unsafe/UnsafeOperations.java#L963-L965 |
belaban/JGroups | src/org/jgroups/blocks/ReplicatedTree.java | ReplicatedTree.findParentNode | Node findParentNode(String fqn, StringHolder child_name, boolean create_if_not_exists) {
"""
Find the node just <em>above</em> the one indicated by {@code fqn}. This is needed in many cases,
e.g. to add a new node or remove an existing node.
@param fqn The fully qualified name of the node.
@param child_name Wil... | java | Node findParentNode(String fqn, StringHolder child_name, boolean create_if_not_exists) {
Node curr=root, node;
StringTokenizer tok;
String name;
StringBuilder sb=null;
if(fqn == null || fqn.equals(SEPARATOR) || fqn != null && fqn.isEmpty())
return curr;
sb=n... | [
"Node",
"findParentNode",
"(",
"String",
"fqn",
",",
"StringHolder",
"child_name",
",",
"boolean",
"create_if_not_exists",
")",
"{",
"Node",
"curr",
"=",
"root",
",",
"node",
";",
"StringTokenizer",
"tok",
";",
"String",
"name",
";",
"StringBuilder",
"sb",
"="... | Find the node just <em>above</em> the one indicated by {@code fqn}. This is needed in many cases,
e.g. to add a new node or remove an existing node.
@param fqn The fully qualified name of the node.
@param child_name Will be filled with the name of the child when this method returns. The child name
is the last relative ... | [
"Find",
"the",
"node",
"just",
"<em",
">",
"above<",
"/",
"em",
">",
"the",
"one",
"indicated",
"by",
"{"
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/blocks/ReplicatedTree.java#L584-L610 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java | PageFlowUtils.getLongLivedPageFlow | public static PageFlowController getLongLivedPageFlow( String modulePath, HttpServletRequest request,
ServletContext servletContext ) {
"""
Get the long-lived page flow instance associated with the given module (directory) path.
@param modulePath the we... | java | public static PageFlowController getLongLivedPageFlow( String modulePath, HttpServletRequest request,
ServletContext servletContext )
{
StorageHandler sh = Handlers.get( servletContext ).getStorageHandler();
HttpServletRequest unwrappedReque... | [
"public",
"static",
"PageFlowController",
"getLongLivedPageFlow",
"(",
"String",
"modulePath",
",",
"HttpServletRequest",
"request",
",",
"ServletContext",
"servletContext",
")",
"{",
"StorageHandler",
"sh",
"=",
"Handlers",
".",
"get",
"(",
"servletContext",
")",
"."... | Get the long-lived page flow instance associated with the given module (directory) path.
@param modulePath the webapp-relative path to the directory containing the long-lived page flow.
@param request the current HttpServletRequest.
@param servletContext the current ServletContext.
@return the long-lived page flow ins... | [
"Get",
"the",
"long",
"-",
"lived",
"page",
"flow",
"instance",
"associated",
"with",
"the",
"given",
"module",
"(",
"directory",
")",
"path",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L483-L494 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.