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 |
|---|---|---|---|---|---|---|---|---|---|---|
playn/playn | core/src/playn/core/Keyboard.java | Keyboard.isKey | public static KeyEvent isKey (Key key, Event event) {
"""
A collector function for key events for {@code key}. Use it to obtain only events for a
particular key like so:
<pre>{@code
Input.keyboardEvents.collect(ev -> Keyboard.isKey(Key.X, ev)).connect(event -> {
// handle the 'x' key being pressed or release... | java | public static KeyEvent isKey (Key key, Event event) {
if (event instanceof KeyEvent && ((KeyEvent)event).key == key) {
return (KeyEvent)event;
} else {
return null;
}
} | [
"public",
"static",
"KeyEvent",
"isKey",
"(",
"Key",
"key",
",",
"Event",
"event",
")",
"{",
"if",
"(",
"event",
"instanceof",
"KeyEvent",
"&&",
"(",
"(",
"KeyEvent",
")",
"event",
")",
".",
"key",
"==",
"key",
")",
"{",
"return",
"(",
"KeyEvent",
")... | A collector function for key events for {@code key}. Use it to obtain only events for a
particular key like so:
<pre>{@code
Input.keyboardEvents.collect(ev -> Keyboard.isKey(Key.X, ev)).connect(event -> {
// handle the 'x' key being pressed or released
});
}</pre> | [
"A",
"collector",
"function",
"for",
"key",
"events",
"for",
"{",
"@code",
"key",
"}",
".",
"Use",
"it",
"to",
"obtain",
"only",
"events",
"for",
"a",
"particular",
"key",
"like",
"so",
":"
] | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/Keyboard.java#L141-L147 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java | VMath.setCol | public static void setCol(final double[][] m1, final int c, final double[] column) {
"""
Sets the <code>c</code>th column of this matrix to the specified column.
@param m1 Input matrix
@param c the index of the column to be set
@param column the value of the column to be set
"""
assert column.length =... | java | public static void setCol(final double[][] m1, final int c, final double[] column) {
assert column.length == m1.length : ERR_DIMENSIONS;
for(int i = 0; i < m1.length; i++) {
m1[i][c] = column[i];
}
} | [
"public",
"static",
"void",
"setCol",
"(",
"final",
"double",
"[",
"]",
"[",
"]",
"m1",
",",
"final",
"int",
"c",
",",
"final",
"double",
"[",
"]",
"column",
")",
"{",
"assert",
"column",
".",
"length",
"==",
"m1",
".",
"length",
":",
"ERR_DIMENSIONS... | Sets the <code>c</code>th column of this matrix to the specified column.
@param m1 Input matrix
@param c the index of the column to be set
@param column the value of the column to be set | [
"Sets",
"the",
"<code",
">",
"c<",
"/",
"code",
">",
"th",
"column",
"of",
"this",
"matrix",
"to",
"the",
"specified",
"column",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/VMath.java#L1106-L1111 |
VoltDB/voltdb | src/frontend/org/voltdb/VoltDB.java | VoltDB.crashGlobalVoltDB | public static void crashGlobalVoltDB(String errMsg, boolean stackTrace, Throwable t) {
"""
Exit the process with an error message, optionally with a stack trace.
Also notify all connected peers that the node is going down.
"""
// for test code
wasCrashCalled = true;
crashMessage = errM... | java | public static void crashGlobalVoltDB(String errMsg, boolean stackTrace, Throwable t) {
// for test code
wasCrashCalled = true;
crashMessage = errMsg;
if (ignoreCrash) {
throw new AssertionError("Faux crash of VoltDB successful.");
}
// end test code
/... | [
"public",
"static",
"void",
"crashGlobalVoltDB",
"(",
"String",
"errMsg",
",",
"boolean",
"stackTrace",
",",
"Throwable",
"t",
")",
"{",
"// for test code",
"wasCrashCalled",
"=",
"true",
";",
"crashMessage",
"=",
"errMsg",
";",
"if",
"(",
"ignoreCrash",
")",
... | Exit the process with an error message, optionally with a stack trace.
Also notify all connected peers that the node is going down. | [
"Exit",
"the",
"process",
"with",
"an",
"error",
"message",
"optionally",
"with",
"a",
"stack",
"trace",
".",
"Also",
"notify",
"all",
"connected",
"peers",
"that",
"the",
"node",
"is",
"going",
"down",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/VoltDB.java#L1416-L1447 |
skuzzle/semantic-version | src/it/java/de/skuzzle/semantic/VersionRegEx.java | VersionRegEx.min | public static VersionRegEx min(VersionRegEx v1, VersionRegEx v2) {
"""
Returns the lower of the two given versions by comparing them using their natural
ordering. If both versions are equal, then the first argument is returned.
@param v1 The first version.
@param v2 The second version.
@return The lower vers... | java | public static VersionRegEx min(VersionRegEx v1, VersionRegEx v2) {
require(v1 != null, "v1 is null");
require(v2 != null, "v2 is null");
return compare(v1, v2, false) <= 0
? v1
: v2;
} | [
"public",
"static",
"VersionRegEx",
"min",
"(",
"VersionRegEx",
"v1",
",",
"VersionRegEx",
"v2",
")",
"{",
"require",
"(",
"v1",
"!=",
"null",
",",
"\"v1 is null\"",
")",
";",
"require",
"(",
"v2",
"!=",
"null",
",",
"\"v2 is null\"",
")",
";",
"return",
... | Returns the lower of the two given versions by comparing them using their natural
ordering. If both versions are equal, then the first argument is returned.
@param v1 The first version.
@param v2 The second version.
@return The lower version.
@throws IllegalArgumentException If either argument is <code>null</code>.
@s... | [
"Returns",
"the",
"lower",
"of",
"the",
"two",
"given",
"versions",
"by",
"comparing",
"them",
"using",
"their",
"natural",
"ordering",
".",
"If",
"both",
"versions",
"are",
"equal",
"then",
"the",
"first",
"argument",
"is",
"returned",
"."
] | train | https://github.com/skuzzle/semantic-version/blob/2ddb66fb80244cd7f67c77ed5f8072d1132ad933/src/it/java/de/skuzzle/semantic/VersionRegEx.java#L246-L252 |
geomajas/geomajas-project-client-gwt | common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java | HtmlBuilder.trClass | public static String trClass(String clazz, String... content) {
"""
Build a HTML TableRow with given CSS class for a string.
Given content does <b>not</b> consists of HTML snippets and
as such is being prepared with {@link HtmlBuilder#htmlEncode(String)}.
@param clazz class for tr element
@param content cont... | java | public static String trClass(String clazz, String... content) {
return tagClass(Html.Tag.TR, clazz, content);
} | [
"public",
"static",
"String",
"trClass",
"(",
"String",
"clazz",
",",
"String",
"...",
"content",
")",
"{",
"return",
"tagClass",
"(",
"Html",
".",
"Tag",
".",
"TR",
",",
"clazz",
",",
"content",
")",
";",
"}"
] | Build a HTML TableRow with given CSS class for a string.
Given content does <b>not</b> consists of HTML snippets and
as such is being prepared with {@link HtmlBuilder#htmlEncode(String)}.
@param clazz class for tr element
@param content content string
@return HTML tr element as string | [
"Build",
"a",
"HTML",
"TableRow",
"with",
"given",
"CSS",
"class",
"for",
"a",
"string",
".",
"Given",
"content",
"does",
"<b",
">",
"not<",
"/",
"b",
">",
"consists",
"of",
"HTML",
"snippets",
"and",
"as",
"such",
"is",
"being",
"prepared",
"with",
"{... | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L140-L142 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/up/SignupPanel.java | SignupPanel.newUsernameTextField | protected Component newUsernameTextField(final String id, final IModel<T> model) {
"""
Factory method for creating the TextField for the username. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a TextField for the username.
@p... | java | protected Component newUsernameTextField(final String id, final IModel<T> model)
{
final IModel<String> labelModel = ResourceModelFactory
.newResourceModel("global.username.label", this);
final IModel<String> placeholderModel = ResourceModelFactory
.newResourceModel("global.enter.your.username.label", this);... | [
"protected",
"Component",
"newUsernameTextField",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"T",
">",
"model",
")",
"{",
"final",
"IModel",
"<",
"String",
">",
"labelModel",
"=",
"ResourceModelFactory",
".",
"newResourceModel",
"(",
"\"global.us... | Factory method for creating the TextField for the username. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a TextField for the username.
@param id
the id
@param model
the model
@return the text field | [
"Factory",
"method",
"for",
"creating",
"the",
"TextField",
"for",
"the",
"username",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"provide",
... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/sign/up/SignupPanel.java#L140-L168 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.deleteProjectMember | public void deleteProjectMember(GitlabProject project, GitlabUser user) throws IOException {
"""
Delete a project team member.
@param project the GitlabProject
@param user the GitlabUser
@throws IOException on gitlab api call error
"""
deleteProjectMember(project.getId(), user.getId());
} | java | public void deleteProjectMember(GitlabProject project, GitlabUser user) throws IOException {
deleteProjectMember(project.getId(), user.getId());
} | [
"public",
"void",
"deleteProjectMember",
"(",
"GitlabProject",
"project",
",",
"GitlabUser",
"user",
")",
"throws",
"IOException",
"{",
"deleteProjectMember",
"(",
"project",
".",
"getId",
"(",
")",
",",
"user",
".",
"getId",
"(",
")",
")",
";",
"}"
] | Delete a project team member.
@param project the GitlabProject
@param user the GitlabUser
@throws IOException on gitlab api call error | [
"Delete",
"a",
"project",
"team",
"member",
"."
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L3057-L3059 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java | NumberUtil.processMultiple | public static int processMultiple(int selectNum, int minNum) {
"""
可以用于计算双色球、大乐透注数的方法<br>
比如大乐透35选5可以这样调用processMultiple(7,5); 就是数学中的:C75=7*6/2*1
@param selectNum 选中小球个数
@param minNum 最少要选中多少个小球
@return 注数
"""
int result;
result = mathSubnode(selectNum, minNum) / mathNode(selectNum - minNum);
re... | java | public static int processMultiple(int selectNum, int minNum) {
int result;
result = mathSubnode(selectNum, minNum) / mathNode(selectNum - minNum);
return result;
} | [
"public",
"static",
"int",
"processMultiple",
"(",
"int",
"selectNum",
",",
"int",
"minNum",
")",
"{",
"int",
"result",
";",
"result",
"=",
"mathSubnode",
"(",
"selectNum",
",",
"minNum",
")",
"/",
"mathNode",
"(",
"selectNum",
"-",
"minNum",
")",
";",
"... | 可以用于计算双色球、大乐透注数的方法<br>
比如大乐透35选5可以这样调用processMultiple(7,5); 就是数学中的:C75=7*6/2*1
@param selectNum 选中小球个数
@param minNum 最少要选中多少个小球
@return 注数 | [
"可以用于计算双色球、大乐透注数的方法<br",
">",
"比如大乐透35选5可以这样调用processMultiple",
"(",
"7",
"5",
")",
";",
"就是数学中的:C75",
"=",
"7",
"*",
"6",
"/",
"2",
"*",
"1"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L1438-L1442 |
ZieIony/Carbon | carbon/src/main/java/carbon/drawable/ripple/LayerDrawable.java | LayerDrawable.setDrawableByLayerId | public boolean setDrawableByLayerId(int id, Drawable drawable) {
"""
Replaces the {@link Drawable} for the layer with the given id.
@param id The layer ID to search for.
@param drawable The replacement {@link Drawable}.
@return Whether the {@link Drawable} was replaced (could return false if the id was ... | java | public boolean setDrawableByLayerId(int id, Drawable drawable) {
final int index = findIndexByLayerId(id);
if (index < 0) {
return false;
}
setDrawable(index, drawable);
return true;
} | [
"public",
"boolean",
"setDrawableByLayerId",
"(",
"int",
"id",
",",
"Drawable",
"drawable",
")",
"{",
"final",
"int",
"index",
"=",
"findIndexByLayerId",
"(",
"id",
")",
";",
"if",
"(",
"index",
"<",
"0",
")",
"{",
"return",
"false",
";",
"}",
"setDrawab... | Replaces the {@link Drawable} for the layer with the given id.
@param id The layer ID to search for.
@param drawable The replacement {@link Drawable}.
@return Whether the {@link Drawable} was replaced (could return false if the id was not
found). | [
"Replaces",
"the",
"{",
"@link",
"Drawable",
"}",
"for",
"the",
"layer",
"with",
"the",
"given",
"id",
"."
] | train | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/drawable/ripple/LayerDrawable.java#L483-L491 |
JakeWharton/butterknife | butterknife-runtime/src/main/java/butterknife/ViewCollections.java | ViewCollections.set | @UiThread
public static <T extends View, V> void set(@NonNull T[] array,
@NonNull Property<? super T, V> setter, @Nullable V value) {
"""
Apply the specified {@code value} across the {@code array} of views using the {@code property}.
"""
//noinspection ForLoopReplaceableByForEach
for (int i = 0... | java | @UiThread
public static <T extends View, V> void set(@NonNull T[] array,
@NonNull Property<? super T, V> setter, @Nullable V value) {
//noinspection ForLoopReplaceableByForEach
for (int i = 0, count = array.length; i < count; i++) {
setter.set(array[i], value);
}
} | [
"@",
"UiThread",
"public",
"static",
"<",
"T",
"extends",
"View",
",",
"V",
">",
"void",
"set",
"(",
"@",
"NonNull",
"T",
"[",
"]",
"array",
",",
"@",
"NonNull",
"Property",
"<",
"?",
"super",
"T",
",",
"V",
">",
"setter",
",",
"@",
"Nullable",
"... | Apply the specified {@code value} across the {@code array} of views using the {@code property}. | [
"Apply",
"the",
"specified",
"{"
] | train | https://github.com/JakeWharton/butterknife/blob/0ead8a7b21620effcf78c728089fc16ae9d664c0/butterknife-runtime/src/main/java/butterknife/ViewCollections.java#L106-L113 |
davidcarboni/restolino | src/main/java/com/github/davidcarboni/restolino/api/Router.java | Router.doMethod | void doMethod(HttpServletRequest request, HttpServletResponse response, HttpMethod httpMethod) {
"""
GO!
@param request The request.
@param response The response.
"""
// Locate a request handler:
String requestPath = mapRequestPath(request);
Route route = api.get(requestPath);
... | java | void doMethod(HttpServletRequest request, HttpServletResponse response, HttpMethod httpMethod) {
// Locate a request handler:
String requestPath = mapRequestPath(request);
Route route = api.get(requestPath);
try {
if (route != null && route.requestHandlers.containsKey(http... | [
"void",
"doMethod",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"HttpMethod",
"httpMethod",
")",
"{",
"// Locate a request handler:",
"String",
"requestPath",
"=",
"mapRequestPath",
"(",
"request",
")",
";",
"Route",
"route",
"="... | GO!
@param request The request.
@param response The response. | [
"GO!"
] | train | https://github.com/davidcarboni/restolino/blob/3f84ece1bd016fbb597c624d46fcca5a2580a33d/src/main/java/com/github/davidcarboni/restolino/api/Router.java#L322-L349 |
anotheria/moskito | moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/stats/GenericStats.java | GenericStats.getStatValueAsInteger | public int getStatValueAsInteger(T metric, String interval) {
"""
Get value of provided metric for the given interval as int value.
@param metric metric which value we wanna get
@param interval the name of the Interval or <code>null</code> to get the absolute value
@return the current value
"""
if (... | java | public int getStatValueAsInteger(T metric, String interval) {
if (metric.isRateMetric()) {
return (int)(getStatValueAsDouble(metric, interval));
}
return getMonitoredStatValue(metric).getValueAsInt(interval);
} | [
"public",
"int",
"getStatValueAsInteger",
"(",
"T",
"metric",
",",
"String",
"interval",
")",
"{",
"if",
"(",
"metric",
".",
"isRateMetric",
"(",
")",
")",
"{",
"return",
"(",
"int",
")",
"(",
"getStatValueAsDouble",
"(",
"metric",
",",
"interval",
")",
... | Get value of provided metric for the given interval as int value.
@param metric metric which value we wanna get
@param interval the name of the Interval or <code>null</code> to get the absolute value
@return the current value | [
"Get",
"value",
"of",
"provided",
"metric",
"for",
"the",
"given",
"interval",
"as",
"int",
"value",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-extensions/moskito-monitoring-plugin/src/main/java/net/anotheria/moskito/extensions/monitoring/stats/GenericStats.java#L178-L183 |
ontop/ontop | core/obda/src/main/java/it/unibz/inf/ontop/spec/ontology/impl/OntologyBuilderImpl.java | OntologyBuilderImpl.createDataPropertyAssertion | public static DataPropertyAssertion createDataPropertyAssertion(DataPropertyExpression dpe, ObjectConstant o1, ValueConstant o2) throws InconsistentOntologyException {
"""
Creates a data property assertion
<p>
DataPropertyAssertion := 'DataPropertyAssertion' '(' axiomAnnotations
DataPropertyExpression sourceInd... | java | public static DataPropertyAssertion createDataPropertyAssertion(DataPropertyExpression dpe, ObjectConstant o1, ValueConstant o2) throws InconsistentOntologyException {
if (dpe.isTop())
return null;
if (dpe.isBottom())
throw new InconsistentOntologyException();
return new... | [
"public",
"static",
"DataPropertyAssertion",
"createDataPropertyAssertion",
"(",
"DataPropertyExpression",
"dpe",
",",
"ObjectConstant",
"o1",
",",
"ValueConstant",
"o2",
")",
"throws",
"InconsistentOntologyException",
"{",
"if",
"(",
"dpe",
".",
"isTop",
"(",
")",
")... | Creates a data property assertion
<p>
DataPropertyAssertion := 'DataPropertyAssertion' '(' axiomAnnotations
DataPropertyExpression sourceIndividual targetValue ')'
<p>
Implements rule [D4]:
- ignore (return null) if the property is top
- inconsistency if the property is bot | [
"Creates",
"a",
"data",
"property",
"assertion",
"<p",
">",
"DataPropertyAssertion",
":",
"=",
"DataPropertyAssertion",
"(",
"axiomAnnotations",
"DataPropertyExpression",
"sourceIndividual",
"targetValue",
")",
"<p",
">",
"Implements",
"rule",
"[",
"D4",
"]",
":",
"... | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/obda/src/main/java/it/unibz/inf/ontop/spec/ontology/impl/OntologyBuilderImpl.java#L480-L487 |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/ImageUtils.java | ImageUtils.compressAndWriteImageToBytes | public static byte[] compressAndWriteImageToBytes(BufferedImage image,
String formatName, float quality) {
"""
Compress and write the image to bytes in the provided format and quality
@param image
buffered image
@param formatName
image format name
@param quality
quality between 0.0 and 1.0
@return comp... | java | public static byte[] compressAndWriteImageToBytes(BufferedImage image,
String formatName, float quality) {
byte[] bytes = null;
Iterator<ImageWriter> writers = ImageIO
.getImageWritersByFormatName(formatName);
if (writers == null || !writers.hasNext()) {
throw new GeoPackageException(
"No Image W... | [
"public",
"static",
"byte",
"[",
"]",
"compressAndWriteImageToBytes",
"(",
"BufferedImage",
"image",
",",
"String",
"formatName",
",",
"float",
"quality",
")",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"null",
";",
"Iterator",
"<",
"ImageWriter",
">",
"writers",
... | Compress and write the image to bytes in the provided format and quality
@param image
buffered image
@param formatName
image format name
@param quality
quality between 0.0 and 1.0
@return compressed image bytes
@since 1.1.2 | [
"Compress",
"and",
"write",
"the",
"image",
"to",
"bytes",
"in",
"the",
"provided",
"format",
"and",
"quality"
] | train | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/ImageUtils.java#L200-L236 |
redkale/redkale | src/org/redkale/net/http/HttpRequest.java | HttpRequest.getHeader | public String getHeader(String name, String defaultValue) {
"""
获取指定的header值, 没有返回默认值
@param name header名
@param defaultValue 默认值
@return header值
"""
return header.getValue(name, defaultValue);
} | java | public String getHeader(String name, String defaultValue) {
return header.getValue(name, defaultValue);
} | [
"public",
"String",
"getHeader",
"(",
"String",
"name",
",",
"String",
"defaultValue",
")",
"{",
"return",
"header",
".",
"getValue",
"(",
"name",
",",
"defaultValue",
")",
";",
"}"
] | 获取指定的header值, 没有返回默认值
@param name header名
@param defaultValue 默认值
@return header值 | [
"获取指定的header值",
"没有返回默认值"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/net/http/HttpRequest.java#L1016-L1018 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/BootstrapConfig.java | BootstrapConfig.getConfigFile | public File getConfigFile(String relativeServerPath) {
"""
Allocate a file in the server config directory, e.g.
usr/servers/serverName/relativeServerPath
@param relativeServerPath
relative path of file to create in the server directory
@return File object for relative path, or for the server directory itself... | java | public File getConfigFile(String relativeServerPath) {
if (relativeServerPath == null)
return configDir;
else
return new File(configDir, relativeServerPath);
} | [
"public",
"File",
"getConfigFile",
"(",
"String",
"relativeServerPath",
")",
"{",
"if",
"(",
"relativeServerPath",
"==",
"null",
")",
"return",
"configDir",
";",
"else",
"return",
"new",
"File",
"(",
"configDir",
",",
"relativeServerPath",
")",
";",
"}"
] | Allocate a file in the server config directory, e.g.
usr/servers/serverName/relativeServerPath
@param relativeServerPath
relative path of file to create in the server directory
@return File object for relative path, or for the server directory itself
if the relative path argument is null | [
"Allocate",
"a",
"file",
"in",
"the",
"server",
"config",
"directory",
"e",
".",
"g",
".",
"usr",
"/",
"servers",
"/",
"serverName",
"/",
"relativeServerPath"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/BootstrapConfig.java#L612-L617 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/CloudTasksClient.java | CloudTasksClient.renewLease | public final Task renewLease(TaskName name, Timestamp scheduleTime, Duration leaseDuration) {
"""
Renew the current lease of a pull task.
<p>The worker can use this method to extend the lease by a new duration, starting from now. The
new task lease will be returned in the task's
[schedule_time][google.cloud.t... | java | public final Task renewLease(TaskName name, Timestamp scheduleTime, Duration leaseDuration) {
RenewLeaseRequest request =
RenewLeaseRequest.newBuilder()
.setName(name == null ? null : name.toString())
.setScheduleTime(scheduleTime)
.setLeaseDuration(leaseDuration)
... | [
"public",
"final",
"Task",
"renewLease",
"(",
"TaskName",
"name",
",",
"Timestamp",
"scheduleTime",
",",
"Duration",
"leaseDuration",
")",
"{",
"RenewLeaseRequest",
"request",
"=",
"RenewLeaseRequest",
".",
"newBuilder",
"(",
")",
".",
"setName",
"(",
"name",
"=... | Renew the current lease of a pull task.
<p>The worker can use this method to extend the lease by a new duration, starting from now. The
new task lease will be returned in the task's
[schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time].
<p>Sample code:
<pre><code>
try (CloudTasksClient cloudTasksClient = Cl... | [
"Renew",
"the",
"current",
"lease",
"of",
"a",
"pull",
"task",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta2/CloudTasksClient.java#L2357-L2366 |
haraldk/TwelveMonkeys | common/common-io/src/main/java/com/twelvemonkeys/io/ole2/CompoundDocument.java | CompoundDocument.seekToSId | private void seekToSId(final int pSId, final long pStreamSize) throws IOException {
"""
Seeks to the start pos for the given stream Id
@param pSId the stream Id
@param pStreamSize the size of the stream, or -1 for system control streams
@throws IOException if an I/O exception occurs
"""
lo... | java | private void seekToSId(final int pSId, final long pStreamSize) throws IOException {
long pos;
if (isShortStream(pStreamSize)) {
// The short stream is not continuous...
Entry root = getRootEntry();
if (shortStreamSIdChain == null) {
shortStream... | [
"private",
"void",
"seekToSId",
"(",
"final",
"int",
"pSId",
",",
"final",
"long",
"pStreamSize",
")",
"throws",
"IOException",
"{",
"long",
"pos",
";",
"if",
"(",
"isShortStream",
"(",
"pStreamSize",
")",
")",
"{",
"// The short stream is not continuous...\r",
... | Seeks to the start pos for the given stream Id
@param pSId the stream Id
@param pStreamSize the size of the stream, or -1 for system control streams
@throws IOException if an I/O exception occurs | [
"Seeks",
"to",
"the",
"start",
"pos",
"for",
"the",
"given",
"stream",
"Id"
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-io/src/main/java/com/twelvemonkeys/io/ole2/CompoundDocument.java#L439-L476 |
maddingo/sojo | src/main/java/net/sf/sojo/common/ObjectUtil.java | ObjectUtil.compareTo | public int compareTo(final Object pvObject1, final Object pvObject2) {
"""
If parameter are <code>java.lang.Comparable</code> than delegate to the <code>compareTo</code> method
of the first parameter object.
<br>
By JavaBean are all properties comparing and add the several compareTo results.
They are one prope... | java | public int compareTo(final Object pvObject1, final Object pvObject2) {
int lvCompareToValue = 0;
if (pvObject1 == null) {
throw new NullPointerException("First arg by compareTo is Null");
}
if (pvObject2 == null) {
throw new NullPointerException("Second arg by compareTo is Null");
}
if (pvOb... | [
"public",
"int",
"compareTo",
"(",
"final",
"Object",
"pvObject1",
",",
"final",
"Object",
"pvObject2",
")",
"{",
"int",
"lvCompareToValue",
"=",
"0",
";",
"if",
"(",
"pvObject1",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"First ... | If parameter are <code>java.lang.Comparable</code> than delegate to the <code>compareTo</code> method
of the first parameter object.
<br>
By JavaBean are all properties comparing and add the several compareTo results.
They are one property <code>+1</code> and the second property <code>-1</code>,
then is the complete va... | [
"If",
"parameter",
"are",
"<code",
">",
"java",
".",
"lang",
".",
"Comparable<",
"/",
"code",
">",
"than",
"delegate",
"to",
"the",
"<code",
">",
"compareTo<",
"/",
"code",
">",
"method",
"of",
"the",
"first",
"parameter",
"object",
".",
"<br",
">",
"B... | train | https://github.com/maddingo/sojo/blob/99e9e0a146b502deb7f507fe0623227402ed675b/src/main/java/net/sf/sojo/common/ObjectUtil.java#L284-L303 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/ConstraintsChecker.java | ConstraintsChecker.mergeBasicConstraints | static int mergeBasicConstraints(X509Certificate cert, int maxPathLength) {
"""
Merges the specified maxPathLength with the pathLenConstraint
obtained from the certificate.
@param cert the <code>X509Certificate</code>
@param maxPathLength the previous maximum path length
@return the new maximum path length c... | java | static int mergeBasicConstraints(X509Certificate cert, int maxPathLength) {
int pathLenConstraint = cert.getBasicConstraints();
if (!X509CertImpl.isSelfIssued(cert)) {
maxPathLength--;
}
if (pathLenConstraint < maxPathLength) {
maxPathLength = pathLenConstraint... | [
"static",
"int",
"mergeBasicConstraints",
"(",
"X509Certificate",
"cert",
",",
"int",
"maxPathLength",
")",
"{",
"int",
"pathLenConstraint",
"=",
"cert",
".",
"getBasicConstraints",
"(",
")",
";",
"if",
"(",
"!",
"X509CertImpl",
".",
"isSelfIssued",
"(",
"cert",... | Merges the specified maxPathLength with the pathLenConstraint
obtained from the certificate.
@param cert the <code>X509Certificate</code>
@param maxPathLength the previous maximum path length
@return the new maximum path length constraint (-1 means no more
certificates can follow, Integer.MAX_VALUE means path length i... | [
"Merges",
"the",
"specified",
"maxPathLength",
"with",
"the",
"pathLenConstraint",
"obtained",
"from",
"the",
"certificate",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/ConstraintsChecker.java#L294-L307 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/util/MRAsyncDiskService.java | MRAsyncDiskService.awaitTermination | public synchronized boolean awaitTermination(long milliseconds)
throws InterruptedException {
"""
Wait for the termination of the thread pools.
@param milliseconds The number of milliseconds to wait
@return true if all thread pools are terminated within time limit
@throws InterruptedException
""... | java | public synchronized boolean awaitTermination(long milliseconds)
throws InterruptedException {
boolean result = asyncDiskService.awaitTermination(milliseconds);
if (result) {
LOG.info("Deleting toBeDeleted directory.");
for (int v = 0; v < volumes.length; v++) {
Path p = new Path(volum... | [
"public",
"synchronized",
"boolean",
"awaitTermination",
"(",
"long",
"milliseconds",
")",
"throws",
"InterruptedException",
"{",
"boolean",
"result",
"=",
"asyncDiskService",
".",
"awaitTermination",
"(",
"milliseconds",
")",
";",
"if",
"(",
"result",
")",
"{",
"... | Wait for the termination of the thread pools.
@param milliseconds The number of milliseconds to wait
@return true if all thread pools are terminated within time limit
@throws InterruptedException | [
"Wait",
"for",
"the",
"termination",
"of",
"the",
"thread",
"pools",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/MRAsyncDiskService.java#L157-L172 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/DateField.java | DateField.getSQLFromField | public void getSQLFromField(PreparedStatement statement, int iType, int iParamColumn) throws SQLException {
"""
Move the physical binary data to this SQL parameter row.
@param statement The SQL prepare statement.
@param iType the type of SQL statement.
@param iParamColumn The column in the prepared statement to... | java | public void getSQLFromField(PreparedStatement statement, int iType, int iParamColumn) throws SQLException
{
if (this.isNull())
{
if ((!this.isNullable())
|| (iType == DBConstants.SQL_SELECT_TYPE)
|| (DBConstants.FALSE.equals(this.getRecord().getTable().get... | [
"public",
"void",
"getSQLFromField",
"(",
"PreparedStatement",
"statement",
",",
"int",
"iType",
",",
"int",
"iParamColumn",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"this",
".",
"isNull",
"(",
")",
")",
"{",
"if",
"(",
"(",
"!",
"this",
".",
"isNu... | Move the physical binary data to this SQL parameter row.
@param statement The SQL prepare statement.
@param iType the type of SQL statement.
@param iParamColumn The column in the prepared statement to set the data.
@exception SQLException From SQL calls. | [
"Move",
"the",
"physical",
"binary",
"data",
"to",
"this",
"SQL",
"parameter",
"row",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/DateField.java#L188-L207 |
pf4j/pf4j | pf4j/src/main/java/org/pf4j/util/DirectedGraph.java | DirectedGraph.removeEdge | public void removeEdge(V from, V to) {
"""
Remove an edge from the graph. Nothing happens if no such edge.
@throws {@link IllegalArgumentException} if either vertex doesn't exist.
"""
if (!containsVertex(from)) {
throw new IllegalArgumentException("Nonexistent vertex " + from);
}
... | java | public void removeEdge(V from, V to) {
if (!containsVertex(from)) {
throw new IllegalArgumentException("Nonexistent vertex " + from);
}
if (!containsVertex(to)) {
throw new IllegalArgumentException("Nonexistent vertex " + to);
}
neighbors.get(from).remov... | [
"public",
"void",
"removeEdge",
"(",
"V",
"from",
",",
"V",
"to",
")",
"{",
"if",
"(",
"!",
"containsVertex",
"(",
"from",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Nonexistent vertex \"",
"+",
"from",
")",
";",
"}",
"if",
"(",
... | Remove an edge from the graph. Nothing happens if no such edge.
@throws {@link IllegalArgumentException} if either vertex doesn't exist. | [
"Remove",
"an",
"edge",
"from",
"the",
"graph",
".",
"Nothing",
"happens",
"if",
"no",
"such",
"edge",
"."
] | train | https://github.com/pf4j/pf4j/blob/6dd7a6069f0e2fbd842c81e2c8c388918b88ea81/pf4j/src/main/java/org/pf4j/util/DirectedGraph.java#L75-L85 |
wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.createHTTPCarbonMessage | public static HttpCarbonMessage createHTTPCarbonMessage(HttpMessage httpMessage, ChannelHandlerContext ctx) {
"""
Creates HTTP carbon message.
@param httpMessage HTTP message
@param ctx Channel handler context
@return HttpCarbonMessage
"""
Listener contentListener = new DefaultListener(ctx);
... | java | public static HttpCarbonMessage createHTTPCarbonMessage(HttpMessage httpMessage, ChannelHandlerContext ctx) {
Listener contentListener = new DefaultListener(ctx);
return new HttpCarbonMessage(httpMessage, contentListener);
} | [
"public",
"static",
"HttpCarbonMessage",
"createHTTPCarbonMessage",
"(",
"HttpMessage",
"httpMessage",
",",
"ChannelHandlerContext",
"ctx",
")",
"{",
"Listener",
"contentListener",
"=",
"new",
"DefaultListener",
"(",
"ctx",
")",
";",
"return",
"new",
"HttpCarbonMessage"... | Creates HTTP carbon message.
@param httpMessage HTTP message
@param ctx Channel handler context
@return HttpCarbonMessage | [
"Creates",
"HTTP",
"carbon",
"message",
"."
] | train | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L672-L675 |
tvesalainen/util | util/src/main/java/org/vesalainen/bean/BeanHelper.java | BeanHelper.getField | public static Field getField(Class cls, String fieldname) throws NoSuchFieldException {
"""
Returns Declared field either from given class or it's super class
@param cls
@param fieldname
@return
@throws NoSuchFieldException
"""
while (true)
{
try
{
... | java | public static Field getField(Class cls, String fieldname) throws NoSuchFieldException
{
while (true)
{
try
{
return cls.getDeclaredField(fieldname);
}
catch (NoSuchFieldException ex)
{
cls = cls.get... | [
"public",
"static",
"Field",
"getField",
"(",
"Class",
"cls",
",",
"String",
"fieldname",
")",
"throws",
"NoSuchFieldException",
"{",
"while",
"(",
"true",
")",
"{",
"try",
"{",
"return",
"cls",
".",
"getDeclaredField",
"(",
"fieldname",
")",
";",
"}",
"ca... | Returns Declared field either from given class or it's super class
@param cls
@param fieldname
@return
@throws NoSuchFieldException | [
"Returns",
"Declared",
"field",
"either",
"from",
"given",
"class",
"or",
"it",
"s",
"super",
"class"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/bean/BeanHelper.java#L269-L290 |
dkmfbk/knowledgestore | ks-core/src/main/java/eu/fbk/knowledgestore/data/XPath.java | XPath.evalUnique | @Nullable
public final <T> T evalUnique(final Object object, final Class<T> resultClass)
throws IllegalArgumentException {
"""
Evaluates this {@code XPath} expression on the object supplied, producing as result a
unique object of the type {@code T} specified.
@param object
the object to evalua... | java | @Nullable
public final <T> T evalUnique(final Object object, final Class<T> resultClass)
throws IllegalArgumentException {
Preconditions.checkNotNull(object);
Preconditions.checkNotNull(resultClass);
try {
return toUnique(doEval(object), resultClass);
} cat... | [
"@",
"Nullable",
"public",
"final",
"<",
"T",
">",
"T",
"evalUnique",
"(",
"final",
"Object",
"object",
",",
"final",
"Class",
"<",
"T",
">",
"resultClass",
")",
"throws",
"IllegalArgumentException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"object",
... | Evaluates this {@code XPath} expression on the object supplied, producing as result a
unique object of the type {@code T} specified.
@param object
the object to evaluate this expression on
@param resultClass
the {@code Class} object for the result object
@param <T>
the type of result
@return on success, the unique obj... | [
"Evaluates",
"this",
"{",
"@code",
"XPath",
"}",
"expression",
"on",
"the",
"object",
"supplied",
"producing",
"as",
"result",
"a",
"unique",
"object",
"of",
"the",
"type",
"{",
"@code",
"T",
"}",
"specified",
"."
] | train | https://github.com/dkmfbk/knowledgestore/blob/a548101b1dd67fcf72a1ec6f838ea7539bdbbe7a/ks-core/src/main/java/eu/fbk/knowledgestore/data/XPath.java#L953-L971 |
lets-blade/blade | src/main/java/com/blade/kit/EncryptKit.java | EncryptKit.desTemplate | public static byte[] desTemplate(byte[] data, byte[] key, String algorithm, String transformation, boolean isEncrypt) {
"""
DES加密模板
@param data 数据
@param key 秘钥
@param algorithm 加密算法
@param transformation 转变
@param isEncrypt {@code true}: 加密 {@code false}: 解密
@return 密文或者明文,适... | java | public static byte[] desTemplate(byte[] data, byte[] key, String algorithm, String transformation, boolean isEncrypt) {
if (data == null || data.length == 0 || key == null || key.length == 0) return null;
try {
SecretKeySpec keySpec = new SecretKeySpec(key, algorithm);
Cipher ... | [
"public",
"static",
"byte",
"[",
"]",
"desTemplate",
"(",
"byte",
"[",
"]",
"data",
",",
"byte",
"[",
"]",
"key",
",",
"String",
"algorithm",
",",
"String",
"transformation",
",",
"boolean",
"isEncrypt",
")",
"{",
"if",
"(",
"data",
"==",
"null",
"||",... | DES加密模板
@param data 数据
@param key 秘钥
@param algorithm 加密算法
@param transformation 转变
@param isEncrypt {@code true}: 加密 {@code false}: 解密
@return 密文或者明文,适用于DES,3DES,AES | [
"DES加密模板"
] | train | https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/kit/EncryptKit.java#L682-L694 |
mygreen/excel-cellformatter | src/main/java/com/github/mygreen/cellformatter/ObjectCellFormatter.java | ObjectCellFormatter.formatAsString | public String formatAsString(final String formatPattern, final String value, final Locale locale) {
"""
ロケールを指定して、文字列型をフォーマットし、結果を直接文字列として取得する。
@param formatPattern フォーマットの書式。
@param value フォーマット対象の値。
@param locale ロケール。書式にロケール条件の記述(例. {@code [$-403]})が含まれている場合は、書式のロケールが優先されます。
@return フォーマットした結果の文字列。
"""
... | java | public String formatAsString(final String formatPattern, final String value, final Locale locale) {
return format(formatPattern, value, locale).getText();
} | [
"public",
"String",
"formatAsString",
"(",
"final",
"String",
"formatPattern",
",",
"final",
"String",
"value",
",",
"final",
"Locale",
"locale",
")",
"{",
"return",
"format",
"(",
"formatPattern",
",",
"value",
",",
"locale",
")",
".",
"getText",
"(",
")",
... | ロケールを指定して、文字列型をフォーマットし、結果を直接文字列として取得する。
@param formatPattern フォーマットの書式。
@param value フォーマット対象の値。
@param locale ロケール。書式にロケール条件の記述(例. {@code [$-403]})が含まれている場合は、書式のロケールが優先されます。
@return フォーマットした結果の文字列。 | [
"ロケールを指定して、文字列型をフォーマットし、結果を直接文字列として取得する。"
] | train | https://github.com/mygreen/excel-cellformatter/blob/e802af273d49889500591e03799c9262cbf29185/src/main/java/com/github/mygreen/cellformatter/ObjectCellFormatter.java#L73-L75 |
alkacon/opencms-core | src/org/opencms/importexport/CmsExport.java | CmsExport.openExportFile | protected Element openExportFile(ExportMode exportMode) throws IOException, SAXException {
"""
Opens the export ZIP file and initializes the internal XML document for the manifest.<p>
@param exportMode the export mode to use.
@return the node in the XML document where all files are appended to
@throws SAXEx... | java | protected Element openExportFile(ExportMode exportMode) throws IOException, SAXException {
// create the export writer
m_exportWriter = new CmsExportHelper(
getExportFileName(),
m_parameters.isExportAsFiles(),
m_parameters.isXmlValidation());
// initialize th... | [
"protected",
"Element",
"openExportFile",
"(",
"ExportMode",
"exportMode",
")",
"throws",
"IOException",
",",
"SAXException",
"{",
"// create the export writer",
"m_exportWriter",
"=",
"new",
"CmsExportHelper",
"(",
"getExportFileName",
"(",
")",
",",
"m_parameters",
".... | Opens the export ZIP file and initializes the internal XML document for the manifest.<p>
@param exportMode the export mode to use.
@return the node in the XML document where all files are appended to
@throws SAXException if something goes wrong processing the manifest.xml
@throws IOException if something goes wrong w... | [
"Opens",
"the",
"export",
"ZIP",
"file",
"and",
"initializes",
"the",
"internal",
"XML",
"document",
"for",
"the",
"manifest",
".",
"<p",
">",
"@param",
"exportMode",
"the",
"export",
"mode",
"to",
"use",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/CmsExport.java#L1487-L1522 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/RuleBasedNumberFormat.java | RuleBasedNumberFormat.readObject | private void readObject(java.io.ObjectInputStream in)
throws java.io.IOException {
"""
Reads this object in from a stream.
@param in The stream to read from.
"""
// read the description in from the stream
String description = in.readUTF();
ULocale loc;
try {
... | java | private void readObject(java.io.ObjectInputStream in)
throws java.io.IOException {
// read the description in from the stream
String description = in.readUTF();
ULocale loc;
try {
loc = (ULocale) in.readObject();
} catch (Exception e) {
loc = ULo... | [
"private",
"void",
"readObject",
"(",
"java",
".",
"io",
".",
"ObjectInputStream",
"in",
")",
"throws",
"java",
".",
"io",
".",
"IOException",
"{",
"// read the description in from the stream",
"String",
"description",
"=",
"in",
".",
"readUTF",
"(",
")",
";",
... | Reads this object in from a stream.
@param in The stream to read from. | [
"Reads",
"this",
"object",
"in",
"from",
"a",
"stream",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/RuleBasedNumberFormat.java#L978-L1009 |
phax/ph-commons | ph-security/src/main/java/com/helger/security/certificate/CertificateHelper.java | CertificateHelper.convertStringToCertficate | @Nullable
public static X509Certificate convertStringToCertficate (@Nullable final String sCertString) throws CertificateException {
"""
Convert the passed String to an X.509 certificate.
@param sCertString
The original text string. May be <code>null</code> or empty. The
String must be ISO-8859-1 encoded fo... | java | @Nullable
public static X509Certificate convertStringToCertficate (@Nullable final String sCertString) throws CertificateException
{
if (StringHelper.hasNoText (sCertString))
{
// No string -> no certificate
return null;
}
final CertificateFactory aCertificateFactory = getX509Certificat... | [
"@",
"Nullable",
"public",
"static",
"X509Certificate",
"convertStringToCertficate",
"(",
"@",
"Nullable",
"final",
"String",
"sCertString",
")",
"throws",
"CertificateException",
"{",
"if",
"(",
"StringHelper",
".",
"hasNoText",
"(",
"sCertString",
")",
")",
"{",
... | Convert the passed String to an X.509 certificate.
@param sCertString
The original text string. May be <code>null</code> or empty. The
String must be ISO-8859-1 encoded for the binary certificate to be
read!
@return <code>null</code> if the passed string is <code>null</code> or
empty
@throws CertificateException
In ca... | [
"Convert",
"the",
"passed",
"String",
"to",
"an",
"X",
".",
"509",
"certificate",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-security/src/main/java/com/helger/security/certificate/CertificateHelper.java#L246-L284 |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/webapp/resources/OrganizationResource.java | OrganizationResource.getNames | @GET
@Produces( {
"""
Return the list of available organization name.
This method is call via GET <dm_url>/organization/names
@return Response A list of organization name in HTML or JSON
"""MediaType.TEXT_HTML, MediaType.APPLICATION_JSON})
@Path(ServerAPI.GET_NAMES)
public Response getNames(){
... | java | @GET
@Produces({MediaType.TEXT_HTML, MediaType.APPLICATION_JSON})
@Path(ServerAPI.GET_NAMES)
public Response getNames(){
LOG.info("Got a get organization names request.");
final ListView view = new ListView("Organization Ids list", "Organizations");
final List<String> names = getOrg... | [
"@",
"GET",
"@",
"Produces",
"(",
"{",
"MediaType",
".",
"TEXT_HTML",
",",
"MediaType",
".",
"APPLICATION_JSON",
"}",
")",
"@",
"Path",
"(",
"ServerAPI",
".",
"GET_NAMES",
")",
"public",
"Response",
"getNames",
"(",
")",
"{",
"LOG",
".",
"info",
"(",
"... | Return the list of available organization name.
This method is call via GET <dm_url>/organization/names
@return Response A list of organization name in HTML or JSON | [
"Return",
"the",
"list",
"of",
"available",
"organization",
"name",
".",
"This",
"method",
"is",
"call",
"via",
"GET",
"<dm_url",
">",
"/",
"organization",
"/",
"names"
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/webapp/resources/OrganizationResource.java#L69-L80 |
Waikato/moa | moa/src/main/java/moa/clusterers/dstream/CharacteristicVector.java | CharacteristicVector.updateGridDensity | public void updateGridDensity(int currTime, double decayFactor, double dl, double dm) {
"""
Implements the update the density of all grids step given at line 2 of
both Fig 3 and Fig 4 of Chen and Tu 2007.
@param currTime the data stream's current internal time
@param decayFactor the value of lambda
@param dl... | java | public void updateGridDensity(int currTime, double decayFactor, double dl, double dm)
{
// record the last attribute
int lastAtt = this.getAttribute();
// Update the density grid's density
double densityOfG = (Math.pow(decayFactor, (currTime-this.getDensityTimeStamp())) * this.getGridDensity());
this.setGr... | [
"public",
"void",
"updateGridDensity",
"(",
"int",
"currTime",
",",
"double",
"decayFactor",
",",
"double",
"dl",
",",
"double",
"dm",
")",
"{",
"// record the last attribute",
"int",
"lastAtt",
"=",
"this",
".",
"getAttribute",
"(",
")",
";",
"// Update the den... | Implements the update the density of all grids step given at line 2 of
both Fig 3 and Fig 4 of Chen and Tu 2007.
@param currTime the data stream's current internal time
@param decayFactor the value of lambda
@param dl the threshold for sparse grids
@param dm the threshold for dense grids
@param addRecord TRUE if a rec... | [
"Implements",
"the",
"update",
"the",
"density",
"of",
"all",
"grids",
"step",
"given",
"at",
"line",
"2",
"of",
"both",
"Fig",
"3",
"and",
"Fig",
"4",
"of",
"Chen",
"and",
"Tu",
"2007",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/clusterers/dstream/CharacteristicVector.java#L235-L258 |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/BuilderMolecule.java | BuilderMolecule.buildMoleculefromCHEM | private static RgroupStructure buildMoleculefromCHEM(final String id, final List<Monomer> validMonomers) throws BuilderMoleculeException, ChemistryException {
"""
method to build a molecule from a chemical component
@param validMonomers all valid monomers of the chemical component
@return Built Molecule
@thro... | java | private static RgroupStructure buildMoleculefromCHEM(final String id, final List<Monomer> validMonomers) throws BuilderMoleculeException, ChemistryException {
LOG.info("Build molecule for chemical component");
/* a chemical molecule should only contain one monomer */
if (validMonomers.size() == 1) {
... | [
"private",
"static",
"RgroupStructure",
"buildMoleculefromCHEM",
"(",
"final",
"String",
"id",
",",
"final",
"List",
"<",
"Monomer",
">",
"validMonomers",
")",
"throws",
"BuilderMoleculeException",
",",
"ChemistryException",
"{",
"LOG",
".",
"info",
"(",
"\"Build mo... | method to build a molecule from a chemical component
@param validMonomers all valid monomers of the chemical component
@return Built Molecule
@throws BuilderMoleculeException if the polymer contains more than one
monomer or if the molecule can't be built
@throws ChemistryException if the Chemistry Engine can not be in... | [
"method",
"to",
"build",
"a",
"molecule",
"from",
"a",
"chemical",
"component"
] | train | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/BuilderMolecule.java#L261-L297 |
JadiraOrg/jadira | cloning/src/main/java/org/jadira/reflection/core/misc/ClassUtils.java | ClassUtils.collectFields | public static Field[] collectFields(Class<?> c, int inclusiveModifiers, int exclusiveModifiers) {
"""
Produces an array with all the instance fields of the specified class which match the supplied rules
@param c The class specified
@param inclusiveModifiers An int indicating the {@link Modifier}s that may be app... | java | public static Field[] collectFields(Class<?> c, int inclusiveModifiers, int exclusiveModifiers) {
return collectFields(c, inclusiveModifiers, exclusiveModifiers, Object.class);
} | [
"public",
"static",
"Field",
"[",
"]",
"collectFields",
"(",
"Class",
"<",
"?",
">",
"c",
",",
"int",
"inclusiveModifiers",
",",
"int",
"exclusiveModifiers",
")",
"{",
"return",
"collectFields",
"(",
"c",
",",
"inclusiveModifiers",
",",
"exclusiveModifiers",
"... | Produces an array with all the instance fields of the specified class which match the supplied rules
@param c The class specified
@param inclusiveModifiers An int indicating the {@link Modifier}s that may be applied
@param exclusiveModifiers An int indicating the {@link Modifier}s that must be excluded
@return The arra... | [
"Produces",
"an",
"array",
"with",
"all",
"the",
"instance",
"fields",
"of",
"the",
"specified",
"class",
"which",
"match",
"the",
"supplied",
"rules"
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/cloning/src/main/java/org/jadira/reflection/core/misc/ClassUtils.java#L203-L206 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/math/Fraction.java | Fraction.multiplyBy | public Fraction multiplyBy(final Fraction fraction) {
"""
<p>Multiplies the value of this fraction by another, returning the
result in reduced form.</p>
@param fraction the fraction to multiply by, must not be <code>null</code>
@return a <code>Fraction</code> instance with the resulting values
@throws Illeg... | java | public Fraction multiplyBy(final Fraction fraction) {
Validate.isTrue(fraction != null, "The fraction must not be null");
if (numerator == 0 || fraction.numerator == 0) {
return ZERO;
}
// knuth 4.5.1
// make sure we don't overflow unless the result *must* overflow.
... | [
"public",
"Fraction",
"multiplyBy",
"(",
"final",
"Fraction",
"fraction",
")",
"{",
"Validate",
".",
"isTrue",
"(",
"fraction",
"!=",
"null",
",",
"\"The fraction must not be null\"",
")",
";",
"if",
"(",
"numerator",
"==",
"0",
"||",
"fraction",
".",
"numerat... | <p>Multiplies the value of this fraction by another, returning the
result in reduced form.</p>
@param fraction the fraction to multiply by, must not be <code>null</code>
@return a <code>Fraction</code> instance with the resulting values
@throws IllegalArgumentException if the fraction is <code>null</code>
@throws Ari... | [
"<p",
">",
"Multiplies",
"the",
"value",
"of",
"this",
"fraction",
"by",
"another",
"returning",
"the",
"result",
"in",
"reduced",
"form",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/math/Fraction.java#L783-L794 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/mult/VectorVectorMult_DDRM.java | VectorVectorMult_DDRM.innerProd | public static double innerProd(DMatrixD1 x, DMatrixD1 y ) {
"""
<p>
Computes the inner product of the two vectors. In geometry this is known as the dot product.<br>
<br>
∑<sub>k=1:n</sub> x<sub>k</sub> * y<sub>k</sub><br>
where x and y are vectors with n elements.
</p>
<p>
These functions are often u... | java | public static double innerProd(DMatrixD1 x, DMatrixD1 y )
{
int m = x.getNumElements();
double total = 0;
for( int i = 0; i < m; i++ ) {
total += x.get(i) * y.get(i);
}
return total;
} | [
"public",
"static",
"double",
"innerProd",
"(",
"DMatrixD1",
"x",
",",
"DMatrixD1",
"y",
")",
"{",
"int",
"m",
"=",
"x",
".",
"getNumElements",
"(",
")",
";",
"double",
"total",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"m",... | <p>
Computes the inner product of the two vectors. In geometry this is known as the dot product.<br>
<br>
∑<sub>k=1:n</sub> x<sub>k</sub> * y<sub>k</sub><br>
where x and y are vectors with n elements.
</p>
<p>
These functions are often used inside of highly optimized code and therefor sanity checks are
kept to a ... | [
"<p",
">",
"Computes",
"the",
"inner",
"product",
"of",
"the",
"two",
"vectors",
".",
"In",
"geometry",
"this",
"is",
"known",
"as",
"the",
"dot",
"product",
".",
"<br",
">",
"<br",
">",
"&sum",
";",
"<sub",
">",
"k",
"=",
"1",
":",
"n<",
"/",
"s... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/mult/VectorVectorMult_DDRM.java#L50-L60 |
google/j2objc | translator/src/main/java/com/google/devtools/j2objc/util/ClassFile.java | ClassFile.getMethod | public MethodDeclaration getMethod(String name, String signature) {
"""
Returns the Procyon method definition for a specified method,
or null if not found.
"""
for (EntityDeclaration node : type.getMembers()) {
if (node.getEntityType() == EntityType.METHOD) {
MethodDeclaration method = (Meth... | java | public MethodDeclaration getMethod(String name, String signature) {
for (EntityDeclaration node : type.getMembers()) {
if (node.getEntityType() == EntityType.METHOD) {
MethodDeclaration method = (MethodDeclaration) node;
if (method.getName().equals(name) && signature.equals(signature(method)))... | [
"public",
"MethodDeclaration",
"getMethod",
"(",
"String",
"name",
",",
"String",
"signature",
")",
"{",
"for",
"(",
"EntityDeclaration",
"node",
":",
"type",
".",
"getMembers",
"(",
")",
")",
"{",
"if",
"(",
"node",
".",
"getEntityType",
"(",
")",
"==",
... | Returns the Procyon method definition for a specified method,
or null if not found. | [
"Returns",
"the",
"Procyon",
"method",
"definition",
"for",
"a",
"specified",
"method",
"or",
"null",
"if",
"not",
"found",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/util/ClassFile.java#L160-L170 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java | DiagnosticsInner.executeSiteDetector | public DiagnosticDetectorResponseInner executeSiteDetector(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory, DateTime startTime, DateTime endTime, String timeGrain) {
"""
Execute Detector.
Execute Detector.
@param resourceGroupName Name of the resource group to which th... | java | public DiagnosticDetectorResponseInner executeSiteDetector(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory, DateTime startTime, DateTime endTime, String timeGrain) {
return executeSiteDetectorWithServiceResponseAsync(resourceGroupName, siteName, detectorName, diagnostic... | [
"public",
"DiagnosticDetectorResponseInner",
"executeSiteDetector",
"(",
"String",
"resourceGroupName",
",",
"String",
"siteName",
",",
"String",
"detectorName",
",",
"String",
"diagnosticCategory",
",",
"DateTime",
"startTime",
",",
"DateTime",
"endTime",
",",
"String",
... | Execute Detector.
Execute Detector.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param detectorName Detector Resource Name
@param diagnosticCategory Category Name
@param startTime Start Time
@param endTime End Time
@param timeGrain Time Grain
@throws Ill... | [
"Execute",
"Detector",
".",
"Execute",
"Detector",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L1237-L1239 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/SparkListenable.java | SparkListenable.setListeners | public void setListeners(StatsStorageRouter statsStorage, TrainingListener... listeners) {
"""
Set the listeners, along with a StatsStorageRouter that the results will be shuffled to (in the
case of any listeners that implement the {@link RoutingIterationListener} interface)
@param statsStorage Stats storage r... | java | public void setListeners(StatsStorageRouter statsStorage, TrainingListener... listeners) {
setListeners(statsStorage, Arrays.asList(listeners));
} | [
"public",
"void",
"setListeners",
"(",
"StatsStorageRouter",
"statsStorage",
",",
"TrainingListener",
"...",
"listeners",
")",
"{",
"setListeners",
"(",
"statsStorage",
",",
"Arrays",
".",
"asList",
"(",
"listeners",
")",
")",
";",
"}"
] | Set the listeners, along with a StatsStorageRouter that the results will be shuffled to (in the
case of any listeners that implement the {@link RoutingIterationListener} interface)
@param statsStorage Stats storage router to place the results into
@param listeners Listeners to set | [
"Set",
"the",
"listeners",
"along",
"with",
"a",
"StatsStorageRouter",
"that",
"the",
"results",
"will",
"be",
"shuffled",
"to",
"(",
"in",
"the",
"case",
"of",
"any",
"listeners",
"that",
"implement",
"the",
"{",
"@link",
"RoutingIterationListener",
"}",
"int... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/SparkListenable.java#L72-L74 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.newInputStream | public static BufferedInputStream newInputStream(URL url) throws MalformedURLException, IOException {
"""
Creates a buffered input stream for this URL.
@param url a URL
@return a BufferedInputStream for the URL
@throws MalformedURLException is thrown if the URL is not well formed
@throws IOException ... | java | public static BufferedInputStream newInputStream(URL url) throws MalformedURLException, IOException {
return new BufferedInputStream(configuredInputStream(null, url));
} | [
"public",
"static",
"BufferedInputStream",
"newInputStream",
"(",
"URL",
"url",
")",
"throws",
"MalformedURLException",
",",
"IOException",
"{",
"return",
"new",
"BufferedInputStream",
"(",
"configuredInputStream",
"(",
"null",
",",
"url",
")",
")",
";",
"}"
] | Creates a buffered input stream for this URL.
@param url a URL
@return a BufferedInputStream for the URL
@throws MalformedURLException is thrown if the URL is not well formed
@throws IOException if an I/O error occurs while creating the input stream
@since 1.5.2 | [
"Creates",
"a",
"buffered",
"input",
"stream",
"for",
"this",
"URL",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L2195-L2197 |
j-easy/easy-random | easy-random-core/src/main/java/org/jeasy/random/EasyRandomParameters.java | EasyRandomParameters.timeRange | public EasyRandomParameters timeRange(final LocalTime min, final LocalTime max) {
"""
Set the time range.
@param min time
@param max time
@return the current {@link EasyRandomParameters} instance for method chaining
"""
if (min.isAfter(max)) {
throw new IllegalArgumentException("Min ti... | java | public EasyRandomParameters timeRange(final LocalTime min, final LocalTime max) {
if (min.isAfter(max)) {
throw new IllegalArgumentException("Min time should be before max time");
}
setTimeRange(new Range<>(min, max));
return this;
} | [
"public",
"EasyRandomParameters",
"timeRange",
"(",
"final",
"LocalTime",
"min",
",",
"final",
"LocalTime",
"max",
")",
"{",
"if",
"(",
"min",
".",
"isAfter",
"(",
"max",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Min time should be befor... | Set the time range.
@param min time
@param max time
@return the current {@link EasyRandomParameters} instance for method chaining | [
"Set",
"the",
"time",
"range",
"."
] | train | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/EasyRandomParameters.java#L470-L476 |
roboconf/roboconf-platform | miscellaneous/roboconf-swagger/src/main/java/net/roboconf/swagger/UpdateSwaggerJson.java | UpdateSwaggerJson.convertToTypes | public void convertToTypes( String serialization, Class<?> clazz, JsonObject newDef ) {
"""
Creates a JSon object from a serialization result.
@param serialization the serialization result
@param clazz the class for which this serialization was made
@param newDef the new definition object to update
"""
co... | java | public void convertToTypes( String serialization, Class<?> clazz, JsonObject newDef ) {
convertToTypes( serialization, clazz.getSimpleName(), newDef );
this.processedClasses.add( clazz );
} | [
"public",
"void",
"convertToTypes",
"(",
"String",
"serialization",
",",
"Class",
"<",
"?",
">",
"clazz",
",",
"JsonObject",
"newDef",
")",
"{",
"convertToTypes",
"(",
"serialization",
",",
"clazz",
".",
"getSimpleName",
"(",
")",
",",
"newDef",
")",
";",
... | Creates a JSon object from a serialization result.
@param serialization the serialization result
@param clazz the class for which this serialization was made
@param newDef the new definition object to update | [
"Creates",
"a",
"JSon",
"object",
"from",
"a",
"serialization",
"result",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-swagger/src/main/java/net/roboconf/swagger/UpdateSwaggerJson.java#L295-L298 |
apache/fluo | modules/core/src/main/java/org/apache/fluo/core/util/CuratorUtil.java | CuratorUtil.startAppIdWatcher | public static NodeCache startAppIdWatcher(Environment env) {
"""
Start watching the fluo app uuid. If it changes or goes away then halt the process.
"""
try {
CuratorFramework curator = env.getSharedResources().getCurator();
byte[] uuidBytes = curator.getData().forPath(ZookeeperPath.CONFIG_FLU... | java | public static NodeCache startAppIdWatcher(Environment env) {
try {
CuratorFramework curator = env.getSharedResources().getCurator();
byte[] uuidBytes = curator.getData().forPath(ZookeeperPath.CONFIG_FLUO_APPLICATION_ID);
if (uuidBytes == null) {
Halt.halt("Fluo Application UUID not found"... | [
"public",
"static",
"NodeCache",
"startAppIdWatcher",
"(",
"Environment",
"env",
")",
"{",
"try",
"{",
"CuratorFramework",
"curator",
"=",
"env",
".",
"getSharedResources",
"(",
")",
".",
"getCurator",
"(",
")",
";",
"byte",
"[",
"]",
"uuidBytes",
"=",
"cura... | Start watching the fluo app uuid. If it changes or goes away then halt the process. | [
"Start",
"watching",
"the",
"fluo",
"app",
"uuid",
".",
"If",
"it",
"changes",
"or",
"goes",
"away",
"then",
"halt",
"the",
"process",
"."
] | train | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/util/CuratorUtil.java#L182-L206 |
RestComm/sip-servlets | containers/tomcat-7/src/main/java/org/mobicents/servlet/sip/startup/SipNamingContextListener.java | SipNamingContextListener.removeSipFactory | public static void removeSipFactory(Context envCtx, String appName, SipFactory sipFactory) {
"""
Removes the sip factory binding from the jndi mapping
@param appName the application name subcontext
@param sipFactory the sip factory to remove
"""
if(envCtx != null) {
try {
javax.naming.Context sip... | java | public static void removeSipFactory(Context envCtx, String appName, SipFactory sipFactory) {
if(envCtx != null) {
try {
javax.naming.Context sipContext = (javax.naming.Context)envCtx.lookup(SIP_SUBCONTEXT + "/" + appName);
sipContext.unbind(SIP_FACTORY_JNDI_NAME);
} catch (NamingException e) {
... | [
"public",
"static",
"void",
"removeSipFactory",
"(",
"Context",
"envCtx",
",",
"String",
"appName",
",",
"SipFactory",
"sipFactory",
")",
"{",
"if",
"(",
"envCtx",
"!=",
"null",
")",
"{",
"try",
"{",
"javax",
".",
"naming",
".",
"Context",
"sipContext",
"=... | Removes the sip factory binding from the jndi mapping
@param appName the application name subcontext
@param sipFactory the sip factory to remove | [
"Removes",
"the",
"sip",
"factory",
"binding",
"from",
"the",
"jndi",
"mapping"
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/containers/tomcat-7/src/main/java/org/mobicents/servlet/sip/startup/SipNamingContextListener.java#L295-L304 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/AuditDto.java | AuditDto.transformToDto | public static List<AuditDto> transformToDto(List<Audit> audits) {
"""
Converts a list of audit entities to DTOs.
@param audits The list of audit entities to convert.
@return The list of DTO objects.
@throws WebApplicationException If an error occurs.
"""
if (audits == null) {
... | java | public static List<AuditDto> transformToDto(List<Audit> audits) {
if (audits == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
List<AuditDto> result = new ArrayList<AuditDto>();
for (Audit ... | [
"public",
"static",
"List",
"<",
"AuditDto",
">",
"transformToDto",
"(",
"List",
"<",
"Audit",
">",
"audits",
")",
"{",
"if",
"(",
"audits",
"==",
"null",
")",
"{",
"throw",
"new",
"WebApplicationException",
"(",
"\"Null entity object cannot be converted to Dto ob... | Converts a list of audit entities to DTOs.
@param audits The list of audit entities to convert.
@return The list of DTO objects.
@throws WebApplicationException If an error occurs. | [
"Converts",
"a",
"list",
"of",
"audit",
"entities",
"to",
"DTOs",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/AuditDto.java#L102-L114 |
icode/ameba | src/main/java/ameba/mvc/template/internal/TemplateModelProcessor.java | TemplateModelProcessor.processModel | private ResourceModel processModel(final ResourceModel resourceModel, final boolean subResourceModel) {
"""
Enhance {@link org.glassfish.jersey.server.model.RuntimeResource runtime resources} of given
{@link org.glassfish.jersey.server.model.ResourceModel resource model} with methods obtained with
{@link #getEnh... | java | private ResourceModel processModel(final ResourceModel resourceModel, final boolean subResourceModel) {
ResourceModel.Builder newModelBuilder = processTemplateAnnotatedInvocables(resourceModel, subResourceModel);
for (RuntimeResource resource : resourceModel.getRuntimeResourceModel().getRuntimeResource... | [
"private",
"ResourceModel",
"processModel",
"(",
"final",
"ResourceModel",
"resourceModel",
",",
"final",
"boolean",
"subResourceModel",
")",
"{",
"ResourceModel",
".",
"Builder",
"newModelBuilder",
"=",
"processTemplateAnnotatedInvocables",
"(",
"resourceModel",
",",
"su... | Enhance {@link org.glassfish.jersey.server.model.RuntimeResource runtime resources} of given
{@link org.glassfish.jersey.server.model.ResourceModel resource model} with methods obtained with
{@link #getEnhancingMethods(org.glassfish.jersey.server.model.RuntimeResource)}.
@param resourceModel resource model to enhan... | [
"Enhance",
"{",
"@link",
"org",
".",
"glassfish",
".",
"jersey",
".",
"server",
".",
"model",
".",
"RuntimeResource",
"runtime",
"resources",
"}",
"of",
"given",
"{",
"@link",
"org",
".",
"glassfish",
".",
"jersey",
".",
"server",
".",
"model",
".",
"Res... | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/mvc/template/internal/TemplateModelProcessor.java#L96-L104 |
alkacon/opencms-core | src/org/opencms/db/CmsSelectQuery.java | CmsSelectQuery.addColumn | public void addColumn(String column) {
"""
Adds an expression which should be added as a column in the result set.<p>
@param column the expression which should be added as a column
"""
m_columns.add(new CmsSimpleQueryFragment(column, Collections.<Object> emptyList()));
} | java | public void addColumn(String column) {
m_columns.add(new CmsSimpleQueryFragment(column, Collections.<Object> emptyList()));
} | [
"public",
"void",
"addColumn",
"(",
"String",
"column",
")",
"{",
"m_columns",
".",
"add",
"(",
"new",
"CmsSimpleQueryFragment",
"(",
"column",
",",
"Collections",
".",
"<",
"Object",
">",
"emptyList",
"(",
")",
")",
")",
";",
"}"
] | Adds an expression which should be added as a column in the result set.<p>
@param column the expression which should be added as a column | [
"Adds",
"an",
"expression",
"which",
"should",
"be",
"added",
"as",
"a",
"column",
"in",
"the",
"result",
"set",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSelectQuery.java#L141-L144 |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/SchemaImpl.java | SchemaImpl.getModeAttribute | private Mode getModeAttribute(Attributes attributes, String localName) {
"""
Get the mode specified by an attribute from no namespace.
@param attributes The attributes.
@param localName The attribute name.
@return The mode refered by the licanName attribute.
"""
return lookupCreateMode(attributes.getV... | java | private Mode getModeAttribute(Attributes attributes, String localName) {
return lookupCreateMode(attributes.getValue("", localName));
} | [
"private",
"Mode",
"getModeAttribute",
"(",
"Attributes",
"attributes",
",",
"String",
"localName",
")",
"{",
"return",
"lookupCreateMode",
"(",
"attributes",
".",
"getValue",
"(",
"\"\"",
",",
"localName",
")",
")",
";",
"}"
] | Get the mode specified by an attribute from no namespace.
@param attributes The attributes.
@param localName The attribute name.
@return The mode refered by the licanName attribute. | [
"Get",
"the",
"mode",
"specified",
"by",
"an",
"attribute",
"from",
"no",
"namespace",
"."
] | train | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/SchemaImpl.java#L1233-L1235 |
Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/TheTVDBApi.java | TheTVDBApi.getEpisode | public Episode getEpisode(String seriesId, int seasonNbr, int episodeNbr, String language) throws TvDbException {
"""
Get a specific episode's information
@param seriesId
@param seasonNbr
@param episodeNbr
@param language
@return
@throws com.omertron.thetvdbapi.TvDbException
"""
return getTVEpi... | java | public Episode getEpisode(String seriesId, int seasonNbr, int episodeNbr, String language) throws TvDbException {
return getTVEpisode(seriesId, seasonNbr, episodeNbr, language, "/default/");
} | [
"public",
"Episode",
"getEpisode",
"(",
"String",
"seriesId",
",",
"int",
"seasonNbr",
",",
"int",
"episodeNbr",
",",
"String",
"language",
")",
"throws",
"TvDbException",
"{",
"return",
"getTVEpisode",
"(",
"seriesId",
",",
"seasonNbr",
",",
"episodeNbr",
",",
... | Get a specific episode's information
@param seriesId
@param seasonNbr
@param episodeNbr
@param language
@return
@throws com.omertron.thetvdbapi.TvDbException | [
"Get",
"a",
"specific",
"episode",
"s",
"information"
] | train | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/TheTVDBApi.java#L179-L181 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java | AppServiceCertificateOrdersInner.createOrUpdate | public AppServiceCertificateOrderInner createOrUpdate(String resourceGroupName, String certificateOrderName, AppServiceCertificateOrderInner certificateDistinguishedName) {
"""
Create or update a certificate purchase order.
Create or update a certificate purchase order.
@param resourceGroupName Name of the res... | java | public AppServiceCertificateOrderInner createOrUpdate(String resourceGroupName, String certificateOrderName, AppServiceCertificateOrderInner certificateDistinguishedName) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName).toBlocking().last().bo... | [
"public",
"AppServiceCertificateOrderInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"certificateOrderName",
",",
"AppServiceCertificateOrderInner",
"certificateDistinguishedName",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"reso... | Create or update a certificate purchase order.
Create or update a certificate purchase order.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param certificateOrderName Name of the certificate order.
@param certificateDistinguishedName Distinguished name to to use for the certificat... | [
"Create",
"or",
"update",
"a",
"certificate",
"purchase",
"order",
".",
"Create",
"or",
"update",
"a",
"certificate",
"purchase",
"order",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java#L594-L596 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java | HttpHeaders.setDate | @Deprecated
public static void setDate(HttpMessage message, Date value) {
"""
@deprecated Use {@link #set(CharSequence, Object)} instead.
Sets the {@code "Date"} header.
"""
message.headers().set(HttpHeaderNames.DATE, value);
} | java | @Deprecated
public static void setDate(HttpMessage message, Date value) {
message.headers().set(HttpHeaderNames.DATE, value);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"setDate",
"(",
"HttpMessage",
"message",
",",
"Date",
"value",
")",
"{",
"message",
".",
"headers",
"(",
")",
".",
"set",
"(",
"HttpHeaderNames",
".",
"DATE",
",",
"value",
")",
";",
"}"
] | @deprecated Use {@link #set(CharSequence, Object)} instead.
Sets the {@code "Date"} header. | [
"@deprecated",
"Use",
"{",
"@link",
"#set",
"(",
"CharSequence",
"Object",
")",
"}",
"instead",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L1069-L1072 |
ocelotds/ocelot | ocelot-processor/src/main/java/org/ocelotds/frameworks/angularjs/FunctionWriter.java | FunctionWriter.writeDependencies | void writeDependencies(Writer writer, String deco, String... dependencies) throws IOException {
"""
dep1, dep2 or if deco = "'" 'dep1', 'dep2'
@param writer
@param deco
@param dependencies
@throws IOException
"""
boolean first = true;
for (String dependency : dependencies) {
if (!first) {
writ... | java | void writeDependencies(Writer writer, String deco, String... dependencies) throws IOException {
boolean first = true;
for (String dependency : dependencies) {
if (!first) {
writer.append(COMMA).append(SPACEOPTIONAL);
}
writer.append(deco).append(dependency).append(deco);
first = false;
}
} | [
"void",
"writeDependencies",
"(",
"Writer",
"writer",
",",
"String",
"deco",
",",
"String",
"...",
"dependencies",
")",
"throws",
"IOException",
"{",
"boolean",
"first",
"=",
"true",
";",
"for",
"(",
"String",
"dependency",
":",
"dependencies",
")",
"{",
"if... | dep1, dep2 or if deco = "'" 'dep1', 'dep2'
@param writer
@param deco
@param dependencies
@throws IOException | [
"dep1",
"dep2",
"or",
"if",
"deco",
"=",
"dep1",
"dep2"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-processor/src/main/java/org/ocelotds/frameworks/angularjs/FunctionWriter.java#L39-L48 |
googleads/googleads-java-lib | examples/admanager_axis/src/main/java/admanager/axis/v201902/reportservice/RunReachReport.java | RunReachReport.runExample | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws IOException, InterruptedException {
"""
Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service... | java | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws IOException, InterruptedException {
// Get the ReportService.
ReportServiceInterface reportService =
adManagerServices.get(session, ReportServiceInterface.class);
// Create report query.
Re... | [
"public",
"static",
"void",
"runExample",
"(",
"AdManagerServices",
"adManagerServices",
",",
"AdManagerSession",
"session",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"// Get the ReportService.",
"ReportServiceInterface",
"reportService",
"=",
"adManager... | Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors.
@throws IOException if unable to write the response to a file.
@throws Inte... | [
"Runs",
"the",
"example",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201902/reportservice/RunReachReport.java#L64-L107 |
roboconf/roboconf-platform | core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/reconfigurables/ReconfigurableClient.java | ReconfigurableClient.switchMessagingType | public void switchMessagingType( String factoryName ) {
"""
Changes the internal messaging client.
@param factoryName the factory name (see {@link MessagingConstants})
"""
// Create a new client
this.logger.fine( "The messaging is requested to switch its type to " + factoryName + "." );
JmxWrapperForMe... | java | public void switchMessagingType( String factoryName ) {
// Create a new client
this.logger.fine( "The messaging is requested to switch its type to " + factoryName + "." );
JmxWrapperForMessagingClient newMessagingClient = null;
try {
IMessagingClient rawClient = createMessagingClient( factoryName );
if( ... | [
"public",
"void",
"switchMessagingType",
"(",
"String",
"factoryName",
")",
"{",
"// Create a new client",
"this",
".",
"logger",
".",
"fine",
"(",
"\"The messaging is requested to switch its type to \"",
"+",
"factoryName",
"+",
"\".\"",
")",
";",
"JmxWrapperForMessaging... | Changes the internal messaging client.
@param factoryName the factory name (see {@link MessagingConstants}) | [
"Changes",
"the",
"internal",
"messaging",
"client",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-messaging-api/src/main/java/net/roboconf/messaging/api/reconfigurables/ReconfigurableClient.java#L160-L206 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPFriendlyURLEntryPersistenceImpl.java | CPFriendlyURLEntryPersistenceImpl.removeByUUID_G | @Override
public CPFriendlyURLEntry removeByUUID_G(String uuid, long groupId)
throws NoSuchCPFriendlyURLEntryException {
"""
Removes the cp friendly url entry where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@return the cp friendly url entry that wa... | java | @Override
public CPFriendlyURLEntry removeByUUID_G(String uuid, long groupId)
throws NoSuchCPFriendlyURLEntryException {
CPFriendlyURLEntry cpFriendlyURLEntry = findByUUID_G(uuid, groupId);
return remove(cpFriendlyURLEntry);
} | [
"@",
"Override",
"public",
"CPFriendlyURLEntry",
"removeByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchCPFriendlyURLEntryException",
"{",
"CPFriendlyURLEntry",
"cpFriendlyURLEntry",
"=",
"findByUUID_G",
"(",
"uuid",
",",
"groupId",
")",
... | Removes the cp friendly url entry where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@return the cp friendly url entry that was removed | [
"Removes",
"the",
"cp",
"friendly",
"url",
"entry",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPFriendlyURLEntryPersistenceImpl.java#L817-L823 |
jqm4gwt/jqm4gwt | library/src/main/java/com/sksamuel/jqm4gwt/list/JQMList.java | JQMList.addItem | public JQMListItem addItem(String text, JQMPage page) {
"""
Adds a new {@link JQMListItem} that contains the given @param text as the heading element.
<br>
The list item is made linkable to the given page
@param text the text to use as the content of the header element
@param page the page to make the list i... | java | public JQMListItem addItem(String text, JQMPage page) {
return addItem(text, "#" + page.getId());
} | [
"public",
"JQMListItem",
"addItem",
"(",
"String",
"text",
",",
"JQMPage",
"page",
")",
"{",
"return",
"addItem",
"(",
"text",
",",
"\"#\"",
"+",
"page",
".",
"getId",
"(",
")",
")",
";",
"}"
] | Adds a new {@link JQMListItem} that contains the given @param text as the heading element.
<br>
The list item is made linkable to the given page
@param text the text to use as the content of the header element
@param page the page to make the list item link to | [
"Adds",
"a",
"new",
"{",
"@link",
"JQMListItem",
"}",
"that",
"contains",
"the",
"given",
"@param",
"text",
"as",
"the",
"heading",
"element",
".",
"<br",
">",
"The",
"list",
"item",
"is",
"made",
"linkable",
"to",
"the",
"given",
"page"
] | train | https://github.com/jqm4gwt/jqm4gwt/blob/cf59958e9ba6d4b70f42507b2c77f10c2465085b/library/src/main/java/com/sksamuel/jqm4gwt/list/JQMList.java#L277-L279 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/list/AbstractIntList.java | AbstractIntList.addAllOfFromTo | public void addAllOfFromTo(AbstractIntList other, int from, int to) {
"""
Appends the part of the specified list between <code>from</code> (inclusive) and <code>to</code> (inclusive) to the receiver.
@param other the list to be added to the receiver.
@param from the index of the first element to be appended (i... | java | public void addAllOfFromTo(AbstractIntList other, int from, int to) {
beforeInsertAllOfFromTo(size,other,from,to);
} | [
"public",
"void",
"addAllOfFromTo",
"(",
"AbstractIntList",
"other",
",",
"int",
"from",
",",
"int",
"to",
")",
"{",
"beforeInsertAllOfFromTo",
"(",
"size",
",",
"other",
",",
"from",
",",
"to",
")",
";",
"}"
] | Appends the part of the specified list between <code>from</code> (inclusive) and <code>to</code> (inclusive) to the receiver.
@param other the list to be added to the receiver.
@param from the index of the first element to be appended (inclusive).
@param to the index of the last element to be appended (inclusive).
@ex... | [
"Appends",
"the",
"part",
"of",
"the",
"specified",
"list",
"between",
"<code",
">",
"from<",
"/",
"code",
">",
"(",
"inclusive",
")",
"and",
"<code",
">",
"to<",
"/",
"code",
">",
"(",
"inclusive",
")",
"to",
"the",
"receiver",
"."
] | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/AbstractIntList.java#L53-L55 |
javafxports/javafxmobile-plugin | src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java | ApkBuilder.addFile | @Override
public void addFile(File file, String archivePath) throws ApkCreationException,
SealedApkException, DuplicateFileException {
"""
Adds a file to the APK at a given path
@param file the file to add
@param archivePath the path of the file inside the APK archive.
@throws ApkCreationExcepti... | java | @Override
public void addFile(File file, String archivePath) throws ApkCreationException,
SealedApkException, DuplicateFileException {
if (mIsSealed) {
throw new SealedApkException("APK is already sealed");
}
try {
doAddFile(file, archivePath);
} ... | [
"@",
"Override",
"public",
"void",
"addFile",
"(",
"File",
"file",
",",
"String",
"archivePath",
")",
"throws",
"ApkCreationException",
",",
"SealedApkException",
",",
"DuplicateFileException",
"{",
"if",
"(",
"mIsSealed",
")",
"{",
"throw",
"new",
"SealedApkExcep... | Adds a file to the APK at a given path
@param file the file to add
@param archivePath the path of the file inside the APK archive.
@throws ApkCreationException if an error occurred
@throws SealedApkException if the APK is already sealed.
@throws DuplicateFileException if a file conflicts with another already added to t... | [
"Adds",
"a",
"file",
"to",
"the",
"APK",
"at",
"a",
"given",
"path"
] | train | https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/ApkBuilder.java#L552-L568 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java | SynchronousRequest.getAllContinentRegionID | public List<Integer> getAllContinentRegionID(int continentID, int floorID) throws GuildWars2Exception {
"""
For more info on continents API go <a href="https://wiki.guildwars2.com/wiki/API:2/continents">here</a><br/>
Get all continent region ids
@param continentID {@link Continent#id}
@param floorID {@lin... | java | public List<Integer> getAllContinentRegionID(int continentID, int floorID) throws GuildWars2Exception {
try {
Response<List<Integer>> response = gw2API.getAllContinentRegionIDs(Integer.toString(continentID),
Integer.toString(floorID)).execute();
if (!response.isSuccessful()) throwError(response.code(), res... | [
"public",
"List",
"<",
"Integer",
">",
"getAllContinentRegionID",
"(",
"int",
"continentID",
",",
"int",
"floorID",
")",
"throws",
"GuildWars2Exception",
"{",
"try",
"{",
"Response",
"<",
"List",
"<",
"Integer",
">>",
"response",
"=",
"gw2API",
".",
"getAllCon... | For more info on continents API go <a href="https://wiki.guildwars2.com/wiki/API:2/continents">here</a><br/>
Get all continent region ids
@param continentID {@link Continent#id}
@param floorID {@link ContinentFloor#id}
@return list of continent region ids
@throws GuildWars2Exception see {@link ErrorCode} for detai... | [
"For",
"more",
"info",
"on",
"continents",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"continents",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Get",
"all"... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java#L1433-L1442 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.listClosedListsWithServiceResponseAsync | public Observable<ServiceResponse<List<ClosedListEntityExtractor>>> listClosedListsWithServiceResponseAsync(UUID appId, String versionId, ListClosedListsOptionalParameter listClosedListsOptionalParameter) {
"""
Gets information about the closedlist models.
@param appId The application ID.
@param versionId The ... | java | public Observable<ServiceResponse<List<ClosedListEntityExtractor>>> listClosedListsWithServiceResponseAsync(UUID appId, String versionId, ListClosedListsOptionalParameter listClosedListsOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.clie... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"List",
"<",
"ClosedListEntityExtractor",
">",
">",
">",
"listClosedListsWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"ListClosedListsOptionalParameter",
"listClosedListsOptionalParamete... | Gets information about the closedlist models.
@param appId The application ID.
@param versionId The version ID.
@param listClosedListsOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@return the... | [
"Gets",
"information",
"about",
"the",
"closedlist",
"models",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L1866-L1880 |
ineunetOS/knife-commons | knife-commons-utils/src/main/java/com/ineunet/knife/util/StringUtils.java | StringUtils.abbreviateMiddle | public static String abbreviateMiddle(String str, String middle, int length) {
"""
<p>Abbreviates a String to the length passed, replacing the middle characters with the supplied
replacement String.</p>
<p>This abbreviation only occurs if the following criteria is met:
<ul>
<li>Neither the String for abbrevi... | java | public static String abbreviateMiddle(String str, String middle, int length) {
if (isEmpty(str) || isEmpty(middle)) {
return str;
}
if (length >= str.length() || length < (middle.length()+2)) {
return str;
}
int targetSting = length-middle.length()... | [
"public",
"static",
"String",
"abbreviateMiddle",
"(",
"String",
"str",
",",
"String",
"middle",
",",
"int",
"length",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"str",
")",
"||",
"isEmpty",
"(",
"middle",
")",
")",
"{",
"return",
"str",
";",
"}",
"if",
"(... | <p>Abbreviates a String to the length passed, replacing the middle characters with the supplied
replacement String.</p>
<p>This abbreviation only occurs if the following criteria is met:
<ul>
<li>Neither the String for abbreviation nor the replacement String are null or empty </li>
<li>The length to truncate to is les... | [
"<p",
">",
"Abbreviates",
"a",
"String",
"to",
"the",
"length",
"passed",
"replacing",
"the",
"middle",
"characters",
"with",
"the",
"supplied",
"replacement",
"String",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ineunetOS/knife-commons/blob/eae9e59afa020a00ae8977c10d43ac8ae46ae236/knife-commons-utils/src/main/java/com/ineunet/knife/util/StringUtils.java#L5833-L5852 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java | StyleUtilities.readStyle | public static StyledLayerDescriptor readStyle( File file ) throws IOException {
"""
Parse a file and extract the {@link StyledLayerDescriptor}.
@param file the sld file to parse.
@return the styled layer descriptor.
@throws IOException
"""
SLDParser stylereader = new SLDParser(sf, file);
S... | java | public static StyledLayerDescriptor readStyle( File file ) throws IOException {
SLDParser stylereader = new SLDParser(sf, file);
StyledLayerDescriptor sld = stylereader.parseSLD();
return sld;
} | [
"public",
"static",
"StyledLayerDescriptor",
"readStyle",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"SLDParser",
"stylereader",
"=",
"new",
"SLDParser",
"(",
"sf",
",",
"file",
")",
";",
"StyledLayerDescriptor",
"sld",
"=",
"stylereader",
".",
"par... | Parse a file and extract the {@link StyledLayerDescriptor}.
@param file the sld file to parse.
@return the styled layer descriptor.
@throws IOException | [
"Parse",
"a",
"file",
"and",
"extract",
"the",
"{",
"@link",
"StyledLayerDescriptor",
"}",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/StyleUtilities.java#L245-L249 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.getAt | public static <T> List<T> getAt(T[] array, Range range) {
"""
Support the range subscript operator for an Array
@param array an Array of Objects
@param range a Range
@return a range of a list from the range's from index up to but not
including the range's to value
@since 1.0
"""
List<T> list = A... | java | public static <T> List<T> getAt(T[] array, Range range) {
List<T> list = Arrays.asList(array);
return getAt(list, range);
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"getAt",
"(",
"T",
"[",
"]",
"array",
",",
"Range",
"range",
")",
"{",
"List",
"<",
"T",
">",
"list",
"=",
"Arrays",
".",
"asList",
"(",
"array",
")",
";",
"return",
"getAt",
"(",
"list"... | Support the range subscript operator for an Array
@param array an Array of Objects
@param range a Range
@return a range of a list from the range's from index up to but not
including the range's to value
@since 1.0 | [
"Support",
"the",
"range",
"subscript",
"operator",
"for",
"an",
"Array"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L7784-L7787 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/ArabicShaping.java | ArabicShaping.deshapeNormalize | private int deshapeNormalize(char[] dest, int start, int length) {
"""
/*
Name : deshapeNormalize
Function: Convert the input buffer from FExx Range into 06xx Range
even the lamalef is converted to the special region in the 06xx range.
According to the options the user enters, all seen family characters
fo... | java | private int deshapeNormalize(char[] dest, int start, int length) {
int lacount = 0;
int yehHamzaComposeEnabled = 0;
int seenComposeEnabled = 0;
yehHamzaComposeEnabled = ((options&YEHHAMZA_MASK) == YEHHAMZA_TWOCELL_NEAR) ? 1 : 0;
seenComposeEnabled = ((options&SEEN_MASK) == SEEN_... | [
"private",
"int",
"deshapeNormalize",
"(",
"char",
"[",
"]",
"dest",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"int",
"lacount",
"=",
"0",
";",
"int",
"yehHamzaComposeEnabled",
"=",
"0",
";",
"int",
"seenComposeEnabled",
"=",
"0",
";",
"yehHam... | /*
Name : deshapeNormalize
Function: Convert the input buffer from FExx Range into 06xx Range
even the lamalef is converted to the special region in the 06xx range.
According to the options the user enters, all seen family characters
followed by a tail character are merged to seen tail family character and
any yeh f... | [
"/",
"*",
"Name",
":",
"deshapeNormalize",
"Function",
":",
"Convert",
"the",
"input",
"buffer",
"from",
"FExx",
"Range",
"into",
"06xx",
"Range",
"even",
"the",
"lamalef",
"is",
"converted",
"to",
"the",
"special",
"region",
"in",
"the",
"06xx",
"range",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/ArabicShaping.java#L1587-L1614 |
Graylog2/graylog2-server | graylog2-server/src/main/java/org/graylog2/search/SearchQueryParser.java | SearchQueryParser.createFieldValue | @VisibleForTesting
FieldValue createFieldValue(SearchQueryField field, String quotedStringValue, boolean negate) {
"""
/* Create a FieldValue for the query field from the string value.
We try to convert the value types according to the data type of the query field.
"""
// Make sure there are no qu... | java | @VisibleForTesting
FieldValue createFieldValue(SearchQueryField field, String quotedStringValue, boolean negate) {
// Make sure there are no quotes in the value (e.g. `"foo"' --> `foo')
final String value = quotedStringValue.replaceAll(QUOTE_REPLACE_REGEX, "");
final SearchQueryField.Type fi... | [
"@",
"VisibleForTesting",
"FieldValue",
"createFieldValue",
"(",
"SearchQueryField",
"field",
",",
"String",
"quotedStringValue",
",",
"boolean",
"negate",
")",
"{",
"// Make sure there are no quotes in the value (e.g. `\"foo\"' --> `foo')",
"final",
"String",
"value",
"=",
"... | /* Create a FieldValue for the query field from the string value.
We try to convert the value types according to the data type of the query field. | [
"/",
"*",
"Create",
"a",
"FieldValue",
"for",
"the",
"query",
"field",
"from",
"the",
"string",
"value",
".",
"We",
"try",
"to",
"convert",
"the",
"value",
"types",
"according",
"to",
"the",
"data",
"type",
"of",
"the",
"query",
"field",
"."
] | train | https://github.com/Graylog2/graylog2-server/blob/50b565dcead6e0a372236d5c2f8530dc5726fa9b/graylog2-server/src/main/java/org/graylog2/search/SearchQueryParser.java#L232-L251 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/RuntimeUtil.java | RuntimeUtil.execForStr | public static String execForStr(Charset charset, String... cmds) throws IORuntimeException {
"""
执行系统命令,使用系统默认编码
@param charset 编码
@param cmds 命令列表,每个元素代表一条命令
@return 执行结果
@throws IORuntimeException IO异常
@since 3.1.2
"""
return getResult(exec(cmds), charset);
} | java | public static String execForStr(Charset charset, String... cmds) throws IORuntimeException {
return getResult(exec(cmds), charset);
} | [
"public",
"static",
"String",
"execForStr",
"(",
"Charset",
"charset",
",",
"String",
"...",
"cmds",
")",
"throws",
"IORuntimeException",
"{",
"return",
"getResult",
"(",
"exec",
"(",
"cmds",
")",
",",
"charset",
")",
";",
"}"
] | 执行系统命令,使用系统默认编码
@param charset 编码
@param cmds 命令列表,每个元素代表一条命令
@return 执行结果
@throws IORuntimeException IO异常
@since 3.1.2 | [
"执行系统命令,使用系统默认编码"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/RuntimeUtil.java#L41-L43 |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/trustmanager/IdentityChecker.java | IdentityChecker.invoke | public void invoke(X509Certificate cert, GSIConstants.CertificateType certType) throws CertPathValidatorException {
"""
Method that sets the identity of the certificate path. Also checks if
limited proxy is acceptable.
@throws CertPathValidatorException If limited proxies are not accepted
and the chain has a ... | java | public void invoke(X509Certificate cert, GSIConstants.CertificateType certType) throws CertPathValidatorException {
if (proxyCertValidator.getIdentityCertificate() == null) {
// check if limited
if (ProxyCertificateUtil.isLimitedProxy(certType)) {
proxyCertValidator.setLi... | [
"public",
"void",
"invoke",
"(",
"X509Certificate",
"cert",
",",
"GSIConstants",
".",
"CertificateType",
"certType",
")",
"throws",
"CertPathValidatorException",
"{",
"if",
"(",
"proxyCertValidator",
".",
"getIdentityCertificate",
"(",
")",
"==",
"null",
")",
"{",
... | Method that sets the identity of the certificate path. Also checks if
limited proxy is acceptable.
@throws CertPathValidatorException If limited proxies are not accepted
and the chain has a limited proxy. | [
"Method",
"that",
"sets",
"the",
"identity",
"of",
"the",
"certificate",
"path",
".",
"Also",
"checks",
"if",
"limited",
"proxy",
"is",
"acceptable",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/trustmanager/IdentityChecker.java#L45-L62 |
facebookarchive/hadoop-20 | src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerDispatcher.java | ServerDispatcher.handleFailedDispatch | @Override
public void handleFailedDispatch(long clientId, long failedTime) {
"""
Called each time a handleNotification or heartbeat Thrift
call fails.
@param clientId the id of the client on which the call failed.
@param failedTime the time at which the call was made. If
this is -1, then nothing will be upda... | java | @Override
public void handleFailedDispatch(long clientId, long failedTime) {
ClientData clientData = core.getClientData(clientId);
if (failedTime == -1 || clientData == null)
return;
// We only add it and don't update it because we are interested in
// keeping track of the first moment it f... | [
"@",
"Override",
"public",
"void",
"handleFailedDispatch",
"(",
"long",
"clientId",
",",
"long",
"failedTime",
")",
"{",
"ClientData",
"clientData",
"=",
"core",
".",
"getClientData",
"(",
"clientId",
")",
";",
"if",
"(",
"failedTime",
"==",
"-",
"1",
"||",
... | Called each time a handleNotification or heartbeat Thrift
call fails.
@param clientId the id of the client on which the call failed.
@param failedTime the time at which the call was made. If
this is -1, then nothing will be updated. | [
"Called",
"each",
"time",
"a",
"handleNotification",
"or",
"heartbeat",
"Thrift",
"call",
"fails",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerDispatcher.java#L390-L404 |
dbracewell/mango | src/main/java/com/davidbracewell/string/StringUtils.java | StringUtils.safeEquals | public static boolean safeEquals(String s1, String s2, boolean caseSensitive) {
"""
Safe equals.
@param s1 the s 1
@param s2 the s 2
@param caseSensitive the case sensitive
@return the boolean
"""
if (s1 == s2) {
return true;
} else if (s1 == null || s2 == null)... | java | public static boolean safeEquals(String s1, String s2, boolean caseSensitive) {
if (s1 == s2) {
return true;
} else if (s1 == null || s2 == null) {
return false;
} else if (caseSensitive) {
return s1.equals(s2);
}
return s1.equalsIgnoreCase(s2);
} | [
"public",
"static",
"boolean",
"safeEquals",
"(",
"String",
"s1",
",",
"String",
"s2",
",",
"boolean",
"caseSensitive",
")",
"{",
"if",
"(",
"s1",
"==",
"s2",
")",
"{",
"return",
"true",
";",
"}",
"else",
"if",
"(",
"s1",
"==",
"null",
"||",
"s2",
... | Safe equals.
@param s1 the s 1
@param s2 the s 2
@param caseSensitive the case sensitive
@return the boolean | [
"Safe",
"equals",
"."
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/string/StringUtils.java#L487-L496 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/IntegrationAccountAssembliesInner.java | IntegrationAccountAssembliesInner.createOrUpdateAsync | public Observable<AssemblyDefinitionInner> createOrUpdateAsync(String resourceGroupName, String integrationAccountName, String assemblyArtifactName, AssemblyDefinitionInner assemblyArtifact) {
"""
Create or update an assembly for an integration account.
@param resourceGroupName The resource group name.
@param ... | java | public Observable<AssemblyDefinitionInner> createOrUpdateAsync(String resourceGroupName, String integrationAccountName, String assemblyArtifactName, AssemblyDefinitionInner assemblyArtifact) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, integrationAccountName, assemblyArtifactName, assembly... | [
"public",
"Observable",
"<",
"AssemblyDefinitionInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"integrationAccountName",
",",
"String",
"assemblyArtifactName",
",",
"AssemblyDefinitionInner",
"assemblyArtifact",
")",
"{",
"return",
"c... | Create or update an assembly for an integration account.
@param resourceGroupName The resource group name.
@param integrationAccountName The integration account name.
@param assemblyArtifactName The assembly artifact name.
@param assemblyArtifact The assembly artifact.
@throws IllegalArgumentException thrown if parame... | [
"Create",
"or",
"update",
"an",
"assembly",
"for",
"an",
"integration",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/IntegrationAccountAssembliesInner.java#L307-L314 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/form/CmsForm.java | CmsForm.addField | public void addField(String fieldGroup, I_CmsFormField formField, String initialValue) {
"""
Adds a form field to the form and sets its initial value.<p>
@param fieldGroup the form field group key
@param formField the form field which should be added
@param initialValue the initial value of the form field, or... | java | public void addField(String fieldGroup, I_CmsFormField formField, String initialValue) {
if (initialValue != null) {
formField.getWidget().setFormValueAsString(initialValue);
}
addField(fieldGroup, formField);
} | [
"public",
"void",
"addField",
"(",
"String",
"fieldGroup",
",",
"I_CmsFormField",
"formField",
",",
"String",
"initialValue",
")",
"{",
"if",
"(",
"initialValue",
"!=",
"null",
")",
"{",
"formField",
".",
"getWidget",
"(",
")",
".",
"setFormValueAsString",
"("... | Adds a form field to the form and sets its initial value.<p>
@param fieldGroup the form field group key
@param formField the form field which should be added
@param initialValue the initial value of the form field, or null if the field shouldn't have an initial value | [
"Adds",
"a",
"form",
"field",
"to",
"the",
"form",
"and",
"sets",
"its",
"initial",
"value",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/form/CmsForm.java#L158-L164 |
b3dgs/lionengine | lionengine-network/src/main/java/com/b3dgs/lionengine/network/ServerImpl.java | ServerImpl.checkValidity | private static boolean checkValidity(ClientSocket client, byte from, StateConnection expected) {
"""
Check if the client is in a valid state.
@param client The client to test.
@param from The client id.
@param expected The expected client state.
@return <code>true</code> if valid, <code>false</code> else.
... | java | private static boolean checkValidity(ClientSocket client, byte from, StateConnection expected)
{
return from >= 0 && client.getState() == expected;
} | [
"private",
"static",
"boolean",
"checkValidity",
"(",
"ClientSocket",
"client",
",",
"byte",
"from",
",",
"StateConnection",
"expected",
")",
"{",
"return",
"from",
">=",
"0",
"&&",
"client",
".",
"getState",
"(",
")",
"==",
"expected",
";",
"}"
] | Check if the client is in a valid state.
@param client The client to test.
@param from The client id.
@param expected The expected client state.
@return <code>true</code> if valid, <code>false</code> else. | [
"Check",
"if",
"the",
"client",
"is",
"in",
"a",
"valid",
"state",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-network/src/main/java/com/b3dgs/lionengine/network/ServerImpl.java#L73-L76 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/script/ProgressScripService.java | ProgressScripService.startStep | public void startStep(String translationKey, String message, Object... arguments) {
"""
Close current step if any and move to next one.
@param translationKey the key used to find the translation of the step message
@param message the default message associated to the step
@param arguments the arguments to ins... | java | public void startStep(String translationKey, String message, Object... arguments)
{
this.progress.startStep(this, new Message(translationKey, message, arguments));
} | [
"public",
"void",
"startStep",
"(",
"String",
"translationKey",
",",
"String",
"message",
",",
"Object",
"...",
"arguments",
")",
"{",
"this",
".",
"progress",
".",
"startStep",
"(",
"this",
",",
"new",
"Message",
"(",
"translationKey",
",",
"message",
",",
... | Close current step if any and move to next one.
@param translationKey the key used to find the translation of the step message
@param message the default message associated to the step
@param arguments the arguments to insert in the step message | [
"Close",
"current",
"step",
"if",
"any",
"and",
"move",
"to",
"next",
"one",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/script/ProgressScripService.java#L96-L99 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.findIndexValues | public static <T> List<Number> findIndexValues(Iterable<T> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure condition) {
"""
Iterates over the elements of an Iterable and returns
the index values of the items that match the condition specified in the closure.
@param self an Iterable
@param... | java | public static <T> List<Number> findIndexValues(Iterable<T> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure condition) {
return findIndexValues(self, 0, condition);
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"Number",
">",
"findIndexValues",
"(",
"Iterable",
"<",
"T",
">",
"self",
",",
"@",
"ClosureParams",
"(",
"FirstParam",
".",
"FirstGenericType",
".",
"class",
")",
"Closure",
"condition",
")",
"{",
"return",
... | Iterates over the elements of an Iterable and returns
the index values of the items that match the condition specified in the closure.
@param self an Iterable
@param condition the matching condition
@return a list of numbers corresponding to the index values of all matched objects
@since 2.5.0 | [
"Iterates",
"over",
"the",
"elements",
"of",
"an",
"Iterable",
"and",
"returns",
"the",
"index",
"values",
"of",
"the",
"items",
"that",
"match",
"the",
"condition",
"specified",
"in",
"the",
"closure",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L17013-L17015 |
cdk/cdk | base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/CompatibilityMatrix.java | CompatibilityMatrix.resetRows | void resetRows(int i, int marking) {
"""
Reset all values marked with (marking) from row i onwards.
@param i row index
@param marking the marking to reset (should be negative)
"""
for (int j = (i * mCols); j < data.length; j++)
if (data[j] == marking) data[j] = 1;
} | java | void resetRows(int i, int marking) {
for (int j = (i * mCols); j < data.length; j++)
if (data[j] == marking) data[j] = 1;
} | [
"void",
"resetRows",
"(",
"int",
"i",
",",
"int",
"marking",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"(",
"i",
"*",
"mCols",
")",
";",
"j",
"<",
"data",
".",
"length",
";",
"j",
"++",
")",
"if",
"(",
"data",
"[",
"j",
"]",
"==",
"marking",
"... | Reset all values marked with (marking) from row i onwards.
@param i row index
@param marking the marking to reset (should be negative) | [
"Reset",
"all",
"values",
"marked",
"with",
"(",
"marking",
")",
"from",
"row",
"i",
"onwards",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/CompatibilityMatrix.java#L119-L122 |
aws/aws-sdk-java | aws-java-sdk-iam/src/main/java/com/amazonaws/services/identitymanagement/model/GetContextKeysForPrincipalPolicyRequest.java | GetContextKeysForPrincipalPolicyRequest.getPolicyInputList | public java.util.List<String> getPolicyInputList() {
"""
<p>
An optional list of additional policies for which you want the list of context keys that are referenced.
</p>
<p>
The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> used to validate this parameter is a string of
characters consisting of... | java | public java.util.List<String> getPolicyInputList() {
if (policyInputList == null) {
policyInputList = new com.amazonaws.internal.SdkInternalList<String>();
}
return policyInputList;
} | [
"public",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
"getPolicyInputList",
"(",
")",
"{",
"if",
"(",
"policyInputList",
"==",
"null",
")",
"{",
"policyInputList",
"=",
"new",
"com",
".",
"amazonaws",
".",
"internal",
".",
"SdkInternalList",
"<",... | <p>
An optional list of additional policies for which you want the list of context keys that are referenced.
</p>
<p>
The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> used to validate this parameter is a string of
characters consisting of the following:
</p>
<ul>
<li>
<p>
Any printable ASCII character ra... | [
"<p",
">",
"An",
"optional",
"list",
"of",
"additional",
"policies",
"for",
"which",
"you",
"want",
"the",
"list",
"of",
"context",
"keys",
"that",
"are",
"referenced",
".",
"<",
"/",
"p",
">",
"<p",
">",
"The",
"<a",
"href",
"=",
"http",
":",
"//",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iam/src/main/java/com/amazonaws/services/identitymanagement/model/GetContextKeysForPrincipalPolicyRequest.java#L216-L221 |
actorapp/actor-platform | actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java | ImageLoading.loadBitmapOptimized | public static Bitmap loadBitmapOptimized(Uri uri, Context context, int limit) throws ImageLoadException {
"""
Loading bitmap with optimized loaded size less than specific pixels count
@param uri content uri for bitmap
@param context Application Context
@param limit maximum pixels size
@return loaded bi... | java | public static Bitmap loadBitmapOptimized(Uri uri, Context context, int limit) throws ImageLoadException {
return loadBitmapOptimized(new UriSource(uri, context) {
}, limit);
} | [
"public",
"static",
"Bitmap",
"loadBitmapOptimized",
"(",
"Uri",
"uri",
",",
"Context",
"context",
",",
"int",
"limit",
")",
"throws",
"ImageLoadException",
"{",
"return",
"loadBitmapOptimized",
"(",
"new",
"UriSource",
"(",
"uri",
",",
"context",
")",
"{",
"}... | Loading bitmap with optimized loaded size less than specific pixels count
@param uri content uri for bitmap
@param context Application Context
@param limit maximum pixels size
@return loaded bitmap (always not null)
@throws ImageLoadException if it is unable to load file | [
"Loading",
"bitmap",
"with",
"optimized",
"loaded",
"size",
"less",
"than",
"specific",
"pixels",
"count"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java#L144-L147 |
j256/ormlite-core | src/main/java/com/j256/ormlite/stmt/QueryBuilder.java | QueryBuilder.orderByRaw | public QueryBuilder<T, ID> orderByRaw(String rawSql) {
"""
Add raw SQL "ORDER BY" clause to the SQL query statement.
@param rawSql
The raw SQL order by clause. This should not include the "ORDER BY".
"""
addOrderBy(new OrderBy(rawSql, (ArgumentHolder[]) null));
return this;
} | java | public QueryBuilder<T, ID> orderByRaw(String rawSql) {
addOrderBy(new OrderBy(rawSql, (ArgumentHolder[]) null));
return this;
} | [
"public",
"QueryBuilder",
"<",
"T",
",",
"ID",
">",
"orderByRaw",
"(",
"String",
"rawSql",
")",
"{",
"addOrderBy",
"(",
"new",
"OrderBy",
"(",
"rawSql",
",",
"(",
"ArgumentHolder",
"[",
"]",
")",
"null",
")",
")",
";",
"return",
"this",
";",
"}"
] | Add raw SQL "ORDER BY" clause to the SQL query statement.
@param rawSql
The raw SQL order by clause. This should not include the "ORDER BY". | [
"Add",
"raw",
"SQL",
"ORDER",
"BY",
"clause",
"to",
"the",
"SQL",
"query",
"statement",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/QueryBuilder.java#L190-L193 |
voldemort/voldemort | contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/HadoopStoreBuilderUtils.java | HadoopStoreBuilderUtils.readFileContents | public static String readFileContents(FileSystem fs, Path path, int bufferSize)
throws IOException {
"""
Given a filesystem, path and buffer-size, read the file contents and
presents it as a string
@param fs Underlying filesystem
@param path The file to read
@param bufferSize The buffer size to u... | java | public static String readFileContents(FileSystem fs, Path path, int bufferSize)
throws IOException {
if(bufferSize <= 0)
return new String();
FSDataInputStream input = fs.open(path);
byte[] buffer = new byte[bufferSize];
ByteArrayOutputStream stream = new ByteAr... | [
"public",
"static",
"String",
"readFileContents",
"(",
"FileSystem",
"fs",
",",
"Path",
"path",
",",
"int",
"bufferSize",
")",
"throws",
"IOException",
"{",
"if",
"(",
"bufferSize",
"<=",
"0",
")",
"return",
"new",
"String",
"(",
")",
";",
"FSDataInputStream... | Given a filesystem, path and buffer-size, read the file contents and
presents it as a string
@param fs Underlying filesystem
@param path The file to read
@param bufferSize The buffer size to use for reading
@return The contents of the file as a string
@throws IOException | [
"Given",
"a",
"filesystem",
"path",
"and",
"buffer",
"-",
"size",
"read",
"the",
"file",
"contents",
"and",
"presents",
"it",
"as",
"a",
"string"
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/HadoopStoreBuilderUtils.java#L52-L73 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.updatePatternAnyEntityRoleWithServiceResponseAsync | public Observable<ServiceResponse<OperationStatus>> updatePatternAnyEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, UpdatePatternAnyEntityRoleOptionalParameter updatePatternAnyEntityRoleOptionalParameter) {
"""
Update an entity role for a given entity.
@param appId T... | java | public Observable<ServiceResponse<OperationStatus>> updatePatternAnyEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, UUID roleId, UpdatePatternAnyEntityRoleOptionalParameter updatePatternAnyEntityRoleOptionalParameter) {
if (this.client.endpoint() == null) {
throw new ... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"OperationStatus",
">",
">",
"updatePatternAnyEntityRoleWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"UUID",
"roleId",
",",
"UpdatePatternAnyEntityRoleOption... | Update an entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity ID.
@param roleId The entity role ID.
@param updatePatternAnyEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API
@throws Illeg... | [
"Update",
"an",
"entity",
"role",
"for",
"a",
"given",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L12908-L12927 |
Azure/azure-sdk-for-java | authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsInner.java | RoleAssignmentsInner.deleteAsync | public Observable<RoleAssignmentInner> deleteAsync(String scope, String roleAssignmentName) {
"""
Deletes a role assignment.
@param scope The scope of the role assignment to delete.
@param roleAssignmentName The name of the role assignment to delete.
@throws IllegalArgumentException thrown if parameters fail ... | java | public Observable<RoleAssignmentInner> deleteAsync(String scope, String roleAssignmentName) {
return deleteWithServiceResponseAsync(scope, roleAssignmentName).map(new Func1<ServiceResponse<RoleAssignmentInner>, RoleAssignmentInner>() {
@Override
public RoleAssignmentInner call(ServiceRes... | [
"public",
"Observable",
"<",
"RoleAssignmentInner",
">",
"deleteAsync",
"(",
"String",
"scope",
",",
"String",
"roleAssignmentName",
")",
"{",
"return",
"deleteWithServiceResponseAsync",
"(",
"scope",
",",
"roleAssignmentName",
")",
".",
"map",
"(",
"new",
"Func1",
... | Deletes a role assignment.
@param scope The scope of the role assignment to delete.
@param roleAssignmentName The name of the role assignment to delete.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the RoleAssignmentInner object | [
"Deletes",
"a",
"role",
"assignment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/authorization/resource-manager/v2015_07_01/src/main/java/com/microsoft/azure/management/authorization/v2015_07_01/implementation/RoleAssignmentsInner.java#L683-L690 |
puniverse/capsule | capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java | Jar.addEntries | public Jar addEntries(Path path, ZipInputStream zip, Filter filter) throws IOException {
"""
Adds the contents of the zip/JAR contained in the given byte array to this JAR.
@param path the path within the JAR where the root of the zip will be placed, or {@code null} for the JAR's root
@param zip the conte... | java | public Jar addEntries(Path path, ZipInputStream zip, Filter filter) throws IOException {
beginWriting();
try (ZipInputStream zis = zip) {
for (ZipEntry entry; (entry = zis.getNextEntry()) != null;) {
final String target = path != null ? path.resolve(entry.getName()).toString(... | [
"public",
"Jar",
"addEntries",
"(",
"Path",
"path",
",",
"ZipInputStream",
"zip",
",",
"Filter",
"filter",
")",
"throws",
"IOException",
"{",
"beginWriting",
"(",
")",
";",
"try",
"(",
"ZipInputStream",
"zis",
"=",
"zip",
")",
"{",
"for",
"(",
"ZipEntry",
... | Adds the contents of the zip/JAR contained in the given byte array to this JAR.
@param path the path within the JAR where the root of the zip will be placed, or {@code null} for the JAR's root
@param zip the contents of the zip/JAR file
@param filter a filter to select particular classes
@return {@code this} | [
"Adds",
"the",
"contents",
"of",
"the",
"zip",
"/",
"JAR",
"contained",
"in",
"the",
"given",
"byte",
"array",
"to",
"this",
"JAR",
"."
] | train | https://github.com/puniverse/capsule/blob/291a54e501a32aaf0284707b8c1fbff6a566822b/capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java#L456-L468 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataCore.java | CoverageDataCore.getFloatPixelValue | public float getFloatPixelValue(GriddedTile griddedTile, Double value) {
"""
Get the pixel value of the coverage data value
@param griddedTile
gridded tile
@param value
coverage data value
@return pixel value
"""
double pixel = 0;
if (value == null) {
if (griddedCoverage != null) {
pixel = g... | java | public float getFloatPixelValue(GriddedTile griddedTile, Double value) {
double pixel = 0;
if (value == null) {
if (griddedCoverage != null) {
pixel = griddedCoverage.getDataNull();
}
} else {
pixel = valueToPixelValue(griddedTile, value);
}
float pixelValue = (float) pixel;
return pixelValu... | [
"public",
"float",
"getFloatPixelValue",
"(",
"GriddedTile",
"griddedTile",
",",
"Double",
"value",
")",
"{",
"double",
"pixel",
"=",
"0",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"if",
"(",
"griddedCoverage",
"!=",
"null",
")",
"{",
"pixel",
"="... | Get the pixel value of the coverage data value
@param griddedTile
gridded tile
@param value
coverage data value
@return pixel value | [
"Get",
"the",
"pixel",
"value",
"of",
"the",
"coverage",
"data",
"value"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataCore.java#L1666-L1680 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPUtils.java | JBBPUtils.ulong2str | public static String ulong2str(final long ulongValue, final int radix, final char[] charBuffer) {
"""
Convert unsigned long value into string representation with defined radix
base.
@param ulongValue value to be converted in string
@param radix radix base to be used for conversion, must be 2..36
@param ... | java | public static String ulong2str(final long ulongValue, final int radix, final char[] charBuffer) {
if (radix < 2 || radix > 36) {
throw new IllegalArgumentException("Illegal radix [" + radix + ']');
}
if (ulongValue == 0) {
return "0";
} else {
final String result;
if (ulongValue... | [
"public",
"static",
"String",
"ulong2str",
"(",
"final",
"long",
"ulongValue",
",",
"final",
"int",
"radix",
",",
"final",
"char",
"[",
"]",
"charBuffer",
")",
"{",
"if",
"(",
"radix",
"<",
"2",
"||",
"radix",
">",
"36",
")",
"{",
"throw",
"new",
"Il... | Convert unsigned long value into string representation with defined radix
base.
@param ulongValue value to be converted in string
@param radix radix base to be used for conversion, must be 2..36
@param charBuffer char buffer to be used for conversion operations, should
be not less than 64 char length, if length i... | [
"Convert",
"unsigned",
"long",
"value",
"into",
"string",
"representation",
"with",
"defined",
"radix",
"base",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPUtils.java#L773-L800 |
lionsoul2014/jcseg | jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/ContextRouter.java | ContextRouter.getPathEntry | private PathEntry getPathEntry(UriEntry uri) {
"""
get the final key with specified path
paths : return:
/a/b : /a/b
/a/* : /a/
/a/b/c : /a/b/c
/a/b/* : /a/b/
/a/b/ : /a/b/
"""
PathEntry pathEntry = new PathEntry( ContextRouter.MAP_PATH_TYPE, "default");
... | java | private PathEntry getPathEntry(UriEntry uri)
{
PathEntry pathEntry = new PathEntry( ContextRouter.MAP_PATH_TYPE, "default");
int length = uri.getLength();
// like /a or /
if ( length < 2) return pathEntry;
String requestUri = uri.getRequestUri();
... | [
"private",
"PathEntry",
"getPathEntry",
"(",
"UriEntry",
"uri",
")",
"{",
"PathEntry",
"pathEntry",
"=",
"new",
"PathEntry",
"(",
"ContextRouter",
".",
"MAP_PATH_TYPE",
",",
"\"default\"",
")",
";",
"int",
"length",
"=",
"uri",
".",
"getLength",
"(",
")",
";... | get the final key with specified path
paths : return:
/a/b : /a/b
/a/* : /a/
/a/b/c : /a/b/c
/a/b/* : /a/b/
/a/b/ : /a/b/ | [
"get",
"the",
"final",
"key",
"with",
"specified",
"path"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-server/src/main/java/org/lionsoul/jcseg/server/core/ContextRouter.java#L59-L93 |
grpc/grpc-java | alts/src/main/java/io/grpc/alts/AltsChannelBuilder.java | AltsChannelBuilder.forAddress | public static AltsChannelBuilder forAddress(String name, int port) {
"""
"Overrides" the static method in {@link ManagedChannelBuilder}.
"""
return forTarget(GrpcUtil.authorityFromHostAndPort(name, port));
} | java | public static AltsChannelBuilder forAddress(String name, int port) {
return forTarget(GrpcUtil.authorityFromHostAndPort(name, port));
} | [
"public",
"static",
"AltsChannelBuilder",
"forAddress",
"(",
"String",
"name",
",",
"int",
"port",
")",
"{",
"return",
"forTarget",
"(",
"GrpcUtil",
".",
"authorityFromHostAndPort",
"(",
"name",
",",
"port",
")",
")",
";",
"}"
] | "Overrides" the static method in {@link ManagedChannelBuilder}. | [
"Overrides",
"the",
"static",
"method",
"in",
"{"
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/alts/src/main/java/io/grpc/alts/AltsChannelBuilder.java#L71-L73 |
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/xml/XmlUtil.java | XmlUtil.parseXmlStringWithXsdValidation | public static Document parseXmlStringWithXsdValidation(String _xmlStr, boolean _namespaceAware, ErrorHandler _errorHandler) throws IOException {
"""
Loads XML from string and uses referenced XSD to validate the content.
@param _xmlStr string to validate
@param _namespaceAware take care of namespace
@param _... | java | public static Document parseXmlStringWithXsdValidation(String _xmlStr, boolean _namespaceAware, ErrorHandler _errorHandler) throws IOException {
if (_errorHandler == null) {
_errorHandler = new XmlErrorHandlers.XmlErrorHandlerQuiet();
}
DocumentBuilderFactory dbFac = DocumentBuilder... | [
"public",
"static",
"Document",
"parseXmlStringWithXsdValidation",
"(",
"String",
"_xmlStr",
",",
"boolean",
"_namespaceAware",
",",
"ErrorHandler",
"_errorHandler",
")",
"throws",
"IOException",
"{",
"if",
"(",
"_errorHandler",
"==",
"null",
")",
"{",
"_errorHandler"... | Loads XML from string and uses referenced XSD to validate the content.
@param _xmlStr string to validate
@param _namespaceAware take care of namespace
@param _errorHandler e.g. {@link XmlErrorHandlers.XmlErrorHandlerQuiet} or {@link XmlErrorHandlers.XmlErrorHandlerRuntimeException}
@return Document
@throws IOExceptio... | [
"Loads",
"XML",
"from",
"string",
"and",
"uses",
"referenced",
"XSD",
"to",
"validate",
"the",
"content",
"."
] | train | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/xml/XmlUtil.java#L167-L186 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/util/LayoutUtils.java | LayoutUtils.copyBandElements | public static void copyBandElements(JRDesignBand destBand, JRBand sourceBand) {
"""
Copy bands elements from source to dest band, also makes sure copied elements
are placed below existing ones (Y offset is calculated)
@param destBand
@param sourceBand
"""
int offset = findVerticalOffset(destBand);
if... | java | public static void copyBandElements(JRDesignBand destBand, JRBand sourceBand) {
int offset = findVerticalOffset(destBand);
if (destBand == null)
throw new DJException("destination band cannot be null");
if (sourceBand == null)
return;
for (JRChild jrChild : sourceBand.getChildren()) {
JRDesignEl... | [
"public",
"static",
"void",
"copyBandElements",
"(",
"JRDesignBand",
"destBand",
",",
"JRBand",
"sourceBand",
")",
"{",
"int",
"offset",
"=",
"findVerticalOffset",
"(",
"destBand",
")",
";",
"if",
"(",
"destBand",
"==",
"null",
")",
"throw",
"new",
"DJExceptio... | Copy bands elements from source to dest band, also makes sure copied elements
are placed below existing ones (Y offset is calculated)
@param destBand
@param sourceBand | [
"Copy",
"bands",
"elements",
"from",
"source",
"to",
"dest",
"band",
"also",
"makes",
"sure",
"copied",
"elements",
"are",
"placed",
"below",
"existing",
"ones",
"(",
"Y",
"offset",
"is",
"calculated",
")"
] | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/util/LayoutUtils.java#L54-L82 |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/FormatUtilities.java | FormatUtilities.getFormattedDateTime | static public String getFormattedDateTime(long dt, String format, long tolerance) {
"""
Returns the given date formatted using the given format.
@param dt The date to be formatted
@param format The format to use to display the date
@param tolerance The tolerance for the date to be formatted
@return The given d... | java | static public String getFormattedDateTime(long dt, String format, long tolerance)
{
return getFormattedDateTime(dt, format, true, tolerance);
} | [
"static",
"public",
"String",
"getFormattedDateTime",
"(",
"long",
"dt",
",",
"String",
"format",
",",
"long",
"tolerance",
")",
"{",
"return",
"getFormattedDateTime",
"(",
"dt",
",",
"format",
",",
"true",
",",
"tolerance",
")",
";",
"}"
] | Returns the given date formatted using the given format.
@param dt The date to be formatted
@param format The format to use to display the date
@param tolerance The tolerance for the date to be formatted
@return The given date formatted using the given format | [
"Returns",
"the",
"given",
"date",
"formatted",
"using",
"the",
"given",
"format",
"."
] | train | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/FormatUtilities.java#L121-L124 |
looly/hutool | hutool-http/src/main/java/cn/hutool/http/HttpConnection.java | HttpConnection.setHttpsInfo | public HttpConnection setHttpsInfo(HostnameVerifier hostnameVerifier, SSLSocketFactory ssf) throws HttpException {
"""
设置https请求参数<br>
有些时候htts请求会出现com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl的实现,此为sun内部api,按照普通http请求处理
@param hostnameVerifier 域名验证器,非https传入null
@param ssf SSLSocketFa... | java | public HttpConnection setHttpsInfo(HostnameVerifier hostnameVerifier, SSLSocketFactory ssf) throws HttpException {
final HttpURLConnection conn = this.conn;
if (conn instanceof HttpsURLConnection) {
// Https请求
final HttpsURLConnection httpsConn = (HttpsURLConnection) conn;
// 验证域
httpsConn.setHo... | [
"public",
"HttpConnection",
"setHttpsInfo",
"(",
"HostnameVerifier",
"hostnameVerifier",
",",
"SSLSocketFactory",
"ssf",
")",
"throws",
"HttpException",
"{",
"final",
"HttpURLConnection",
"conn",
"=",
"this",
".",
"conn",
";",
"if",
"(",
"conn",
"instanceof",
"Https... | 设置https请求参数<br>
有些时候htts请求会出现com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl的实现,此为sun内部api,按照普通http请求处理
@param hostnameVerifier 域名验证器,非https传入null
@param ssf SSLSocketFactory,非https传入null
@return this
@throws HttpException KeyManagementException和NoSuchAlgorithmException异常包装 | [
"设置https请求参数<br",
">",
"有些时候htts请求会出现com",
".",
"sun",
".",
"net",
".",
"ssl",
".",
"internal",
".",
"www",
".",
"protocol",
".",
"https",
".",
"HttpsURLConnectionOldImpl的实现,此为sun内部api,按照普通http请求处理"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HttpConnection.java#L261-L285 |
Jasig/uPortal | uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/ReferenceCompositeGroupService.java | ReferenceCompositeGroupService.getGroupMember | @Override
public IGroupMember getGroupMember(String key, Class type) throws GroupsException {
"""
Returns an <code>IGroupMember</code> representing either a group or a portal entity. If the
parm <code>type</code> is the group type, the <code>IGroupMember</code> is an <code>
IEntityGroup</code> else it is an ... | java | @Override
public IGroupMember getGroupMember(String key, Class type) throws GroupsException {
IGroupMember gm = null;
if (type == ICompositeGroupService.GROUP_ENTITY_TYPE) gm = findGroup(key);
else gm = getEntity(key, type);
return gm;
} | [
"@",
"Override",
"public",
"IGroupMember",
"getGroupMember",
"(",
"String",
"key",
",",
"Class",
"type",
")",
"throws",
"GroupsException",
"{",
"IGroupMember",
"gm",
"=",
"null",
";",
"if",
"(",
"type",
"==",
"ICompositeGroupService",
".",
"GROUP_ENTITY_TYPE",
"... | Returns an <code>IGroupMember</code> representing either a group or a portal entity. If the
parm <code>type</code> is the group type, the <code>IGroupMember</code> is an <code>
IEntityGroup</code> else it is an <code>IEntity</code>. | [
"Returns",
"an",
"<code",
">",
"IGroupMember<",
"/",
"code",
">",
"representing",
"either",
"a",
"group",
"or",
"a",
"portal",
"entity",
".",
"If",
"the",
"parm",
"<code",
">",
"type<",
"/",
"code",
">",
"is",
"the",
"group",
"type",
"the",
"<code",
">... | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/ReferenceCompositeGroupService.java#L135-L141 |
buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/cache/TransactionalCache.java | TransactionalCache.get | public Object get(Id id, Mode mode) {
"""
Lookup an instance in the cache identified by its id.
@param id
The id.
@param mode
The mode.
@return The corresponding instance or <code>null</code> if no instance is
available.
"""
Object value = writeCache.get(id);
if (value == null) {
... | java | public Object get(Id id, Mode mode) {
Object value = writeCache.get(id);
if (value == null) {
value = readCache.get(new CacheKey(id));
if (value != null && Mode.WRITE.equals(mode)) {
writeCache.put(id, value);
}
}
return value;
} | [
"public",
"Object",
"get",
"(",
"Id",
"id",
",",
"Mode",
"mode",
")",
"{",
"Object",
"value",
"=",
"writeCache",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"value",
"=",
"readCache",
".",
"get",
"(",
"new",
"Cach... | Lookup an instance in the cache identified by its id.
@param id
The id.
@param mode
The mode.
@return The corresponding instance or <code>null</code> if no instance is
available. | [
"Lookup",
"an",
"instance",
"in",
"the",
"cache",
"identified",
"by",
"its",
"id",
"."
] | train | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/cache/TransactionalCache.java#L83-L92 |
protobufel/protobuf-el | protobufel/src/main/java/com/github/protobufel/RepeatedFieldBuilder.java | RepeatedFieldBuilder.getMessage | private MType getMessage(final int index, final boolean forBuild) {
"""
Get the message at the specified index. If the message is currently stored as a {@code Builder}
, it is converted to a {@code Message} by calling {@link Message.Builder#buildPartial} on it.
@param index the index of the message to get
@pa... | java | private MType getMessage(final int index, final boolean forBuild) {
if (this.builders == null) {
// We don't have any builders -- return the current Message.
// This is the case where no builder was created, so we MUST have a
// Message.
return messages.get(index);
}
final S... | [
"private",
"MType",
"getMessage",
"(",
"final",
"int",
"index",
",",
"final",
"boolean",
"forBuild",
")",
"{",
"if",
"(",
"this",
".",
"builders",
"==",
"null",
")",
"{",
"// We don't have any builders -- return the current Message.\r",
"// This is the case where no bui... | Get the message at the specified index. If the message is currently stored as a {@code Builder}
, it is converted to a {@code Message} by calling {@link Message.Builder#buildPartial} on it.
@param index the index of the message to get
@param forBuild this is being called for build so we want to make sure we
SingleFiel... | [
"Get",
"the",
"message",
"at",
"the",
"specified",
"index",
".",
"If",
"the",
"message",
"is",
"currently",
"stored",
"as",
"a",
"{",
"@code",
"Builder",
"}",
"it",
"is",
"converted",
"to",
"a",
"{",
"@code",
"Message",
"}",
"by",
"calling",
"{",
"@lin... | train | https://github.com/protobufel/protobuf-el/blob/3a600e2f7a8e74b637f44eee0331ef6e57e7441c/protobufel/src/main/java/com/github/protobufel/RepeatedFieldBuilder.java#L215-L233 |
rundeck/rundeck | examples/example-java-step-plugin/src/main/java/com/dtolabs/rundeck/plugin/example/ExampleNodeStepPlugin.java | ExampleNodeStepPlugin.executeNodeStep | public void executeNodeStep(final PluginStepContext context,
final Map<String, Object> configuration,
final INodeEntry entry) throws NodeStepException {
"""
The {@link #performNodeStep(com.dtolabs.rundeck.plugins.step.PluginStepContext,
com.dtolabs.r... | java | public void executeNodeStep(final PluginStepContext context,
final Map<String, Object> configuration,
final INodeEntry entry) throws NodeStepException {
System.out.println("Example node step executing on node: " + entry.getNodename());
Sys... | [
"public",
"void",
"executeNodeStep",
"(",
"final",
"PluginStepContext",
"context",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"configuration",
",",
"final",
"INodeEntry",
"entry",
")",
"throws",
"NodeStepException",
"{",
"System",
".",
"out",
".",
... | The {@link #performNodeStep(com.dtolabs.rundeck.plugins.step.PluginStepContext,
com.dtolabs.rundeck.core.common.INodeEntry)} method is invoked when your plugin should perform its logic for the
appropriate node. The {@link PluginStepContext} provides access to the configuration of the plugin, and details
about the step... | [
"The",
"{"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/examples/example-java-step-plugin/src/main/java/com/dtolabs/rundeck/plugin/example/ExampleNodeStepPlugin.java#L129-L141 |
OpenTSDB/opentsdb | src/tools/Fsck.java | Fsck.runFullTable | public void runFullTable() throws Exception {
"""
Fetches the max metric ID and splits the data table up amongst threads on
a naive split. By default we execute cores * 2 threads but the user can
specify more or fewer.
@throws Exception If something goes pear shaped.
"""
LOG.info("Starting full table sc... | java | public void runFullTable() throws Exception {
LOG.info("Starting full table scan");
final long start_time = System.currentTimeMillis() / 1000;
final int workers = options.threads() > 0 ? options.threads() :
Runtime.getRuntime().availableProcessors() * 2;
final List<Scanner> scanners = CliUtils.ge... | [
"public",
"void",
"runFullTable",
"(",
")",
"throws",
"Exception",
"{",
"LOG",
".",
"info",
"(",
"\"Starting full table scan\"",
")",
";",
"final",
"long",
"start_time",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"/",
"1000",
";",
"final",
"int",
"wo... | Fetches the max metric ID and splits the data table up amongst threads on
a naive split. By default we execute cores * 2 threads but the user can
specify more or fewer.
@throws Exception If something goes pear shaped. | [
"Fetches",
"the",
"max",
"metric",
"ID",
"and",
"splits",
"the",
"data",
"table",
"up",
"amongst",
"threads",
"on",
"a",
"naive",
"split",
".",
"By",
"default",
"we",
"execute",
"cores",
"*",
"2",
"threads",
"but",
"the",
"user",
"can",
"specify",
"more"... | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/Fsck.java#L147-L175 |
pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/WriteQueue.java | WriteQueue.calculateFillRatio | private static double calculateFillRatio(long totalLength, int size) {
"""
Calculates the FillRatio, which is a number between [0, 1] that represents the average fill of each
write with respect to the maximum BookKeeper write allowance.
@param totalLength Total length of the writes.
@param size Total number of ... | java | private static double calculateFillRatio(long totalLength, int size) {
if (size > 0) {
return Math.min(1, (double) totalLength / size / BookKeeperConfig.MAX_APPEND_LENGTH);
} else {
return 0;
}
} | [
"private",
"static",
"double",
"calculateFillRatio",
"(",
"long",
"totalLength",
",",
"int",
"size",
")",
"{",
"if",
"(",
"size",
">",
"0",
")",
"{",
"return",
"Math",
".",
"min",
"(",
"1",
",",
"(",
"double",
")",
"totalLength",
"/",
"size",
"/",
"B... | Calculates the FillRatio, which is a number between [0, 1] that represents the average fill of each
write with respect to the maximum BookKeeper write allowance.
@param totalLength Total length of the writes.
@param size Total number of writes. | [
"Calculates",
"the",
"FillRatio",
"which",
"is",
"a",
"number",
"between",
"[",
"0",
"1",
"]",
"that",
"represents",
"the",
"average",
"fill",
"of",
"each",
"write",
"with",
"respect",
"to",
"the",
"maximum",
"BookKeeper",
"write",
"allowance",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/WriteQueue.java#L204-L210 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderTransaction.java | SpiderTransaction.addScalarValueColumn | public void addScalarValueColumn(TableDefinition tableDef, String objID, String fieldName, String fieldValue) {
"""
Add the column needed to add or replace the given scalar field belonging to the
object with the given ID in the given table.
@param tableDef {@link TableDefinition} of table that owns object... | java | public void addScalarValueColumn(TableDefinition tableDef, String objID, String fieldName, String fieldValue) {
addColumn(SpiderService.objectsStoreName(tableDef),
objID,
fieldName,
SpiderService.scalarValueToBinary(tableDef, fieldName, fieldValue));
... | [
"public",
"void",
"addScalarValueColumn",
"(",
"TableDefinition",
"tableDef",
",",
"String",
"objID",
",",
"String",
"fieldName",
",",
"String",
"fieldValue",
")",
"{",
"addColumn",
"(",
"SpiderService",
".",
"objectsStoreName",
"(",
"tableDef",
")",
",",
"objID",... | Add the column needed to add or replace the given scalar field belonging to the
object with the given ID in the given table.
@param tableDef {@link TableDefinition} of table that owns object.
@param objID ID of object.
@param fieldName Name of scalar field being added.
@param fieldValue Value being... | [
"Add",
"the",
"column",
"needed",
"to",
"add",
"or",
"replace",
"the",
"given",
"scalar",
"field",
"belonging",
"to",
"the",
"object",
"with",
"the",
"given",
"ID",
"in",
"the",
"given",
"table",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderTransaction.java#L267-L272 |
ArcadiaConsulting/javapns-json-refactor | src/main/java/javapns/notification/PushNotificationManager.java | PushNotificationManager.initializeConnection | public void initializeConnection(AppleNotificationServer server) throws CommunicationException, KeystoreException {
"""
Initialize a connection and create a SSLSocket
@param server The Apple server to connect to.
@throws CommunicationException thrown if a communication error occurs
@throws KeystoreException thr... | java | public void initializeConnection(AppleNotificationServer server) throws CommunicationException, KeystoreException {
try {
this.connectionToAppleServer = new ConnectionToNotificationServer(server);
this.socket = connectionToAppleServer.getSSLSocket();
if (heavyDebugMode) {
dumpCertificateChainDescr... | [
"public",
"void",
"initializeConnection",
"(",
"AppleNotificationServer",
"server",
")",
"throws",
"CommunicationException",
",",
"KeystoreException",
"{",
"try",
"{",
"this",
".",
"connectionToAppleServer",
"=",
"new",
"ConnectionToNotificationServer",
"(",
"server",
")"... | Initialize a connection and create a SSLSocket
@param server The Apple server to connect to.
@throws CommunicationException thrown if a communication error occurs
@throws KeystoreException thrown if there is a problem with your keystore | [
"Initialize",
"a",
"connection",
"and",
"create",
"a",
"SSLSocket"
] | train | https://github.com/ArcadiaConsulting/javapns-json-refactor/blob/293575ceda910b9c74733d2f6b963dff5302d859/src/main/java/javapns/notification/PushNotificationManager.java#L103-L119 |
Impetus/Kundera | src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/query/ResultIterator.java | ResultIterator.setRelationEntities | private E setRelationEntities(Object enhanceEntity, Client client, EntityMetadata m) {
"""
Sets the relation entities.
@param enhanceEntity
the enhance entity
@param client
the client
@param m
the m
@return the e
"""
E result = null;
if (enhanceEntity != null)
{
if ... | java | private E setRelationEntities(Object enhanceEntity, Client client, EntityMetadata m)
{
E result = null;
if (enhanceEntity != null)
{
if (!(enhanceEntity instanceof EnhanceEntity))
{
enhanceEntity = new EnhanceEntity(enhanceEntity, PropertyAccessorHelpe... | [
"private",
"E",
"setRelationEntities",
"(",
"Object",
"enhanceEntity",
",",
"Client",
"client",
",",
"EntityMetadata",
"m",
")",
"{",
"E",
"result",
"=",
"null",
";",
"if",
"(",
"enhanceEntity",
"!=",
"null",
")",
"{",
"if",
"(",
"!",
"(",
"enhanceEntity",... | Sets the relation entities.
@param enhanceEntity
the enhance entity
@param client
the client
@param m
the m
@return the e | [
"Sets",
"the",
"relation",
"entities",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/query/ResultIterator.java#L175-L191 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.