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 |
|---|---|---|---|---|---|---|---|---|---|---|
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.toLineString | public LineString toLineString(List<LatLng> latLngs, boolean hasZ,
boolean hasM) {
"""
Convert a list of {@link LatLng} to a {@link LineString}
@param latLngs lat lngs
@param hasZ has z flag
@param hasM has m flag
@return line string
"""
LineString lineSt... | java | public LineString toLineString(List<LatLng> latLngs, boolean hasZ,
boolean hasM) {
LineString lineString = new LineString(hasZ, hasM);
populateLineString(lineString, latLngs);
return lineString;
} | [
"public",
"LineString",
"toLineString",
"(",
"List",
"<",
"LatLng",
">",
"latLngs",
",",
"boolean",
"hasZ",
",",
"boolean",
"hasM",
")",
"{",
"LineString",
"lineString",
"=",
"new",
"LineString",
"(",
"hasZ",
",",
"hasM",
")",
";",
"populateLineString",
"(",... | Convert a list of {@link LatLng} to a {@link LineString}
@param latLngs lat lngs
@param hasZ has z flag
@param hasM has m flag
@return line string | [
"Convert",
"a",
"list",
"of",
"{",
"@link",
"LatLng",
"}",
"to",
"a",
"{",
"@link",
"LineString",
"}"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L347-L355 |
sdl/odata | odata_renderer/src/main/java/com/sdl/odata/renderer/json/writer/JsonWriter.java | JsonWriter.marshallEnum | private void marshallEnum(Object value, EnumType enumType) throws IOException {
"""
Marshall an enum value.
@param value The value to marshall. Can be {@code null}.
@param enumType The OData enum type.
"""
LOG.trace("Enum value: {} of type: {}", value, enumType);
jsonGenerator.writeStrin... | java | private void marshallEnum(Object value, EnumType enumType) throws IOException {
LOG.trace("Enum value: {} of type: {}", value, enumType);
jsonGenerator.writeString(value.toString());
} | [
"private",
"void",
"marshallEnum",
"(",
"Object",
"value",
",",
"EnumType",
"enumType",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"trace",
"(",
"\"Enum value: {} of type: {}\"",
",",
"value",
",",
"enumType",
")",
";",
"jsonGenerator",
".",
"writeString",
"... | Marshall an enum value.
@param value The value to marshall. Can be {@code null}.
@param enumType The OData enum type. | [
"Marshall",
"an",
"enum",
"value",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/json/writer/JsonWriter.java#L446-L449 |
apache/groovy | src/main/java/org/apache/groovy/util/SystemUtil.java | SystemUtil.getSystemPropertySafe | public static String getSystemPropertySafe(String name, String defaultValue) {
"""
Retrieves a System property, or returns some default value if:
<ul>
<li>the property isn't found</li>
<li>the property name is null or empty</li>
<li>if a security manager exists and its checkPropertyAccess method doesn't allow ... | java | public static String getSystemPropertySafe(String name, String defaultValue) {
try {
return System.getProperty(name, defaultValue);
} catch (SecurityException | NullPointerException | IllegalArgumentException ignore) {
// suppress exception
}
return defaultValue;
... | [
"public",
"static",
"String",
"getSystemPropertySafe",
"(",
"String",
"name",
",",
"String",
"defaultValue",
")",
"{",
"try",
"{",
"return",
"System",
".",
"getProperty",
"(",
"name",
",",
"defaultValue",
")",
";",
"}",
"catch",
"(",
"SecurityException",
"|",
... | Retrieves a System property, or returns some default value if:
<ul>
<li>the property isn't found</li>
<li>the property name is null or empty</li>
<li>if a security manager exists and its checkPropertyAccess method doesn't allow access to the specified system property.</li>
</ul>
@param name the name of the sys... | [
"Retrieves",
"a",
"System",
"property",
"or",
"returns",
"some",
"default",
"value",
"if",
":",
"<ul",
">",
"<li",
">",
"the",
"property",
"isn",
"t",
"found<",
"/",
"li",
">",
"<li",
">",
"the",
"property",
"name",
"is",
"null",
"or",
"empty<",
"/",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/apache/groovy/util/SystemUtil.java#L79-L86 |
banq/jdonframework | src/main/java/com/jdon/util/UtilDateTime.java | UtilDateTime.toTimestamp | public static java.sql.Timestamp toTimestamp(String date, String time) {
"""
Converts a date String and a time String into a Timestamp
@param date
The date String: MM/DD/YYYY
@param time
The time String: either HH:MM or HH:MM:SS
@return A Timestamp made from the date and time Strings
"""
java.util.Da... | java | public static java.sql.Timestamp toTimestamp(String date, String time) {
java.util.Date newDate = toDate(date, time);
if (newDate != null)
return new java.sql.Timestamp(newDate.getTime());
else
return null;
} | [
"public",
"static",
"java",
".",
"sql",
".",
"Timestamp",
"toTimestamp",
"(",
"String",
"date",
",",
"String",
"time",
")",
"{",
"java",
".",
"util",
".",
"Date",
"newDate",
"=",
"toDate",
"(",
"date",
",",
"time",
")",
";",
"if",
"(",
"newDate",
"!=... | Converts a date String and a time String into a Timestamp
@param date
The date String: MM/DD/YYYY
@param time
The time String: either HH:MM or HH:MM:SS
@return A Timestamp made from the date and time Strings | [
"Converts",
"a",
"date",
"String",
"and",
"a",
"time",
"String",
"into",
"a",
"Timestamp"
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/UtilDateTime.java#L230-L237 |
jaxio/celerio | celerio-engine/src/main/java/com/jaxio/celerio/util/IOUtil.java | IOUtil.stringToOutputStream | public void stringToOutputStream(String content, OutputStream out) throws IOException {
"""
Save a string to a file.
@param content the string to be written to file
"""
out.write(content.getBytes());
out.close();
} | java | public void stringToOutputStream(String content, OutputStream out) throws IOException {
out.write(content.getBytes());
out.close();
} | [
"public",
"void",
"stringToOutputStream",
"(",
"String",
"content",
",",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"out",
".",
"write",
"(",
"content",
".",
"getBytes",
"(",
")",
")",
";",
"out",
".",
"close",
"(",
")",
";",
"}"
] | Save a string to a file.
@param content the string to be written to file | [
"Save",
"a",
"string",
"to",
"a",
"file",
"."
] | train | https://github.com/jaxio/celerio/blob/fbfacb639e286f9f3f3a18986f74ea275bebd887/celerio-engine/src/main/java/com/jaxio/celerio/util/IOUtil.java#L82-L85 |
DJCordhose/jmte | src/com/floreysoft/jmte/TemplateContext.java | TemplateContext.notifyProcessListener | public void notifyProcessListener(Token token, Action action) {
"""
Allows you to send additional notifications of executed processing steps.
@param token
the token that is handled
@param action
the action that is executed on the action
"""
if (processListener != null) {
processListener.log(this, ... | java | public void notifyProcessListener(Token token, Action action) {
if (processListener != null) {
processListener.log(this, token, action);
}
} | [
"public",
"void",
"notifyProcessListener",
"(",
"Token",
"token",
",",
"Action",
"action",
")",
"{",
"if",
"(",
"processListener",
"!=",
"null",
")",
"{",
"processListener",
".",
"log",
"(",
"this",
",",
"token",
",",
"action",
")",
";",
"}",
"}"
] | Allows you to send additional notifications of executed processing steps.
@param token
the token that is handled
@param action
the action that is executed on the action | [
"Allows",
"you",
"to",
"send",
"additional",
"notifications",
"of",
"executed",
"processing",
"steps",
"."
] | train | https://github.com/DJCordhose/jmte/blob/7334e6d111cc2198c5cf69ee336584ab9e192fe5/src/com/floreysoft/jmte/TemplateContext.java#L100-L104 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapAdapter.java | LdapAdapter.getAncestors | private void getAncestors(Entity entity, LdapEntry ldapEntry, AncestorControl ancesCtrl) throws WIMException {
"""
Method to get the ancestors of the given entity.
@param entity
@param ldapEntry
@param ancesCtrl
@throws WIMException
"""
if (ancesCtrl == null) {
return;
}
... | java | private void getAncestors(Entity entity, LdapEntry ldapEntry, AncestorControl ancesCtrl) throws WIMException {
if (ancesCtrl == null) {
return;
}
List<String> propNames = ancesCtrl.getProperties();
int level = ancesCtrl.getLevel();
List<String> ancesTypes = getEntity... | [
"private",
"void",
"getAncestors",
"(",
"Entity",
"entity",
",",
"LdapEntry",
"ldapEntry",
",",
"AncestorControl",
"ancesCtrl",
")",
"throws",
"WIMException",
"{",
"if",
"(",
"ancesCtrl",
"==",
"null",
")",
"{",
"return",
";",
"}",
"List",
"<",
"String",
">"... | Method to get the ancestors of the given entity.
@param entity
@param ldapEntry
@param ancesCtrl
@throws WIMException | [
"Method",
"to",
"get",
"the",
"ancestors",
"of",
"the",
"given",
"entity",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapAdapter.java#L2579-L2610 |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java | XMLEmitter.onProcessingInstruction | public void onProcessingInstruction (@Nonnull final String sTarget, @Nullable final String sData) {
"""
On processing instruction
@param sTarget
The target
@param sData
The data (attributes as a string)
"""
_append (PI_START)._append (sTarget);
if (StringHelper.hasText (sData))
_append (' '... | java | public void onProcessingInstruction (@Nonnull final String sTarget, @Nullable final String sData)
{
_append (PI_START)._append (sTarget);
if (StringHelper.hasText (sData))
_append (' ')._append (sData);
_append (PI_END);
newLine ();
} | [
"public",
"void",
"onProcessingInstruction",
"(",
"@",
"Nonnull",
"final",
"String",
"sTarget",
",",
"@",
"Nullable",
"final",
"String",
"sData",
")",
"{",
"_append",
"(",
"PI_START",
")",
".",
"_append",
"(",
"sTarget",
")",
";",
"if",
"(",
"StringHelper",
... | On processing instruction
@param sTarget
The target
@param sData
The data (attributes as a string) | [
"On",
"processing",
"instruction"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/serialize/write/XMLEmitter.java#L392-L399 |
PinaeOS/nala | src/main/java/org/pinae/nala/xb/marshal/parser/ObjectParser.java | ObjectParser.parseNodeValue | protected NodeConfig parseNodeValue(String fieldType, String name, Object value) {
"""
根据字段类型解析对象值并构造节点
@param fieldType 字段类型
@param name 节点配置名称
@param value 节点配置值
@return 节点配置信息
"""
value = parseValue(fieldType, value);
if (value != null) {
NodeConfig nodeConfig = new NodeConfig();
nodeConfi... | java | protected NodeConfig parseNodeValue(String fieldType, String name, Object value) {
value = parseValue(fieldType, value);
if (value != null) {
NodeConfig nodeConfig = new NodeConfig();
nodeConfig.setName(name);
nodeConfig.setValue(value.toString());
return nodeConfig;
}
return null;
} | [
"protected",
"NodeConfig",
"parseNodeValue",
"(",
"String",
"fieldType",
",",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"value",
"=",
"parseValue",
"(",
"fieldType",
",",
"value",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"NodeConfig"... | 根据字段类型解析对象值并构造节点
@param fieldType 字段类型
@param name 节点配置名称
@param value 节点配置值
@return 节点配置信息 | [
"根据字段类型解析对象值并构造节点"
] | train | https://github.com/PinaeOS/nala/blob/2047ade4af197cec938278d300d111ea94af6fbf/src/main/java/org/pinae/nala/xb/marshal/parser/ObjectParser.java#L97-L106 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/detect/DuplicateBranches.java | DuplicateBranches.getDeepFirstInstruction | private static InstructionHandle getDeepFirstInstruction(CFG cfg, BasicBlock bb) {
"""
Like bb.getFirstInstruction() except that if null is returned it will
follow the FALL_THROUGH_EDGE (if any)
"""
InstructionHandle ih = bb.getFirstInstruction();
if (ih != null) {
return ih;
... | java | private static InstructionHandle getDeepFirstInstruction(CFG cfg, BasicBlock bb) {
InstructionHandle ih = bb.getFirstInstruction();
if (ih != null) {
return ih;
}
Iterator<Edge> iei = cfg.outgoingEdgeIterator(bb);
while (iei.hasNext()) {
Edge e = iei.next(... | [
"private",
"static",
"InstructionHandle",
"getDeepFirstInstruction",
"(",
"CFG",
"cfg",
",",
"BasicBlock",
"bb",
")",
"{",
"InstructionHandle",
"ih",
"=",
"bb",
".",
"getFirstInstruction",
"(",
")",
";",
"if",
"(",
"ih",
"!=",
"null",
")",
"{",
"return",
"ih... | Like bb.getFirstInstruction() except that if null is returned it will
follow the FALL_THROUGH_EDGE (if any) | [
"Like",
"bb",
".",
"getFirstInstruction",
"()",
"except",
"that",
"if",
"null",
"is",
"returned",
"it",
"will",
"follow",
"the",
"FALL_THROUGH_EDGE",
"(",
"if",
"any",
")"
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/DuplicateBranches.java#L181-L194 |
samskivert/samskivert | src/main/java/com/samskivert/util/IntIntMap.java | IntIntMap.getOrElse | public int getOrElse (int key, int defval) {
"""
Returns the value mapped to the specified key or the supplied default value if there is no
mapping.
"""
Record rec = locateRecord(key);
return (rec == null) ? defval : rec.value;
} | java | public int getOrElse (int key, int defval)
{
Record rec = locateRecord(key);
return (rec == null) ? defval : rec.value;
} | [
"public",
"int",
"getOrElse",
"(",
"int",
"key",
",",
"int",
"defval",
")",
"{",
"Record",
"rec",
"=",
"locateRecord",
"(",
"key",
")",
";",
"return",
"(",
"rec",
"==",
"null",
")",
"?",
"defval",
":",
"rec",
".",
"value",
";",
"}"
] | Returns the value mapped to the specified key or the supplied default value if there is no
mapping. | [
"Returns",
"the",
"value",
"mapped",
"to",
"the",
"specified",
"key",
"or",
"the",
"supplied",
"default",
"value",
"if",
"there",
"is",
"no",
"mapping",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/IntIntMap.java#L120-L124 |
jboss/jboss-jstl-api_spec | src/main/java/javax/servlet/jsp/jstl/core/Config.java | Config.get | public static Object get(ServletContext context, String name) {
"""
Looks up a configuration variable in the "application" scope.
<p> The lookup of configuration variables is performed as if each scope
had its own name space, that is, the same configuration variable name
in one scope does not replace one stored... | java | public static Object get(ServletContext context, String name) {
return context.getAttribute(name + APPLICATION_SCOPE_SUFFIX);
} | [
"public",
"static",
"Object",
"get",
"(",
"ServletContext",
"context",
",",
"String",
"name",
")",
"{",
"return",
"context",
".",
"getAttribute",
"(",
"name",
"+",
"APPLICATION_SCOPE_SUFFIX",
")",
";",
"}"
] | Looks up a configuration variable in the "application" scope.
<p> The lookup of configuration variables is performed as if each scope
had its own name space, that is, the same configuration variable name
in one scope does not replace one stored in a different scope.
@param context Servlet context in which the configur... | [
"Looks",
"up",
"a",
"configuration",
"variable",
"in",
"the",
"application",
"scope",
".",
"<p",
">",
"The",
"lookup",
"of",
"configuration",
"variables",
"is",
"performed",
"as",
"if",
"each",
"scope",
"had",
"its",
"own",
"name",
"space",
"that",
"is",
"... | train | https://github.com/jboss/jboss-jstl-api_spec/blob/4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c/src/main/java/javax/servlet/jsp/jstl/core/Config.java#L165-L167 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/DPathUtils.java | DPathUtils.setValue | public static void setValue(JsonNode node, String dPath, Object value) {
"""
Set a value to the target {@link JsonNode} specified by DPath expression.
<p>
Note: intermediated nodes will NOT be created.
</p>
<p>
Note: if {@code value} is {@code null}:
<ul>
<li>If the specified item's parent is an {@link ... | java | public static void setValue(JsonNode node, String dPath, Object value) {
setValue(node, dPath, value, false);
} | [
"public",
"static",
"void",
"setValue",
"(",
"JsonNode",
"node",
",",
"String",
"dPath",
",",
"Object",
"value",
")",
"{",
"setValue",
"(",
"node",
",",
"dPath",
",",
"value",
",",
"false",
")",
";",
"}"
] | Set a value to the target {@link JsonNode} specified by DPath expression.
<p>
Note: intermediated nodes will NOT be created.
</p>
<p>
Note: if {@code value} is {@code null}:
<ul>
<li>If the specified item's parent is an {@link ArrayNode}, the item
(specified by {@code dPath}) will be set to {@code null}.</li>
<li>If ... | [
"Set",
"a",
"value",
"to",
"the",
"target",
"{",
"@link",
"JsonNode",
"}",
"specified",
"by",
"DPath",
"expression",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/DPathUtils.java#L829-L831 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/Path.java | Path.lineTo | public void lineTo(float x, float y) {
"""
Add a line to the contour or hole which ends at the specified
location.
@param x The x coordinate to draw the line to
@param y The y coordiante to draw the line to
"""
if (hole != null) {
hole.add(new float[] {x,y});
} else {
localPoints.add(new flo... | java | public void lineTo(float x, float y) {
if (hole != null) {
hole.add(new float[] {x,y});
} else {
localPoints.add(new float[] {x,y});
}
cx = x;
cy = y;
pointsDirty = true;
} | [
"public",
"void",
"lineTo",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"if",
"(",
"hole",
"!=",
"null",
")",
"{",
"hole",
".",
"add",
"(",
"new",
"float",
"[",
"]",
"{",
"x",
",",
"y",
"}",
")",
";",
"}",
"else",
"{",
"localPoints",
".",... | Add a line to the contour or hole which ends at the specified
location.
@param x The x coordinate to draw the line to
@param y The y coordiante to draw the line to | [
"Add",
"a",
"line",
"to",
"the",
"contour",
"or",
"hole",
"which",
"ends",
"at",
"the",
"specified",
"location",
"."
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/Path.java#L56-L65 |
knightliao/disconf | disconf-web/src/main/java/com/baidu/unbiz/common/genericdao/dao/GenericDao.java | GenericDao.count | public int count(List<Match> matches) {
"""
查询符合条件组合的记录数
@param matches
@return 2013-8-26 下午3:04:02 created by wangchongjie
"""
Query query = queryGenerator.getCountQuery(matches);
// 执行操作
String sql = query.getSql();
return countBySQL(sql, query.getParams());
} | java | public int count(List<Match> matches) {
Query query = queryGenerator.getCountQuery(matches);
// 执行操作
String sql = query.getSql();
return countBySQL(sql, query.getParams());
} | [
"public",
"int",
"count",
"(",
"List",
"<",
"Match",
">",
"matches",
")",
"{",
"Query",
"query",
"=",
"queryGenerator",
".",
"getCountQuery",
"(",
"matches",
")",
";",
"// 执行操作",
"String",
"sql",
"=",
"query",
".",
"getSql",
"(",
")",
";",
"return",
"c... | 查询符合条件组合的记录数
@param matches
@return 2013-8-26 下午3:04:02 created by wangchongjie | [
"查询符合条件组合的记录数"
] | train | https://github.com/knightliao/disconf/blob/d413cbce9334fe38a5a24982ce4db3a6ed8e98ea/disconf-web/src/main/java/com/baidu/unbiz/common/genericdao/dao/GenericDao.java#L200-L206 |
amzn/ion-java | src/com/amazon/ion/impl/IonUTF8.java | IonUTF8.convertToUTF8Bytes | public final static int convertToUTF8Bytes(int unicodeScalar, byte[] outputBytes, int offset, int maxLength) {
"""
this helper converts the unicodeScalar to a sequence of utf8 bytes
and copies those bytes into the supplied outputBytes array. If there
is insufficient room in the array to hold the generated bytes... | java | public final static int convertToUTF8Bytes(int unicodeScalar, byte[] outputBytes, int offset, int maxLength)
{
int dst = offset;
int end = offset + maxLength;
switch (getUTF8ByteCount(unicodeScalar)) {
case 1:
if (dst >= end) throw new ArrayIndexOutOfBoundsException();
... | [
"public",
"final",
"static",
"int",
"convertToUTF8Bytes",
"(",
"int",
"unicodeScalar",
",",
"byte",
"[",
"]",
"outputBytes",
",",
"int",
"offset",
",",
"int",
"maxLength",
")",
"{",
"int",
"dst",
"=",
"offset",
";",
"int",
"end",
"=",
"offset",
"+",
"max... | this helper converts the unicodeScalar to a sequence of utf8 bytes
and copies those bytes into the supplied outputBytes array. If there
is insufficient room in the array to hold the generated bytes it will
throw an ArrayIndexOutOfBoundsException. It does not check for the
validity of the passed in unicodeScalar thoro... | [
"this",
"helper",
"converts",
"the",
"unicodeScalar",
"to",
"a",
"sequence",
"of",
"utf8",
"bytes",
"and",
"copies",
"those",
"bytes",
"into",
"the",
"supplied",
"outputBytes",
"array",
".",
"If",
"there",
"is",
"insufficient",
"room",
"in",
"the",
"array",
... | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonUTF8.java#L209-L239 |
apache/incubator-gobblin | gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/InnerMetricContext.java | InnerMetricContext.getGauges | @Override
public SortedMap<String, Gauge> getGauges(MetricFilter filter) {
"""
See {@link com.codahale.metrics.MetricRegistry#getGauges(com.codahale.metrics.MetricFilter)}.
<p>
This method will return fully-qualified metric names if the {@link MetricContext} is configured
to report fully-qualified metric na... | java | @Override
public SortedMap<String, Gauge> getGauges(MetricFilter filter) {
return getSimplyNamedMetrics(Gauge.class, Optional.of(filter));
} | [
"@",
"Override",
"public",
"SortedMap",
"<",
"String",
",",
"Gauge",
">",
"getGauges",
"(",
"MetricFilter",
"filter",
")",
"{",
"return",
"getSimplyNamedMetrics",
"(",
"Gauge",
".",
"class",
",",
"Optional",
".",
"of",
"(",
"filter",
")",
")",
";",
"}"
] | See {@link com.codahale.metrics.MetricRegistry#getGauges(com.codahale.metrics.MetricFilter)}.
<p>
This method will return fully-qualified metric names if the {@link MetricContext} is configured
to report fully-qualified metric names.
</p> | [
"See",
"{",
"@link",
"com",
".",
"codahale",
".",
"metrics",
".",
"MetricRegistry#getGauges",
"(",
"com",
".",
"codahale",
".",
"metrics",
".",
"MetricFilter",
")",
"}",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/InnerMetricContext.java#L190-L193 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/Pattern.java | Pattern.matchMiddle | public boolean matchMiddle(char[] chars, int start, int end) {
"""
Match a sequence of characters against the midClauses of this pattern
"""
if (midClauses == null)
return true;
int[] cursor = new int[] {start, end};
for (int i = 0; i < midClauses.length; i++) {
Clause clause = midClaus... | java | public boolean matchMiddle(char[] chars, int start, int end) {
if (midClauses == null)
return true;
int[] cursor = new int[] {start, end};
for (int i = 0; i < midClauses.length; i++) {
Clause clause = midClauses[i];
if (!find(clause, chars, cursor))
return false;
}
return t... | [
"public",
"boolean",
"matchMiddle",
"(",
"char",
"[",
"]",
"chars",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"if",
"(",
"midClauses",
"==",
"null",
")",
"return",
"true",
";",
"int",
"[",
"]",
"cursor",
"=",
"new",
"int",
"[",
"]",
"{",
... | Match a sequence of characters against the midClauses of this pattern | [
"Match",
"a",
"sequence",
"of",
"characters",
"against",
"the",
"midClauses",
"of",
"this",
"pattern"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/Pattern.java#L232-L242 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java | BusGroup.sendToNeighbours | protected void sendToNeighbours(SubscriptionMessage msg, Transaction transaction, boolean startup)
throws SIResourceException {
"""
Sends the messages to all the Neighbours in this Bus.
@param transaction The transaction to send the message under
@param msg The message to be sent.
"""
if (TraceCo... | java | protected void sendToNeighbours(SubscriptionMessage msg, Transaction transaction, boolean startup)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "sendToNeighbours", new Object[] { msg, transaction, new Boolean(startup)});
for (int i = ... | [
"protected",
"void",
"sendToNeighbours",
"(",
"SubscriptionMessage",
"msg",
",",
"Transaction",
"transaction",
",",
"boolean",
"startup",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
... | Sends the messages to all the Neighbours in this Bus.
@param transaction The transaction to send the message under
@param msg The message to be sent. | [
"Sends",
"the",
"messages",
"to",
"all",
"the",
"Neighbours",
"in",
"this",
"Bus",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java#L522-L542 |
app55/app55-java | src/support/java/com/googlecode/openbeans/Beans.java | Beans.instantiate | public static Object instantiate(ClassLoader cls, String beanName, BeanContext beanContext) throws IOException, ClassNotFoundException {
"""
Obtains an instance of a JavaBean specified the bean name using the specified class loader, and adds the instance into the specified bean context.
<p>
If the specified cl... | java | public static Object instantiate(ClassLoader cls, String beanName, BeanContext beanContext) throws IOException, ClassNotFoundException
{
return internalInstantiate(cls, beanName, beanContext, null);
} | [
"public",
"static",
"Object",
"instantiate",
"(",
"ClassLoader",
"cls",
",",
"String",
"beanName",
",",
"BeanContext",
"beanContext",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"return",
"internalInstantiate",
"(",
"cls",
",",
"beanName",
",",... | Obtains an instance of a JavaBean specified the bean name using the specified class loader, and adds the instance into the specified bean context.
<p>
If the specified class loader is null, the system class loader is used.
</p>
@param cls
the specified class loader. It can be null.
@param beanName
the name of the Jav... | [
"Obtains",
"an",
"instance",
"of",
"a",
"JavaBean",
"specified",
"the",
"bean",
"name",
"using",
"the",
"specified",
"class",
"loader",
"and",
"adds",
"the",
"instance",
"into",
"the",
"specified",
"bean",
"context",
"."
] | train | https://github.com/app55/app55-java/blob/73e51d0f3141a859dfbd37ca9becef98477e553e/src/support/java/com/googlecode/openbeans/Beans.java#L166-L170 |
jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java | ProtobufIDLProxy.generateProtobufDefinedForField | private static void generateProtobufDefinedForField(StringBuilder code, Field field, Set<String> enumNames) {
"""
to generate @Protobuf defined code for target field.
@param code the code
@param field the field
@param enumNames the enum names
"""
code.append("@").append(Protobuf.class.getSimpleNam... | java | private static void generateProtobufDefinedForField(StringBuilder code, Field field, Set<String> enumNames) {
code.append("@").append(Protobuf.class.getSimpleName()).append("(");
String fieldType = fieldTypeMapping.get(field.getType());
if (fieldType == null) {
if (enumNames.contain... | [
"private",
"static",
"void",
"generateProtobufDefinedForField",
"(",
"StringBuilder",
"code",
",",
"Field",
"field",
",",
"Set",
"<",
"String",
">",
"enumNames",
")",
"{",
"code",
".",
"append",
"(",
"\"@\"",
")",
".",
"append",
"(",
"Protobuf",
".",
"class"... | to generate @Protobuf defined code for target field.
@param code the code
@param field the field
@param enumNames the enum names | [
"to",
"generate",
"@Protobuf",
"defined",
"code",
"for",
"target",
"field",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java#L1372-L1393 |
lecho/hellocharts-android | hellocharts-library/src/lecho/lib/hellocharts/computator/ChartComputator.java | ChartComputator.setCurrentViewport | public void setCurrentViewport(float left, float top, float right, float bottom) {
"""
Set new values for curent viewport, that will change what part of chart is visible. Current viewport must be
equal or smaller than maximum viewport.
"""
constrainViewport(left, top, right, bottom);
} | java | public void setCurrentViewport(float left, float top, float right, float bottom) {
constrainViewport(left, top, right, bottom);
} | [
"public",
"void",
"setCurrentViewport",
"(",
"float",
"left",
",",
"float",
"top",
",",
"float",
"right",
",",
"float",
"bottom",
")",
"{",
"constrainViewport",
"(",
"left",
",",
"top",
",",
"right",
",",
"bottom",
")",
";",
"}"
] | Set new values for curent viewport, that will change what part of chart is visible. Current viewport must be
equal or smaller than maximum viewport. | [
"Set",
"new",
"values",
"for",
"curent",
"viewport",
"that",
"will",
"change",
"what",
"part",
"of",
"chart",
"is",
"visible",
".",
"Current",
"viewport",
"must",
"be",
"equal",
"or",
"smaller",
"than",
"maximum",
"viewport",
"."
] | train | https://github.com/lecho/hellocharts-android/blob/c41419c9afa097452dee823c7eba0e5136aa96bd/hellocharts-library/src/lecho/lib/hellocharts/computator/ChartComputator.java#L256-L258 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/dispatcher/DataContextUtils.java | DataContextUtils.replaceDataReferencesInArray | public static String[] replaceDataReferencesInArray(final String[] args, final Map<String, Map<String, String>> data, Converter<String, String> converter, boolean failIfUnexpanded) {
"""
Replace the embedded properties of the form '${key.name}' in the input Strings with the value from the data
context
@param ... | java | public static String[] replaceDataReferencesInArray(final String[] args, final Map<String, Map<String, String>> data, Converter<String, String> converter, boolean failIfUnexpanded) {
return replaceDataReferencesInArray(args, data, converter, failIfUnexpanded, false);
} | [
"public",
"static",
"String",
"[",
"]",
"replaceDataReferencesInArray",
"(",
"final",
"String",
"[",
"]",
"args",
",",
"final",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"String",
">",
">",
"data",
",",
"Converter",
"<",
"String",
",",
"Strin... | Replace the embedded properties of the form '${key.name}' in the input Strings with the value from the data
context
@param args argument string array
@param data data context
@param converter converter
@param failIfUnexpanded true to fail if property is not found
@return string array with replaced embedded properties | [
"Replace",
"the",
"embedded",
"properties",
"of",
"the",
"form",
"$",
"{",
"key",
".",
"name",
"}",
"in",
"the",
"input",
"Strings",
"with",
"the",
"value",
"from",
"the",
"data",
"context"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/dispatcher/DataContextUtils.java#L338-L340 |
apache/incubator-gobblin | gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java | FlowConfigResourceLocalHandler.createFlowSpecForConfig | public static FlowSpec createFlowSpecForConfig(FlowConfig flowConfig) {
"""
Build a {@link FlowSpec} from a {@link FlowConfig}
@param flowConfig flow configuration
@return {@link FlowSpec} created with attributes from flowConfig
"""
ConfigBuilder configBuilder = ConfigBuilder.create()
.addPrimiti... | java | public static FlowSpec createFlowSpecForConfig(FlowConfig flowConfig) {
ConfigBuilder configBuilder = ConfigBuilder.create()
.addPrimitive(ConfigurationKeys.FLOW_GROUP_KEY, flowConfig.getId().getFlowGroup())
.addPrimitive(ConfigurationKeys.FLOW_NAME_KEY, flowConfig.getId().getFlowName());
if (f... | [
"public",
"static",
"FlowSpec",
"createFlowSpecForConfig",
"(",
"FlowConfig",
"flowConfig",
")",
"{",
"ConfigBuilder",
"configBuilder",
"=",
"ConfigBuilder",
".",
"create",
"(",
")",
".",
"addPrimitive",
"(",
"ConfigurationKeys",
".",
"FLOW_GROUP_KEY",
",",
"flowConfi... | Build a {@link FlowSpec} from a {@link FlowConfig}
@param flowConfig flow configuration
@return {@link FlowSpec} created with attributes from flowConfig | [
"Build",
"a",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java#L197-L240 |
hdbeukel/james-extensions | src/main/java/org/jamesframework/ext/problems/objectives/WeightedIndex.java | WeightedIndex.removeObjective | public boolean removeObjective(Objective<? super SolutionType, ? super DataType> objective) {
"""
Remove an objective, if present. Returns <code>true</code> if the objective has been successfully
removed, <code>false</code> if it was not contained in the index.
@param objective objective to remove
@return <co... | java | public boolean removeObjective(Objective<? super SolutionType, ? super DataType> objective){
if(weights.containsKey(objective)){
weights.remove(objective);
return true;
} else {
return false;
}
} | [
"public",
"boolean",
"removeObjective",
"(",
"Objective",
"<",
"?",
"super",
"SolutionType",
",",
"?",
"super",
"DataType",
">",
"objective",
")",
"{",
"if",
"(",
"weights",
".",
"containsKey",
"(",
"objective",
")",
")",
"{",
"weights",
".",
"remove",
"("... | Remove an objective, if present. Returns <code>true</code> if the objective has been successfully
removed, <code>false</code> if it was not contained in the index.
@param objective objective to remove
@return <code>true</code> if the objective has been successfully removed | [
"Remove",
"an",
"objective",
"if",
"present",
".",
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"the",
"objective",
"has",
"been",
"successfully",
"removed",
"<code",
">",
"false<",
"/",
"code",
">",
"if",
"it",
"was",
"not",
"contained",
"i... | train | https://github.com/hdbeukel/james-extensions/blob/37a43aa6ac4d67575cabc7aed25fd96c91d4c7b2/src/main/java/org/jamesframework/ext/problems/objectives/WeightedIndex.java#L75-L82 |
alkacon/opencms-core | src-gwt/org/opencms/ade/publish/client/CmsPublishSelectPanel.java | CmsPublishSelectPanel.addGroupPanel | private CmsPublishGroupPanel addGroupPanel(CmsPublishGroup group, int currentIndex) {
"""
Adds a new group panel.<p>
@param group the publish group for which a panel should be added
@param currentIndex the index of the publish group
@return the publish group panel which has been added
"""
Strin... | java | private CmsPublishGroupPanel addGroupPanel(CmsPublishGroup group, int currentIndex) {
String header = group.getName();
CmsPublishGroupPanel groupPanel = new CmsPublishGroupPanel(
group,
header,
currentIndex,
this,
m_model,
m_select... | [
"private",
"CmsPublishGroupPanel",
"addGroupPanel",
"(",
"CmsPublishGroup",
"group",
",",
"int",
"currentIndex",
")",
"{",
"String",
"header",
"=",
"group",
".",
"getName",
"(",
")",
";",
"CmsPublishGroupPanel",
"groupPanel",
"=",
"new",
"CmsPublishGroupPanel",
"(",... | Adds a new group panel.<p>
@param group the publish group for which a panel should be added
@param currentIndex the index of the publish group
@return the publish group panel which has been added | [
"Adds",
"a",
"new",
"group",
"panel",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/publish/client/CmsPublishSelectPanel.java#L1058-L1077 |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/BinaryContentUploadServlet.java | BinaryContentUploadServlet.processRequest | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
"""
Processes requests for both HTTP
<code>GET</code> and
<code>POST</code> methods.
@param request servlet request
@param response servlet response
@throws ServletExcep... | java | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
List<FileItem> items;
// Parse the request
try {
items = upload.parseRequest(request);
} catch (FileUploadException e) {
thro... | [
"protected",
"void",
"processRequest",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"List",
"<",
"FileItem",
">",
"items",
";",
"// Parse the request",
"try",
"{",
"items",
... | Processes requests for both HTTP
<code>GET</code> and
<code>POST</code> methods.
@param request servlet request
@param response servlet response
@throws ServletException if a servlet-specific error occurs
@throws IOException if an I/O error occurs | [
"Processes",
"requests",
"for",
"both",
"HTTP",
"<code",
">",
"GET<",
"/",
"code",
">",
"and",
"<code",
">",
"POST<",
"/",
"code",
">",
"methods",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/BinaryContentUploadServlet.java#L68-L108 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplaceManager.java | CmsWorkplaceManager.addAccountInfo | public void addAccountInfo(String field, String addInfoKey, String editable) {
"""
Adds an account info.<p>
@param field the field
@param addInfoKey the additional info key
@param editable the editable flag
"""
addAccountInfo(new CmsAccountInfo(field, addInfoKey, editable));
} | java | public void addAccountInfo(String field, String addInfoKey, String editable) {
addAccountInfo(new CmsAccountInfo(field, addInfoKey, editable));
} | [
"public",
"void",
"addAccountInfo",
"(",
"String",
"field",
",",
"String",
"addInfoKey",
",",
"String",
"editable",
")",
"{",
"addAccountInfo",
"(",
"new",
"CmsAccountInfo",
"(",
"field",
",",
"addInfoKey",
",",
"editable",
")",
")",
";",
"}"
] | Adds an account info.<p>
@param field the field
@param addInfoKey the additional info key
@param editable the editable flag | [
"Adds",
"an",
"account",
"info",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplaceManager.java#L439-L442 |
jhy/jsoup | src/main/java/org/jsoup/nodes/Element.java | Element.insertChildren | public Element insertChildren(int index, Collection<? extends Node> children) {
"""
Inserts the given child nodes into this element at the specified index. Current nodes will be shifted to the
right. The inserted nodes will be moved from their current parent. To prevent moving, copy the nodes first.
@param ind... | java | public Element insertChildren(int index, Collection<? extends Node> children) {
Validate.notNull(children, "Children collection to be inserted must not be null.");
int currentSize = childNodeSize();
if (index < 0) index += currentSize +1; // roll around
Validate.isTrue(index >= 0 && inde... | [
"public",
"Element",
"insertChildren",
"(",
"int",
"index",
",",
"Collection",
"<",
"?",
"extends",
"Node",
">",
"children",
")",
"{",
"Validate",
".",
"notNull",
"(",
"children",
",",
"\"Children collection to be inserted must not be null.\"",
")",
";",
"int",
"c... | Inserts the given child nodes into this element at the specified index. Current nodes will be shifted to the
right. The inserted nodes will be moved from their current parent. To prevent moving, copy the nodes first.
@param index 0-based index to insert children at. Specify {@code 0} to insert at the start, {@code -1}... | [
"Inserts",
"the",
"given",
"child",
"nodes",
"into",
"this",
"element",
"at",
"the",
"specified",
"index",
".",
"Current",
"nodes",
"will",
"be",
"shifted",
"to",
"the",
"right",
".",
"The",
"inserted",
"nodes",
"will",
"be",
"moved",
"from",
"their",
"cur... | train | https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/nodes/Element.java#L456-L466 |
haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/NetUtil.java | NetUtil.getURLAndSetAuthorization | private static URL getURLAndSetAuthorization(final String pURL, final Properties pProperties) throws MalformedURLException {
"""
Registers the password from the URL string, and returns the URL object.
@param pURL the string representation of the URL, possibly including authorization part
@param pProperties the... | java | private static URL getURLAndSetAuthorization(final String pURL, final Properties pProperties) throws MalformedURLException {
String url = pURL;
// Split user/password away from url
String userPass = null;
String protocolPrefix = HTTP;
int httpIdx = url.indexOf(HTTPS);
if... | [
"private",
"static",
"URL",
"getURLAndSetAuthorization",
"(",
"final",
"String",
"pURL",
",",
"final",
"Properties",
"pProperties",
")",
"throws",
"MalformedURLException",
"{",
"String",
"url",
"=",
"pURL",
";",
"// Split user/password away from url",
"String",
"userPas... | Registers the password from the URL string, and returns the URL object.
@param pURL the string representation of the URL, possibly including authorization part
@param pProperties the
@return the URL created from {@code pURL}.
@throws java.net.MalformedURLException if there's a syntax error in {@code pURL} | [
"Registers",
"the",
"password",
"from",
"the",
"URL",
"string",
"and",
"returns",
"the",
"URL",
"object",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/NetUtil.java#L597-L631 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.jwt/src/com/ibm/ws/security/jwt/internal/ConsumerUtil.java | ConsumerUtil.checkForReusedJwt | void checkForReusedJwt(JwtTokenConsumerImpl jwt, JwtConsumerConfig config) throws InvalidTokenException {
"""
Throws an exception if JWTs are not allowed to be reused (as configured by
the provided config option) AND a token with a matching "jti" and "issuer"
claim already exists in the cache.
"""
// Only ... | java | void checkForReusedJwt(JwtTokenConsumerImpl jwt, JwtConsumerConfig config) throws InvalidTokenException {
// Only throw an error if tokens are not allowed to be reused
if (!config.getTokenReuse()) {
throwExceptionIfJwtReused(jwt);
}
} | [
"void",
"checkForReusedJwt",
"(",
"JwtTokenConsumerImpl",
"jwt",
",",
"JwtConsumerConfig",
"config",
")",
"throws",
"InvalidTokenException",
"{",
"// Only throw an error if tokens are not allowed to be reused",
"if",
"(",
"!",
"config",
".",
"getTokenReuse",
"(",
")",
")",
... | Throws an exception if JWTs are not allowed to be reused (as configured by
the provided config option) AND a token with a matching "jti" and "issuer"
claim already exists in the cache. | [
"Throws",
"an",
"exception",
"if",
"JWTs",
"are",
"not",
"allowed",
"to",
"be",
"reused",
"(",
"as",
"configured",
"by",
"the",
"provided",
"config",
"option",
")",
"AND",
"a",
"token",
"with",
"a",
"matching",
"jti",
"and",
"issuer",
"claim",
"already",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jwt/src/com/ibm/ws/security/jwt/internal/ConsumerUtil.java#L99-L104 |
hawkular/hawkular-agent | hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SocketBindingJBossASClient.java | SocketBindingJBossASClient.addStandardSocketBinding | public void addStandardSocketBinding(String socketBindingName, String sysPropName, int port) throws Exception {
"""
Adds a socket binding to the standard bindings group.
See {@link #addSocketBinding(String, String, String, int)} for parameter definitions.
If a socket binding with the given name already exists, t... | java | public void addStandardSocketBinding(String socketBindingName, String sysPropName, int port) throws Exception {
addSocketBinding(STANDARD_SOCKETS, socketBindingName, sysPropName, port);
} | [
"public",
"void",
"addStandardSocketBinding",
"(",
"String",
"socketBindingName",
",",
"String",
"sysPropName",
",",
"int",
"port",
")",
"throws",
"Exception",
"{",
"addSocketBinding",
"(",
"STANDARD_SOCKETS",
",",
"socketBindingName",
",",
"sysPropName",
",",
"port",... | Adds a socket binding to the standard bindings group.
See {@link #addSocketBinding(String, String, String, int)} for parameter definitions.
If a socket binding with the given name already exists, this method does nothing.
@param socketBindingName the name of the socket binding to be created with the given port
@param ... | [
"Adds",
"a",
"socket",
"binding",
"to",
"the",
"standard",
"bindings",
"group",
".",
"See",
"{",
"@link",
"#addSocketBinding",
"(",
"String",
"String",
"String",
"int",
")",
"}",
"for",
"parameter",
"definitions",
".",
"If",
"a",
"socket",
"binding",
"with",... | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SocketBindingJBossASClient.java#L103-L105 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/checksum/ChecksumExtensions.java | ChecksumExtensions.getChecksum | public static String getChecksum(final Byte[] bytes, final Algorithm algorithm)
throws NoSuchAlgorithmException {
"""
Gets the checksum from the given byte array with an instance of.
@param bytes
the Byte object array.
@param algorithm
the algorithm to get the checksum. This could be for instance "MD4", "M... | java | public static String getChecksum(final Byte[] bytes, final Algorithm algorithm)
throws NoSuchAlgorithmException
{
return getChecksum(bytes, algorithm.getAlgorithm());
} | [
"public",
"static",
"String",
"getChecksum",
"(",
"final",
"Byte",
"[",
"]",
"bytes",
",",
"final",
"Algorithm",
"algorithm",
")",
"throws",
"NoSuchAlgorithmException",
"{",
"return",
"getChecksum",
"(",
"bytes",
",",
"algorithm",
".",
"getAlgorithm",
"(",
")",
... | Gets the checksum from the given byte array with an instance of.
@param bytes
the Byte object array.
@param algorithm
the algorithm to get the checksum. This could be for instance "MD4", "MD5",
"SHA-1", "SHA-256", "SHA-384" or "SHA-512".
@return The checksum from the file as a String object.
@throws NoSuchAlgorithmExc... | [
"Gets",
"the",
"checksum",
"from",
"the",
"given",
"byte",
"array",
"with",
"an",
"instance",
"of",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/checksum/ChecksumExtensions.java#L156-L160 |
fozziethebeat/S-Space | hadoop/src/main/java/edu/ucla/sspace/ri/HadoopRandomIndexing.java | HadoopRandomIndexing.setWordToIndexVector | public void setWordToIndexVector(Map<String,TernaryVector> m) {
"""
Assigns the token to {@link IntegerVector} mapping to be used by this
instance. The contents of the map are copied, so any additions of new
index words by this instance will not be reflected in the parameter's
mapping.
@param m a mapping fr... | java | public void setWordToIndexVector(Map<String,TernaryVector> m) {
wordToIndexVector.clear();
wordToIndexVector.putAll(m);
} | [
"public",
"void",
"setWordToIndexVector",
"(",
"Map",
"<",
"String",
",",
"TernaryVector",
">",
"m",
")",
"{",
"wordToIndexVector",
".",
"clear",
"(",
")",
";",
"wordToIndexVector",
".",
"putAll",
"(",
"m",
")",
";",
"}"
] | Assigns the token to {@link IntegerVector} mapping to be used by this
instance. The contents of the map are copied, so any additions of new
index words by this instance will not be reflected in the parameter's
mapping.
@param m a mapping from token to the {@code IntegerVector} that should be
used represent it when ca... | [
"Assigns",
"the",
"token",
"to",
"{",
"@link",
"IntegerVector",
"}",
"mapping",
"to",
"be",
"used",
"by",
"this",
"instance",
".",
"The",
"contents",
"of",
"the",
"map",
"are",
"copied",
"so",
"any",
"additions",
"of",
"new",
"index",
"words",
"by",
"thi... | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/hadoop/src/main/java/edu/ucla/sspace/ri/HadoopRandomIndexing.java#L410-L413 |
gallandarakhneorg/afc | advanced/nodefx/src/main/java/org/arakhne/afc/nodefx/ZoomableGraphicsContext.java | ZoomableGraphicsContext.drawImage | public void drawImage(Image img, double x, double y) {
"""
Draws an image at the given x, y position using the width
and height of the given image.
A {@code null} image value or an image still in progress will be ignored.
<p>This method will be affected by any of the
global common attributes as specified in ... | java | public void drawImage(Image img, double x, double y) {
this.gc.drawImage(img, doc2fxX(x), doc2fxY(y));
} | [
"public",
"void",
"drawImage",
"(",
"Image",
"img",
",",
"double",
"x",
",",
"double",
"y",
")",
"{",
"this",
".",
"gc",
".",
"drawImage",
"(",
"img",
",",
"doc2fxX",
"(",
"x",
")",
",",
"doc2fxY",
"(",
"y",
")",
")",
";",
"}"
] | Draws an image at the given x, y position using the width
and height of the given image.
A {@code null} image value or an image still in progress will be ignored.
<p>This method will be affected by any of the
global common attributes as specified in the
Rendering Attributes Table of {@link GraphicsContext}.
@param im... | [
"Draws",
"an",
"image",
"at",
"the",
"given",
"x",
"y",
"position",
"using",
"the",
"width",
"and",
"height",
"of",
"the",
"given",
"image",
".",
"A",
"{",
"@code",
"null",
"}",
"image",
"value",
"or",
"an",
"image",
"still",
"in",
"progress",
"will",
... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/nodefx/src/main/java/org/arakhne/afc/nodefx/ZoomableGraphicsContext.java#L1660-L1662 |
VoltDB/voltdb | third_party/java/src/org/apache/commons_voltpatches/cli/HelpFormatter.java | HelpFormatter.printHelp | public void printHelp(String cmdLineSyntax, Options options, boolean autoUsage) {
"""
Print the help for <code>options</code> with the specified
command line syntax. This method prints help information to
System.out.
@param cmdLineSyntax the syntax for this application
@param options the Options instance
@... | java | public void printHelp(String cmdLineSyntax, Options options, boolean autoUsage)
{
printHelp(getWidth(), cmdLineSyntax, null, options, null, autoUsage);
} | [
"public",
"void",
"printHelp",
"(",
"String",
"cmdLineSyntax",
",",
"Options",
"options",
",",
"boolean",
"autoUsage",
")",
"{",
"printHelp",
"(",
"getWidth",
"(",
")",
",",
"cmdLineSyntax",
",",
"null",
",",
"options",
",",
"null",
",",
"autoUsage",
")",
... | Print the help for <code>options</code> with the specified
command line syntax. This method prints help information to
System.out.
@param cmdLineSyntax the syntax for this application
@param options the Options instance
@param autoUsage whether to print an automatically generated
usage statement | [
"Print",
"the",
"help",
"for",
"<code",
">",
"options<",
"/",
"code",
">",
"with",
"the",
"specified",
"command",
"line",
"syntax",
".",
"This",
"method",
"prints",
"help",
"information",
"to",
"System",
".",
"out",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/commons_voltpatches/cli/HelpFormatter.java#L421-L424 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java | Frame.getArgument | @Deprecated
public ValueType getArgument(InvokeInstruction ins, ConstantPoolGen cpg, int i, int numArguments)
throws DataflowAnalysisException {
"""
Get the <i>i</i>th argument passed to given method invocation.
@param ins
the method invocation instruction
@param cpg
the ConstantPoolGen for t... | java | @Deprecated
public ValueType getArgument(InvokeInstruction ins, ConstantPoolGen cpg, int i, int numArguments)
throws DataflowAnalysisException {
SignatureParser sigParser = new SignatureParser(ins.getSignature(cpg));
return getArgument(ins, cpg, i, sigParser);
} | [
"@",
"Deprecated",
"public",
"ValueType",
"getArgument",
"(",
"InvokeInstruction",
"ins",
",",
"ConstantPoolGen",
"cpg",
",",
"int",
"i",
",",
"int",
"numArguments",
")",
"throws",
"DataflowAnalysisException",
"{",
"SignatureParser",
"sigParser",
"=",
"new",
"Signat... | Get the <i>i</i>th argument passed to given method invocation.
@param ins
the method invocation instruction
@param cpg
the ConstantPoolGen for the class containing the method
@param i
index of the argument; 0 for the first argument, etc.
@param numArguments
total number of arguments to the method
@return the <i>i</i>t... | [
"Get",
"the",
"<i",
">",
"i<",
"/",
"i",
">",
"th",
"argument",
"passed",
"to",
"given",
"method",
"invocation",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java#L387-L392 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormat.java | DateTimeFormat.patternForStyle | public static String patternForStyle(String style, Locale locale) {
"""
Returns the pattern used by a particular style and locale.
<p>
The first character is the date style, and the second character is the
time style. Specify a character of 'S' for short style, 'M' for medium,
'L' for long, and 'F' for full.
... | java | public static String patternForStyle(String style, Locale locale) {
DateTimeFormatter formatter = createFormatterForStyle(style);
if (locale == null) {
locale = Locale.getDefault();
}
// Not pretty, but it works.
return ((StyleFormatter) formatter.getPrinter0()).getPa... | [
"public",
"static",
"String",
"patternForStyle",
"(",
"String",
"style",
",",
"Locale",
"locale",
")",
"{",
"DateTimeFormatter",
"formatter",
"=",
"createFormatterForStyle",
"(",
"style",
")",
";",
"if",
"(",
"locale",
"==",
"null",
")",
"{",
"locale",
"=",
... | Returns the pattern used by a particular style and locale.
<p>
The first character is the date style, and the second character is the
time style. Specify a character of 'S' for short style, 'M' for medium,
'L' for long, and 'F' for full.
A date or time may be omitted by specifying a style character '-'.
@param style ... | [
"Returns",
"the",
"pattern",
"used",
"by",
"a",
"particular",
"style",
"and",
"locale",
".",
"<p",
">",
"The",
"first",
"character",
"is",
"the",
"date",
"style",
"and",
"the",
"second",
"character",
"is",
"the",
"time",
"style",
".",
"Specify",
"a",
"ch... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormat.java#L218-L225 |
apache/flink | flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java | Configuration.setStorageSize | public void setStorageSize(String name, double value, StorageUnit unit) {
"""
Sets Storage Size for the specified key.
@param name - Key to set.
@param value - The numeric value to set.
@param unit - Storage Unit to be used.
"""
set(name, value + unit.getShortName());
} | java | public void setStorageSize(String name, double value, StorageUnit unit) {
set(name, value + unit.getShortName());
} | [
"public",
"void",
"setStorageSize",
"(",
"String",
"name",
",",
"double",
"value",
",",
"StorageUnit",
"unit",
")",
"{",
"set",
"(",
"name",
",",
"value",
"+",
"unit",
".",
"getShortName",
"(",
")",
")",
";",
"}"
] | Sets Storage Size for the specified key.
@param name - Key to set.
@param value - The numeric value to set.
@param unit - Storage Unit to be used. | [
"Sets",
"Storage",
"Size",
"for",
"the",
"specified",
"key",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L1776-L1778 |
googleapis/google-api-java-client | google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaHttpDownloader.java | MediaHttpDownloader.setContentRange | public MediaHttpDownloader setContentRange(long firstBytePos, long lastBytePos) {
"""
Sets the content range of the next download request. Eg: bytes=firstBytePos-lastBytePos.
<p>If a download was aborted mid-way due to a connection failure then users can resume the
download from the point where it left off.
... | java | public MediaHttpDownloader setContentRange(long firstBytePos, long lastBytePos) {
Preconditions.checkArgument(lastBytePos >= firstBytePos);
setBytesDownloaded(firstBytePos);
this.lastBytePos = lastBytePos;
return this;
} | [
"public",
"MediaHttpDownloader",
"setContentRange",
"(",
"long",
"firstBytePos",
",",
"long",
"lastBytePos",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"lastBytePos",
">=",
"firstBytePos",
")",
";",
"setBytesDownloaded",
"(",
"firstBytePos",
")",
";",
"th... | Sets the content range of the next download request. Eg: bytes=firstBytePos-lastBytePos.
<p>If a download was aborted mid-way due to a connection failure then users can resume the
download from the point where it left off.
<p>Use {@link #setBytesDownloaded} if you only need to specify the first byte position.
@param... | [
"Sets",
"the",
"content",
"range",
"of",
"the",
"next",
"download",
"request",
".",
"Eg",
":",
"bytes",
"=",
"firstBytePos",
"-",
"lastBytePos",
"."
] | train | https://github.com/googleapis/google-api-java-client/blob/88decfd14fc40cae6eb6729a45c7d56a1132e450/google-api-client/src/main/java/com/google/api/client/googleapis/media/MediaHttpDownloader.java#L313-L318 |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/web/PortalWebUtils.java | PortalWebUtils.getMapRequestAttribute | public static <K, V> ConcurrentMap<K, V> getMapRequestAttribute(
ServletRequest servletRequest, String name) {
"""
Get a {@link ConcurrentMap} for the specified name from the {@link ServletRequest}
attributes. If it doesn't exist create it and store it in the attributes. This is done in a
thread-safe... | java | public static <K, V> ConcurrentMap<K, V> getMapRequestAttribute(
ServletRequest servletRequest, String name) {
return getMapRequestAttribute(servletRequest, name, true);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"ConcurrentMap",
"<",
"K",
",",
"V",
">",
"getMapRequestAttribute",
"(",
"ServletRequest",
"servletRequest",
",",
"String",
"name",
")",
"{",
"return",
"getMapRequestAttribute",
"(",
"servletRequest",
",",
"name",
"... | Get a {@link ConcurrentMap} for the specified name from the {@link ServletRequest}
attributes. If it doesn't exist create it and store it in the attributes. This is done in a
thread-safe matter that ensures only one Map per name & request will be created @See {@link
#getRequestAttributeMutex(ServletRequest)} | [
"Get",
"a",
"{"
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/web/PortalWebUtils.java#L69-L72 |
ZuInnoTe/hadoopoffice | fileformat/src/main/java/org/zuinnote/hadoop/office/format/common/HadoopKeyStoreManager.java | HadoopKeyStoreManager.setPassword | public void setPassword(String alias, String password, String passwordPassword) throws NoSuchAlgorithmException, InvalidKeySpecException, KeyStoreException {
"""
Sets the password in the currently openend keystore. Do not forget to store it afterwards
@param alias
@param password to store
@param passwordPassw... | java | public void setPassword(String alias, String password, String passwordPassword) throws NoSuchAlgorithmException, InvalidKeySpecException, KeyStoreException {
SecretKeyFactory skf = SecretKeyFactory.getInstance("PBE");
SecretKey pSecret = skf.generateSecret(new PBEKeySpec(password.toCharArray()));
KeyS... | [
"public",
"void",
"setPassword",
"(",
"String",
"alias",
",",
"String",
"password",
",",
"String",
"passwordPassword",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeySpecException",
",",
"KeyStoreException",
"{",
"SecretKeyFactory",
"skf",
"=",
"SecretKeyFac... | Sets the password in the currently openend keystore. Do not forget to store it afterwards
@param alias
@param password to store
@param passwordPassword password for encrypting password. You can use the same as the keystore password
@throws NoSuchAlgorithmException
@throws InvalidKeySpecException
@throws KeyStoreExcept... | [
"Sets",
"the",
"password",
"in",
"the",
"currently",
"openend",
"keystore",
".",
"Do",
"not",
"forget",
"to",
"store",
"it",
"afterwards"
] | train | https://github.com/ZuInnoTe/hadoopoffice/blob/58fc9223ee290bcb14847aaaff3fadf39c465e46/fileformat/src/main/java/org/zuinnote/hadoop/office/format/common/HadoopKeyStoreManager.java#L147-L152 |
RogerParkinson/madura-workflows | madura-workflow/src/main/java/nz/co/senanque/workflow/WorkflowManagerImpl.java | WorkflowManagerImpl.lockProcessInstance | public ProcessInstance lockProcessInstance(final ProcessInstance processInstance, final boolean techSupport, final String userName) {
"""
This manages the transition of the process instance from Waiting to Busy with appropriate locking
and unlocking. Once it is busy it is ours but we have to check that it was not... | java | public ProcessInstance lockProcessInstance(final ProcessInstance processInstance, final boolean techSupport, final String userName) {
List<Lock> locks = ContextUtils.getLocks(processInstance,getLockFactory(),"nz.co.senanque.workflow.WorkflowClient.lock(ProcessInstance)");
LockTemplate lockTemplate = new LockTemplat... | [
"public",
"ProcessInstance",
"lockProcessInstance",
"(",
"final",
"ProcessInstance",
"processInstance",
",",
"final",
"boolean",
"techSupport",
",",
"final",
"String",
"userName",
")",
"{",
"List",
"<",
"Lock",
">",
"locks",
"=",
"ContextUtils",
".",
"getLocks",
"... | This manages the transition of the process instance from Waiting to Busy with appropriate locking
and unlocking. Once it is busy it is ours but we have to check that it was not changed since we last saw it.
The situation we are protecting against is that although the process instance looked to be in wait state
in the t... | [
"This",
"manages",
"the",
"transition",
"of",
"the",
"process",
"instance",
"from",
"Waiting",
"to",
"Busy",
"with",
"appropriate",
"locking",
"and",
"unlocking",
".",
"Once",
"it",
"is",
"busy",
"it",
"is",
"ours",
"but",
"we",
"have",
"to",
"check",
"tha... | train | https://github.com/RogerParkinson/madura-workflows/blob/3d26c322fc85a006ff0d0cbebacbc453aed8e492/madura-workflow/src/main/java/nz/co/senanque/workflow/WorkflowManagerImpl.java#L309-L351 |
konvergeio/cofoja | src/main/java/com/google/java/contract/core/util/Elements.java | Elements.getUriForClass | @Requires( {
"""
Returns a Contracts for Java private URI for the specified class name
and kind.
"""
"name != null",
"!name.isEmpty()",
"kind != null"
})
public static URI getUriForClass(String name, Kind kind) {
try {
return new URI("com.google.java.contract://com.google.java.contra... | java | @Requires({
"name != null",
"!name.isEmpty()",
"kind != null"
})
public static URI getUriForClass(String name, Kind kind) {
try {
return new URI("com.google.java.contract://com.google.java.contract/" + name + kind.extension);
} catch (URISyntaxException e) {
throw new IllegalArgument... | [
"@",
"Requires",
"(",
"{",
"\"name != null\"",
",",
"\"!name.isEmpty()\"",
",",
"\"kind != null\"",
"}",
")",
"public",
"static",
"URI",
"getUriForClass",
"(",
"String",
"name",
",",
"Kind",
"kind",
")",
"{",
"try",
"{",
"return",
"new",
"URI",
"(",
"\"com.g... | Returns a Contracts for Java private URI for the specified class name
and kind. | [
"Returns",
"a",
"Contracts",
"for",
"Java",
"private",
"URI",
"for",
"the",
"specified",
"class",
"name",
"and",
"kind",
"."
] | train | https://github.com/konvergeio/cofoja/blob/6ded58fa05eb5bf85f16353c8dd4c70bee59121a/src/main/java/com/google/java/contract/core/util/Elements.java#L119-L130 |
jbossas/jboss-invocation | src/main/java/org/jboss/invocation/proxy/AbstractSubclassFactory.java | AbstractSubclassFactory.overrideMethod | protected boolean overrideMethod(ClassMethod method, MethodIdentifier identifier, MethodBodyCreator creator) {
"""
Creates a new method on the generated class that overrides the given methods, unless a method with the same signature has
already been overridden.
@param method The method to override
@param ... | java | protected boolean overrideMethod(ClassMethod method, MethodIdentifier identifier, MethodBodyCreator creator) {
if (!overriddenMethods.contains(identifier)) {
overriddenMethods.add(identifier);
creator.overrideMethod(method, null);
return true;
}
return false;
... | [
"protected",
"boolean",
"overrideMethod",
"(",
"ClassMethod",
"method",
",",
"MethodIdentifier",
"identifier",
",",
"MethodBodyCreator",
"creator",
")",
"{",
"if",
"(",
"!",
"overriddenMethods",
".",
"contains",
"(",
"identifier",
")",
")",
"{",
"overriddenMethods",... | Creates a new method on the generated class that overrides the given methods, unless a method with the same signature has
already been overridden.
@param method The method to override
@param identifier The identifier of the method to override
@param creator The {@link MethodBodyCreator} used to create the metho... | [
"Creates",
"a",
"new",
"method",
"on",
"the",
"generated",
"class",
"that",
"overrides",
"the",
"given",
"methods",
"unless",
"a",
"method",
"with",
"the",
"same",
"signature",
"has",
"already",
"been",
"overridden",
"."
] | train | https://github.com/jbossas/jboss-invocation/blob/f72586a554264cbc78fcdad9fdd3e84b833249c9/src/main/java/org/jboss/invocation/proxy/AbstractSubclassFactory.java#L134-L141 |
Stratio/stratio-connector-commons | connector-commons/src/main/java/com/stratio/connector/commons/metadata/IndexMetadataBuilder.java | IndexMetadataBuilder.addOption | @TimerJ
public IndexMetadataBuilder addOption(String option, Boolean value) {
"""
Adds a new boolean option.
@param option the option
@param value the value
@return the index metadata builder
"""
if (options == null) {
options = new HashMap<Selector, Selector>();
}
... | java | @TimerJ
public IndexMetadataBuilder addOption(String option, Boolean value) {
if (options == null) {
options = new HashMap<Selector, Selector>();
}
options.put(new StringSelector(option), new BooleanSelector(value));
return this;
} | [
"@",
"TimerJ",
"public",
"IndexMetadataBuilder",
"addOption",
"(",
"String",
"option",
",",
"Boolean",
"value",
")",
"{",
"if",
"(",
"options",
"==",
"null",
")",
"{",
"options",
"=",
"new",
"HashMap",
"<",
"Selector",
",",
"Selector",
">",
"(",
")",
";"... | Adds a new boolean option.
@param option the option
@param value the value
@return the index metadata builder | [
"Adds",
"a",
"new",
"boolean",
"option",
"."
] | train | https://github.com/Stratio/stratio-connector-commons/blob/d7cc66cb9591344a13055962e87a91f01c3707d1/connector-commons/src/main/java/com/stratio/connector/commons/metadata/IndexMetadataBuilder.java#L166-L173 |
janvanbesien/java-ipv6 | src/main/java/com/googlecode/ipv6/IPv6AddressPool.java | IPv6AddressPool.fromRangeAndSubnet | public static IPv6AddressPool fromRangeAndSubnet(final IPv6AddressRange range,
final IPv6NetworkMask allocationSubnetSize) {
"""
Create a pool of the given range (boundaries inclusive) which is completely free. The given subnet size is the network mask (thus
si... | java | public static IPv6AddressPool fromRangeAndSubnet(final IPv6AddressRange range,
final IPv6NetworkMask allocationSubnetSize)
{
// in the beginning, all is free
return new IPv6AddressPool(range, allocationSubnetSize, new TreeSet<IPv6AddressRange>(Arr... | [
"public",
"static",
"IPv6AddressPool",
"fromRangeAndSubnet",
"(",
"final",
"IPv6AddressRange",
"range",
",",
"final",
"IPv6NetworkMask",
"allocationSubnetSize",
")",
"{",
"// in the beginning, all is free",
"return",
"new",
"IPv6AddressPool",
"(",
"range",
",",
"allocationS... | Create a pool of the given range (boundaries inclusive) which is completely free. The given subnet size is the network mask (thus
size) of the allocated subnets in this range. This constructor verifies that the whole range is "aligned" with subnets of this size
(i.e. there should not be a waste of space in the beginnin... | [
"Create",
"a",
"pool",
"of",
"the",
"given",
"range",
"(",
"boundaries",
"inclusive",
")",
"which",
"is",
"completely",
"free",
".",
"The",
"given",
"subnet",
"size",
"is",
"the",
"network",
"mask",
"(",
"thus",
"size",
")",
"of",
"the",
"allocated",
"su... | train | https://github.com/janvanbesien/java-ipv6/blob/9af15b4a6c0074f9fa23dfa030027c631b9c2f78/src/main/java/com/googlecode/ipv6/IPv6AddressPool.java#L57-L62 |
twilliamson/mogwee-logging | src/main/java/com/mogwee/logging/Logger.java | Logger.warnDebugf | public final void warnDebugf(final Throwable cause, final String message, final Object... args) {
"""
Logs a formatted message and stack trace if DEBUG logging is enabled
or a formatted message and exception description if WARN logging is enabled.
@param cause an exception to print stack trace of if DEBUG lo... | java | public final void warnDebugf(final Throwable cause, final String message, final Object... args)
{
logDebugf(Level.WARN, cause, message, args);
} | [
"public",
"final",
"void",
"warnDebugf",
"(",
"final",
"Throwable",
"cause",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"args",
")",
"{",
"logDebugf",
"(",
"Level",
".",
"WARN",
",",
"cause",
",",
"message",
",",
"args",
")",
";",
... | Logs a formatted message and stack trace if DEBUG logging is enabled
or a formatted message and exception description if WARN logging is enabled.
@param cause an exception to print stack trace of if DEBUG logging is enabled
@param message a <a href="http://download.oracle.com/javase/6/docs/api/java/util/Formatter.ht... | [
"Logs",
"a",
"formatted",
"message",
"and",
"stack",
"trace",
"if",
"DEBUG",
"logging",
"is",
"enabled",
"or",
"a",
"formatted",
"message",
"and",
"exception",
"description",
"if",
"WARN",
"logging",
"is",
"enabled",
"."
] | train | https://github.com/twilliamson/mogwee-logging/blob/30b99c2649de455432d956a8f6a74316de4cd62c/src/main/java/com/mogwee/logging/Logger.java#L369-L372 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalBuilder.java | CrystalBuilder.setChainIdsInResidueNumbers | private static void setChainIdsInResidueNumbers(Chain c, String newChainName) {
"""
Auxiliary method to reset chain ids of residue numbers in a chain.
Used when cloning chains and resetting their ids: one needs to take care of
resetting the ids within residue numbers too.
@param c
@param newChainName
"""
... | java | private static void setChainIdsInResidueNumbers(Chain c, String newChainName) {
for (Group g:c.getAtomGroups()) {
g.setResidueNumber(newChainName, g.getResidueNumber().getSeqNum(), g.getResidueNumber().getInsCode());
}
for (Group g:c.getSeqResGroups()) {
if (g.getResidueNumber()==null) continue;
g.setRes... | [
"private",
"static",
"void",
"setChainIdsInResidueNumbers",
"(",
"Chain",
"c",
",",
"String",
"newChainName",
")",
"{",
"for",
"(",
"Group",
"g",
":",
"c",
".",
"getAtomGroups",
"(",
")",
")",
"{",
"g",
".",
"setResidueNumber",
"(",
"newChainName",
",",
"g... | Auxiliary method to reset chain ids of residue numbers in a chain.
Used when cloning chains and resetting their ids: one needs to take care of
resetting the ids within residue numbers too.
@param c
@param newChainName | [
"Auxiliary",
"method",
"to",
"reset",
"chain",
"ids",
"of",
"residue",
"numbers",
"in",
"a",
"chain",
".",
"Used",
"when",
"cloning",
"chains",
"and",
"resetting",
"their",
"ids",
":",
"one",
"needs",
"to",
"take",
"care",
"of",
"resetting",
"the",
"ids",
... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalBuilder.java#L620-L628 |
apache/flink | flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java | SqlValidatorImpl.validateExpr | private void validateExpr(SqlNode expr, SqlValidatorScope scope) {
"""
Validates an expression.
@param expr Expression
@param scope Scope in which expression occurs
"""
if (expr instanceof SqlCall) {
final SqlOperator op = ((SqlCall) expr).getOperator();
if (op.isAggregator() && op.requiresOver())... | java | private void validateExpr(SqlNode expr, SqlValidatorScope scope) {
if (expr instanceof SqlCall) {
final SqlOperator op = ((SqlCall) expr).getOperator();
if (op.isAggregator() && op.requiresOver()) {
throw newValidationError(expr,
RESOURCE.absentOverClause());
}
}
// Call on the expression to va... | [
"private",
"void",
"validateExpr",
"(",
"SqlNode",
"expr",
",",
"SqlValidatorScope",
"scope",
")",
"{",
"if",
"(",
"expr",
"instanceof",
"SqlCall",
")",
"{",
"final",
"SqlOperator",
"op",
"=",
"(",
"(",
"SqlCall",
")",
"expr",
")",
".",
"getOperator",
"(",... | Validates an expression.
@param expr Expression
@param scope Scope in which expression occurs | [
"Validates",
"an",
"expression",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java#L4101-L4116 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Main.java | Main.execute | public static int execute(String[] args, PrintWriter writer) {
"""
Programmatic interface.
@param writer a stream for all output
@param args The command line parameters.
@return The return code.
"""
Start jdoc = new Start(writer, writer);
return jdoc.begin(args).exitCode;
} | java | public static int execute(String[] args, PrintWriter writer) {
Start jdoc = new Start(writer, writer);
return jdoc.begin(args).exitCode;
} | [
"public",
"static",
"int",
"execute",
"(",
"String",
"[",
"]",
"args",
",",
"PrintWriter",
"writer",
")",
"{",
"Start",
"jdoc",
"=",
"new",
"Start",
"(",
"writer",
",",
"writer",
")",
";",
"return",
"jdoc",
".",
"begin",
"(",
"args",
")",
".",
"exitC... | Programmatic interface.
@param writer a stream for all output
@param args The command line parameters.
@return The return code. | [
"Programmatic",
"interface",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Main.java#L73-L76 |
GerdHolz/TOVAL | src/de/invation/code/toval/os/WindowsRegistry.java | WindowsRegistry.readValue | public static String readValue(String keyName, String valueName) throws RegistryException {
"""
Reads a string value from the given key and value name.
@param keyName Name of the key, which contains the value to read.
@param valueName Name of the value to read.
@return Content of the specified value.
@throws... | java | public static String readValue(String keyName, String valueName) throws RegistryException {
try (Key key = Key.open(keyName, KEY_READ)) {
return fromByteArray(invoke(Methods.REG_QUERY_VALUE_EX.get(), key.id, toByteArray(valueName)));
}
} | [
"public",
"static",
"String",
"readValue",
"(",
"String",
"keyName",
",",
"String",
"valueName",
")",
"throws",
"RegistryException",
"{",
"try",
"(",
"Key",
"key",
"=",
"Key",
".",
"open",
"(",
"keyName",
",",
"KEY_READ",
")",
")",
"{",
"return",
"fromByte... | Reads a string value from the given key and value name.
@param keyName Name of the key, which contains the value to read.
@param valueName Name of the value to read.
@return Content of the specified value.
@throws RegistryException | [
"Reads",
"a",
"string",
"value",
"from",
"the",
"given",
"key",
"and",
"value",
"name",
"."
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/os/WindowsRegistry.java#L249-L253 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/FrameDataflowAnalysis.java | FrameDataflowAnalysis.modifyFrame | final protected FrameType modifyFrame(FrameType orig, @CheckForNull FrameType copy) {
"""
<p>Create a modifiable copy of a frame. This is useful for meetInto(), if
the frame needs to be modified in a path-sensitive fashion. A typical
usage pattern is:
</p>
<pre>
FrameType copy = null;
if (someCondition()) ... | java | final protected FrameType modifyFrame(FrameType orig, @CheckForNull FrameType copy) {
if (copy == null) {
copy = createFact();
copy.copyFrom(orig);
}
return copy;
} | [
"final",
"protected",
"FrameType",
"modifyFrame",
"(",
"FrameType",
"orig",
",",
"@",
"CheckForNull",
"FrameType",
"copy",
")",
"{",
"if",
"(",
"copy",
"==",
"null",
")",
"{",
"copy",
"=",
"createFact",
"(",
")",
";",
"copy",
".",
"copyFrom",
"(",
"orig"... | <p>Create a modifiable copy of a frame. This is useful for meetInto(), if
the frame needs to be modified in a path-sensitive fashion. A typical
usage pattern is:
</p>
<pre>
FrameType copy = null;
if (someCondition()) {
copy = modifyFrame(fact, copy);
// modify copy
}
if (someOtherCondition()) {
copy = modifyFrame(fact... | [
"<p",
">",
"Create",
"a",
"modifiable",
"copy",
"of",
"a",
"frame",
".",
"This",
"is",
"useful",
"for",
"meetInto",
"()",
"if",
"the",
"frame",
"needs",
"to",
"be",
"modified",
"in",
"a",
"path",
"-",
"sensitive",
"fashion",
".",
"A",
"typical",
"usage... | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/FrameDataflowAnalysis.java#L167-L173 |
fuinorg/srcgen4javassist | src/main/java/org/fuin/srcgen4javassist/ByteCodeGenerator.java | ByteCodeGenerator.createInstance | @SuppressWarnings("unchecked")
public final Object createInstance(final SgClass clasz) {
"""
Creates an instance from a model class with it's no argument constructor
and maps all exceptions into <code>RuntimeException</code>.
@param clasz
Class to create an instance for.
@return New instance.
"""
... | java | @SuppressWarnings("unchecked")
public final Object createInstance(final SgClass clasz) {
final Class newClass = createClass(clasz);
return createInstance(newClass, new Class[] {}, new Object[] {});
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"final",
"Object",
"createInstance",
"(",
"final",
"SgClass",
"clasz",
")",
"{",
"final",
"Class",
"newClass",
"=",
"createClass",
"(",
"clasz",
")",
";",
"return",
"createInstance",
"(",
"newClass",
... | Creates an instance from a model class with it's no argument constructor
and maps all exceptions into <code>RuntimeException</code>.
@param clasz
Class to create an instance for.
@return New instance. | [
"Creates",
"an",
"instance",
"from",
"a",
"model",
"class",
"with",
"it",
"s",
"no",
"argument",
"constructor",
"and",
"maps",
"all",
"exceptions",
"into",
"<code",
">",
"RuntimeException<",
"/",
"code",
">",
"."
] | train | https://github.com/fuinorg/srcgen4javassist/blob/355828113cfce3cdd3d69ba242c5bdfc7d899f2f/src/main/java/org/fuin/srcgen4javassist/ByteCodeGenerator.java#L337-L343 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/TypeUtil.java | TypeUtil.getTypeArgument | public static Type getTypeArgument(Type type, int index) {
"""
获得给定类的泛型参数
@param type 被检查的类型,必须是已经确定泛型类型的类
@param index 泛型类型的索引号,既第几个泛型类型
@return {@link Type}
"""
final Type[] typeArguments = getTypeArguments(type);
if (null != typeArguments && typeArguments.length > index) {
return typeArgument... | java | public static Type getTypeArgument(Type type, int index) {
final Type[] typeArguments = getTypeArguments(type);
if (null != typeArguments && typeArguments.length > index) {
return typeArguments[index];
}
return null;
} | [
"public",
"static",
"Type",
"getTypeArgument",
"(",
"Type",
"type",
",",
"int",
"index",
")",
"{",
"final",
"Type",
"[",
"]",
"typeArguments",
"=",
"getTypeArguments",
"(",
"type",
")",
";",
"if",
"(",
"null",
"!=",
"typeArguments",
"&&",
"typeArguments",
... | 获得给定类的泛型参数
@param type 被检查的类型,必须是已经确定泛型类型的类
@param index 泛型类型的索引号,既第几个泛型类型
@return {@link Type} | [
"获得给定类的泛型参数"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/TypeUtil.java#L209-L215 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/overlays/AbstractContainerOverlay.java | AbstractContainerOverlay.addPathRecursively | protected void addPathRecursively(
final File sourcePath, final Path targetPath, final ContainerSpecification env) throws IOException {
"""
Add a path recursively to the container specification.
If the path is a directory, the directory itself (not just its contents) is added to the target path.
The execut... | java | protected void addPathRecursively(
final File sourcePath, final Path targetPath, final ContainerSpecification env) throws IOException {
final java.nio.file.Path sourceRoot = sourcePath.toPath().getParent();
Files.walkFileTree(sourcePath.toPath(), new SimpleFileVisitor<java.nio.file.Path>() {
@Override
pub... | [
"protected",
"void",
"addPathRecursively",
"(",
"final",
"File",
"sourcePath",
",",
"final",
"Path",
"targetPath",
",",
"final",
"ContainerSpecification",
"env",
")",
"throws",
"IOException",
"{",
"final",
"java",
".",
"nio",
".",
"file",
".",
"Path",
"sourceRoo... | Add a path recursively to the container specification.
If the path is a directory, the directory itself (not just its contents) is added to the target path.
The execute bit is preserved; permissions aren't.
@param sourcePath the path to add.
@param targetPath the target path.
@param env the specification to mutate.
... | [
"Add",
"a",
"path",
"recursively",
"to",
"the",
"container",
"specification",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/overlays/AbstractContainerOverlay.java#L48-L71 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ObjectUtility.java | ObjectUtility.notEquals | public static boolean notEquals(final Object object1, final Object object2) {
"""
Return true if the object are NOT equals.<br />
This method is NullPointerException-proof
@param object1 first object to compare
@param object2 second object to compare
@return true if the object are NOT equals
"""
... | java | public static boolean notEquals(final Object object1, final Object object2) {
return object1 != null && !object1.equals(object2) || object1 == null && object2 != null;
} | [
"public",
"static",
"boolean",
"notEquals",
"(",
"final",
"Object",
"object1",
",",
"final",
"Object",
"object2",
")",
"{",
"return",
"object1",
"!=",
"null",
"&&",
"!",
"object1",
".",
"equals",
"(",
"object2",
")",
"||",
"object1",
"==",
"null",
"&&",
... | Return true if the object are NOT equals.<br />
This method is NullPointerException-proof
@param object1 first object to compare
@param object2 second object to compare
@return true if the object are NOT equals | [
"Return",
"true",
"if",
"the",
"object",
"are",
"NOT",
"equals",
".",
"<br",
"/",
">",
"This",
"method",
"is",
"NullPointerException",
"-",
"proof"
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ObjectUtility.java#L62-L64 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/DoubleStream.java | DoubleStream.flatMap | @NotNull
public DoubleStream flatMap(@NotNull final DoubleFunction<? extends DoubleStream> mapper) {
"""
Returns a stream consisting of the results of replacing each element of
this stream with the contents of a mapped stream produced by applying
the provided mapping function to each element.
<p>This is a... | java | @NotNull
public DoubleStream flatMap(@NotNull final DoubleFunction<? extends DoubleStream> mapper) {
return new DoubleStream(params, new DoubleFlatMap(iterator, mapper));
} | [
"@",
"NotNull",
"public",
"DoubleStream",
"flatMap",
"(",
"@",
"NotNull",
"final",
"DoubleFunction",
"<",
"?",
"extends",
"DoubleStream",
">",
"mapper",
")",
"{",
"return",
"new",
"DoubleStream",
"(",
"params",
",",
"new",
"DoubleFlatMap",
"(",
"iterator",
","... | Returns a stream consisting of the results of replacing each element of
this stream with the contents of a mapped stream produced by applying
the provided mapping function to each element.
<p>This is an intermediate operation.
<p>Example:
<pre>
mapper: (a) -> [a, a + 5]
stream: [1, 2, 3, 4]
result: [1, 6, 2, 7, 3,... | [
"Returns",
"a",
"stream",
"consisting",
"of",
"the",
"results",
"of",
"replacing",
"each",
"element",
"of",
"this",
"stream",
"with",
"the",
"contents",
"of",
"a",
"mapped",
"stream",
"produced",
"by",
"applying",
"the",
"provided",
"mapping",
"function",
"to"... | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/DoubleStream.java#L527-L530 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxTrash.java | BoxTrash.getFolderInfo | public BoxFolder.Info getFolderInfo(String folderID, String... fields) {
"""
Gets information about a trashed folder that's limited to a list of specified fields.
@param folderID the ID of the trashed folder.
@param fields the fields to retrieve.
@return info about the trashed folder containing onl... | java | public BoxFolder.Info getFolderInfo(String folderID, String... fields) {
String queryString = new QueryStringBuilder().appendParam("fields", fields).toString();
URL url = FOLDER_INFO_URL_TEMPLATE.buildWithQuery(this.api.getBaseURL(), queryString, folderID);
BoxAPIRequest request = new BoxAPIRequ... | [
"public",
"BoxFolder",
".",
"Info",
"getFolderInfo",
"(",
"String",
"folderID",
",",
"String",
"...",
"fields",
")",
"{",
"String",
"queryString",
"=",
"new",
"QueryStringBuilder",
"(",
")",
".",
"appendParam",
"(",
"\"fields\"",
",",
"fields",
")",
".",
"to... | Gets information about a trashed folder that's limited to a list of specified fields.
@param folderID the ID of the trashed folder.
@param fields the fields to retrieve.
@return info about the trashed folder containing only the specified fields. | [
"Gets",
"information",
"about",
"a",
"trashed",
"folder",
"that",
"s",
"limited",
"to",
"a",
"list",
"of",
"specified",
"fields",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTrash.java#L81-L90 |
apache/flink | flink-core/src/main/java/org/apache/flink/util/StringUtils.java | StringUtils.writeNullableString | public static void writeNullableString(@Nullable String str, DataOutputView out) throws IOException {
"""
Writes a String to the given output. The string may be null.
The written string can be read with {@link #readNullableString(DataInputView)}-
@param str The string to write, or null.
@param out The output ... | java | public static void writeNullableString(@Nullable String str, DataOutputView out) throws IOException {
if (str != null) {
out.writeBoolean(true);
writeString(str, out);
} else {
out.writeBoolean(false);
}
} | [
"public",
"static",
"void",
"writeNullableString",
"(",
"@",
"Nullable",
"String",
"str",
",",
"DataOutputView",
"out",
")",
"throws",
"IOException",
"{",
"if",
"(",
"str",
"!=",
"null",
")",
"{",
"out",
".",
"writeBoolean",
"(",
"true",
")",
";",
"writeSt... | Writes a String to the given output. The string may be null.
The written string can be read with {@link #readNullableString(DataInputView)}-
@param str The string to write, or null.
@param out The output to write to.
@throws IOException Thrown, if the writing or the serialization fails. | [
"Writes",
"a",
"String",
"to",
"the",
"given",
"output",
".",
"The",
"string",
"may",
"be",
"null",
".",
"The",
"written",
"string",
"can",
"be",
"read",
"with",
"{",
"@link",
"#readNullableString",
"(",
"DataInputView",
")",
"}",
"-"
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/StringUtils.java#L319-L326 |
kite-sdk/kite | kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/filesystem/CSVAppender.java | CSVAppender.valueString | private static String valueString(Object value, Schema schema) {
"""
Returns a the value as the first matching schema type or null.
Note that if the value may be null even if the schema does not allow the
value to be null.
@param value a value
@param schema a Schema
@return a String representation of the ... | java | private static String valueString(Object value, Schema schema) {
if (value == null || schema.getType() == Schema.Type.NULL) {
return null;
}
switch (schema.getType()) {
case BOOLEAN:
case FLOAT:
case DOUBLE:
case INT:
case LONG:
case STRING:
return value.to... | [
"private",
"static",
"String",
"valueString",
"(",
"Object",
"value",
",",
"Schema",
"schema",
")",
"{",
"if",
"(",
"value",
"==",
"null",
"||",
"schema",
".",
"getType",
"(",
")",
"==",
"Schema",
".",
"Type",
".",
"NULL",
")",
"{",
"return",
"null",
... | Returns a the value as the first matching schema type or null.
Note that if the value may be null even if the schema does not allow the
value to be null.
@param value a value
@param schema a Schema
@return a String representation of the value according to the Schema type | [
"Returns",
"a",
"the",
"value",
"as",
"the",
"first",
"matching",
"schema",
"type",
"or",
"null",
"."
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/filesystem/CSVAppender.java#L131-L155 |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java | ReflectionUtils.getGetter | public static Method getGetter(Class<?> clazz, String fieldName) {
"""
Retrieves the getter method of the given class for the specified field
name. The method first tries to find the getFieldName method of the class
and if it can not find that method it looks for the isFieldName method.
If this method also can ... | java | public static Method getGetter(Class<?> clazz, String fieldName) {
StringBuilder sb = new StringBuilder("get").append(
Character.toUpperCase(fieldName.charAt(0))).append(fieldName,
1, fieldName.length());
final String internedGetName = sb.toString().intern();
fina... | [
"public",
"static",
"Method",
"getGetter",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"fieldName",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"\"get\"",
")",
".",
"append",
"(",
"Character",
".",
"toUpperCase",
"(",
"field... | Retrieves the getter method of the given class for the specified field
name. The method first tries to find the getFieldName method of the class
and if it can not find that method it looks for the isFieldName method.
If this method also can not be found, null is returned.
<p>
This method uses #
{@link ReflectionUtils#g... | [
"Retrieves",
"the",
"getter",
"method",
"of",
"the",
"given",
"class",
"for",
"the",
"specified",
"field",
"name",
".",
"The",
"method",
"first",
"tries",
"to",
"find",
"the",
"getFieldName",
"method",
"of",
"the",
"class",
"and",
"if",
"it",
"can",
"not",... | train | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java#L1014-L1046 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/BaseNDArrayFactory.java | BaseNDArrayFactory.pullRows | @Override
public INDArray pullRows(INDArray source, int sourceDimension, int[] indexes, char order) {
"""
This method produces concatenated array, that consist from tensors, fetched from source array, against some dimension and specified indexes
@param source source tensor
@param sourceDimension dimension ... | java | @Override
public INDArray pullRows(INDArray source, int sourceDimension, int[] indexes, char order) {
Shape.assertValidOrder(order);
long vectorLength = source.shape()[sourceDimension];
INDArray ret = Nd4j.createUninitialized(new long[] {indexes.length, vectorLength}, order);
for (i... | [
"@",
"Override",
"public",
"INDArray",
"pullRows",
"(",
"INDArray",
"source",
",",
"int",
"sourceDimension",
",",
"int",
"[",
"]",
"indexes",
",",
"char",
"order",
")",
"{",
"Shape",
".",
"assertValidOrder",
"(",
"order",
")",
";",
"long",
"vectorLength",
... | This method produces concatenated array, that consist from tensors, fetched from source array, against some dimension and specified indexes
@param source source tensor
@param sourceDimension dimension of source tensor
@param indexes indexes from source array
@return | [
"This",
"method",
"produces",
"concatenated",
"array",
"that",
"consist",
"from",
"tensors",
"fetched",
"from",
"source",
"array",
"against",
"some",
"dimension",
"and",
"specified",
"indexes"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/BaseNDArrayFactory.java#L751-L762 |
jfoenixadmin/JFoenix | jfoenix/src/main/java/com/jfoenix/controls/JFXTreeTableView.java | JFXTreeTableView.unGroup | public void unGroup(TreeTableColumn<S, ?>... treeTableColumns) {
"""
this is a blocking method so it should not be called from the ui thread,
it will ungroup the tree table view
@param treeTableColumns
"""
try {
lock.lock();
if (groupOrder.size() > 0) {
group... | java | public void unGroup(TreeTableColumn<S, ?>... treeTableColumns) {
try {
lock.lock();
if (groupOrder.size() > 0) {
groupOrder.removeAll(treeTableColumns);
List<TreeTableColumn<S, ?>> grouped = new ArrayList<>();
grouped.addAll(groupOrder);
... | [
"public",
"void",
"unGroup",
"(",
"TreeTableColumn",
"<",
"S",
",",
"?",
">",
"...",
"treeTableColumns",
")",
"{",
"try",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"if",
"(",
"groupOrder",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"groupOrder",
"."... | this is a blocking method so it should not be called from the ui thread,
it will ungroup the tree table view
@param treeTableColumns | [
"this",
"is",
"a",
"blocking",
"method",
"so",
"it",
"should",
"not",
"be",
"called",
"from",
"the",
"ui",
"thread",
"it",
"will",
"ungroup",
"the",
"tree",
"table",
"view"
] | train | https://github.com/jfoenixadmin/JFoenix/blob/53235b5f561da4a515ef716059b8a8df5239ffa1/jfoenix/src/main/java/com/jfoenix/controls/JFXTreeTableView.java#L246-L275 |
streamsets/datacollector-api | src/main/java/com/streamsets/pipeline/api/impl/Utils.java | Utils.checkState | public static void checkState(boolean expression, @Nullable Object msg) {
"""
Ensures the truth of an expression involving the state of the calling instance, but not
involving any parameters to the calling method.
@param expression a boolean expression
@param msg the exception message to use if the check fail... | java | public static void checkState(boolean expression, @Nullable Object msg) {
if (!expression) {
throw new IllegalStateException(String.valueOf(msg));
}
} | [
"public",
"static",
"void",
"checkState",
"(",
"boolean",
"expression",
",",
"@",
"Nullable",
"Object",
"msg",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"String",
".",
"valueOf",
"(",
"msg",
")",
")",
... | Ensures the truth of an expression involving the state of the calling instance, but not
involving any parameters to the calling method.
@param expression a boolean expression
@param msg the exception message to use if the check fails; will be converted to a
string using {@link String#valueOf(Object)}
@throws IllegalSt... | [
"Ensures",
"the",
"truth",
"of",
"an",
"expression",
"involving",
"the",
"state",
"of",
"the",
"calling",
"instance",
"but",
"not",
"involving",
"any",
"parameters",
"to",
"the",
"calling",
"method",
"."
] | train | https://github.com/streamsets/datacollector-api/blob/ac832a97bea2fcef11f50fac6746e85019adad58/src/main/java/com/streamsets/pipeline/api/impl/Utils.java#L85-L89 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java | Types.isSameTypes | public boolean isSameTypes(List<Type> ts, List<Type> ss) {
"""
Are corresponding elements of the lists the same type? If
lists are of different length, return false.
"""
return isSameTypes(ts, ss, false);
} | java | public boolean isSameTypes(List<Type> ts, List<Type> ss) {
return isSameTypes(ts, ss, false);
} | [
"public",
"boolean",
"isSameTypes",
"(",
"List",
"<",
"Type",
">",
"ts",
",",
"List",
"<",
"Type",
">",
"ss",
")",
"{",
"return",
"isSameTypes",
"(",
"ts",
",",
"ss",
",",
"false",
")",
";",
"}"
] | Are corresponding elements of the lists the same type? If
lists are of different length, return false. | [
"Are",
"corresponding",
"elements",
"of",
"the",
"lists",
"the",
"same",
"type?",
"If",
"lists",
"are",
"of",
"different",
"length",
"return",
"false",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java#L984-L986 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/oauth/OAuthFlowImpl.java | OAuthFlowImpl.refreshToken | public Token refreshToken(Token token) throws OAuthTokenException, JSONSerializerException, HttpClientException, URISyntaxException, InvalidRequestException {
"""
Refresh token.
Exceptions:
- IllegalArgumentException : if token is null.
- InvalidTokenRequestException : if the token request is invalid
- Inval... | java | public Token refreshToken(Token token) throws OAuthTokenException, JSONSerializerException, HttpClientException, URISyntaxException, InvalidRequestException {
// Prepare the hash
String doHash = clientSecret + "|" + token.getRefreshToken();
MessageDigest md;
try {
md = Messag... | [
"public",
"Token",
"refreshToken",
"(",
"Token",
"token",
")",
"throws",
"OAuthTokenException",
",",
"JSONSerializerException",
",",
"HttpClientException",
",",
"URISyntaxException",
",",
"InvalidRequestException",
"{",
"// Prepare the hash",
"String",
"doHash",
"=",
"cli... | Refresh token.
Exceptions:
- IllegalArgumentException : if token is null.
- InvalidTokenRequestException : if the token request is invalid
- InvalidOAuthClientException : if the client information is invalid
- InvalidOAuthGrantException : if the authorization code or refresh token is invalid or expired,
the redirect_u... | [
"Refresh",
"token",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/oauth/OAuthFlowImpl.java#L302-L331 |
protostuff/protostuff | protostuff-core/src/main/java/io/protostuff/IOUtil.java | IOUtil.fillBufferFrom | static void fillBufferFrom(InputStream in, byte[] buf, int offset, int len)
throws IOException {
"""
Fills the byte buffer from the {@link InputStream} with the specified length.
"""
for (int read = 0; len > 0; len -= read, offset += read)
{
read = in.read(buf, offse... | java | static void fillBufferFrom(InputStream in, byte[] buf, int offset, int len)
throws IOException
{
for (int read = 0; len > 0; len -= read, offset += read)
{
read = in.read(buf, offset, len);
if (read == -1)
throw ProtobufException.truncatedMe... | [
"static",
"void",
"fillBufferFrom",
"(",
"InputStream",
"in",
",",
"byte",
"[",
"]",
"buf",
",",
"int",
"offset",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"for",
"(",
"int",
"read",
"=",
"0",
";",
"len",
">",
"0",
";",
"len",
"-=",
"re... | Fills the byte buffer from the {@link InputStream} with the specified length. | [
"Fills",
"the",
"byte",
"buffer",
"from",
"the",
"{"
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-core/src/main/java/io/protostuff/IOUtil.java#L222-L231 |
facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/FailoverClientHandler.java | FailoverClientHandler.handleFailure | void handleFailure(IOException ex, int failures)
throws IOException {
"""
This function should be called within try..finally which releases
readlock, if this fails.
"""
// Check if the exception was thrown by the network stack
if (failoverClient.isShuttingdown() || !shouldHandleException(ex)) {
... | java | void handleFailure(IOException ex, int failures)
throws IOException {
// Check if the exception was thrown by the network stack
if (failoverClient.isShuttingdown() || !shouldHandleException(ex)) {
throw ex;
}
if (failures > FAILURE_RETRY) {
throw ex;
}
try {
// This might... | [
"void",
"handleFailure",
"(",
"IOException",
"ex",
",",
"int",
"failures",
")",
"throws",
"IOException",
"{",
"// Check if the exception was thrown by the network stack",
"if",
"(",
"failoverClient",
".",
"isShuttingdown",
"(",
")",
"||",
"!",
"shouldHandleException",
"... | This function should be called within try..finally which releases
readlock, if this fails. | [
"This",
"function",
"should",
"be",
"called",
"within",
"try",
"..",
"finally",
"which",
"releases",
"readlock",
"if",
"this",
"fails",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/FailoverClientHandler.java#L126-L159 |
GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/StorageResourceId.java | StorageResourceId.createReadableString | public static String createReadableString(String bucketName, String objectName) {
"""
Helper for standardizing the way various human-readable messages in logs/exceptions that refer
to a bucket/object pair.
"""
if (bucketName == null && objectName != null) {
throw new IllegalArgumentException(
... | java | public static String createReadableString(String bucketName, String objectName) {
if (bucketName == null && objectName != null) {
throw new IllegalArgumentException(
String.format("Invalid bucketName/objectName pair: gs://%s/%s", bucketName, objectName));
}
// TODO(user): Unify this method w... | [
"public",
"static",
"String",
"createReadableString",
"(",
"String",
"bucketName",
",",
"String",
"objectName",
")",
"{",
"if",
"(",
"bucketName",
"==",
"null",
"&&",
"objectName",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String"... | Helper for standardizing the way various human-readable messages in logs/exceptions that refer
to a bucket/object pair. | [
"Helper",
"for",
"standardizing",
"the",
"way",
"various",
"human",
"-",
"readable",
"messages",
"in",
"logs",
"/",
"exceptions",
"that",
"refer",
"to",
"a",
"bucket",
"/",
"object",
"pair",
"."
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/StorageResourceId.java#L223-L238 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bcc/BccClient.java | BccClient.createImage | public CreateImageResponse createImage(CreateImageRequest request) {
"""
Creating a customized image which can be used for creating instance in the future.
<p>
You can create an image from an instance or you can create from an snapshot.
The parameters of instanceId and snapshotId can no be null simultaneously... | java | public CreateImageResponse createImage(CreateImageRequest request) {
checkNotNull(request, "request should not be null.");
if (Strings.isNullOrEmpty(request.getClientToken())) {
request.setClientToken(this.generateClientToken());
}
checkStringNotEmpty(request.getImageName(), ... | [
"public",
"CreateImageResponse",
"createImage",
"(",
"CreateImageRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"request should not be null.\"",
")",
";",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"request",
".",
"getClientToken",
"(",
... | Creating a customized image which can be used for creating instance in the future.
<p>
You can create an image from an instance or you can create from an snapshot.
The parameters of instanceId and snapshotId can no be null simultaneously.
when both instanceId and snapshotId are assigned,only instanceId will be used.
<... | [
"Creating",
"a",
"customized",
"image",
"which",
"can",
"be",
"used",
"for",
"creating",
"instance",
"in",
"the",
"future",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bcc/BccClient.java#L1251-L1264 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/auth/HttpAuthServiceBuilder.java | HttpAuthServiceBuilder.addOAuth2 | public HttpAuthServiceBuilder addOAuth2(Authorizer<? super OAuth2Token> authorizer, AsciiString header) {
"""
Adds an OAuth2 {@link Authorizer} for the given {@code header}.
"""
return addTokenAuthorizer(new OAuth2TokenExtractor(requireNonNull(header, "header")),
requi... | java | public HttpAuthServiceBuilder addOAuth2(Authorizer<? super OAuth2Token> authorizer, AsciiString header) {
return addTokenAuthorizer(new OAuth2TokenExtractor(requireNonNull(header, "header")),
requireNonNull(authorizer, "authorizer"));
} | [
"public",
"HttpAuthServiceBuilder",
"addOAuth2",
"(",
"Authorizer",
"<",
"?",
"super",
"OAuth2Token",
">",
"authorizer",
",",
"AsciiString",
"header",
")",
"{",
"return",
"addTokenAuthorizer",
"(",
"new",
"OAuth2TokenExtractor",
"(",
"requireNonNull",
"(",
"header",
... | Adds an OAuth2 {@link Authorizer} for the given {@code header}. | [
"Adds",
"an",
"OAuth2",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/auth/HttpAuthServiceBuilder.java#L116-L119 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/tasks/net/ThreadBoundJschLogger.java | ThreadBoundJschLogger.setThreadLogger | private void setThreadLogger(BaseLogger logger, int loggingLevel) {
"""
Set the thread-inherited logger with a loglevel on Jsch
@param logger logger
@param loggingLevel level
"""
baseLogger.set(logger);
logLevel.set(loggingLevel);
JSch.setLogger(this);
} | java | private void setThreadLogger(BaseLogger logger, int loggingLevel) {
baseLogger.set(logger);
logLevel.set(loggingLevel);
JSch.setLogger(this);
} | [
"private",
"void",
"setThreadLogger",
"(",
"BaseLogger",
"logger",
",",
"int",
"loggingLevel",
")",
"{",
"baseLogger",
".",
"set",
"(",
"logger",
")",
";",
"logLevel",
".",
"set",
"(",
"loggingLevel",
")",
";",
"JSch",
".",
"setLogger",
"(",
"this",
")",
... | Set the thread-inherited logger with a loglevel on Jsch
@param logger logger
@param loggingLevel level | [
"Set",
"the",
"thread",
"-",
"inherited",
"logger",
"with",
"a",
"loglevel",
"on",
"Jsch"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/tasks/net/ThreadBoundJschLogger.java#L78-L82 |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/ElementSelectors.java | ElementSelectors.byXPath | public static ElementSelector byXPath(String xpath, ElementSelector childSelector) {
"""
Selects two elements as matching if the child elements selected
via XPath match using the given childSelector.
<p>The xpath expression should yield elements. Two elements
match if a DefaultNodeMatcher applied to the sele... | java | public static ElementSelector byXPath(String xpath, ElementSelector childSelector) {
return byXPath(xpath, null, childSelector);
} | [
"public",
"static",
"ElementSelector",
"byXPath",
"(",
"String",
"xpath",
",",
"ElementSelector",
"childSelector",
")",
"{",
"return",
"byXPath",
"(",
"xpath",
",",
"null",
",",
"childSelector",
")",
";",
"}"
] | Selects two elements as matching if the child elements selected
via XPath match using the given childSelector.
<p>The xpath expression should yield elements. Two elements
match if a DefaultNodeMatcher applied to the selected children
finds matching pairs for all children.</p>
@param xpath XPath expression applied in... | [
"Selects",
"two",
"elements",
"as",
"matching",
"if",
"the",
"child",
"elements",
"selected",
"via",
"XPath",
"match",
"using",
"the",
"given",
"childSelector",
"."
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/ElementSelectors.java#L381-L383 |
google/error-prone-javac | src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Graph.java | Graph.pathExists | private boolean pathExists(T u, T v, boolean includeAdjacent) {
"""
Returns true if there exists a path from u to v in this graph.
If includeAdjacent is false, it returns true if there exists
another path from u to v of distance > 1
"""
if (!nodes.contains(u) || !nodes.contains(v)) {
retu... | java | private boolean pathExists(T u, T v, boolean includeAdjacent) {
if (!nodes.contains(u) || !nodes.contains(v)) {
return false;
}
if (includeAdjacent && isAdjacent(u, v)) {
return true;
}
Deque<T> stack = new LinkedList<>();
Set<T> visited = new Hash... | [
"private",
"boolean",
"pathExists",
"(",
"T",
"u",
",",
"T",
"v",
",",
"boolean",
"includeAdjacent",
")",
"{",
"if",
"(",
"!",
"nodes",
".",
"contains",
"(",
"u",
")",
"||",
"!",
"nodes",
".",
"contains",
"(",
"v",
")",
")",
"{",
"return",
"false",... | Returns true if there exists a path from u to v in this graph.
If includeAdjacent is false, it returns true if there exists
another path from u to v of distance > 1 | [
"Returns",
"true",
"if",
"there",
"exists",
"a",
"path",
"from",
"u",
"to",
"v",
"in",
"this",
"graph",
".",
"If",
"includeAdjacent",
"is",
"false",
"it",
"returns",
"true",
"if",
"there",
"exists",
"another",
"path",
"from",
"u",
"to",
"v",
"of",
"dis... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Graph.java#L193-L217 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorsInner.java | ConnectionMonitorsInner.beginQueryAsync | public Observable<ConnectionMonitorQueryResultInner> beginQueryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) {
"""
Query a snapshot of the most recent connection states.
@param resourceGroupName The name of the resource group containing Network Watcher.
@param network... | java | public Observable<ConnectionMonitorQueryResultInner> beginQueryAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) {
return beginQueryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).map(new Func1<ServiceResponse<ConnectionMonitorQueryRe... | [
"public",
"Observable",
"<",
"ConnectionMonitorQueryResultInner",
">",
"beginQueryAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"String",
"connectionMonitorName",
")",
"{",
"return",
"beginQueryWithServiceResponseAsync",
"(",
"resourceG... | Query a snapshot of the most recent connection states.
@param resourceGroupName The name of the resource group containing Network Watcher.
@param networkWatcherName The name of the Network Watcher resource.
@param connectionMonitorName The name given to the connection monitor.
@throws IllegalArgumentException thrown i... | [
"Query",
"a",
"snapshot",
"of",
"the",
"most",
"recent",
"connection",
"states",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorsInner.java#L987-L994 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/DocumentTranslator.java | DocumentTranslator.getChildReferencesFromBlock | protected ChildReferences getChildReferencesFromBlock( Document block, boolean allowsSNS ) {
"""
Reads the children of the given block and returns a {@link ChildReferences} instance.
@param block a {@code non-null} {@link Document} representing a block of children
@param allowsSNS {@code true} if the child ref... | java | protected ChildReferences getChildReferencesFromBlock( Document block, boolean allowsSNS ) {
if (!block.containsField(CHILDREN)) {
return ImmutableChildReferences.EMPTY_CHILD_REFERENCES;
}
return ImmutableChildReferences.create(this, block, CHILDREN, allowsSNS);
} | [
"protected",
"ChildReferences",
"getChildReferencesFromBlock",
"(",
"Document",
"block",
",",
"boolean",
"allowsSNS",
")",
"{",
"if",
"(",
"!",
"block",
".",
"containsField",
"(",
"CHILDREN",
")",
")",
"{",
"return",
"ImmutableChildReferences",
".",
"EMPTY_CHILD_REF... | Reads the children of the given block and returns a {@link ChildReferences} instance.
@param block a {@code non-null} {@link Document} representing a block of children
@param allowsSNS {@code true} if the child references instance should be SNS aware, {@code false} otherwise
@return a {@code non-null} child references... | [
"Reads",
"the",
"children",
"of",
"the",
"given",
"block",
"and",
"returns",
"a",
"{",
"@link",
"ChildReferences",
"}",
"instance",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/DocumentTranslator.java#L917-L922 |
grails/grails-core | grails-core/src/main/groovy/grails/util/GrailsClassUtils.java | GrailsClassUtils.getFieldValue | public static Object getFieldValue(Object obj, String name) {
"""
Get the value of a declared field on an object
@param obj
@param name
@return The object value or null if there is no such field or access problems
"""
Class<?> clazz = obj.getClass();
try {
Field f = clazz.getDe... | java | public static Object getFieldValue(Object obj, String name) {
Class<?> clazz = obj.getClass();
try {
Field f = clazz.getDeclaredField(name);
return f.get(obj);
}
catch (Exception e) {
return null;
}
} | [
"public",
"static",
"Object",
"getFieldValue",
"(",
"Object",
"obj",
",",
"String",
"name",
")",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"obj",
".",
"getClass",
"(",
")",
";",
"try",
"{",
"Field",
"f",
"=",
"clazz",
".",
"getDeclaredField",
"(",
"... | Get the value of a declared field on an object
@param obj
@param name
@return The object value or null if there is no such field or access problems | [
"Get",
"the",
"value",
"of",
"a",
"declared",
"field",
"on",
"an",
"object"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L655-L664 |
paypal/SeLion | dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/ExcelDataProviderImpl.java | ExcelDataProviderImpl.getAllData | @Override
public Object[][] getAllData() {
"""
This function will read the whole excel sheet and map the data into two-dimensional array of object which is
compatible with TestNG DataProvider to provide real test data driven development. This function will ignore all
rows in which keys are preceded by "#" as... | java | @Override
public Object[][] getAllData() {
logger.entering();
int i;
Object[][] obj = null;
Field[] fields = resource.getCls().getDeclaredFields();
// Extracting number of rows of data to read
// Notice that numRows is returning the actual
// number of non-bl... | [
"@",
"Override",
"public",
"Object",
"[",
"]",
"[",
"]",
"getAllData",
"(",
")",
"{",
"logger",
".",
"entering",
"(",
")",
";",
"int",
"i",
";",
"Object",
"[",
"]",
"[",
"]",
"obj",
"=",
"null",
";",
"Field",
"[",
"]",
"fields",
"=",
"resource",
... | This function will read the whole excel sheet and map the data into two-dimensional array of object which is
compatible with TestNG DataProvider to provide real test data driven development. This function will ignore all
rows in which keys are preceded by "#" as a comment character.
For the function to work, the sheet... | [
"This",
"function",
"will",
"read",
"the",
"whole",
"excel",
"sheet",
"and",
"map",
"the",
"data",
"into",
"two",
"-",
"dimensional",
"array",
"of",
"object",
"which",
"is",
"compatible",
"with",
"TestNG",
"DataProvider",
"to",
"provide",
"real",
"test",
"da... | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/ExcelDataProviderImpl.java#L284-L316 |
chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/util/jaxb/JaxbUtils.java | JaxbUtils.unmarshalCollection | public static <T> List<T> unmarshalCollection(Class<T> cl, String s) throws JAXBException {
"""
Converts the contents of the string to a List with objects of the given class.
@param cl Type to be used
@param s Input string
@return List with objects of the given type
"""
return unmarshalCollection(cl,... | java | public static <T> List<T> unmarshalCollection(Class<T> cl, String s) throws JAXBException {
return unmarshalCollection(cl, new StringReader(s));
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"unmarshalCollection",
"(",
"Class",
"<",
"T",
">",
"cl",
",",
"String",
"s",
")",
"throws",
"JAXBException",
"{",
"return",
"unmarshalCollection",
"(",
"cl",
",",
"new",
"StringReader",
"(",
"s",... | Converts the contents of the string to a List with objects of the given class.
@param cl Type to be used
@param s Input string
@return List with objects of the given type | [
"Converts",
"the",
"contents",
"of",
"the",
"string",
"to",
"a",
"List",
"with",
"objects",
"of",
"the",
"given",
"class",
"."
] | train | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/util/jaxb/JaxbUtils.java#L299-L301 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java | StyleUtil.setColor | public static CellStyle setColor(CellStyle cellStyle, IndexedColors color, FillPatternType fillPattern) {
"""
给cell设置颜色
@param cellStyle {@link CellStyle}
@param color 背景颜色
@param fillPattern 填充方式 {@link FillPatternType}枚举
@return {@link CellStyle}
"""
return setColor(cellStyle, color.index, fillPatte... | java | public static CellStyle setColor(CellStyle cellStyle, IndexedColors color, FillPatternType fillPattern) {
return setColor(cellStyle, color.index, fillPattern);
} | [
"public",
"static",
"CellStyle",
"setColor",
"(",
"CellStyle",
"cellStyle",
",",
"IndexedColors",
"color",
",",
"FillPatternType",
"fillPattern",
")",
"{",
"return",
"setColor",
"(",
"cellStyle",
",",
"color",
".",
"index",
",",
"fillPattern",
")",
";",
"}"
] | 给cell设置颜色
@param cellStyle {@link CellStyle}
@param color 背景颜色
@param fillPattern 填充方式 {@link FillPatternType}枚举
@return {@link CellStyle} | [
"给cell设置颜色"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java#L93-L95 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyDecoder.java | KeyDecoder.decodeByteObjDesc | public static Byte decodeByteObjDesc(byte[] src, int srcOffset)
throws CorruptEncodingException {
"""
Decodes a signed Byte object from exactly 1 or 2 bytes, as encoded for
descending order. If null is returned, then 1 byte was read.
@param src source of encoded bytes
@param srcOffset offset into sou... | java | public static Byte decodeByteObjDesc(byte[] src, int srcOffset)
throws CorruptEncodingException
{
try {
int b = src[srcOffset];
if (b == NULL_BYTE_HIGH || b == NULL_BYTE_LOW) {
return null;
}
return decodeByteDesc(src, srcOffset... | [
"public",
"static",
"Byte",
"decodeByteObjDesc",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"srcOffset",
")",
"throws",
"CorruptEncodingException",
"{",
"try",
"{",
"int",
"b",
"=",
"src",
"[",
"srcOffset",
"]",
";",
"if",
"(",
"b",
"==",
"NULL_BYTE_HIGH",
... | Decodes a signed Byte object from exactly 1 or 2 bytes, as encoded for
descending order. If null is returned, then 1 byte was read.
@param src source of encoded bytes
@param srcOffset offset into source array
@return signed Byte object or null | [
"Decodes",
"a",
"signed",
"Byte",
"object",
"from",
"exactly",
"1",
"or",
"2",
"bytes",
"as",
"encoded",
"for",
"descending",
"order",
".",
"If",
"null",
"is",
"returned",
"then",
"1",
"byte",
"was",
"read",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyDecoder.java#L134-L146 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/modules/r/interpolation2d/core/TPSInterpolator.java | TPSInterpolator.fillKsubMatrix | private void fillKsubMatrix( Coordinate[] controlPoints, GeneralMatrix L ) {
"""
Fill K submatrix (<a href="http://elonen.iki.fi/code/tpsdemo/index.html"> see more here</a>)
@param controlPoints
@param L
"""
double alfa = 0;
int controlPointsNum = controlPoints.length;
for( int i = ... | java | private void fillKsubMatrix( Coordinate[] controlPoints, GeneralMatrix L ) {
double alfa = 0;
int controlPointsNum = controlPoints.length;
for( int i = 0; i < controlPointsNum; i++ ) {
for( int j = i + 1; j < controlPointsNum; j++ ) {
double u = calculateFunctionU(con... | [
"private",
"void",
"fillKsubMatrix",
"(",
"Coordinate",
"[",
"]",
"controlPoints",
",",
"GeneralMatrix",
"L",
")",
"{",
"double",
"alfa",
"=",
"0",
";",
"int",
"controlPointsNum",
"=",
"controlPoints",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
... | Fill K submatrix (<a href="http://elonen.iki.fi/code/tpsdemo/index.html"> see more here</a>)
@param controlPoints
@param L | [
"Fill",
"K",
"submatrix",
"(",
"<a",
"href",
"=",
"http",
":",
"//",
"elonen",
".",
"iki",
".",
"fi",
"/",
"code",
"/",
"tpsdemo",
"/",
"index",
".",
"html",
">",
"see",
"more",
"here<",
"/",
"a",
">",
")"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/interpolation2d/core/TPSInterpolator.java#L119-L132 |
jenkinsci/jenkins | core/src/main/java/hudson/FilePath.java | FilePath.act | public <V,E extends Throwable> V act(Callable<V,E> callable) throws IOException, InterruptedException, E {
"""
Executes some program on the machine that this {@link FilePath} exists,
so that one can perform local file operations.
"""
if(channel!=null) {
// run this on a remote system
... | java | public <V,E extends Throwable> V act(Callable<V,E> callable) throws IOException, InterruptedException, E {
if(channel!=null) {
// run this on a remote system
return channel.call(callable);
} else {
// the file is on the local machine
return callable.call()... | [
"public",
"<",
"V",
",",
"E",
"extends",
"Throwable",
">",
"V",
"act",
"(",
"Callable",
"<",
"V",
",",
"E",
">",
"callable",
")",
"throws",
"IOException",
",",
"InterruptedException",
",",
"E",
"{",
"if",
"(",
"channel",
"!=",
"null",
")",
"{",
"// r... | Executes some program on the machine that this {@link FilePath} exists,
so that one can perform local file operations. | [
"Executes",
"some",
"program",
"on",
"the",
"machine",
"that",
"this",
"{"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/FilePath.java#L1156-L1164 |
op4j/op4j | src/main/java/org/op4j/functions/FnNumber.java | FnNumber.toStr | public static final Function<Number,String> toStr(Locale locale, boolean groupingUsed) {
"""
<p>
It returns the {@link String} representation of the target number in the given {@link Locale}. Grouping
will be used depending on the value of the groupingUsed parameter
</p>
@param locale the {@link Locale} to b... | java | public static final Function<Number,String> toStr(Locale locale, boolean groupingUsed) {
return new ToString(locale, groupingUsed);
} | [
"public",
"static",
"final",
"Function",
"<",
"Number",
",",
"String",
">",
"toStr",
"(",
"Locale",
"locale",
",",
"boolean",
"groupingUsed",
")",
"{",
"return",
"new",
"ToString",
"(",
"locale",
",",
"groupingUsed",
")",
";",
"}"
] | <p>
It returns the {@link String} representation of the target number in the given {@link Locale}. Grouping
will be used depending on the value of the groupingUsed parameter
</p>
@param locale the {@link Locale} to be used
@param groupingUsed whether or not grouping will be used
@return the {@link String} representati... | [
"<p",
">",
"It",
"returns",
"the",
"{",
"@link",
"String",
"}",
"representation",
"of",
"the",
"target",
"number",
"in",
"the",
"given",
"{",
"@link",
"Locale",
"}",
".",
"Grouping",
"will",
"be",
"used",
"depending",
"on",
"the",
"value",
"of",
"the",
... | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnNumber.java#L381-L383 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/util/XMLUtils.java | XMLUtils.buildNodeName | private static void buildNodeName(Node node, StringBuffer buffer) {
"""
Builds the node path expression for a node in the DOM tree.
@param node in a DOM tree.
@param buffer string buffer.
"""
if (node.getParentNode() == null) {
return;
}
buildNodeName(node.getParentNode()... | java | private static void buildNodeName(Node node, StringBuffer buffer) {
if (node.getParentNode() == null) {
return;
}
buildNodeName(node.getParentNode(), buffer);
if (node.getParentNode() != null
&& node.getParentNode().getParentNode() != null) {
buf... | [
"private",
"static",
"void",
"buildNodeName",
"(",
"Node",
"node",
",",
"StringBuffer",
"buffer",
")",
"{",
"if",
"(",
"node",
".",
"getParentNode",
"(",
")",
"==",
"null",
")",
"{",
"return",
";",
"}",
"buildNodeName",
"(",
"node",
".",
"getParentNode",
... | Builds the node path expression for a node in the DOM tree.
@param node in a DOM tree.
@param buffer string buffer. | [
"Builds",
"the",
"node",
"path",
"expression",
"for",
"a",
"node",
"in",
"the",
"DOM",
"tree",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/util/XMLUtils.java#L192-L205 |
tango-controls/JTango | server/src/main/java/org/tango/server/build/DevicePropertyBuilder.java | DevicePropertyBuilder.build | public void build(final Class<?> clazz, final Field field, final DeviceImpl device, final Object businessObject)
throws DevFailed {
"""
Create device property {@link DeviceProperty}
@param clazz
@param field
@param device
@param businessObject
@throws DevFailed
"""
xlogger.entry();
... | java | public void build(final Class<?> clazz, final Field field, final DeviceImpl device, final Object businessObject)
throws DevFailed {
xlogger.entry();
try {
// Inject each device property
final DeviceProperty annot = field.getAnnotation(DeviceProperty.class);
... | [
"public",
"void",
"build",
"(",
"final",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"Field",
"field",
",",
"final",
"DeviceImpl",
"device",
",",
"final",
"Object",
"businessObject",
")",
"throws",
"DevFailed",
"{",
"xlogger",
".",
"entry",
"(",
")",
... | Create device property {@link DeviceProperty}
@param clazz
@param field
@param device
@param businessObject
@throws DevFailed | [
"Create",
"device",
"property",
"{",
"@link",
"DeviceProperty",
"}"
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/build/DevicePropertyBuilder.java#L62-L101 |
pressgang-ccms/PressGangCCMSContentSpec | src/main/java/org/jboss/pressgang/ccms/contentspec/utils/CustomTopicXMLValidator.java | CustomTopicXMLValidator.isTopicANormalTopic | public static boolean isTopicANormalTopic(final BaseTopicWrapper<?> topic, final ServerSettingsWrapper serverSettings) {
"""
Check to see if a Topic is a normal topic, instead of a Revision History or Legal Notice
@param topic The topic to be checked.
@return True if the topic is a normal topic, otherwise fals... | java | public static boolean isTopicANormalTopic(final BaseTopicWrapper<?> topic, final ServerSettingsWrapper serverSettings) {
return !(topic.hasTag(serverSettings.getEntities().getRevisionHistoryTagId()) || topic.hasTag(
serverSettings.getEntities().getLegalNoticeTagId()) || topic.hasTag(
... | [
"public",
"static",
"boolean",
"isTopicANormalTopic",
"(",
"final",
"BaseTopicWrapper",
"<",
"?",
">",
"topic",
",",
"final",
"ServerSettingsWrapper",
"serverSettings",
")",
"{",
"return",
"!",
"(",
"topic",
".",
"hasTag",
"(",
"serverSettings",
".",
"getEntities"... | Check to see if a Topic is a normal topic, instead of a Revision History or Legal Notice
@param topic The topic to be checked.
@return True if the topic is a normal topic, otherwise false. | [
"Check",
"to",
"see",
"if",
"a",
"Topic",
"is",
"a",
"normal",
"topic",
"instead",
"of",
"a",
"Revision",
"History",
"or",
"Legal",
"Notice"
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/utils/CustomTopicXMLValidator.java#L153-L158 |
OpenLiberty/open-liberty | dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/ws/crypto/util/custom/CustomUtils.java | CustomUtils.getResourceBundle | public static ResourceBundle getResourceBundle(File location, String name, Locale locale) {
"""
find the best matching resouce bundle of the specified resouce file name.
"""
File[] files = new File[] { new File(location, name + "_" + locale.toString() + RESOURCE_FILE_EXT),
... | java | public static ResourceBundle getResourceBundle(File location, String name, Locale locale) {
File[] files = new File[] { new File(location, name + "_" + locale.toString() + RESOURCE_FILE_EXT),
new File(location, name + "_" + locale.getLanguage() + RESOURCE_FILE_EXT),
... | [
"public",
"static",
"ResourceBundle",
"getResourceBundle",
"(",
"File",
"location",
",",
"String",
"name",
",",
"Locale",
"locale",
")",
"{",
"File",
"[",
"]",
"files",
"=",
"new",
"File",
"[",
"]",
"{",
"new",
"File",
"(",
"location",
",",
"name",
"+",
... | find the best matching resouce bundle of the specified resouce file name. | [
"find",
"the",
"best",
"matching",
"resouce",
"bundle",
"of",
"the",
"specified",
"resouce",
"file",
"name",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/ws/crypto/util/custom/CustomUtils.java#L152-L168 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java | SARLQuickfixProvider.fixUnreachableBehaviorUnit | @Fix(io.sarl.lang.validation.IssueCodes.UNREACHABLE_BEHAVIOR_UNIT)
public void fixUnreachableBehaviorUnit(Issue issue, IssueResolutionAcceptor acceptor) {
"""
Quick fix for "Unreachable behavior unit".
@param issue the issue.
@param acceptor the quick fix acceptor.
"""
MemberRemoveModification.accept(th... | java | @Fix(io.sarl.lang.validation.IssueCodes.UNREACHABLE_BEHAVIOR_UNIT)
public void fixUnreachableBehaviorUnit(Issue issue, IssueResolutionAcceptor acceptor) {
MemberRemoveModification.accept(this, issue, acceptor);
} | [
"@",
"Fix",
"(",
"io",
".",
"sarl",
".",
"lang",
".",
"validation",
".",
"IssueCodes",
".",
"UNREACHABLE_BEHAVIOR_UNIT",
")",
"public",
"void",
"fixUnreachableBehaviorUnit",
"(",
"Issue",
"issue",
",",
"IssueResolutionAcceptor",
"acceptor",
")",
"{",
"MemberRemove... | Quick fix for "Unreachable behavior unit".
@param issue the issue.
@param acceptor the quick fix acceptor. | [
"Quick",
"fix",
"for",
"Unreachable",
"behavior",
"unit",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java#L775-L778 |
ag-gipp/MathMLTools | mathml-core/src/main/java/com/formulasearchengine/mathmltools/helper/XMLHelper.java | XMLHelper.string2Doc | public static Document string2Doc(String inputXMLString, boolean namespaceAwareness) {
"""
Helper program: Transforms a String to a XML Document.
@param inputXMLString the input xml string
@param namespaceAwareness the namespace awareness
@return parsed document
"""
try {
return Xm... | java | public static Document string2Doc(String inputXMLString, boolean namespaceAwareness) {
try {
return XmlDocumentReader.parse(inputXMLString, false);
} catch (IOException | SAXException e) {
log.error("Cannot parse XML string.", e);
return null;
}
// try ... | [
"public",
"static",
"Document",
"string2Doc",
"(",
"String",
"inputXMLString",
",",
"boolean",
"namespaceAwareness",
")",
"{",
"try",
"{",
"return",
"XmlDocumentReader",
".",
"parse",
"(",
"inputXMLString",
",",
"false",
")",
";",
"}",
"catch",
"(",
"IOException... | Helper program: Transforms a String to a XML Document.
@param inputXMLString the input xml string
@param namespaceAwareness the namespace awareness
@return parsed document | [
"Helper",
"program",
":",
"Transforms",
"a",
"String",
"to",
"a",
"XML",
"Document",
"."
] | train | https://github.com/ag-gipp/MathMLTools/blob/77c69b6366a5b8720796d1cd9d155ba26c2f1b20/mathml-core/src/main/java/com/formulasearchengine/mathmltools/helper/XMLHelper.java#L193-L210 |
burberius/eve-esi | src/main/java/net/troja/eve/esi/api/FleetsApi.java | FleetsApi.getFleetsFleetId | public FleetResponse getFleetsFleetId(Long fleetId, String datasource, String ifNoneMatch, String token)
throws ApiException {
"""
Get fleet information Return details about a fleet --- This route is
cached for up to 5 seconds SSO Scope: esi-fleets.read_fleet.v1
@param fleetId
ID for a fleet (requ... | java | public FleetResponse getFleetsFleetId(Long fleetId, String datasource, String ifNoneMatch, String token)
throws ApiException {
ApiResponse<FleetResponse> resp = getFleetsFleetIdWithHttpInfo(fleetId, datasource, ifNoneMatch, token);
return resp.getData();
} | [
"public",
"FleetResponse",
"getFleetsFleetId",
"(",
"Long",
"fleetId",
",",
"String",
"datasource",
",",
"String",
"ifNoneMatch",
",",
"String",
"token",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"FleetResponse",
">",
"resp",
"=",
"getFleetsFleetIdWith... | Get fleet information Return details about a fleet --- This route is
cached for up to 5 seconds SSO Scope: esi-fleets.read_fleet.v1
@param fleetId
ID for a fleet (required)
@param datasource
The server name you would like data from (optional, default to
tranquility)
@param ifNoneMatch
ETag from a previous request. A 3... | [
"Get",
"fleet",
"information",
"Return",
"details",
"about",
"a",
"fleet",
"---",
"This",
"route",
"is",
"cached",
"for",
"up",
"to",
"5",
"seconds",
"SSO",
"Scope",
":",
"esi",
"-",
"fleets",
".",
"read_fleet",
".",
"v1"
] | train | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/FleetsApi.java#L792-L796 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_statistics_partition_partition_chart_GET | public OvhChartReturn serviceName_statistics_partition_partition_chart_GET(String serviceName, String partition, OvhRtmChartPeriodEnum period) throws IOException {
"""
Retrieve partition charts
REST: GET /dedicated/server/{serviceName}/statistics/partition/{partition}/chart
@param period [required] chart perio... | java | public OvhChartReturn serviceName_statistics_partition_partition_chart_GET(String serviceName, String partition, OvhRtmChartPeriodEnum period) throws IOException {
String qPath = "/dedicated/server/{serviceName}/statistics/partition/{partition}/chart";
StringBuilder sb = path(qPath, serviceName, partition);
query... | [
"public",
"OvhChartReturn",
"serviceName_statistics_partition_partition_chart_GET",
"(",
"String",
"serviceName",
",",
"String",
"partition",
",",
"OvhRtmChartPeriodEnum",
"period",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/{serviceName}/st... | Retrieve partition charts
REST: GET /dedicated/server/{serviceName}/statistics/partition/{partition}/chart
@param period [required] chart period
@param serviceName [required] The internal name of your dedicated server
@param partition [required] Partition | [
"Retrieve",
"partition",
"charts"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L1249-L1255 |
aws/aws-sdk-java | aws-java-sdk-iot1clickdevices/src/main/java/com/amazonaws/services/iot1clickdevices/model/DeviceDescription.java | DeviceDescription.withAttributes | public DeviceDescription withAttributes(java.util.Map<String, String> attributes) {
"""
<p>
An array of zero or more elements of DeviceAttribute objects providing user specified device attributes.
</p>
@param attributes
An array of zero or more elements of DeviceAttribute objects providing user specified dev... | java | public DeviceDescription withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"DeviceDescription",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
An array of zero or more elements of DeviceAttribute objects providing user specified device attributes.
</p>
@param attributes
An array of zero or more elements of DeviceAttribute objects providing user specified device attributes.
@return Returns a reference to this object so that method calls can be chained tog... | [
"<p",
">",
"An",
"array",
"of",
"zero",
"or",
"more",
"elements",
"of",
"DeviceAttribute",
"objects",
"providing",
"user",
"specified",
"device",
"attributes",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot1clickdevices/src/main/java/com/amazonaws/services/iot1clickdevices/model/DeviceDescription.java#L146-L149 |
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.getCompositeEntityRoleAsync | public Observable<EntityRole> getCompositeEntityRoleAsync(UUID appId, String versionId, UUID cEntityId, UUID roleId) {
"""
Get one entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param cEntityId The composite entity extractor ID.
@param roleId entity role ID... | java | public Observable<EntityRole> getCompositeEntityRoleAsync(UUID appId, String versionId, UUID cEntityId, UUID roleId) {
return getCompositeEntityRoleWithServiceResponseAsync(appId, versionId, cEntityId, roleId).map(new Func1<ServiceResponse<EntityRole>, EntityRole>() {
@Override
public En... | [
"public",
"Observable",
"<",
"EntityRole",
">",
"getCompositeEntityRoleAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"cEntityId",
",",
"UUID",
"roleId",
")",
"{",
"return",
"getCompositeEntityRoleWithServiceResponseAsync",
"(",
"appId",
",",
... | Get one entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param cEntityId The composite entity extractor ID.
@param roleId entity role ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the EntityRole object | [
"Get",
"one",
"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#L12383-L12390 |
google/closure-templates | java/src/com/google/template/soy/jssrc/internal/GenJsCodeVisitorAssistantForMsgs.java | GenJsCodeVisitorAssistantForMsgs.genGoogGetMsgCallHelper | private GoogMsgCodeGenInfo genGoogGetMsgCallHelper(String googMsgVarName, MsgNode msgNode) {
"""
Generates the goog.getMsg call for an MsgNode. The goog.getMsg call (including JsDoc) will be
appended to the jsCodeBuilder.
@return The GoogMsgCodeGenInfo object created in the process, which may be needed for
ge... | java | private GoogMsgCodeGenInfo genGoogGetMsgCallHelper(String googMsgVarName, MsgNode msgNode) {
// Build the code for the message content.
// TODO: We could build the msg parts once and save it as a field on the MsgNode or save it some
// other way, but it would increase memory usage a little bit. It's probab... | [
"private",
"GoogMsgCodeGenInfo",
"genGoogGetMsgCallHelper",
"(",
"String",
"googMsgVarName",
",",
"MsgNode",
"msgNode",
")",
"{",
"// Build the code for the message content.",
"// TODO: We could build the msg parts once and save it as a field on the MsgNode or save it some",
"// other way,... | Generates the goog.getMsg call for an MsgNode. The goog.getMsg call (including JsDoc) will be
appended to the jsCodeBuilder.
@return The GoogMsgCodeGenInfo object created in the process, which may be needed for
generating postprocessing code (if the message is plural/select). | [
"Generates",
"the",
"goog",
".",
"getMsg",
"call",
"for",
"an",
"MsgNode",
".",
"The",
"goog",
".",
"getMsg",
"call",
"(",
"including",
"JsDoc",
")",
"will",
"be",
"appended",
"to",
"the",
"jsCodeBuilder",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/internal/GenJsCodeVisitorAssistantForMsgs.java#L283-L329 |
finmath/finmath-lib | src/main/java/net/finmath/marketdata/model/bond/Bond.java | Bond.getValueWithGivenSpreadOverCurve | public double getValueWithGivenSpreadOverCurve(double evaluationTime,Curve referenceCurve, double spread, AnalyticModel model) {
"""
Returns the value of the sum of discounted cash flows of the bond where
the discounting is done with the given reference curve and an additional spread.
This method can be used for... | java | public double getValueWithGivenSpreadOverCurve(double evaluationTime,Curve referenceCurve, double spread, AnalyticModel model) {
double value=0;
for(int periodIndex=0; periodIndex<schedule.getNumberOfPeriods();periodIndex++) {
double paymentDate = schedule.getPayment(periodIndex);
value+= paymentDate>evaluati... | [
"public",
"double",
"getValueWithGivenSpreadOverCurve",
"(",
"double",
"evaluationTime",
",",
"Curve",
"referenceCurve",
",",
"double",
"spread",
",",
"AnalyticModel",
"model",
")",
"{",
"double",
"value",
"=",
"0",
";",
"for",
"(",
"int",
"periodIndex",
"=",
"0... | Returns the value of the sum of discounted cash flows of the bond where
the discounting is done with the given reference curve and an additional spread.
This method can be used for optimizer.
@param evaluationTime The evaluation time as double. Cash flows prior and including this time are not considered.
@param refere... | [
"Returns",
"the",
"value",
"of",
"the",
"sum",
"of",
"discounted",
"cash",
"flows",
"of",
"the",
"bond",
"where",
"the",
"discounting",
"is",
"done",
"with",
"the",
"given",
"reference",
"curve",
"and",
"an",
"additional",
"spread",
".",
"This",
"method",
... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/marketdata/model/bond/Bond.java#L235-L244 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/Projection.java | Projection.toPixelsFromProjected | @Deprecated
public Point toPixelsFromProjected(final PointL in, final Point reuse) {
"""
Performs the second computationally light part of the projection.
@param in
the PointL calculated by the {@link #toProjectedPixels(double, double, PointL)}
@param reuse
just pass null if you do not have a Point to be 'r... | java | @Deprecated
public Point toPixelsFromProjected(final PointL in, final Point reuse) {
final Point out = reuse != null ? reuse : new Point();
final double power = getProjectedPowerDifference();
final PointL tmp = new PointL();
getLongPixelsFromProjected(in, power, true, tmp);
out.x = TileSystem.truncateToInt(t... | [
"@",
"Deprecated",
"public",
"Point",
"toPixelsFromProjected",
"(",
"final",
"PointL",
"in",
",",
"final",
"Point",
"reuse",
")",
"{",
"final",
"Point",
"out",
"=",
"reuse",
"!=",
"null",
"?",
"reuse",
":",
"new",
"Point",
"(",
")",
";",
"final",
"double... | Performs the second computationally light part of the projection.
@param in
the PointL calculated by the {@link #toProjectedPixels(double, double, PointL)}
@param reuse
just pass null if you do not have a Point to be 'recycled'.
@return the Point containing the coordinates of the initial GeoPoint passed to the
{@link ... | [
"Performs",
"the",
"second",
"computationally",
"light",
"part",
"of",
"the",
"projection",
"."
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/Projection.java#L291-L300 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.newStatusUpdateRequest | private static Request newStatusUpdateRequest(Session session, String message, String placeId, List<String> tagIds,
Callback callback) {
"""
Creates a new Request configured to post a status update to a user's feed.
@param session
the Session to use, or null; if non-null, the session must be in an ... | java | private static Request newStatusUpdateRequest(Session session, String message, String placeId, List<String> tagIds,
Callback callback) {
Bundle parameters = new Bundle();
parameters.putString("message", message);
if (placeId != null) {
parameters.putString("place", plac... | [
"private",
"static",
"Request",
"newStatusUpdateRequest",
"(",
"Session",
"session",
",",
"String",
"message",
",",
"String",
"placeId",
",",
"List",
"<",
"String",
">",
"tagIds",
",",
"Callback",
"callback",
")",
"{",
"Bundle",
"parameters",
"=",
"new",
"Bund... | Creates a new Request configured to post a status update to a user's feed.
@param session
the Session to use, or null; if non-null, the session must be in an opened state
@param message
the text of the status update
@param placeId
an optional place id to associate with the post
@param tagIds
an optional list of user i... | [
"Creates",
"a",
"new",
"Request",
"configured",
"to",
"post",
"a",
"status",
"update",
"to",
"a",
"user",
"s",
"feed",
"."
] | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L459-L475 |
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java | DevicesInner.getUpdateSummaryAsync | public Observable<UpdateSummaryInner> getUpdateSummaryAsync(String deviceName, String resourceGroupName) {
"""
Gets information about the availability of updates based on the last scan of the device. It also gets information about any ongoing download or install jobs on the device.
@param deviceName The device ... | java | public Observable<UpdateSummaryInner> getUpdateSummaryAsync(String deviceName, String resourceGroupName) {
return getUpdateSummaryWithServiceResponseAsync(deviceName, resourceGroupName).map(new Func1<ServiceResponse<UpdateSummaryInner>, UpdateSummaryInner>() {
@Override
public UpdateSumm... | [
"public",
"Observable",
"<",
"UpdateSummaryInner",
">",
"getUpdateSummaryAsync",
"(",
"String",
"deviceName",
",",
"String",
"resourceGroupName",
")",
"{",
"return",
"getUpdateSummaryWithServiceResponseAsync",
"(",
"deviceName",
",",
"resourceGroupName",
")",
".",
"map",
... | Gets information about the availability of updates based on the last scan of the device. It also gets information about any ongoing download or install jobs on the device.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@throws IllegalArgumentException thrown if parameters fail the... | [
"Gets",
"information",
"about",
"the",
"availability",
"of",
"updates",
"based",
"on",
"the",
"last",
"scan",
"of",
"the",
"device",
".",
"It",
"also",
"gets",
"information",
"about",
"any",
"ongoing",
"download",
"or",
"install",
"jobs",
"on",
"the",
"devic... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java#L2036-L2043 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.