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 |
|---|---|---|---|---|---|---|---|---|---|---|
datoin/http-requests | src/main/java/org/datoin/net/http/Request.java | Request.getResponse | protected Response getResponse(HttpEntity entity, RequestBuilder req) {
"""
get response from preconfigured http entity and request builder
@param entity : http entity to be used in request
@param req : request builder object to build the http request
@return : Response object prepared after executing the r... | java | protected Response getResponse(HttpEntity entity, RequestBuilder req) {
CloseableHttpClient client = getClient();
initHeaders(req);
req.setEntity(entity);
CloseableHttpResponse resp = null;
Response response = null;
try {
final HttpUriRequest uriRequest = req.... | [
"protected",
"Response",
"getResponse",
"(",
"HttpEntity",
"entity",
",",
"RequestBuilder",
"req",
")",
"{",
"CloseableHttpClient",
"client",
"=",
"getClient",
"(",
")",
";",
"initHeaders",
"(",
"req",
")",
";",
"req",
".",
"setEntity",
"(",
"entity",
")",
"... | get response from preconfigured http entity and request builder
@param entity : http entity to be used in request
@param req : request builder object to build the http request
@return : Response object prepared after executing the request | [
"get",
"response",
"from",
"preconfigured",
"http",
"entity",
"and",
"request",
"builder"
] | train | https://github.com/datoin/http-requests/blob/660a4bc516c594f321019df94451fead4dea19b6/src/main/java/org/datoin/net/http/Request.java#L455-L478 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/EmulatedFields.java | EmulatedFields.get | public float get(String name, float defaultValue) throws IllegalArgumentException {
"""
Finds and returns the float value of a given field named {@code name} in
the receiver. If the field has not been assigned any value yet, the
default value {@code defaultValue} is returned instead.
@param name
the name of ... | java | public float get(String name, float defaultValue) throws IllegalArgumentException {
ObjectSlot slot = findMandatorySlot(name, float.class);
return slot.defaulted ? defaultValue : ((Float) slot.fieldValue).floatValue();
} | [
"public",
"float",
"get",
"(",
"String",
"name",
",",
"float",
"defaultValue",
")",
"throws",
"IllegalArgumentException",
"{",
"ObjectSlot",
"slot",
"=",
"findMandatorySlot",
"(",
"name",
",",
"float",
".",
"class",
")",
";",
"return",
"slot",
".",
"defaulted"... | Finds and returns the float value of a given field named {@code name} in
the receiver. If the field has not been assigned any value yet, the
default value {@code defaultValue} is returned instead.
@param name
the name of the field to find.
@param defaultValue
return value in case the field has not been assigned to yet... | [
"Finds",
"and",
"returns",
"the",
"float",
"value",
"of",
"a",
"given",
"field",
"named",
"{",
"@code",
"name",
"}",
"in",
"the",
"receiver",
".",
"If",
"the",
"field",
"has",
"not",
"been",
"assigned",
"any",
"value",
"yet",
"the",
"default",
"value",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/EmulatedFields.java#L268-L271 |
cdapio/tigon | tigon-api/src/main/java/co/cask/tigon/api/common/Bytes.java | Bytes.padTail | public static byte [] padTail(final byte [] a, final int length) {
"""
Return a byte array with value in <code>a</code> plus <code>length</code> appended 0 bytes.
@param a array
@param length new array size
@return Value in <code>a</code> plus <code>length</code> appended 0 bytes
"""
byte [] padding = n... | java | public static byte [] padTail(final byte [] a, final int length) {
byte [] padding = new byte[length];
for (int i = 0; i < length; i++) {
padding[i] = 0;
}
return add(a, padding);
} | [
"public",
"static",
"byte",
"[",
"]",
"padTail",
"(",
"final",
"byte",
"[",
"]",
"a",
",",
"final",
"int",
"length",
")",
"{",
"byte",
"[",
"]",
"padding",
"=",
"new",
"byte",
"[",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",... | Return a byte array with value in <code>a</code> plus <code>length</code> appended 0 bytes.
@param a array
@param length new array size
@return Value in <code>a</code> plus <code>length</code> appended 0 bytes | [
"Return",
"a",
"byte",
"array",
"with",
"value",
"in",
"<code",
">",
"a<",
"/",
"code",
">",
"plus",
"<code",
">",
"length<",
"/",
"code",
">",
"appended",
"0",
"bytes",
"."
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-api/src/main/java/co/cask/tigon/api/common/Bytes.java#L1078-L1084 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/layout/FlowLayoutExample.java | FlowLayoutExample.addBoxesWithDiffContent | private static void addBoxesWithDiffContent(final WPanel panel, final int amount) {
"""
Adds a set of boxes to the given panel.
@param panel the panel to add the boxes to.
@param amount the number of boxes to add.
"""
for (int i = 1; i <= amount; i++) {
WPanel content = new WPanel(WPanel.Type.BOX);
... | java | private static void addBoxesWithDiffContent(final WPanel panel, final int amount) {
for (int i = 1; i <= amount; i++) {
WPanel content = new WPanel(WPanel.Type.BOX);
content.setLayout(new FlowLayout(FlowLayout.VERTICAL, 3));
for (int j = 1; j <= i; j++) {
content.add(new WText(Integer.toString(i)));
}... | [
"private",
"static",
"void",
"addBoxesWithDiffContent",
"(",
"final",
"WPanel",
"panel",
",",
"final",
"int",
"amount",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<=",
"amount",
";",
"i",
"++",
")",
"{",
"WPanel",
"content",
"=",
"new",
"... | Adds a set of boxes to the given panel.
@param panel the panel to add the boxes to.
@param amount the number of boxes to add. | [
"Adds",
"a",
"set",
"of",
"boxes",
"to",
"the",
"given",
"panel",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/layout/FlowLayoutExample.java#L191-L200 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxUtils.java | TileBoundingBoxUtils.getTileGridWGS84 | public static TileGrid getTileGridWGS84(BoundingBox boundingBox, int zoom) {
"""
Get the tile grid that includes the entire tile bounding box
@param boundingBox
wgs84 bounding box
@param zoom
zoom level
@return tile grid
@since 1.2.0
"""
int tilesPerLat = tilesPerWGS84LatSide(zoom);
int tilesPer... | java | public static TileGrid getTileGridWGS84(BoundingBox boundingBox, int zoom) {
int tilesPerLat = tilesPerWGS84LatSide(zoom);
int tilesPerLon = tilesPerWGS84LonSide(zoom);
double tileSizeLat = tileSizeLatPerWGS84Side(tilesPerLat);
double tileSizeLon = tileSizeLonPerWGS84Side(tilesPerLon);
int minX = (int) ((b... | [
"public",
"static",
"TileGrid",
"getTileGridWGS84",
"(",
"BoundingBox",
"boundingBox",
",",
"int",
"zoom",
")",
"{",
"int",
"tilesPerLat",
"=",
"tilesPerWGS84LatSide",
"(",
"zoom",
")",
";",
"int",
"tilesPerLon",
"=",
"tilesPerWGS84LonSide",
"(",
"zoom",
")",
";... | Get the tile grid that includes the entire tile bounding box
@param boundingBox
wgs84 bounding box
@param zoom
zoom level
@return tile grid
@since 1.2.0 | [
"Get",
"the",
"tile",
"grid",
"that",
"includes",
"the",
"entire",
"tile",
"bounding",
"box"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxUtils.java#L1135-L1164 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/json/ObjectToJsonConverter.java | ObjectToJsonConverter.setObjectValue | private Object setObjectValue(Object pInner, String pAttribute, Object pValue)
throws IllegalAccessException, InvocationTargetException {
"""
Set an value of an inner object
@param pInner the inner object
@param pAttribute the attribute to set
@param pValue the value to set
@return the old value
... | java | private Object setObjectValue(Object pInner, String pAttribute, Object pValue)
throws IllegalAccessException, InvocationTargetException {
// Call various handlers depending on the type of the inner object, as is extract Object
Class clazz = pInner.getClass();
if (clazz.isArray()) {... | [
"private",
"Object",
"setObjectValue",
"(",
"Object",
"pInner",
",",
"String",
"pAttribute",
",",
"Object",
"pValue",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"// Call various handlers depending on the type of the inner object, as is extract... | Set an value of an inner object
@param pInner the inner object
@param pAttribute the attribute to set
@param pValue the value to set
@return the old value
@throws IllegalAccessException if the reflection code fails during setting of the value
@throws InvocationTargetException reflection error | [
"Set",
"an",
"value",
"of",
"an",
"inner",
"object"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/ObjectToJsonConverter.java#L226-L244 |
forge/javaee-descriptors | impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/facespartialresponse20/WebFacesPartialResponseDescriptorImpl.java | WebFacesPartialResponseDescriptorImpl.addNamespace | public WebFacesPartialResponseDescriptor addNamespace(String name, String value) {
"""
Adds a new namespace
@return the current instance of <code>WebFacesPartialResponseDescriptor</code>
"""
model.attribute(name, value);
return this;
} | java | public WebFacesPartialResponseDescriptor addNamespace(String name, String value)
{
model.attribute(name, value);
return this;
} | [
"public",
"WebFacesPartialResponseDescriptor",
"addNamespace",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"model",
".",
"attribute",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds a new namespace
@return the current instance of <code>WebFacesPartialResponseDescriptor</code> | [
"Adds",
"a",
"new",
"namespace"
] | train | https://github.com/forge/javaee-descriptors/blob/cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed/impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/facespartialresponse20/WebFacesPartialResponseDescriptorImpl.java#L85-L89 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/LineSegment.java | LineSegment.getIntersection | public Coordinate getIntersection(LineSegment lineSegment) {
"""
Return the intersection point of 2 lines. Yes you are reading this correctly! For this function the LineSegments
are treated as lines. This means that the intersection point does not necessarily lie on the LineSegment (in that
case, the {@link #int... | java | public Coordinate getIntersection(LineSegment lineSegment) { // may not be on either one of the line segments.
// http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/
double x1 = this.x1();
double y1 = this.y1();
double x2 = this.x2();
double y2 = this.y2();
double x3 = lineSegment.x1();
double y3 =... | [
"public",
"Coordinate",
"getIntersection",
"(",
"LineSegment",
"lineSegment",
")",
"{",
"// may not be on either one of the line segments.",
"// http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/",
"double",
"x1",
"=",
"this",
".",
"x1",
"(",
")",
";",
"double",
"y1",... | Return the intersection point of 2 lines. Yes you are reading this correctly! For this function the LineSegments
are treated as lines. This means that the intersection point does not necessarily lie on the LineSegment (in that
case, the {@link #intersects} function would return false).
@param lineSegment
The other Lin... | [
"Return",
"the",
"intersection",
"point",
"of",
"2",
"lines",
".",
"Yes",
"you",
"are",
"reading",
"this",
"correctly!",
"For",
"this",
"function",
"the",
"LineSegments",
"are",
"treated",
"as",
"lines",
".",
"This",
"means",
"that",
"the",
"intersection",
"... | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/LineSegment.java#L118-L135 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/Parser.java | Parser.parseLineComment | public static int parseLineComment(final char[] query, int offset) {
"""
Test if the <tt>-</tt> character at <tt>offset</tt> starts a <tt>--</tt> style line comment,
and return the position of the first <tt>\r</tt> or <tt>\n</tt> character.
@param query query
@param offset start offset
@return position of t... | java | public static int parseLineComment(final char[] query, int offset) {
if (offset + 1 < query.length && query[offset + 1] == '-') {
while (offset + 1 < query.length) {
offset++;
if (query[offset] == '\r' || query[offset] == '\n') {
break;
}
}
}
return offset;
} | [
"public",
"static",
"int",
"parseLineComment",
"(",
"final",
"char",
"[",
"]",
"query",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"offset",
"+",
"1",
"<",
"query",
".",
"length",
"&&",
"query",
"[",
"offset",
"+",
"1",
"]",
"==",
"'",
"'",
")",
... | Test if the <tt>-</tt> character at <tt>offset</tt> starts a <tt>--</tt> style line comment,
and return the position of the first <tt>\r</tt> or <tt>\n</tt> character.
@param query query
@param offset start offset
@return position of the first <tt>\r</tt> or <tt>\n</tt> character | [
"Test",
"if",
"the",
"<tt",
">",
"-",
"<",
"/",
"tt",
">",
"character",
"at",
"<tt",
">",
"offset<",
"/",
"tt",
">",
"starts",
"a",
"<tt",
">",
"--",
"<",
"/",
"tt",
">",
"style",
"line",
"comment",
"and",
"return",
"the",
"position",
"of",
"the"... | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Parser.java#L503-L513 |
graknlabs/grakn | server/src/server/exception/TemporaryWriteException.java | TemporaryWriteException.indexOverlap | public static TemporaryWriteException indexOverlap(Vertex vertex, Exception e) {
"""
Thrown when multiple transactions overlap in using an index. This results in incomplete vertices being shared
between transactions.
"""
return new TemporaryWriteException(String.format("Index overlap has led to the ac... | java | public static TemporaryWriteException indexOverlap(Vertex vertex, Exception e){
return new TemporaryWriteException(String.format("Index overlap has led to the accidental sharing of a partially complete vertex {%s}", vertex), e);
} | [
"public",
"static",
"TemporaryWriteException",
"indexOverlap",
"(",
"Vertex",
"vertex",
",",
"Exception",
"e",
")",
"{",
"return",
"new",
"TemporaryWriteException",
"(",
"String",
".",
"format",
"(",
"\"Index overlap has led to the accidental sharing of a partially complete v... | Thrown when multiple transactions overlap in using an index. This results in incomplete vertices being shared
between transactions. | [
"Thrown",
"when",
"multiple",
"transactions",
"overlap",
"in",
"using",
"an",
"index",
".",
"This",
"results",
"in",
"incomplete",
"vertices",
"being",
"shared",
"between",
"transactions",
"."
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/exception/TemporaryWriteException.java#L54-L56 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java | TaskSlotTable.markSlotInactive | public boolean markSlotInactive(AllocationID allocationId, Time slotTimeout) throws SlotNotFoundException {
"""
Marks the slot under the given allocation id as inactive. If the slot could not be found,
then a {@link SlotNotFoundException} is thrown.
@param allocationId to identify the task slot to mark as inac... | java | public boolean markSlotInactive(AllocationID allocationId, Time slotTimeout) throws SlotNotFoundException {
checkInit();
TaskSlot taskSlot = getTaskSlot(allocationId);
if (taskSlot != null) {
if (taskSlot.markInactive()) {
// register a timeout to free the slot
timerService.registerTimeout(allocation... | [
"public",
"boolean",
"markSlotInactive",
"(",
"AllocationID",
"allocationId",
",",
"Time",
"slotTimeout",
")",
"throws",
"SlotNotFoundException",
"{",
"checkInit",
"(",
")",
";",
"TaskSlot",
"taskSlot",
"=",
"getTaskSlot",
"(",
"allocationId",
")",
";",
"if",
"(",... | Marks the slot under the given allocation id as inactive. If the slot could not be found,
then a {@link SlotNotFoundException} is thrown.
@param allocationId to identify the task slot to mark as inactive
@param slotTimeout until the slot times out
@throws SlotNotFoundException if the slot could not be found for the gi... | [
"Marks",
"the",
"slot",
"under",
"the",
"given",
"allocation",
"id",
"as",
"inactive",
".",
"If",
"the",
"slot",
"could",
"not",
"be",
"found",
"then",
"a",
"{",
"@link",
"SlotNotFoundException",
"}",
"is",
"thrown",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java#L259-L276 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ClassDocImpl.java | ClassDocImpl.serializationMethods | public MethodDoc[] serializationMethods() {
"""
Return the serialization methods for this class.
@return an array of <code>MethodDocImpl</code> that represents
the serialization methods for this class.
"""
if (serializedForm == null) {
serializedForm = new SerializedForm(env, tsym, this... | java | public MethodDoc[] serializationMethods() {
if (serializedForm == null) {
serializedForm = new SerializedForm(env, tsym, this);
}
//### Clone this?
return serializedForm.methods();
} | [
"public",
"MethodDoc",
"[",
"]",
"serializationMethods",
"(",
")",
"{",
"if",
"(",
"serializedForm",
"==",
"null",
")",
"{",
"serializedForm",
"=",
"new",
"SerializedForm",
"(",
"env",
",",
"tsym",
",",
"this",
")",
";",
"}",
"//### Clone this?",
"return",
... | Return the serialization methods for this class.
@return an array of <code>MethodDocImpl</code> that represents
the serialization methods for this class. | [
"Return",
"the",
"serialization",
"methods",
"for",
"this",
"class",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ClassDocImpl.java#L1258-L1264 |
impossibl/stencil | engine/src/main/java/com/impossibl/stencil/engine/StencilEngine.java | StencilEngine.renderInline | public String renderInline(String text, GlobalScope... extraGlobalScopes) throws IOException, ParseException {
"""
Renders given text and returns rendered text.
@param text Template text to render
@param extraGlobalScopes Any extra global scopes to make available
@return Rendered text
@throws IOException
@t... | java | public String renderInline(String text, GlobalScope... extraGlobalScopes) throws IOException, ParseException {
return render(loadInline(text), extraGlobalScopes);
} | [
"public",
"String",
"renderInline",
"(",
"String",
"text",
",",
"GlobalScope",
"...",
"extraGlobalScopes",
")",
"throws",
"IOException",
",",
"ParseException",
"{",
"return",
"render",
"(",
"loadInline",
"(",
"text",
")",
",",
"extraGlobalScopes",
")",
";",
"}"
... | Renders given text and returns rendered text.
@param text Template text to render
@param extraGlobalScopes Any extra global scopes to make available
@return Rendered text
@throws IOException
@throws ParseException | [
"Renders",
"given",
"text",
"and",
"returns",
"rendered",
"text",
"."
] | train | https://github.com/impossibl/stencil/blob/4aac1be605542b4248be95bf8916be4e2f755d1c/engine/src/main/java/com/impossibl/stencil/engine/StencilEngine.java#L299-L301 |
skyscreamer/JSONassert | src/main/java/org/skyscreamer/jsonassert/JSONAssert.java | JSONAssert.assertEquals | public static void assertEquals(String message, String expectedStr, String actualStr, JSONCompareMode compareMode)
throws JSONException {
"""
Asserts that the JSONArray provided matches the expected string. If it isn't it throws an
{@link AssertionError}.
@param message Error message to be displayed i... | java | public static void assertEquals(String message, String expectedStr, String actualStr, JSONCompareMode compareMode)
throws JSONException {
if (expectedStr==actualStr) return;
if (expectedStr==null){
throw new AssertionError("Expected string is null.");
}else if (actualStr==nul... | [
"public",
"static",
"void",
"assertEquals",
"(",
"String",
"message",
",",
"String",
"expectedStr",
",",
"String",
"actualStr",
",",
"JSONCompareMode",
"compareMode",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"expectedStr",
"==",
"actualStr",
")",
"return",
... | Asserts that the JSONArray provided matches the expected string. If it isn't it throws an
{@link AssertionError}.
@param message Error message to be displayed in case of assertion failure
@param expectedStr Expected JSON string
@param actualStr String to compare
@param compareMode Specifies which comparison mode to u... | [
"Asserts",
"that",
"the",
"JSONArray",
"provided",
"matches",
"the",
"expected",
"string",
".",
"If",
"it",
"isn",
"t",
"it",
"throws",
"an",
"{",
"@link",
"AssertionError",
"}",
"."
] | train | https://github.com/skyscreamer/JSONassert/blob/830efcf546d07f955d8a213cc5c8a1db34d78f04/src/main/java/org/skyscreamer/jsonassert/JSONAssert.java#L407-L419 |
aehrc/ontology-core | ontology-import/src/main/java/au/csiro/ontology/importer/rf2/RF2Importer.java | RF2Importer.getOntologyBuilder | protected OntologyBuilder getOntologyBuilder(VersionRows vr, String rootModuleId, String rootModuleVersion,
Map<String, String> metadata) {
"""
Hook method for subclasses to override.
@param vr
@param rootModuleId
@param rootModuleVersion
@param includeInactiveAxioms
@return
"""
retu... | java | protected OntologyBuilder getOntologyBuilder(VersionRows vr, String rootModuleId, String rootModuleVersion,
Map<String, String> metadata) {
return new OntologyBuilder(vr, rootModuleId, rootModuleVersion, metadata);
} | [
"protected",
"OntologyBuilder",
"getOntologyBuilder",
"(",
"VersionRows",
"vr",
",",
"String",
"rootModuleId",
",",
"String",
"rootModuleVersion",
",",
"Map",
"<",
"String",
",",
"String",
">",
"metadata",
")",
"{",
"return",
"new",
"OntologyBuilder",
"(",
"vr",
... | Hook method for subclasses to override.
@param vr
@param rootModuleId
@param rootModuleVersion
@param includeInactiveAxioms
@return | [
"Hook",
"method",
"for",
"subclasses",
"to",
"override",
"."
] | train | https://github.com/aehrc/ontology-core/blob/446aa691119f2bbcb8d184566084b8da7a07a44e/ontology-import/src/main/java/au/csiro/ontology/importer/rf2/RF2Importer.java#L663-L666 |
primefaces-extensions/core | src/main/java/org/primefaces/extensions/model/dynaform/DynaFormRow.java | DynaFormRow.addControl | public DynaFormControl addControl(final Object data, final int colspan, final int rowspan) {
"""
Adds control with given data, default type, colspan and rowspan.
@param data data object
@param colspan colspan
@param rowspan rowspan
@return DynaFormControl added control
"""
return addControl(data,... | java | public DynaFormControl addControl(final Object data, final int colspan, final int rowspan) {
return addControl(data, DynaFormControl.DEFAULT_TYPE, colspan, rowspan);
} | [
"public",
"DynaFormControl",
"addControl",
"(",
"final",
"Object",
"data",
",",
"final",
"int",
"colspan",
",",
"final",
"int",
"rowspan",
")",
"{",
"return",
"addControl",
"(",
"data",
",",
"DynaFormControl",
".",
"DEFAULT_TYPE",
",",
"colspan",
",",
"rowspan... | Adds control with given data, default type, colspan and rowspan.
@param data data object
@param colspan colspan
@param rowspan rowspan
@return DynaFormControl added control | [
"Adds",
"control",
"with",
"given",
"data",
"default",
"type",
"colspan",
"and",
"rowspan",
"."
] | train | https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/model/dynaform/DynaFormRow.java#L82-L84 |
igniterealtime/REST-API-Client | src/main/java/org/igniterealtime/restclient/RestApiClient.java | RestApiClient.deleteMember | public Response deleteMember(String roomName, String jid) {
"""
Delete member from chatroom.
@param roomName
the room name
@param jid
the jid
@return the response
"""
return restClient.delete("chatrooms/" + roomName + "/members/" + jid,
new HashMap<String, String>());
} | java | public Response deleteMember(String roomName, String jid) {
return restClient.delete("chatrooms/" + roomName + "/members/" + jid,
new HashMap<String, String>());
} | [
"public",
"Response",
"deleteMember",
"(",
"String",
"roomName",
",",
"String",
"jid",
")",
"{",
"return",
"restClient",
".",
"delete",
"(",
"\"chatrooms/\"",
"+",
"roomName",
"+",
"\"/members/\"",
"+",
"jid",
",",
"new",
"HashMap",
"<",
"String",
",",
"Stri... | Delete member from chatroom.
@param roomName
the room name
@param jid
the jid
@return the response | [
"Delete",
"member",
"from",
"chatroom",
"."
] | train | https://github.com/igniterealtime/REST-API-Client/blob/fd544dd770ec2ababa47fef51579522ddce09f05/src/main/java/org/igniterealtime/restclient/RestApiClient.java#L315-L318 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/geometry/GeometryUtilities.java | GeometryUtilities.scaleDownToFit | public static void scaleDownToFit( Rectangle2D rectToFitIn, Rectangle2D toScale ) {
"""
Scales a rectangle down to fit inside the given one, keeping the ratio.
@param rectToFitIn the fixed rectangle to fit in.
@param toScale the rectangle to scale.
"""
double fitWidth = rectToFitIn.getWidth();
... | java | public static void scaleDownToFit( Rectangle2D rectToFitIn, Rectangle2D toScale ) {
double fitWidth = rectToFitIn.getWidth();
double fitHeight = rectToFitIn.getHeight();
double toScaleWidth = toScale.getWidth();
double toScaleHeight = toScale.getHeight();
if (toScaleWidth > fit... | [
"public",
"static",
"void",
"scaleDownToFit",
"(",
"Rectangle2D",
"rectToFitIn",
",",
"Rectangle2D",
"toScale",
")",
"{",
"double",
"fitWidth",
"=",
"rectToFitIn",
".",
"getWidth",
"(",
")",
";",
"double",
"fitHeight",
"=",
"rectToFitIn",
".",
"getHeight",
"(",
... | Scales a rectangle down to fit inside the given one, keeping the ratio.
@param rectToFitIn the fixed rectangle to fit in.
@param toScale the rectangle to scale. | [
"Scales",
"a",
"rectangle",
"down",
"to",
"fit",
"inside",
"the",
"given",
"one",
"keeping",
"the",
"ratio",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/geometry/GeometryUtilities.java#L716-L734 |
google/closure-templates | java/src/com/google/template/soy/plugin/java/restricted/JavaValueFactory.java | JavaValueFactory.createMethod | public static Method createMethod(Class<?> clazz, String methodName, Class<?>... params) {
"""
Convenience method for retrieving a {@link Method} from a class.
@see Class#getMethod(String, Class...)
"""
try {
return clazz.getMethod(methodName, params);
} catch (NoSuchMethodException | Security... | java | public static Method createMethod(Class<?> clazz, String methodName, Class<?>... params) {
try {
return clazz.getMethod(methodName, params);
} catch (NoSuchMethodException | SecurityException e) {
throw new IllegalArgumentException(e);
}
} | [
"public",
"static",
"Method",
"createMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"...",
"params",
")",
"{",
"try",
"{",
"return",
"clazz",
".",
"getMethod",
"(",
"methodName",
",",
"params",
... | Convenience method for retrieving a {@link Method} from a class.
@see Class#getMethod(String, Class...) | [
"Convenience",
"method",
"for",
"retrieving",
"a",
"{",
"@link",
"Method",
"}",
"from",
"a",
"class",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/plugin/java/restricted/JavaValueFactory.java#L61-L67 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasesInner.java | DatabasesInner.listByServerAsync | public Observable<Page<DatabaseInner>> listByServerAsync(final String resourceGroupName, final String serverName) {
"""
Gets a list of databases.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@par... | java | public Observable<Page<DatabaseInner>> listByServerAsync(final String resourceGroupName, final String serverName) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName)
.map(new Func1<ServiceResponse<Page<DatabaseInner>>, Page<DatabaseInner>>() {
@Override
... | [
"public",
"Observable",
"<",
"Page",
"<",
"DatabaseInner",
">",
">",
"listByServerAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"serverName",
")",
"{",
"return",
"listByServerWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"ser... | Gets a list of databases.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the obse... | [
"Gets",
"a",
"list",
"of",
"databases",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasesInner.java#L192-L200 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/Jinx.java | Jinx.flickrUpload | public <T> T flickrUpload(Map<String, String> params, byte[] photoData, Class<T> tClass) throws JinxException {
"""
Upload a photo or video to Flickr.
<br>
Do not call this directly. Use the {@link net.jeremybrooks.jinx.api.PhotosUploadApi} class.
@param params request parameters.
@param photoData photo o... | java | public <T> T flickrUpload(Map<String, String> params, byte[] photoData, Class<T> tClass) throws JinxException {
if (this.oAuthAccessToken == null) {
throw new JinxException("Jinx has not been configured with an OAuth Access Token.");
}
params.put("api_key", getApiKey());
return uploadOrReplace(par... | [
"public",
"<",
"T",
">",
"T",
"flickrUpload",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"params",
",",
"byte",
"[",
"]",
"photoData",
",",
"Class",
"<",
"T",
">",
"tClass",
")",
"throws",
"JinxException",
"{",
"if",
"(",
"this",
".",
"oAuthAcces... | Upload a photo or video to Flickr.
<br>
Do not call this directly. Use the {@link net.jeremybrooks.jinx.api.PhotosUploadApi} class.
@param params request parameters.
@param photoData photo or video data to upload.
@param tClass the class that will be returned.
@param <T> type of the class returned.
@return... | [
"Upload",
"a",
"photo",
"or",
"video",
"to",
"Flickr",
".",
"<br",
">",
"Do",
"not",
"call",
"this",
"directly",
".",
"Use",
"the",
"{",
"@link",
"net",
".",
"jeremybrooks",
".",
"jinx",
".",
"api",
".",
"PhotosUploadApi",
"}",
"class",
"."
] | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/Jinx.java#L593-L599 |
twilio/twilio-java | src/main/java/com/twilio/rest/authy/v1/service/EntityReader.java | EntityReader.previousPage | @Override
public Page<Entity> previousPage(final Page<Entity> page,
final TwilioRestClient client) {
"""
Retrieve the previous page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Previous Page
""... | java | @Override
public Page<Entity> previousPage(final Page<Entity> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getPreviousPageUrl(
Domains.AUTHY.toString(),
client.getRegio... | [
"@",
"Override",
"public",
"Page",
"<",
"Entity",
">",
"previousPage",
"(",
"final",
"Page",
"<",
"Entity",
">",
"page",
",",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".",
"GET",
",",
... | Retrieve the previous page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Previous Page | [
"Retrieve",
"the",
"previous",
"page",
"from",
"the",
"Twilio",
"API",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/authy/v1/service/EntityReader.java#L115-L126 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/waiters/WaiterExecution.java | WaiterExecution.pollResource | public boolean pollResource() throws AmazonServiceException, WaiterTimedOutException, WaiterUnrecoverableException {
"""
Polls until a specified resource transitions into either success or failure state or
until the specified number of retries has been made.
@return True if the resource transitions into desire... | java | public boolean pollResource() throws AmazonServiceException, WaiterTimedOutException, WaiterUnrecoverableException {
int retriesAttempted = 0;
while (true) {
switch (getCurrentState()) {
case SUCCESS:
return true;
case FAILURE:
... | [
"public",
"boolean",
"pollResource",
"(",
")",
"throws",
"AmazonServiceException",
",",
"WaiterTimedOutException",
",",
"WaiterUnrecoverableException",
"{",
"int",
"retriesAttempted",
"=",
"0",
";",
"while",
"(",
"true",
")",
"{",
"switch",
"(",
"getCurrentState",
"... | Polls until a specified resource transitions into either success or failure state or
until the specified number of retries has been made.
@return True if the resource transitions into desired state.
@throws AmazonServiceException If the service exception thrown doesn't match any of the expected
exceptions, it's ... | [
"Polls",
"until",
"a",
"specified",
"resource",
"transitions",
"into",
"either",
"success",
"or",
"failure",
"state",
"or",
"until",
"the",
"specified",
"number",
"of",
"retries",
"has",
"been",
"made",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/waiters/WaiterExecution.java#L71-L92 |
tempodb/tempodb-java | src/main/java/com/tempodb/Client.java | Client.readDataPoints | public Cursor<DataPoint> readDataPoints(Filter filter, Interval interval, DateTimeZone timezone, Aggregation aggregation, Rollup rollup, Interpolation interpolation) {
"""
Returns a cursor of datapoints specified by a series filter.
This endpoint allows one to request multiple series and apply an aggregation fu... | java | public Cursor<DataPoint> readDataPoints(Filter filter, Interval interval, DateTimeZone timezone, Aggregation aggregation, Rollup rollup, Interpolation interpolation) {
checkNotNull(filter);
checkNotNull(interval);
checkNotNull(aggregation);
checkNotNull(timezone);
URI uri = null;
try {
UR... | [
"public",
"Cursor",
"<",
"DataPoint",
">",
"readDataPoints",
"(",
"Filter",
"filter",
",",
"Interval",
"interval",
",",
"DateTimeZone",
"timezone",
",",
"Aggregation",
"aggregation",
",",
"Rollup",
"rollup",
",",
"Interpolation",
"interpolation",
")",
"{",
"checkN... | Returns a cursor of datapoints specified by a series filter.
This endpoint allows one to request multiple series and apply an aggregation function.
@param filter The series filter
@param interval An interval of time for the query (start/end datetimes)
@param timezone The time zone for the returned datapoints.
@param ... | [
"Returns",
"a",
"cursor",
"of",
"datapoints",
"specified",
"by",
"a",
"series",
"filter",
"."
] | train | https://github.com/tempodb/tempodb-java/blob/5733f204fe4c8dda48916ba1f67cf44f5a3f9c69/src/main/java/com/tempodb/Client.java#L830-L853 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java | OjbTagsHandler.processNested | public String processNested(Properties attributes) throws XDocletException {
"""
Addes the current member as a nested object.
@param template The template
@param attributes The attributes of the tag
@exception XDocletException If an error occurs
@doc.tag type="con... | java | public String processNested(Properties attributes) throws XDocletException
{
String name = OjbMemberTagsHandler.getMemberName();
XClass type = OjbMemberTagsHandler.getMemberType();
int dim = OjbMemberTagsHandler.getMemberDimension();
NestedDef nestedD... | [
"public",
"String",
"processNested",
"(",
"Properties",
"attributes",
")",
"throws",
"XDocletException",
"{",
"String",
"name",
"=",
"OjbMemberTagsHandler",
".",
"getMemberName",
"(",
")",
";",
"XClass",
"type",
"=",
"OjbMemberTagsHandler",
".",
"getMemberType",
"("... | Addes the current member as a nested object.
@param template The template
@param attributes The attributes of the tag
@exception XDocletException If an error occurs
@doc.tag type="content" | [
"Addes",
"the",
"current",
"member",
"as",
"a",
"nested",
"object",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java#L1084-L1127 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java | ComputationGraph.feedForward | public Map<String, INDArray> feedForward(INDArray[] input, boolean train) {
"""
Conduct forward pass using an array of inputs
@param input An array of ComputationGraph inputs
@param train If true: do forward pass at training time; false: do forward pass at test time
@return A map of activations for each layer... | java | public Map<String, INDArray> feedForward(INDArray[] input, boolean train) {
return feedForward(input, train, true);
} | [
"public",
"Map",
"<",
"String",
",",
"INDArray",
">",
"feedForward",
"(",
"INDArray",
"[",
"]",
"input",
",",
"boolean",
"train",
")",
"{",
"return",
"feedForward",
"(",
"input",
",",
"train",
",",
"true",
")",
";",
"}"
] | Conduct forward pass using an array of inputs
@param input An array of ComputationGraph inputs
@param train If true: do forward pass at training time; false: do forward pass at test time
@return A map of activations for each layer (not each GraphVertex). Keys = layer name, values = layer activations | [
"Conduct",
"forward",
"pass",
"using",
"an",
"array",
"of",
"inputs"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java#L1530-L1532 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncAgentsInner.java | SyncAgentsInner.getAsync | public Observable<SyncAgentInner> getAsync(String resourceGroupName, String serverName, String syncAgentName) {
"""
Gets a sync agent.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverNa... | java | public Observable<SyncAgentInner> getAsync(String resourceGroupName, String serverName, String syncAgentName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, syncAgentName).map(new Func1<ServiceResponse<SyncAgentInner>, SyncAgentInner>() {
@Override
public SyncAgentIn... | [
"public",
"Observable",
"<",
"SyncAgentInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"syncAgentName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
",",
"syncA... | Gets a sync agent.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server on which the sync agent is hosted.
@param syncAgentName The name of the sync agent.
@throws Illega... | [
"Gets",
"a",
"sync",
"agent",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncAgentsInner.java#L144-L151 |
EdwardRaff/JSAT | JSAT/src/jsat/linear/RowColumnOps.java | RowColumnOps.addCol | public static void addCol(Matrix A, int j, int start, int to, double c) {
"""
Updates the values of column <tt>j</tt> in the given matrix to be A[:,j] = A[:,j]+ c
@param A the matrix to perform he update on
@param j the row to update
@param start the first index of the row to update from (inclusive)
@param t... | java | public static void addCol(Matrix A, int j, int start, int to, double c)
{
for(int i = start; i < to; i++)
A.increment(i, j, c);
} | [
"public",
"static",
"void",
"addCol",
"(",
"Matrix",
"A",
",",
"int",
"j",
",",
"int",
"start",
",",
"int",
"to",
",",
"double",
"c",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"start",
";",
"i",
"<",
"to",
";",
"i",
"++",
")",
"A",
".",
"increme... | Updates the values of column <tt>j</tt> in the given matrix to be A[:,j] = A[:,j]+ c
@param A the matrix to perform he update on
@param j the row to update
@param start the first index of the row to update from (inclusive)
@param to the last index of the row to update (exclusive)
@param c the constant to add to each e... | [
"Updates",
"the",
"values",
"of",
"column",
"<tt",
">",
"j<",
"/",
"tt",
">",
"in",
"the",
"given",
"matrix",
"to",
"be",
"A",
"[",
":",
"j",
"]",
"=",
"A",
"[",
":",
"j",
"]",
"+",
"c"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/RowColumnOps.java#L177-L181 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.beginCreateOrUpdateWorkerPool | public WorkerPoolResourceInner beginCreateOrUpdateWorkerPool(String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) {
"""
Create or update a worker pool.
Create or update a worker pool.
@param resourceGroupName Name of the resource group to which the resource ... | java | public WorkerPoolResourceInner beginCreateOrUpdateWorkerPool(String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) {
return beginCreateOrUpdateWorkerPoolWithServiceResponseAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope).toBlocking().single()... | [
"public",
"WorkerPoolResourceInner",
"beginCreateOrUpdateWorkerPool",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"String",
"workerPoolName",
",",
"WorkerPoolResourceInner",
"workerPoolEnvelope",
")",
"{",
"return",
"beginCreateOrUpdateWorkerPoolWithServiceRes... | Create or update a worker pool.
Create or update a worker pool.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@param workerPoolName Name of the worker pool.
@param workerPoolEnvelope Properties of the worker pool.
@throws IllegalArgu... | [
"Create",
"or",
"update",
"a",
"worker",
"pool",
".",
"Create",
"or",
"update",
"a",
"worker",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L5278-L5280 |
jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/orm/ReflectionUtils.java | ReflectionUtils.getDeclaredFieldWithPath | public static Field getDeclaredFieldWithPath(Class<?> clazz, String path) {
"""
Returns the Field for a given parent class and a dot-separated path of
field names.
@param clazz
Parent class.
@param path
Path to the desired field.
"""
int lastDot = path.lastIndexOf('.');
if (lastDot > -... | java | public static Field getDeclaredFieldWithPath(Class<?> clazz, String path) {
int lastDot = path.lastIndexOf('.');
if (lastDot > -1) {
String parentPath = path.substring(0, lastDot);
String fieldName = path.substring(lastDot + 1);
Field parentField = getDeclaredFieldW... | [
"public",
"static",
"Field",
"getDeclaredFieldWithPath",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"path",
")",
"{",
"int",
"lastDot",
"=",
"path",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"lastDot",
">",
"-",
"1",
")",
"{",... | Returns the Field for a given parent class and a dot-separated path of
field names.
@param clazz
Parent class.
@param path
Path to the desired field. | [
"Returns",
"the",
"Field",
"for",
"a",
"given",
"parent",
"class",
"and",
"a",
"dot",
"-",
"separated",
"path",
"of",
"field",
"names",
"."
] | train | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/orm/ReflectionUtils.java#L44-L56 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java | CQLSSTableWriter.rawAddRow | public CQLSSTableWriter rawAddRow(List<ByteBuffer> values)
throws InvalidRequestException, IOException {
"""
Adds a new row to the writer given already serialized values.
<p>
This is a shortcut for {@code rawAddRow(Arrays.asList(values))}.
@param values the row values (corresponding to the bind variables ... | java | public CQLSSTableWriter rawAddRow(List<ByteBuffer> values)
throws InvalidRequestException, IOException
{
if (values.size() != boundNames.size())
throw new InvalidRequestException(String.format("Invalid number of arguments, expecting %d values but got %d", boundNames.size(), values.size()));
... | [
"public",
"CQLSSTableWriter",
"rawAddRow",
"(",
"List",
"<",
"ByteBuffer",
">",
"values",
")",
"throws",
"InvalidRequestException",
",",
"IOException",
"{",
"if",
"(",
"values",
".",
"size",
"(",
")",
"!=",
"boundNames",
".",
"size",
"(",
")",
")",
"throw",
... | Adds a new row to the writer given already serialized values.
<p>
This is a shortcut for {@code rawAddRow(Arrays.asList(values))}.
@param values the row values (corresponding to the bind variables of the
insertion statement used when creating by this writer) as binary.
@return this writer. | [
"Adds",
"a",
"new",
"row",
"to",
"the",
"writer",
"given",
"already",
"serialized",
"values",
".",
"<p",
">",
"This",
"is",
"a",
"shortcut",
"for",
"{",
"@code",
"rawAddRow",
"(",
"Arrays",
".",
"asList",
"(",
"values",
"))",
"}",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java#L201-L234 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/chrono/IsoChronology.java | IsoChronology.dateYearDay | @Override // override with covariant return type
public LocalDate dateYearDay(Era era, int yearOfEra, int dayOfYear) {
"""
Obtains an ISO local date from the era, year-of-era and day-of-year fields.
@param era the ISO era, not null
@param yearOfEra the ISO year-of-era
@param dayOfYear the ISO day-of-y... | java | @Override // override with covariant return type
public LocalDate dateYearDay(Era era, int yearOfEra, int dayOfYear) {
return dateYearDay(prolepticYear(era, yearOfEra), dayOfYear);
} | [
"@",
"Override",
"// override with covariant return type",
"public",
"LocalDate",
"dateYearDay",
"(",
"Era",
"era",
",",
"int",
"yearOfEra",
",",
"int",
"dayOfYear",
")",
"{",
"return",
"dateYearDay",
"(",
"prolepticYear",
"(",
"era",
",",
"yearOfEra",
")",
",",
... | Obtains an ISO local date from the era, year-of-era and day-of-year fields.
@param era the ISO era, not null
@param yearOfEra the ISO year-of-era
@param dayOfYear the ISO day-of-year
@return the ISO local date, not null
@throws DateTimeException if unable to create the date | [
"Obtains",
"an",
"ISO",
"local",
"date",
"from",
"the",
"era",
"year",
"-",
"of",
"-",
"era",
"and",
"day",
"-",
"of",
"-",
"year",
"fields",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/chrono/IsoChronology.java#L217-L220 |
jenkinsci/jenkins | core/src/main/java/hudson/security/csrf/CrumbIssuer.java | CrumbIssuer.validateCrumb | public boolean validateCrumb(ServletRequest request, MultipartFormDataParser parser) {
"""
Get a crumb from multipart form data and validate it against other data
in the current request. The salt and request parameter that is used is
defined by the current configuration.
@param request
@param parser
"""
... | java | public boolean validateCrumb(ServletRequest request, MultipartFormDataParser parser) {
CrumbIssuerDescriptor<CrumbIssuer> desc = getDescriptor();
String crumbField = desc.getCrumbRequestField();
String crumbSalt = desc.getCrumbSalt();
return validateCrumb(request, crumbSalt, parser.get(... | [
"public",
"boolean",
"validateCrumb",
"(",
"ServletRequest",
"request",
",",
"MultipartFormDataParser",
"parser",
")",
"{",
"CrumbIssuerDescriptor",
"<",
"CrumbIssuer",
">",
"desc",
"=",
"getDescriptor",
"(",
")",
";",
"String",
"crumbField",
"=",
"desc",
".",
"ge... | Get a crumb from multipart form data and validate it against other data
in the current request. The salt and request parameter that is used is
defined by the current configuration.
@param request
@param parser | [
"Get",
"a",
"crumb",
"from",
"multipart",
"form",
"data",
"and",
"validate",
"it",
"against",
"other",
"data",
"in",
"the",
"current",
"request",
".",
"The",
"salt",
"and",
"request",
"parameter",
"that",
"is",
"used",
"is",
"defined",
"by",
"the",
"curren... | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/security/csrf/CrumbIssuer.java#L131-L137 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java | TreeScanner.visitCase | @Override
public R visitCase(CaseTree node, P p) {
"""
{@inheritDoc} This implementation scans the children in left to right order.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of scanning
"""
R r = scan(node.getExpression(), p);
r = scanAndReduce(node.getState... | java | @Override
public R visitCase(CaseTree node, P p) {
R r = scan(node.getExpression(), p);
r = scanAndReduce(node.getStatements(), p, r);
return r;
} | [
"@",
"Override",
"public",
"R",
"visitCase",
"(",
"CaseTree",
"node",
",",
"P",
"p",
")",
"{",
"R",
"r",
"=",
"scan",
"(",
"node",
".",
"getExpression",
"(",
")",
",",
"p",
")",
";",
"r",
"=",
"scanAndReduce",
"(",
"node",
".",
"getStatements",
"("... | {@inheritDoc} This implementation scans the children in left to right order.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of scanning | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"scans",
"the",
"children",
"in",
"left",
"to",
"right",
"order",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java#L343-L348 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/xml/XMLOutputUtil.java | XMLOutputUtil.writeElementList | public static void writeElementList(XMLOutput xmlOutput, String tagName, Iterator<String> listValueIterator)
throws IOException {
"""
Write a list of Strings to document as elements with given tag name.
@param xmlOutput
the XMLOutput object to write to
@param tagName
the tag name
@param listValu... | java | public static void writeElementList(XMLOutput xmlOutput, String tagName, Iterator<String> listValueIterator)
throws IOException {
while (listValueIterator.hasNext()) {
xmlOutput.openTag(tagName);
xmlOutput.writeText(listValueIterator.next());
xmlOutput.closeTag(ta... | [
"public",
"static",
"void",
"writeElementList",
"(",
"XMLOutput",
"xmlOutput",
",",
"String",
"tagName",
",",
"Iterator",
"<",
"String",
">",
"listValueIterator",
")",
"throws",
"IOException",
"{",
"while",
"(",
"listValueIterator",
".",
"hasNext",
"(",
")",
")"... | Write a list of Strings to document as elements with given tag name.
@param xmlOutput
the XMLOutput object to write to
@param tagName
the tag name
@param listValueIterator
Iterator over String values to write | [
"Write",
"a",
"list",
"of",
"Strings",
"to",
"document",
"as",
"elements",
"with",
"given",
"tag",
"name",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/xml/XMLOutputUtil.java#L58-L65 |
samskivert/samskivert | src/main/java/com/samskivert/servlet/user/UserRepository.java | UserRepository.registerSession | public String registerSession (User user, int expireDays)
throws PersistenceException {
"""
Creates a new session for the specified user and returns the randomly generated session
identifier for that session. If a session entry already exists for the specified user it
will be reused.
@param expireDays... | java | public String registerSession (User user, int expireDays)
throws PersistenceException
{
// look for an existing session for this user
final String query = "select authcode from sessions where userId = " + user.userId;
String authcode = execute(new Operation<String>() {
pu... | [
"public",
"String",
"registerSession",
"(",
"User",
"user",
",",
"int",
"expireDays",
")",
"throws",
"PersistenceException",
"{",
"// look for an existing session for this user",
"final",
"String",
"query",
"=",
"\"select authcode from sessions where userId = \"",
"+",
"user"... | Creates a new session for the specified user and returns the randomly generated session
identifier for that session. If a session entry already exists for the specified user it
will be reused.
@param expireDays the number of days in which the session token should expire. | [
"Creates",
"a",
"new",
"session",
"for",
"the",
"specified",
"user",
"and",
"returns",
"the",
"randomly",
"generated",
"session",
"identifier",
"for",
"that",
"session",
".",
"If",
"a",
"session",
"entry",
"already",
"exists",
"for",
"the",
"specified",
"user"... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/user/UserRepository.java#L250-L289 |
unbescape/unbescape | src/main/java/org/unbescape/json/JsonEscape.java | JsonEscape.escapeJsonMinimal | public static void escapeJsonMinimal(final String text, final Writer writer)
throws IOException {
"""
<p>
Perform a JSON level 1 (only basic set) <strong>escape</strong> operation
on a <tt>String</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 1</em> means this method will onl... | java | public static void escapeJsonMinimal(final String text, final Writer writer)
throws IOException {
escapeJson(text, writer,
JsonEscapeType.SINGLE_ESCAPE_CHARS_DEFAULT_TO_UHEXA,
JsonEscapeLevel.LEVEL_1_BASIC_ESCAPE_SET);
} | [
"public",
"static",
"void",
"escapeJsonMinimal",
"(",
"final",
"String",
"text",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeJson",
"(",
"text",
",",
"writer",
",",
"JsonEscapeType",
".",
"SINGLE_ESCAPE_CHARS_DEFAULT_TO_UHEXA",
",",
... | <p>
Perform a JSON level 1 (only basic set) <strong>escape</strong> operation
on a <tt>String</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 1</em> means this method will only escape the JSON basic escape set:
</p>
<ul>
<li>The <em>Single Escape Characters</em>:
<tt>\b</tt> (<tt>U+0008</tt>),
... | [
"<p",
">",
"Perform",
"a",
"JSON",
"level",
"1",
"(",
"only",
"basic",
"set",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",
">",
"... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/json/JsonEscape.java#L374-L379 |
Jasig/uPortal | uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AnyUnblockedGrantPermissionPolicy.java | AnyUnblockedGrantPermissionPolicy.containsType | private boolean containsType(final Set<IPermission> permissions, final String soughtType) {
"""
Returns true if a set of IPermission instances contains a permission of the specified type,
otherwise false. Permissions passed to this method <em>must</em> already be filtered of
inactive (expired) instances.
@ret... | java | private boolean containsType(final Set<IPermission> permissions, final String soughtType) {
// Assertions
if (permissions == null) {
throw new IllegalArgumentException("Cannot check null set for contents.");
}
if (soughtType == null) {
throw new IllegalArgumentEx... | [
"private",
"boolean",
"containsType",
"(",
"final",
"Set",
"<",
"IPermission",
">",
"permissions",
",",
"final",
"String",
"soughtType",
")",
"{",
"// Assertions",
"if",
"(",
"permissions",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",... | Returns true if a set of IPermission instances contains a permission of the specified type,
otherwise false. Permissions passed to this method <em>must</em> already be filtered of
inactive (expired) instances.
@return True if the set contains a permission of the sought type, false otherwise
@throws IllegalArgumentExce... | [
"Returns",
"true",
"if",
"a",
"set",
"of",
"IPermission",
"instances",
"contains",
"a",
"permission",
"of",
"the",
"specified",
"type",
"otherwise",
"false",
".",
"Permissions",
"passed",
"to",
"this",
"method",
"<em",
">",
"must<",
"/",
"em",
">",
"already"... | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AnyUnblockedGrantPermissionPolicy.java#L385-L404 |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/contract/Checks.java | Checks.checkIsInstance | @Beta
public static <T> T checkIsInstance(Class<T> class_, Object reference,
@Nullable String errorMessage) {
"""
Performs a runtime check if the reference is an instance of the provided class
@param class_ the class to use
@param reference reference to chec... | java | @Beta
public static <T> T checkIsInstance(Class<T> class_, Object reference,
@Nullable String errorMessage) {
return checkIsInstance(class_, reference, errorMessage, EMPTY_ERROR_MESSAGE_ARGS);
} | [
"@",
"Beta",
"public",
"static",
"<",
"T",
">",
"T",
"checkIsInstance",
"(",
"Class",
"<",
"T",
">",
"class_",
",",
"Object",
"reference",
",",
"@",
"Nullable",
"String",
"errorMessage",
")",
"{",
"return",
"checkIsInstance",
"(",
"class_",
",",
"reference... | Performs a runtime check if the reference is an instance of the provided class
@param class_ the class to use
@param reference reference to check
@param errorMessage the exception message to use if the check fails; will
be converted to a string using {@link String#valueOf(Object)}
@param <T> the refe... | [
"Performs",
"a",
"runtime",
"check",
"if",
"the",
"reference",
"is",
"an",
"instance",
"of",
"the",
"provided",
"class"
] | train | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/contract/Checks.java#L401-L405 |
Erudika/para | para-core/src/main/java/com/erudika/para/core/User.java | User.resetPassword | public final boolean resetPassword(String token, String newpass) {
"""
Changes the user password permanently.
@param token the reset token. see {@link #generatePasswordResetToken()}
@param newpass the new password
@return true if successful
"""
if (StringUtils.isBlank(newpass) || StringUtils.isBlank(token... | java | public final boolean resetPassword(String token, String newpass) {
if (StringUtils.isBlank(newpass) || StringUtils.isBlank(token) || newpass.length() < Config.MIN_PASS_LENGTH) {
return false;
}
Sysprop s = CoreUtils.getInstance().getDao().read(getAppid(), identifier);
if (isValidToken(s, Config._RESET_TOKEN,... | [
"public",
"final",
"boolean",
"resetPassword",
"(",
"String",
"token",
",",
"String",
"newpass",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"newpass",
")",
"||",
"StringUtils",
".",
"isBlank",
"(",
"token",
")",
"||",
"newpass",
".",
"length"... | Changes the user password permanently.
@param token the reset token. see {@link #generatePasswordResetToken()}
@param newpass the new password
@return true if successful | [
"Changes",
"the",
"user",
"password",
"permanently",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/core/User.java#L629-L643 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/MapTileAppenderModel.java | MapTileAppenderModel.appendMap | private void appendMap(MapTile other, int offsetX, int offsetY) {
"""
Append the map at specified offset.
@param other The map to append.
@param offsetX The horizontal offset.
@param offsetY The vertical offset.
"""
for (int v = 0; v < other.getInTileHeight(); v++)
{
final int ... | java | private void appendMap(MapTile other, int offsetX, int offsetY)
{
for (int v = 0; v < other.getInTileHeight(); v++)
{
final int ty = offsetY + v;
for (int h = 0; h < other.getInTileWidth(); h++)
{
final int tx = offsetX + h;
final T... | [
"private",
"void",
"appendMap",
"(",
"MapTile",
"other",
",",
"int",
"offsetX",
",",
"int",
"offsetY",
")",
"{",
"for",
"(",
"int",
"v",
"=",
"0",
";",
"v",
"<",
"other",
".",
"getInTileHeight",
"(",
")",
";",
"v",
"++",
")",
"{",
"final",
"int",
... | Append the map at specified offset.
@param other The map to append.
@param offsetX The horizontal offset.
@param offsetY The vertical offset. | [
"Append",
"the",
"map",
"at",
"specified",
"offset",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/MapTileAppenderModel.java#L67-L84 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/auth/BoxAuthentication.java | BoxAuthentication.onAuthenticationFailure | public void onAuthenticationFailure(BoxAuthenticationInfo infoOriginal, Exception ex) {
"""
Callback method to be called if authentication process fails.
@param infoOriginal the authentication information associated with the failed authentication.
@param ex the exception if appliable that caused the logout.
... | java | public void onAuthenticationFailure(BoxAuthenticationInfo infoOriginal, Exception ex) {
String msg = "failure:";
if (getAuthStorage() != null) {
msg += "auth storage :" + getAuthStorage().toString();
}
BoxAuthenticationInfo info = BoxAuthenticationInfo.unmodifiableObject(info... | [
"public",
"void",
"onAuthenticationFailure",
"(",
"BoxAuthenticationInfo",
"infoOriginal",
",",
"Exception",
"ex",
")",
"{",
"String",
"msg",
"=",
"\"failure:\"",
";",
"if",
"(",
"getAuthStorage",
"(",
")",
"!=",
"null",
")",
"{",
"msg",
"+=",
"\"auth storage :\... | Callback method to be called if authentication process fails.
@param infoOriginal the authentication information associated with the failed authentication.
@param ex the exception if appliable that caused the logout. | [
"Callback",
"method",
"to",
"be",
"called",
"if",
"authentication",
"process",
"fails",
"."
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/auth/BoxAuthentication.java#L180-L195 |
jglobus/JGlobus | gss/src/main/java/org/globus/gsi/gssapi/SSLUtil.java | SSLUtil.readFully | public static void readFully(InputStream in, byte [] buf, int off, int len)
throws IOException {
"""
Reads some number of bytes from the input stream.
This function blocks until all data is read or an I/O
error occurs.
@param in the input stream to read the bytes from.
@param buf the buffer into whic... | java | public static void readFully(InputStream in, byte [] buf, int off, int len)
throws IOException {
int n = 0;
while (n < len) {
int count = in.read(buf, off + n, len - n);
if (count < 0)
throw new EOFException();
n += count;
}
} | [
"public",
"static",
"void",
"readFully",
"(",
"InputStream",
"in",
",",
"byte",
"[",
"]",
"buf",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"int",
"n",
"=",
"0",
";",
"while",
"(",
"n",
"<",
"len",
")",
"{",
"int",
"... | Reads some number of bytes from the input stream.
This function blocks until all data is read or an I/O
error occurs.
@param in the input stream to read the bytes from.
@param buf the buffer into which read the data is read.
@param off the start offset in array b at which the data is written.
@param len the maximum nu... | [
"Reads",
"some",
"number",
"of",
"bytes",
"from",
"the",
"input",
"stream",
".",
"This",
"function",
"blocks",
"until",
"all",
"data",
"is",
"read",
"or",
"an",
"I",
"/",
"O",
"error",
"occurs",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gss/src/main/java/org/globus/gsi/gssapi/SSLUtil.java#L61-L70 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/TagsInner.java | TagsInner.deleteValue | public void deleteValue(String tagName, String tagValue) {
"""
Deletes a tag value.
@param tagName The name of the tag.
@param tagValue The value of the tag to delete.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
... | java | public void deleteValue(String tagName, String tagValue) {
deleteValueWithServiceResponseAsync(tagName, tagValue).toBlocking().single().body();
} | [
"public",
"void",
"deleteValue",
"(",
"String",
"tagName",
",",
"String",
"tagValue",
")",
"{",
"deleteValueWithServiceResponseAsync",
"(",
"tagName",
",",
"tagValue",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"body",
"(",
")",
";",
"... | Deletes a tag value.
@param tagName The name of the tag.
@param tagValue The value of the tag to delete.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the requ... | [
"Deletes",
"a",
"tag",
"value",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/TagsInner.java#L97-L99 |
threerings/narya | core/src/main/java/com/threerings/presents/data/TimeBaseObject.java | TimeBaseObject.getDelta | protected long getDelta (long timeStamp, long maxValue) {
"""
Obtains a delta with the specified maximum value, swapping from
even to odd, if necessary.
"""
boolean even = (evenBase > oddBase);
long base = even ? evenBase : oddBase;
long delta = timeStamp - base;
// make sure ... | java | protected long getDelta (long timeStamp, long maxValue)
{
boolean even = (evenBase > oddBase);
long base = even ? evenBase : oddBase;
long delta = timeStamp - base;
// make sure this timestamp is not sufficiently old that we can't
// generate a delta time with it
if ... | [
"protected",
"long",
"getDelta",
"(",
"long",
"timeStamp",
",",
"long",
"maxValue",
")",
"{",
"boolean",
"even",
"=",
"(",
"evenBase",
">",
"oddBase",
")",
";",
"long",
"base",
"=",
"even",
"?",
"evenBase",
":",
"oddBase",
";",
"long",
"delta",
"=",
"t... | Obtains a delta with the specified maximum value, swapping from
even to odd, if necessary. | [
"Obtains",
"a",
"delta",
"with",
"the",
"specified",
"maximum",
"value",
"swapping",
"from",
"even",
"to",
"odd",
"if",
"necessary",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/data/TimeBaseObject.java#L103-L132 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/CharsTrieBuilder.java | CharsTrieBuilder.write | @Deprecated
@Override
protected int write(int offset, int length) {
"""
{@inheritDoc}
@deprecated This API is ICU internal only.
@hide draft / provisional / internal are hidden on Android
"""
int newLength=charsLength+length;
ensureCapacity(newLength);
charsLength=newLength;
... | java | @Deprecated
@Override
protected int write(int offset, int length) {
int newLength=charsLength+length;
ensureCapacity(newLength);
charsLength=newLength;
int charsOffset=chars.length-charsLength;
while(length>0) {
chars[charsOffset++]=strings.charAt(offset++);
... | [
"@",
"Deprecated",
"@",
"Override",
"protected",
"int",
"write",
"(",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"int",
"newLength",
"=",
"charsLength",
"+",
"length",
";",
"ensureCapacity",
"(",
"newLength",
")",
";",
"charsLength",
"=",
"newLength",
... | {@inheritDoc}
@deprecated This API is ICU internal only.
@hide draft / provisional / internal are hidden on Android | [
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/CharsTrieBuilder.java#L166-L178 |
beangle/beangle3 | commons/core/src/main/java/org/beangle/commons/io/Files.java | Files.readLines | public static List<String> readLines(File file, Charset charset) throws IOException {
"""
Reads the contents of a file line by line to a List of Strings.
The file is always closed.
"""
InputStream in = null;
try {
in = new FileInputStream(file);
if (null == charset) {
return IOs.re... | java | public static List<String> readLines(File file, Charset charset) throws IOException {
InputStream in = null;
try {
in = new FileInputStream(file);
if (null == charset) {
return IOs.readLines(new InputStreamReader(in));
} else {
InputStreamReader reader = new InputStreamReader(i... | [
"public",
"static",
"List",
"<",
"String",
">",
"readLines",
"(",
"File",
"file",
",",
"Charset",
"charset",
")",
"throws",
"IOException",
"{",
"InputStream",
"in",
"=",
"null",
";",
"try",
"{",
"in",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
";",... | Reads the contents of a file line by line to a List of Strings.
The file is always closed. | [
"Reads",
"the",
"contents",
"of",
"a",
"file",
"line",
"by",
"line",
"to",
"a",
"List",
"of",
"Strings",
".",
"The",
"file",
"is",
"always",
"closed",
"."
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/io/Files.java#L76-L89 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NFSubstitution.java | FractionalPartSubstitution.doSubstitution | public void doSubstitution(double number, StringBuilder toInsertInto, int position, int recursionCount) {
"""
If in "by digits" mode, fills in the substitution one decimal digit
at a time using the rule set containing this substitution.
Otherwise, uses the superclass function.
@param number The number being for... | java | public void doSubstitution(double number, StringBuilder toInsertInto, int position, int recursionCount) {
if (!byDigits) {
// if we're not in "byDigits" mode, just use the inherited
// doSubstitution() routine
super.doSubstitution(number, toInsertInto, position, recursionCoun... | [
"public",
"void",
"doSubstitution",
"(",
"double",
"number",
",",
"StringBuilder",
"toInsertInto",
",",
"int",
"position",
",",
"int",
"recursionCount",
")",
"{",
"if",
"(",
"!",
"byDigits",
")",
"{",
"// if we're not in \"byDigits\" mode, just use the inherited",
"//... | If in "by digits" mode, fills in the substitution one decimal digit
at a time using the rule set containing this substitution.
Otherwise, uses the superclass function.
@param number The number being formatted
@param toInsertInto The string to insert the result of formatting
the substitution into
@param position The pos... | [
"If",
"in",
"by",
"digits",
"mode",
"fills",
"in",
"the",
"substitution",
"one",
"decimal",
"digit",
"at",
"a",
"time",
"using",
"the",
"rule",
"set",
"containing",
"this",
"substitution",
".",
"Otherwise",
"uses",
"the",
"superclass",
"function",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NFSubstitution.java#L1174-L1211 |
JodaOrg/joda-time | src/main/java/org/joda/time/LocalDate.java | LocalDate.toInterval | public Interval toInterval(DateTimeZone zone) {
"""
Converts this object to an Interval representing the whole day.
<p>
The interval may have more or less than 24 hours if this is a daylight
savings cutover date.
<p>
This instance is immutable and unaffected by this method call.
@param zone the zone to ge... | java | public Interval toInterval(DateTimeZone zone) {
zone = DateTimeUtils.getZone(zone);
DateTime start = toDateTimeAtStartOfDay(zone);
DateTime end = plusDays(1).toDateTimeAtStartOfDay(zone);
return new Interval(start, end);
} | [
"public",
"Interval",
"toInterval",
"(",
"DateTimeZone",
"zone",
")",
"{",
"zone",
"=",
"DateTimeUtils",
".",
"getZone",
"(",
"zone",
")",
";",
"DateTime",
"start",
"=",
"toDateTimeAtStartOfDay",
"(",
"zone",
")",
";",
"DateTime",
"end",
"=",
"plusDays",
"("... | Converts this object to an Interval representing the whole day.
<p>
The interval may have more or less than 24 hours if this is a daylight
savings cutover date.
<p>
This instance is immutable and unaffected by this method call.
@param zone the zone to get the Interval in, null means default
@return a interval over th... | [
"Converts",
"this",
"object",
"to",
"an",
"Interval",
"representing",
"the",
"whole",
"day",
".",
"<p",
">",
"The",
"interval",
"may",
"have",
"more",
"or",
"less",
"than",
"24",
"hours",
"if",
"this",
"is",
"a",
"daylight",
"savings",
"cutover",
"date",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/LocalDate.java#L991-L996 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.convertPixelToNorm | public static Point2D_F32 convertPixelToNorm(CameraModel param , Point2D_F32 pixel , Point2D_F32 norm ) {
"""
<p>
Convenient function for converting from distorted image pixel coordinate to undistorted normalized
image coordinates. If speed is a concern then {@link PinholePtoN_F32} should be used instead.
</p>
... | java | public static Point2D_F32 convertPixelToNorm(CameraModel param , Point2D_F32 pixel , Point2D_F32 norm ) {
return ImplPerspectiveOps_F32.convertPixelToNorm(param, pixel, norm);
} | [
"public",
"static",
"Point2D_F32",
"convertPixelToNorm",
"(",
"CameraModel",
"param",
",",
"Point2D_F32",
"pixel",
",",
"Point2D_F32",
"norm",
")",
"{",
"return",
"ImplPerspectiveOps_F32",
".",
"convertPixelToNorm",
"(",
"param",
",",
"pixel",
",",
"norm",
")",
";... | <p>
Convenient function for converting from distorted image pixel coordinate to undistorted normalized
image coordinates. If speed is a concern then {@link PinholePtoN_F32} should be used instead.
</p>
NOTE: norm and pixel can be the same instance.
@param param Intrinsic camera parameters
@param pixel Pixel coordinat... | [
"<p",
">",
"Convenient",
"function",
"for",
"converting",
"from",
"distorted",
"image",
"pixel",
"coordinate",
"to",
"undistorted",
"normalized",
"image",
"coordinates",
".",
"If",
"speed",
"is",
"a",
"concern",
"then",
"{",
"@link",
"PinholePtoN_F32",
"}",
"sho... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L462-L464 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSet.java | UnicodeSet.stripFrom | @Deprecated
public String stripFrom(CharSequence source, boolean matches) {
"""
Strips code points from source. If matches is true, script all that match <i>this</i>. If matches is false, then strip all that <i>don't</i> match.
@param source The source of the CharSequence to strip from.
@param matches A bool... | java | @Deprecated
public String stripFrom(CharSequence source, boolean matches) {
StringBuilder result = new StringBuilder();
for (int pos = 0; pos < source.length();) {
int inside = findIn(source, pos, !matches);
result.append(source.subSequence(pos, inside));
pos = fi... | [
"@",
"Deprecated",
"public",
"String",
"stripFrom",
"(",
"CharSequence",
"source",
",",
"boolean",
"matches",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"pos",
"=",
"0",
";",
"pos",
"<",
"source",
... | Strips code points from source. If matches is true, script all that match <i>this</i>. If matches is false, then strip all that <i>don't</i> match.
@param source The source of the CharSequence to strip from.
@param matches A boolean to either strip all that matches or don't match with the current UnicodeSet object.
@re... | [
"Strips",
"code",
"points",
"from",
"source",
".",
"If",
"matches",
"is",
"true",
"script",
"all",
"that",
"match",
"<i",
">",
"this<",
"/",
"i",
">",
".",
"If",
"matches",
"is",
"false",
"then",
"strip",
"all",
"that",
"<i",
">",
"don",
"t<",
"/",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSet.java#L4644-L4653 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/photos/licenses/LicensesInterface.java | LicensesInterface.setLicense | public void setLicense(String photoId, int licenseId) throws FlickrException {
"""
Sets the license for a photo.
This method requires authentication with 'write' permission.
@param photoId
The photo to update the license for.
@param licenseId
The license to apply, or 0 (zero) to remove the current license... | java | public void setLicense(String photoId, int licenseId) throws FlickrException {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("method", METHOD_SET_LICENSE);
parameters.put("photo_id", photoId);
parameters.put("license_id", Integer.toString(licenseId));... | [
"public",
"void",
"setLicense",
"(",
"String",
"photoId",
",",
"int",
"licenseId",
")",
"throws",
"FlickrException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"pa... | Sets the license for a photo.
This method requires authentication with 'write' permission.
@param photoId
The photo to update the license for.
@param licenseId
The license to apply, or 0 (zero) to remove the current license.
@throws FlickrException | [
"Sets",
"the",
"license",
"for",
"a",
"photo",
"."
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/photos/licenses/LicensesInterface.java#L82-L95 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplace.java | CmsWorkplace.getStartSiteRoot | public static String getStartSiteRoot(CmsObject cms, CmsWorkplaceSettings settings) {
"""
Returns the start site from the given workplace settings.<p>
@param cms the cms context
@param settings the workplace settings
@return the start site root
"""
return getStartSiteRoot(cms, settings.getUserS... | java | public static String getStartSiteRoot(CmsObject cms, CmsWorkplaceSettings settings) {
return getStartSiteRoot(cms, settings.getUserSettings());
} | [
"public",
"static",
"String",
"getStartSiteRoot",
"(",
"CmsObject",
"cms",
",",
"CmsWorkplaceSettings",
"settings",
")",
"{",
"return",
"getStartSiteRoot",
"(",
"cms",
",",
"settings",
".",
"getUserSettings",
"(",
")",
")",
";",
"}"
] | Returns the start site from the given workplace settings.<p>
@param cms the cms context
@param settings the workplace settings
@return the start site root | [
"Returns",
"the",
"start",
"site",
"from",
"the",
"given",
"workplace",
"settings",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplace.java#L629-L632 |
LearnLib/automatalib | incremental/src/main/java/net/automatalib/incremental/mealy/dag/IncrementalMealyDAGBuilder.java | IncrementalMealyDAGBuilder.updateInitSignature | private void updateInitSignature(int idx, State<O> succ) {
"""
Update the signature of the initial state. This requires special handling, as the initial state is not stored in
the register (since it can never legally act as a predecessor).
@param idx
the transition index being changed
@param succ
the new su... | java | private void updateInitSignature(int idx, State<O> succ) {
StateSignature<O> sig = init.getSignature();
State<O> oldSucc = sig.successors.array[idx];
if (oldSucc == succ) {
return;
}
if (oldSucc != null) {
oldSucc.decreaseIncoming();
}
sig.... | [
"private",
"void",
"updateInitSignature",
"(",
"int",
"idx",
",",
"State",
"<",
"O",
">",
"succ",
")",
"{",
"StateSignature",
"<",
"O",
">",
"sig",
"=",
"init",
".",
"getSignature",
"(",
")",
";",
"State",
"<",
"O",
">",
"oldSucc",
"=",
"sig",
".",
... | Update the signature of the initial state. This requires special handling, as the initial state is not stored in
the register (since it can never legally act as a predecessor).
@param idx
the transition index being changed
@param succ
the new successor state | [
"Update",
"the",
"signature",
"of",
"the",
"initial",
"state",
".",
"This",
"requires",
"special",
"handling",
"as",
"the",
"initial",
"state",
"is",
"not",
"stored",
"in",
"the",
"register",
"(",
"since",
"it",
"can",
"never",
"legally",
"act",
"as",
"a",... | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/incremental/src/main/java/net/automatalib/incremental/mealy/dag/IncrementalMealyDAGBuilder.java#L329-L340 |
lucee/Lucee | core/src/main/java/lucee/runtime/PageSourcePool.java | PageSourcePool.getPageSource | public PageSource getPageSource(String key, boolean updateAccesTime) {
"""
return pages matching to key
@param key key for the page
@param updateAccesTime define if do update access time
@return page
""" // DO NOT CHANGE INTERFACE (used by Argus Monitor)
PageSource ps = pageSources.get(key.toLowerCase())... | java | public PageSource getPageSource(String key, boolean updateAccesTime) { // DO NOT CHANGE INTERFACE (used by Argus Monitor)
PageSource ps = pageSources.get(key.toLowerCase());
if (ps == null) return null;
if (updateAccesTime) ps.setLastAccessTime();
return ps;
} | [
"public",
"PageSource",
"getPageSource",
"(",
"String",
"key",
",",
"boolean",
"updateAccesTime",
")",
"{",
"// DO NOT CHANGE INTERFACE (used by Argus Monitor)",
"PageSource",
"ps",
"=",
"pageSources",
".",
"get",
"(",
"key",
".",
"toLowerCase",
"(",
")",
")",
";",
... | return pages matching to key
@param key key for the page
@param updateAccesTime define if do update access time
@return page | [
"return",
"pages",
"matching",
"to",
"key"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/PageSourcePool.java#L67-L72 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/Inet6Address.java | Inet6Address.getByAddress | public static Inet6Address getByAddress(String host, byte[] addr, NetworkInterface nif)
throws UnknownHostException {
"""
Create an Inet6Address in the exact manner of {@link InetAddress#getByAddress(String,byte[])}
except that the IPv6 scope_id is set to the value corresponding to the given interface
fo... | java | public static Inet6Address getByAddress(String host, byte[] addr, NetworkInterface nif)
throws UnknownHostException {
if (host != null && host.length() > 0 && host.charAt(0) == '[') {
if (host.charAt(host.length()-1) == ']') {
host = host.substring(1, host.length() -1);
... | [
"public",
"static",
"Inet6Address",
"getByAddress",
"(",
"String",
"host",
",",
"byte",
"[",
"]",
"addr",
",",
"NetworkInterface",
"nif",
")",
"throws",
"UnknownHostException",
"{",
"if",
"(",
"host",
"!=",
"null",
"&&",
"host",
".",
"length",
"(",
")",
">... | Create an Inet6Address in the exact manner of {@link InetAddress#getByAddress(String,byte[])}
except that the IPv6 scope_id is set to the value corresponding to the given interface
for the address type specified in <code>addr</code>.
The call will fail with an UnknownHostException if the given interface does not have a... | [
"Create",
"an",
"Inet6Address",
"in",
"the",
"exact",
"manner",
"of",
"{",
"@link",
"InetAddress#getByAddress",
"(",
"String",
"byte",
"[]",
")",
"}",
"except",
"that",
"the",
"IPv6",
"scope_id",
"is",
"set",
"to",
"the",
"value",
"corresponding",
"to",
"the... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/Inet6Address.java#L289-L302 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/DoubleStream.java | DoubleStream.scan | @NotNull
public DoubleStream scan(@NotNull final DoubleBinaryOperator accumulator) {
"""
Returns a {@code DoubleStream} produced by iterative application of a accumulation function
to reduction value and next element of the current stream.
Produces a {@code DoubleStream} consisting of {@code value1}, {@code ... | java | @NotNull
public DoubleStream scan(@NotNull final DoubleBinaryOperator accumulator) {
Objects.requireNonNull(accumulator);
return new DoubleStream(params, new DoubleScan(iterator, accumulator));
} | [
"@",
"NotNull",
"public",
"DoubleStream",
"scan",
"(",
"@",
"NotNull",
"final",
"DoubleBinaryOperator",
"accumulator",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"accumulator",
")",
";",
"return",
"new",
"DoubleStream",
"(",
"params",
",",
"new",
"DoubleSc... | Returns a {@code DoubleStream} produced by iterative application of a accumulation function
to reduction value and next element of the current stream.
Produces a {@code DoubleStream} consisting of {@code value1}, {@code acc(value1, value2)},
{@code acc(acc(value1, value2), value3)}, etc.
<p>This is an intermediate ope... | [
"Returns",
"a",
"{",
"@code",
"DoubleStream",
"}",
"produced",
"by",
"iterative",
"application",
"of",
"a",
"accumulation",
"function",
"to",
"reduction",
"value",
"and",
"next",
"element",
"of",
"the",
"current",
"stream",
".",
"Produces",
"a",
"{",
"@code",
... | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/DoubleStream.java#L646-L650 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/util/MessagesLookup.java | MessagesLookup.get | public String get (String key, Object... args) {
"""
Translate a key with any number of arguments, backed by the Lookup.
"""
// First make the key for GWT-friendly
return fetch(key.replace('.', '_'), args);
} | java | public String get (String key, Object... args)
{
// First make the key for GWT-friendly
return fetch(key.replace('.', '_'), args);
} | [
"public",
"String",
"get",
"(",
"String",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"// First make the key for GWT-friendly",
"return",
"fetch",
"(",
"key",
".",
"replace",
"(",
"'",
"'",
",",
"'",
"'",
")",
",",
"args",
")",
";",
"}"
] | Translate a key with any number of arguments, backed by the Lookup. | [
"Translate",
"a",
"key",
"with",
"any",
"number",
"of",
"arguments",
"backed",
"by",
"the",
"Lookup",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/MessagesLookup.java#L63-L67 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java | ObjectUpdater.checkNewlySharded | private void checkNewlySharded(DBObject dbObj, Map<String, String> currScalarMap) {
"""
previously undetermined but is not being assigned to a shard.
"""
if (!m_tableDef.isSharded()) {
return;
}
String shardingFieldName = m_tableDef.getShardingField().getName();
... | java | private void checkNewlySharded(DBObject dbObj, Map<String, String> currScalarMap) {
if (!m_tableDef.isSharded()) {
return;
}
String shardingFieldName = m_tableDef.getShardingField().getName();
if (!currScalarMap.containsKey(shardingFieldName)) {
m_dbTran.add... | [
"private",
"void",
"checkNewlySharded",
"(",
"DBObject",
"dbObj",
",",
"Map",
"<",
"String",
",",
"String",
">",
"currScalarMap",
")",
"{",
"if",
"(",
"!",
"m_tableDef",
".",
"isSharded",
"(",
")",
")",
"{",
"return",
";",
"}",
"String",
"shardingFieldName... | previously undetermined but is not being assigned to a shard. | [
"previously",
"undetermined",
"but",
"is",
"not",
"being",
"assigned",
"to",
"a",
"shard",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/ObjectUpdater.java#L233-L241 |
IBM/ibm-cos-sdk-java | ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/s3/model/AccessControlList.java | AccessControlList.grantPermission | public void grantPermission(Grantee grantee, Permission permission) {
"""
Adds a grantee to the access control list (ACL) with the given permission.
If this access control list already
contains the grantee (i.e. the same grantee object) the permission for the
grantee will be updated.
@param grantee
The gran... | java | public void grantPermission(Grantee grantee, Permission permission) {
getGrantsAsList().add(new Grant(grantee, permission));
} | [
"public",
"void",
"grantPermission",
"(",
"Grantee",
"grantee",
",",
"Permission",
"permission",
")",
"{",
"getGrantsAsList",
"(",
")",
".",
"add",
"(",
"new",
"Grant",
"(",
"grantee",
",",
"permission",
")",
")",
";",
"}"
] | Adds a grantee to the access control list (ACL) with the given permission.
If this access control list already
contains the grantee (i.e. the same grantee object) the permission for the
grantee will be updated.
@param grantee
The grantee to whom the permission will apply.
@param permission
The permission to apply to t... | [
"Adds",
"a",
"grantee",
"to",
"the",
"access",
"control",
"list",
"(",
"ACL",
")",
"with",
"the",
"given",
"permission",
".",
"If",
"this",
"access",
"control",
"list",
"already",
"contains",
"the",
"grantee",
"(",
"i",
".",
"e",
".",
"the",
"same",
"g... | train | https://github.com/IBM/ibm-cos-sdk-java/blob/d0bb2dd754c328a05e7dba8dc42e28b271b6daf2/ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/s3/model/AccessControlList.java#L141-L143 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/UriUtils.java | UriUtils.buildNewURI | public static URI buildNewURI( URI referenceUri, String uriSuffix ) throws URISyntaxException {
"""
Builds an URI from an URI and a suffix.
<p>
This suffix can be an absolute URL, or a relative path
with respect to the first URI. In this case, the suffix is resolved
with respect to the URI.
</p>
<p>
If th... | java | public static URI buildNewURI( URI referenceUri, String uriSuffix ) throws URISyntaxException {
if( uriSuffix == null )
throw new IllegalArgumentException( "The URI suffix cannot be null." );
uriSuffix = uriSuffix.replaceAll( "\\\\", "/" );
URI importUri = null;
try {
// Absolute URL ?
importUri = ur... | [
"public",
"static",
"URI",
"buildNewURI",
"(",
"URI",
"referenceUri",
",",
"String",
"uriSuffix",
")",
"throws",
"URISyntaxException",
"{",
"if",
"(",
"uriSuffix",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The URI suffix cannot be null.\""... | Builds an URI from an URI and a suffix.
<p>
This suffix can be an absolute URL, or a relative path
with respect to the first URI. In this case, the suffix is resolved
with respect to the URI.
</p>
<p>
If the suffix is already an URL, its is returned.<br>
If the suffix is a relative file path and cannot be resolved, an... | [
"Builds",
"an",
"URI",
"from",
"an",
"URI",
"and",
"a",
"suffix",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/UriUtils.java#L122-L151 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/PoolOperations.java | PoolOperations.removeNodeFromPool | public void removeNodeFromPool(String poolId, String computeNodeId) throws BatchErrorException, IOException {
"""
Removes the specified compute node from the specified pool.
@param poolId
The ID of the pool.
@param computeNodeId
The ID of the compute node to remove from the pool.
@throws BatchErrorException... | java | public void removeNodeFromPool(String poolId, String computeNodeId) throws BatchErrorException, IOException {
removeNodeFromPool(poolId, computeNodeId, null, null, null);
} | [
"public",
"void",
"removeNodeFromPool",
"(",
"String",
"poolId",
",",
"String",
"computeNodeId",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"removeNodeFromPool",
"(",
"poolId",
",",
"computeNodeId",
",",
"null",
",",
"null",
",",
"null",
")",
... | Removes the specified compute node from the specified pool.
@param poolId
The ID of the pool.
@param computeNodeId
The ID of the compute node to remove from the pool.
@throws BatchErrorException
Exception thrown when an error response is received from the
Batch service.
@throws IOException
Exception thrown when there ... | [
"Removes",
"the",
"specified",
"compute",
"node",
"from",
"the",
"specified",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/PoolOperations.java#L858-L860 |
qiniu/android-sdk | library/src/main/java/com/qiniu/android/utils/Etag.java | Etag.stream | public static String stream(InputStream in, long len) throws IOException {
"""
计算输入流的etag
@param in 数据输入流
@param len 数据流长度
@return 数据流的etag值
@throws IOException 文件读取异常
"""
if (len == 0) {
return "Fto5o-5ea0sNMlW_75VgGJCv2AcJ";
}
byte[] buffer = new byte[64 * 1024];
... | java | public static String stream(InputStream in, long len) throws IOException {
if (len == 0) {
return "Fto5o-5ea0sNMlW_75VgGJCv2AcJ";
}
byte[] buffer = new byte[64 * 1024];
byte[][] blocks = new byte[(int) ((len + Configuration.BLOCK_SIZE - 1) / Configuration.BLOCK_SIZE)][];
... | [
"public",
"static",
"String",
"stream",
"(",
"InputStream",
"in",
",",
"long",
"len",
")",
"throws",
"IOException",
"{",
"if",
"(",
"len",
"==",
"0",
")",
"{",
"return",
"\"Fto5o-5ea0sNMlW_75VgGJCv2AcJ\"",
";",
"}",
"byte",
"[",
"]",
"buffer",
"=",
"new",
... | 计算输入流的etag
@param in 数据输入流
@param len 数据流长度
@return 数据流的etag值
@throws IOException 文件读取异常 | [
"计算输入流的etag"
] | train | https://github.com/qiniu/android-sdk/blob/dbd2a01fb3bff7a5e75e8934bbf81713124d8466/library/src/main/java/com/qiniu/android/utils/Etag.java#L100-L112 |
couchbase/couchbase-lite-java | src/main/java/okhttp3/internal/tls/CustomHostnameVerifier.java | CustomHostnameVerifier.verifyHostname | private boolean verifyHostname(String hostname, X509Certificate certificate) {
"""
Returns true if {@code certificate} matches {@code hostname}.
"""
hostname = hostname.toLowerCase(Locale.US);
boolean hasDns = false;
List<String> altNames = getSubjectAltNames(certificate, ALT_DNS_NAME);... | java | private boolean verifyHostname(String hostname, X509Certificate certificate) {
hostname = hostname.toLowerCase(Locale.US);
boolean hasDns = false;
List<String> altNames = getSubjectAltNames(certificate, ALT_DNS_NAME);
for (int i = 0, size = altNames.size(); i < size; i++) {
h... | [
"private",
"boolean",
"verifyHostname",
"(",
"String",
"hostname",
",",
"X509Certificate",
"certificate",
")",
"{",
"hostname",
"=",
"hostname",
".",
"toLowerCase",
"(",
"Locale",
".",
"US",
")",
";",
"boolean",
"hasDns",
"=",
"false",
";",
"List",
"<",
"Str... | Returns true if {@code certificate} matches {@code hostname}. | [
"Returns",
"true",
"if",
"{"
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/okhttp3/internal/tls/CustomHostnameVerifier.java#L95-L120 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java | EnhancedBigtableStub.createSampleRowKeysCallable | private UnaryCallable<String, List<KeyOffset>> createSampleRowKeysCallable() {
"""
Creates a callable chain to handle SampleRowKeys RPcs. The chain will:
<ul>
<li>Convert a table id to a {@link com.google.bigtable.v2.SampleRowKeysRequest}.
<li>Dispatch the request to the GAPIC's {@link BigtableStub#sampleRowK... | java | private UnaryCallable<String, List<KeyOffset>> createSampleRowKeysCallable() {
UnaryCallable<SampleRowKeysRequest, List<SampleRowKeysResponse>> spoolable =
stub.sampleRowKeysCallable().all();
UnaryCallable<SampleRowKeysRequest, List<SampleRowKeysResponse>> retryable =
Callables.retrying(spoolab... | [
"private",
"UnaryCallable",
"<",
"String",
",",
"List",
"<",
"KeyOffset",
">",
">",
"createSampleRowKeysCallable",
"(",
")",
"{",
"UnaryCallable",
"<",
"SampleRowKeysRequest",
",",
"List",
"<",
"SampleRowKeysResponse",
">",
">",
"spoolable",
"=",
"stub",
".",
"s... | Creates a callable chain to handle SampleRowKeys RPcs. The chain will:
<ul>
<li>Convert a table id to a {@link com.google.bigtable.v2.SampleRowKeysRequest}.
<li>Dispatch the request to the GAPIC's {@link BigtableStub#sampleRowKeysCallable()}.
<li>Spool responses into a list.
<li>Retry on failure.
<li>Convert the respo... | [
"Creates",
"a",
"callable",
"chain",
"to",
"handle",
"SampleRowKeys",
"RPcs",
".",
"The",
"chain",
"will",
":"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java#L279-L288 |
OpenLiberty/open-liberty | dev/com.ibm.ws.session.cache/src/com/ibm/ws/session/store/cache/TypeConversion.java | TypeConversion.bytesToLong | public static long bytesToLong(byte[] bytes, int offset) {
"""
A utility method to convert the long from the byte array to a long.
@param bytes
The byte array containing the long.
@param offset
The index at which the long is located.
@return The long value.
"""
long result = 0x0;
for (in... | java | public static long bytesToLong(byte[] bytes, int offset) {
long result = 0x0;
for (int i = offset; i < offset + 8; ++i) {
result = result << 8;
result |= (bytes[i] & 0x00000000000000FFl);
}
return result;
} | [
"public",
"static",
"long",
"bytesToLong",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
")",
"{",
"long",
"result",
"=",
"0x0",
";",
"for",
"(",
"int",
"i",
"=",
"offset",
";",
"i",
"<",
"offset",
"+",
"8",
";",
"++",
"i",
")",
"{",
"r... | A utility method to convert the long from the byte array to a long.
@param bytes
The byte array containing the long.
@param offset
The index at which the long is located.
@return The long value. | [
"A",
"utility",
"method",
"to",
"convert",
"the",
"long",
"from",
"the",
"byte",
"array",
"to",
"a",
"long",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session.cache/src/com/ibm/ws/session/store/cache/TypeConversion.java#L65-L72 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.deleteUser | public void deleteUser(CmsRequestContext context, String username) throws CmsException {
"""
Deletes a user.<p>
@param context the current request context
@param username the name of the user to be deleted
@throws CmsException if something goes wrong
"""
CmsUser user = readUser(context, usernam... | java | public void deleteUser(CmsRequestContext context, String username) throws CmsException {
CmsUser user = readUser(context, username);
deleteUser(context, user, null);
} | [
"public",
"void",
"deleteUser",
"(",
"CmsRequestContext",
"context",
",",
"String",
"username",
")",
"throws",
"CmsException",
"{",
"CmsUser",
"user",
"=",
"readUser",
"(",
"context",
",",
"username",
")",
";",
"deleteUser",
"(",
"context",
",",
"user",
",",
... | Deletes a user.<p>
@param context the current request context
@param username the name of the user to be deleted
@throws CmsException if something goes wrong | [
"Deletes",
"a",
"user",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L1697-L1701 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.primitiveArrayPut | protected static Object primitiveArrayPut(Object self, int idx, Object newValue) {
"""
Implements the setAt(int idx) method for primitive type arrays.
@param self an object
@param idx the index of interest
@param newValue the new value to be put into the index of interest
@return the added value
@s... | java | protected static Object primitiveArrayPut(Object self, int idx, Object newValue) {
Array.set(self, normaliseIndex(idx, Array.getLength(self)), newValue);
return newValue;
} | [
"protected",
"static",
"Object",
"primitiveArrayPut",
"(",
"Object",
"self",
",",
"int",
"idx",
",",
"Object",
"newValue",
")",
"{",
"Array",
".",
"set",
"(",
"self",
",",
"normaliseIndex",
"(",
"idx",
",",
"Array",
".",
"getLength",
"(",
"self",
")",
")... | Implements the setAt(int idx) method for primitive type arrays.
@param self an object
@param idx the index of interest
@param newValue the new value to be put into the index of interest
@return the added value
@since 1.5.0 | [
"Implements",
"the",
"setAt",
"(",
"int",
"idx",
")",
"method",
"for",
"primitive",
"type",
"arrays",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L14599-L14602 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java | HttpPostRequestEncoder.addBodyFileUpload | public void addBodyFileUpload(String name, String filename, File file, String contentType, boolean isText)
throws ErrorDataEncoderException {
"""
Add a file as a FileUpload
@param name
the name of the parameter
@param file
the file to be uploaded (if not Multipart mode, only the filename will be ... | java | public void addBodyFileUpload(String name, String filename, File file, String contentType, boolean isText)
throws ErrorDataEncoderException {
checkNotNull(name, "name");
checkNotNull(file, "file");
if (filename == null) {
filename = StringUtil.EMPTY_STRING;
}
... | [
"public",
"void",
"addBodyFileUpload",
"(",
"String",
"name",
",",
"String",
"filename",
",",
"File",
"file",
",",
"String",
"contentType",
",",
"boolean",
"isText",
")",
"throws",
"ErrorDataEncoderException",
"{",
"checkNotNull",
"(",
"name",
",",
"\"name\"",
"... | Add a file as a FileUpload
@param name
the name of the parameter
@param file
the file to be uploaded (if not Multipart mode, only the filename will be included)
@param filename
the filename to use for this File part, empty String will be ignored by
the encoder
@param contentType
the associated contentType for the File... | [
"Add",
"a",
"file",
"as",
"a",
"FileUpload"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java#L384-L411 |
hageldave/ImagingKit | ImagingKit_Core/src/main/java/hageldave/imagingkit/core/Pixel.java | Pixel.setRGB_fromDouble | public Pixel setRGB_fromDouble(double r, double g, double b) {
"""
Sets an opaque RGB value at the position currently referenced by this Pixel. <br>
Each channel value is assumed to be within [0.0 .. 1.0]. Channel values
outside these bounds will be clamped to them.
@param r normalized red
@param g normalized ... | java | public Pixel setRGB_fromDouble(double r, double g, double b){
return setValue(Pixel.rgb_fromNormalized(r, g, b));
} | [
"public",
"Pixel",
"setRGB_fromDouble",
"(",
"double",
"r",
",",
"double",
"g",
",",
"double",
"b",
")",
"{",
"return",
"setValue",
"(",
"Pixel",
".",
"rgb_fromNormalized",
"(",
"r",
",",
"g",
",",
"b",
")",
")",
";",
"}"
] | Sets an opaque RGB value at the position currently referenced by this Pixel. <br>
Each channel value is assumed to be within [0.0 .. 1.0]. Channel values
outside these bounds will be clamped to them.
@param r normalized red
@param g normalized green
@param b normalized blue
@throws ArrayIndexOutOfBoundsException if thi... | [
"Sets",
"an",
"opaque",
"RGB",
"value",
"at",
"the",
"position",
"currently",
"referenced",
"by",
"this",
"Pixel",
".",
"<br",
">",
"Each",
"channel",
"value",
"is",
"assumed",
"to",
"be",
"within",
"[",
"0",
".",
"0",
"..",
"1",
".",
"0",
"]",
".",
... | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Core/src/main/java/hageldave/imagingkit/core/Pixel.java#L429-L431 |
graphql-java/graphql-java | src/main/java/graphql/execution/instrumentation/fieldvalidation/SimpleFieldValidation.java | SimpleFieldValidation.addRule | public SimpleFieldValidation addRule(ExecutionPath fieldPath, BiFunction<FieldAndArguments, FieldValidationEnvironment, Optional<GraphQLError>> rule) {
"""
Adds the rule against the field address path. If the rule returns an error, it will be added to the list of errors
@param fieldPath the path to the field
... | java | public SimpleFieldValidation addRule(ExecutionPath fieldPath, BiFunction<FieldAndArguments, FieldValidationEnvironment, Optional<GraphQLError>> rule) {
rules.put(fieldPath, rule);
return this;
} | [
"public",
"SimpleFieldValidation",
"addRule",
"(",
"ExecutionPath",
"fieldPath",
",",
"BiFunction",
"<",
"FieldAndArguments",
",",
"FieldValidationEnvironment",
",",
"Optional",
"<",
"GraphQLError",
">",
">",
"rule",
")",
"{",
"rules",
".",
"put",
"(",
"fieldPath",
... | Adds the rule against the field address path. If the rule returns an error, it will be added to the list of errors
@param fieldPath the path to the field
@param rule the rule function
@return this validator | [
"Adds",
"the",
"rule",
"against",
"the",
"field",
"address",
"path",
".",
"If",
"the",
"rule",
"returns",
"an",
"error",
"it",
"will",
"be",
"added",
"to",
"the",
"list",
"of",
"errors"
] | train | https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/execution/instrumentation/fieldvalidation/SimpleFieldValidation.java#L34-L37 |
UrielCh/ovh-java-sdk | ovh-java-sdk-licensevirtuozzo/src/main/java/net/minidev/ovh/api/ApiOvhLicensevirtuozzo.java | ApiOvhLicensevirtuozzo.serviceName_canLicenseBeMovedTo_GET | public OvhChangeIpStatus serviceName_canLicenseBeMovedTo_GET(String serviceName, String destinationIp) throws IOException {
"""
Will tell if the ip can accept the license
REST: GET /license/virtuozzo/{serviceName}/canLicenseBeMovedTo
@param destinationIp [required] The Ip on which you want to move this license... | java | public OvhChangeIpStatus serviceName_canLicenseBeMovedTo_GET(String serviceName, String destinationIp) throws IOException {
String qPath = "/license/virtuozzo/{serviceName}/canLicenseBeMovedTo";
StringBuilder sb = path(qPath, serviceName);
query(sb, "destinationIp", destinationIp);
String resp = exec(qPath, "GE... | [
"public",
"OvhChangeIpStatus",
"serviceName_canLicenseBeMovedTo_GET",
"(",
"String",
"serviceName",
",",
"String",
"destinationIp",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/license/virtuozzo/{serviceName}/canLicenseBeMovedTo\"",
";",
"StringBuilder",
"sb",... | Will tell if the ip can accept the license
REST: GET /license/virtuozzo/{serviceName}/canLicenseBeMovedTo
@param destinationIp [required] The Ip on which you want to move this license
@param serviceName [required] The name of your Virtuozzo license | [
"Will",
"tell",
"if",
"the",
"ip",
"can",
"accept",
"the",
"license"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-licensevirtuozzo/src/main/java/net/minidev/ovh/api/ApiOvhLicensevirtuozzo.java#L227-L233 |
prestodb/presto | presto-parser/src/main/java/com/facebook/presto/sql/tree/Node.java | Node.accept | protected <R, C> R accept(AstVisitor<R, C> visitor, C context) {
"""
Accessible for {@link AstVisitor}, use {@link AstVisitor#process(Node, Object)} instead.
"""
return visitor.visitNode(this, context);
} | java | protected <R, C> R accept(AstVisitor<R, C> visitor, C context)
{
return visitor.visitNode(this, context);
} | [
"protected",
"<",
"R",
",",
"C",
">",
"R",
"accept",
"(",
"AstVisitor",
"<",
"R",
",",
"C",
">",
"visitor",
",",
"C",
"context",
")",
"{",
"return",
"visitor",
".",
"visitNode",
"(",
"this",
",",
"context",
")",
";",
"}"
] | Accessible for {@link AstVisitor}, use {@link AstVisitor#process(Node, Object)} instead. | [
"Accessible",
"for",
"{"
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-parser/src/main/java/com/facebook/presto/sql/tree/Node.java#L33-L36 |
google/error-prone-javac | src/jdk.compiler/share/classes/jdk/internal/shellsupport/doc/JavadocFormatter.java | JavadocFormatter.formatJavadoc | public String formatJavadoc(String header, String javadoc) {
"""
Format javadoc to plain text.
@param header element caption that should be used
@param javadoc to format
@return javadoc formatted to plain text
"""
try {
StringBuilder result = new StringBuilder();
result.ap... | java | public String formatJavadoc(String header, String javadoc) {
try {
StringBuilder result = new StringBuilder();
result.append(escape(CODE_HIGHLIGHT)).append(header).append(escape(CODE_RESET)).append("\n");
if (javadoc == null) {
return result.toString();
... | [
"public",
"String",
"formatJavadoc",
"(",
"String",
"header",
",",
"String",
"javadoc",
")",
"{",
"try",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"result",
".",
"append",
"(",
"escape",
"(",
"CODE_HIGHLIGHT",
")",
")",
".... | Format javadoc to plain text.
@param header element caption that should be used
@param javadoc to format
@return javadoc formatted to plain text | [
"Format",
"javadoc",
"to",
"plain",
"text",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/jdk/internal/shellsupport/doc/JavadocFormatter.java#L99-L126 |
zaproxy/zaproxy | src/org/parosproxy/paros/core/scanner/VariantURLQuery.java | VariantURLQuery.getEscapedValue | @Override
protected String getEscapedValue(HttpMessage msg, String value) {
"""
Encode the parameter for a correct URL introduction
@param msg the message object
@param value the value that need to be encoded
@return the Encoded value
"""
// ZAP: unfortunately the method setQuery() defined ins... | java | @Override
protected String getEscapedValue(HttpMessage msg, String value) {
// ZAP: unfortunately the method setQuery() defined inside the httpclient Apache component
// create trouble when special characters like ?+? are set inside the parameter,
// because this method implementation s... | [
"@",
"Override",
"protected",
"String",
"getEscapedValue",
"(",
"HttpMessage",
"msg",
",",
"String",
"value",
")",
"{",
"// ZAP: unfortunately the method setQuery() defined inside the httpclient Apache component\r",
"// create trouble when special characters like ?+? are set inside the p... | Encode the parameter for a correct URL introduction
@param msg the message object
@param value the value that need to be encoded
@return the Encoded value | [
"Encode",
"the",
"parameter",
"for",
"a",
"correct",
"URL",
"introduction"
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/core/scanner/VariantURLQuery.java#L51-L59 |
elastic/elasticsearch-hadoop | storm/src/main/java/org/elasticsearch/storm/security/AutoElasticsearch.java | AutoElasticsearch.populateCredentials | @Override
public void populateCredentials(Map<String, String> credentials, Map topologyConfiguration) {
"""
{@inheritDoc}
@deprecated This is available for any storm cluster that operates against the older method of obtaining credentials
"""
populateCredentials(credentials, topologyConfiguration, ... | java | @Override
public void populateCredentials(Map<String, String> credentials, Map topologyConfiguration) {
populateCredentials(credentials, topologyConfiguration, null);
} | [
"@",
"Override",
"public",
"void",
"populateCredentials",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"credentials",
",",
"Map",
"topologyConfiguration",
")",
"{",
"populateCredentials",
"(",
"credentials",
",",
"topologyConfiguration",
",",
"null",
")",
";",
... | {@inheritDoc}
@deprecated This is available for any storm cluster that operates against the older method of obtaining credentials | [
"{"
] | train | https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/storm/src/main/java/org/elasticsearch/storm/security/AutoElasticsearch.java#L98-L101 |
SeleniumHQ/fluent-selenium | java/src/main/java/org/seleniumhq/selenium/fluent/FluentSelect.java | FluentSelect.deselectByIndex | public FluentSelect deselectByIndex(final int index) {
"""
Deselect the option at the given index. This is done by examining the "index" attribute of an
element, and not merely by counting.
@param index The option at this index will be deselected
"""
executeAndWrapReThrowIfNeeded(new DeselectByInde... | java | public FluentSelect deselectByIndex(final int index) {
executeAndWrapReThrowIfNeeded(new DeselectByIndex(index), Context.singular(context, "deselectByIndex", null, index), true);
return new FluentSelect(super.delegate, currentElement.getFound(), this.context, monitor, booleanInsteadOfNotFoundException);... | [
"public",
"FluentSelect",
"deselectByIndex",
"(",
"final",
"int",
"index",
")",
"{",
"executeAndWrapReThrowIfNeeded",
"(",
"new",
"DeselectByIndex",
"(",
"index",
")",
",",
"Context",
".",
"singular",
"(",
"context",
",",
"\"deselectByIndex\"",
",",
"null",
",",
... | Deselect the option at the given index. This is done by examining the "index" attribute of an
element, and not merely by counting.
@param index The option at this index will be deselected | [
"Deselect",
"the",
"option",
"at",
"the",
"given",
"index",
".",
"This",
"is",
"done",
"by",
"examining",
"the",
"index",
"attribute",
"of",
"an",
"element",
"and",
"not",
"merely",
"by",
"counting",
"."
] | train | https://github.com/SeleniumHQ/fluent-selenium/blob/fcb171471a7d1abb2800bcbca21b3ae3e6c12472/java/src/main/java/org/seleniumhq/selenium/fluent/FluentSelect.java#L152-L155 |
aragozin/jvm-tools | mxdump/src/main/java/org/gridkit/jvmtool/jackson/WriterBasedGenerator.java | WriterBasedGenerator._appendCharacterEscape | private final void _appendCharacterEscape(char ch, int escCode)
throws IOException, JsonGenerationException {
"""
Method called to append escape sequence for given character, at the
end of standard output buffer; or if not possible, write out directly.
"""
if (escCode >= 0) { // \\N (2 char)
... | java | private final void _appendCharacterEscape(char ch, int escCode)
throws IOException, JsonGenerationException
{
if (escCode >= 0) { // \\N (2 char)
if ((_outputTail + 2) > _outputEnd) {
_flushBuffer();
}
_outputBuffer[_outputTail++] = '\\';
... | [
"private",
"final",
"void",
"_appendCharacterEscape",
"(",
"char",
"ch",
",",
"int",
"escCode",
")",
"throws",
"IOException",
",",
"JsonGenerationException",
"{",
"if",
"(",
"escCode",
">=",
"0",
")",
"{",
"// \\\\N (2 char)",
"if",
"(",
"(",
"_outputTail",
"+... | Method called to append escape sequence for given character, at the
end of standard output buffer; or if not possible, write out directly. | [
"Method",
"called",
"to",
"append",
"escape",
"sequence",
"for",
"given",
"character",
"at",
"the",
"end",
"of",
"standard",
"output",
"buffer",
";",
"or",
"if",
"not",
"possible",
"write",
"out",
"directly",
"."
] | train | https://github.com/aragozin/jvm-tools/blob/d3a4d0c6a47fb9317f274988569655f30dcd2f76/mxdump/src/main/java/org/gridkit/jvmtool/jackson/WriterBasedGenerator.java#L1325-L1359 |
netheosgithub/pcs_api | java/src/main/java/net/netheos/pcsapi/models/CDownloadRequest.java | CDownloadRequest.setRange | public CDownloadRequest setRange( long offset, long length ) {
"""
Defines a range for partial content download. Note that second parameter is a length, not an offset (this differs
from http header Range header raw value).
<ul>
<li>(-1, -1) = default : download full blob.</li>
<li>(10, -1) = download, starting... | java | public CDownloadRequest setRange( long offset, long length )
{
if ( length == 0 ) {
// Indicate we want to download 0 bytes ?! We ignore such specification
length = -1;
}
if ( offset < 0 && length < 0 ) {
byteRange = null;
} else {
byte... | [
"public",
"CDownloadRequest",
"setRange",
"(",
"long",
"offset",
",",
"long",
"length",
")",
"{",
"if",
"(",
"length",
"==",
"0",
")",
"{",
"// Indicate we want to download 0 bytes ?! We ignore such specification",
"length",
"=",
"-",
"1",
";",
"}",
"if",
"(",
"... | Defines a range for partial content download. Note that second parameter is a length, not an offset (this differs
from http header Range header raw value).
<ul>
<li>(-1, -1) = default : download full blob.</li>
<li>(10, -1) = download, starting at offset 10</li>
<li>(-1, 10) = download last 10 bytes</li>
<li>(10, 100) ... | [
"Defines",
"a",
"range",
"for",
"partial",
"content",
"download",
".",
"Note",
"that",
"second",
"parameter",
"is",
"a",
"length",
"not",
"an",
"offset",
"(",
"this",
"differs",
"from",
"http",
"header",
"Range",
"header",
"raw",
"value",
")",
".",
"<ul",
... | train | https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/models/CDownloadRequest.java#L101-L113 |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/blueprint/BlueprintProducersFactory.java | BlueprintProducersFactory.getBlueprintProducer | public static BlueprintProducer getBlueprintProducer(String producerId, String category, String subsystem) {
"""
Returns the blueprint producer with this id. Creates one if none is existing. Uses DLC pattern to reduce synchronization overhead.
@param producerId
@param category
@param subsystem
@return
"""
... | java | public static BlueprintProducer getBlueprintProducer(String producerId, String category, String subsystem){
try{
//first find producer
BlueprintProducer producer = producers.get(producerId);
if (producer==null){
synchronized(producers){
producer = producers.get(producerId);
if (producer==null){... | [
"public",
"static",
"BlueprintProducer",
"getBlueprintProducer",
"(",
"String",
"producerId",
",",
"String",
"category",
",",
"String",
"subsystem",
")",
"{",
"try",
"{",
"//first find producer",
"BlueprintProducer",
"producer",
"=",
"producers",
".",
"get",
"(",
"p... | Returns the blueprint producer with this id. Creates one if none is existing. Uses DLC pattern to reduce synchronization overhead.
@param producerId
@param category
@param subsystem
@return | [
"Returns",
"the",
"blueprint",
"producer",
"with",
"this",
"id",
".",
"Creates",
"one",
"if",
"none",
"is",
"existing",
".",
"Uses",
"DLC",
"pattern",
"to",
"reduce",
"synchronization",
"overhead",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/blueprint/BlueprintProducersFactory.java#L33-L53 |
bazaarvoice/emodb | common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/RestartingS3InputStream.java | RestartingS3InputStream.reopenS3InputStream | private void reopenS3InputStream()
throws IOException {
"""
Re-opens the input stream, starting at the first unread byte.
"""
// First attempt to close the existing input stream
try {
closeS3InputStream();
} catch (IOException ignore) {
// Ignore this... | java | private void reopenS3InputStream()
throws IOException {
// First attempt to close the existing input stream
try {
closeS3InputStream();
} catch (IOException ignore) {
// Ignore this exception; we're re-opening because there was in issue with the existing strea... | [
"private",
"void",
"reopenS3InputStream",
"(",
")",
"throws",
"IOException",
"{",
"// First attempt to close the existing input stream",
"try",
"{",
"closeS3InputStream",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"ignore",
")",
"{",
"// Ignore this exception; we're... | Re-opens the input stream, starting at the first unread byte. | [
"Re",
"-",
"opens",
"the",
"input",
"stream",
"starting",
"at",
"the",
"first",
"unread",
"byte",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/RestartingS3InputStream.java#L137-L172 |
eserating/siren4j | src/main/java/com/google/code/siren4j/converter/ReflectingConverter.java | ReflectingConverter.getSubEntityAnnotation | private Siren4JSubEntity getSubEntityAnnotation(Field currentField, List<ReflectedInfo> fieldInfo) {
"""
Helper to retrieve a sub entity annotation from either the field itself or the getter.
If an annotation exists on both, then the field wins.
@param currentField assumed not <code>null</code>.
@param fieldI... | java | private Siren4JSubEntity getSubEntityAnnotation(Field currentField, List<ReflectedInfo> fieldInfo) {
Siren4JSubEntity result = null;
result = currentField.getAnnotation(Siren4JSubEntity.class);
if (result == null && fieldInfo != null) {
ReflectedInfo info = ReflectionUtils.getFie... | [
"private",
"Siren4JSubEntity",
"getSubEntityAnnotation",
"(",
"Field",
"currentField",
",",
"List",
"<",
"ReflectedInfo",
">",
"fieldInfo",
")",
"{",
"Siren4JSubEntity",
"result",
"=",
"null",
";",
"result",
"=",
"currentField",
".",
"getAnnotation",
"(",
"Siren4JSu... | Helper to retrieve a sub entity annotation from either the field itself or the getter.
If an annotation exists on both, then the field wins.
@param currentField assumed not <code>null</code>.
@param fieldInfo assumed not <code>null</code>.
@return the annotation if found else <code>null</code>. | [
"Helper",
"to",
"retrieve",
"a",
"sub",
"entity",
"annotation",
"from",
"either",
"the",
"field",
"itself",
"or",
"the",
"getter",
".",
"If",
"an",
"annotation",
"exists",
"on",
"both",
"then",
"the",
"field",
"wins",
"."
] | train | https://github.com/eserating/siren4j/blob/f12e3185076ad920352ec4f6eb2a071a3683505f/src/main/java/com/google/code/siren4j/converter/ReflectingConverter.java#L561-L571 |
jbundle/jbundle | thin/base/db/base/src/main/java/org/jbundle/thin/base/db/mem/base/PKeyArea.java | PKeyArea.doRemove | public void doRemove(FieldTable table, KeyAreaInfo keyArea, BaseBuffer buffer) throws DBException {
"""
Delete the key from this buffer.
@param table The basetable.
@param keyArea The basetable's key area.
@param buffer The buffer to compare.
@exception DBException File exception.
"""
if (!this.atC... | java | public void doRemove(FieldTable table, KeyAreaInfo keyArea, BaseBuffer buffer) throws DBException
{
if (!this.atCurrent(buffer))
{
buffer = this.doSeek("==", table, keyArea);
if (buffer == null)
throw new DBException(Constants.FILE_INCONSISTENCY);
}
... | [
"public",
"void",
"doRemove",
"(",
"FieldTable",
"table",
",",
"KeyAreaInfo",
"keyArea",
",",
"BaseBuffer",
"buffer",
")",
"throws",
"DBException",
"{",
"if",
"(",
"!",
"this",
".",
"atCurrent",
"(",
"buffer",
")",
")",
"{",
"buffer",
"=",
"this",
".",
"... | Delete the key from this buffer.
@param table The basetable.
@param keyArea The basetable's key area.
@param buffer The buffer to compare.
@exception DBException File exception. | [
"Delete",
"the",
"key",
"from",
"this",
"buffer",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/mem/base/PKeyArea.java#L102-L111 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java | BoxApiFolder.getCreateRequest | public BoxRequestsFolder.CreateFolder getCreateRequest(String parentId, String name) {
"""
Gets a request that creates a folder in a parent folder
@param parentId id of the parent folder to create the folder in
@param name name of the new folder
@return request to create a folder
"""
Bo... | java | public BoxRequestsFolder.CreateFolder getCreateRequest(String parentId, String name) {
BoxRequestsFolder.CreateFolder request = new BoxRequestsFolder.CreateFolder(parentId, name, getFoldersUrl(), mSession);
return request;
} | [
"public",
"BoxRequestsFolder",
".",
"CreateFolder",
"getCreateRequest",
"(",
"String",
"parentId",
",",
"String",
"name",
")",
"{",
"BoxRequestsFolder",
".",
"CreateFolder",
"request",
"=",
"new",
"BoxRequestsFolder",
".",
"CreateFolder",
"(",
"parentId",
",",
"name... | Gets a request that creates a folder in a parent folder
@param parentId id of the parent folder to create the folder in
@param name name of the new folder
@return request to create a folder | [
"Gets",
"a",
"request",
"that",
"creates",
"a",
"folder",
"in",
"a",
"parent",
"folder"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java#L120-L123 |
datasift/datasift-java | src/main/java/com/datasift/client/accounts/DataSiftAccount.java | DataSiftAccount.getToken | public FutureData<Token> getToken(String identity, String service) {
"""
/*
Fetch a token using it's service ID and it's Identity's ID
@param identity the ID of the identity to query
@param service the service of the token to fetch
@return The identity for the ID provided
"""
FutureData<Token> f... | java | public FutureData<Token> getToken(String identity, String service) {
FutureData<Token> future = new FutureData<>();
URI uri = newParams().put("id", identity)
.forURL(config.newAPIEndpointURI(IDENTITY + "/" + identity + "/token/" + service));
Request request = config.http().
... | [
"public",
"FutureData",
"<",
"Token",
">",
"getToken",
"(",
"String",
"identity",
",",
"String",
"service",
")",
"{",
"FutureData",
"<",
"Token",
">",
"future",
"=",
"new",
"FutureData",
"<>",
"(",
")",
";",
"URI",
"uri",
"=",
"newParams",
"(",
")",
".... | /*
Fetch a token using it's service ID and it's Identity's ID
@param identity the ID of the identity to query
@param service the service of the token to fetch
@return The identity for the ID provided | [
"/",
"*",
"Fetch",
"a",
"token",
"using",
"it",
"s",
"service",
"ID",
"and",
"it",
"s",
"Identity",
"s",
"ID"
] | train | https://github.com/datasift/datasift-java/blob/09de124f2a1a507ff6181e59875c6f325290850e/src/main/java/com/datasift/client/accounts/DataSiftAccount.java#L209-L217 |
pravega/pravega | shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java | StreamSegmentNameUtils.getTransactionNameFromId | public static String getTransactionNameFromId(String parentStreamSegmentName, UUID transactionId) {
"""
Returns the transaction name for a TransactionStreamSegment based on the name of the current Parent StreamSegment, and the transactionId.
@param parentStreamSegmentName The name of the Parent StreamSegment fo... | java | public static String getTransactionNameFromId(String parentStreamSegmentName, UUID transactionId) {
StringBuilder result = new StringBuilder();
result.append(parentStreamSegmentName);
result.append(TRANSACTION_DELIMITER);
result.append(String.format(FULL_HEX_FORMAT, transactionId.getMost... | [
"public",
"static",
"String",
"getTransactionNameFromId",
"(",
"String",
"parentStreamSegmentName",
",",
"UUID",
"transactionId",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"result",
".",
"append",
"(",
"parentStreamSegmentName",
... | Returns the transaction name for a TransactionStreamSegment based on the name of the current Parent StreamSegment, and the transactionId.
@param parentStreamSegmentName The name of the Parent StreamSegment for this transaction.
@param transactionId The unique Id for the transaction.
@return The name of the T... | [
"Returns",
"the",
"transaction",
"name",
"for",
"a",
"TransactionStreamSegment",
"based",
"on",
"the",
"name",
"of",
"the",
"current",
"Parent",
"StreamSegment",
"and",
"the",
"transactionId",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java#L83-L90 |
Atmosphere/wasync | wasync/src/main/java/org/atmosphere/wasync/RequestBuilder.java | RequestBuilder.queryString | public T queryString(String name, String value) {
"""
Add a query param.
@param name header name
@param value header value
@return this
"""
List<String> l = queryString.get(name);
if (l == null) {
l = new ArrayList<String>();
}
l.add(value);
queryString.pu... | java | public T queryString(String name, String value) {
List<String> l = queryString.get(name);
if (l == null) {
l = new ArrayList<String>();
}
l.add(value);
queryString.put(name, l);
return derived.cast(this);
} | [
"public",
"T",
"queryString",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"List",
"<",
"String",
">",
"l",
"=",
"queryString",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"l",
"==",
"null",
")",
"{",
"l",
"=",
"new",
"ArrayList",
"... | Add a query param.
@param name header name
@param value header value
@return this | [
"Add",
"a",
"query",
"param",
"."
] | train | https://github.com/Atmosphere/wasync/blob/0146828b2f5138d4cbb4872fcbfe7d6e1887ac14/wasync/src/main/java/org/atmosphere/wasync/RequestBuilder.java#L125-L133 |
Alluxio/alluxio | core/common/src/main/java/alluxio/AbstractClient.java | AbstractClient.retryRPC | protected synchronized <V> V retryRPC(RpcCallable<V> rpc) throws AlluxioStatusException {
"""
Tries to execute an RPC defined as a {@link RpcCallable}.
If a {@link UnavailableException} occurs, a reconnection will be tried through
{@link #connect()} and the action will be re-executed.
@param rpc the RPC cal... | java | protected synchronized <V> V retryRPC(RpcCallable<V> rpc) throws AlluxioStatusException {
return retryRPCInternal(rpc, () -> null);
} | [
"protected",
"synchronized",
"<",
"V",
">",
"V",
"retryRPC",
"(",
"RpcCallable",
"<",
"V",
">",
"rpc",
")",
"throws",
"AlluxioStatusException",
"{",
"return",
"retryRPCInternal",
"(",
"rpc",
",",
"(",
")",
"->",
"null",
")",
";",
"}"
] | Tries to execute an RPC defined as a {@link RpcCallable}.
If a {@link UnavailableException} occurs, a reconnection will be tried through
{@link #connect()} and the action will be re-executed.
@param rpc the RPC call to be executed
@param <V> type of return value of the RPC call
@return the return value of the RPC cal... | [
"Tries",
"to",
"execute",
"an",
"RPC",
"defined",
"as",
"a",
"{",
"@link",
"RpcCallable",
"}",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/AbstractClient.java#L333-L335 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/JMessageClient.java | JMessageClient.setGroupShield | public ResponseWrapper setGroupShield(GroupShieldPayload payload, String username)
throws APIConnectionException, APIRequestException {
"""
Set user's group message blocking
@param payload GroupShieldPayload
@param username Necessary
@return No content
@throws APIConnectionException connect excepti... | java | public ResponseWrapper setGroupShield(GroupShieldPayload payload, String username)
throws APIConnectionException, APIRequestException {
return _userClient.setGroupShield(payload, username);
} | [
"public",
"ResponseWrapper",
"setGroupShield",
"(",
"GroupShieldPayload",
"payload",
",",
"String",
"username",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"return",
"_userClient",
".",
"setGroupShield",
"(",
"payload",
",",
"username",
")"... | Set user's group message blocking
@param payload GroupShieldPayload
@param username Necessary
@return No content
@throws APIConnectionException connect exception
@throws APIRequestException request exception | [
"Set",
"user",
"s",
"group",
"message",
"blocking"
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/JMessageClient.java#L341-L344 |
alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/task/TopologyContext.java | TopologyContext.setSubscribedState | public <T extends ISubscribedState> T setSubscribedState(String componentId, T obj) {
"""
Synchronizes the default stream from the specified state spout component id with the provided ISubscribedState object.
The recommended usage of this method is as follows:
<pre>
_myState = context.setSubscribedState(compo... | java | public <T extends ISubscribedState> T setSubscribedState(String componentId, T obj) {
return setSubscribedState(componentId, Utils.DEFAULT_STREAM_ID, obj);
} | [
"public",
"<",
"T",
"extends",
"ISubscribedState",
">",
"T",
"setSubscribedState",
"(",
"String",
"componentId",
",",
"T",
"obj",
")",
"{",
"return",
"setSubscribedState",
"(",
"componentId",
",",
"Utils",
".",
"DEFAULT_STREAM_ID",
",",
"obj",
")",
";",
"}"
] | Synchronizes the default stream from the specified state spout component id with the provided ISubscribedState object.
The recommended usage of this method is as follows:
<pre>
_myState = context.setSubscribedState(componentId, new MyState());
</pre>
@param componentId the id of the StateSpout component to subscribe ... | [
"Synchronizes",
"the",
"default",
"stream",
"from",
"the",
"specified",
"state",
"spout",
"component",
"id",
"with",
"the",
"provided",
"ISubscribedState",
"object",
"."
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/task/TopologyContext.java#L109-L111 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/registry/NotificationHandlerNodeSubregistry.java | NotificationHandlerNodeSubregistry.unregisterEntry | void unregisterEntry(ListIterator<PathElement> iterator, String value, ConcreteNotificationHandlerRegistration.NotificationHandlerEntry entry) {
"""
Get the registry child for the given {@code elementValue} and traverse it to unregister the entry.
"""
NotificationHandlerNodeRegistry registry = childReg... | java | void unregisterEntry(ListIterator<PathElement> iterator, String value, ConcreteNotificationHandlerRegistration.NotificationHandlerEntry entry) {
NotificationHandlerNodeRegistry registry = childRegistries.get(value);
if (registry == null) {
return;
}
registry.unregisterEntry(i... | [
"void",
"unregisterEntry",
"(",
"ListIterator",
"<",
"PathElement",
">",
"iterator",
",",
"String",
"value",
",",
"ConcreteNotificationHandlerRegistration",
".",
"NotificationHandlerEntry",
"entry",
")",
"{",
"NotificationHandlerNodeRegistry",
"registry",
"=",
"childRegistr... | Get the registry child for the given {@code elementValue} and traverse it to unregister the entry. | [
"Get",
"the",
"registry",
"child",
"for",
"the",
"given",
"{"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/registry/NotificationHandlerNodeSubregistry.java#L82-L88 |
tobato/FastDFS_Client | src/main/java/com/github/tobato/fastdfs/domain/proto/mapper/FdfsParamMapper.java | FdfsParamMapper.mapByIndex | private static <T> T mapByIndex(byte[] content, Class<T> genericType, ObjectMetaData objectMap, Charset charset)
throws InstantiationException, IllegalAccessException, InvocationTargetException {
"""
按列顺序映射
@param content
@param genericType
@param objectMap
@return
@throws InstantiationException... | java | private static <T> T mapByIndex(byte[] content, Class<T> genericType, ObjectMetaData objectMap, Charset charset)
throws InstantiationException, IllegalAccessException, InvocationTargetException {
List<FieldMetaData> mappingFields = objectMap.getFieldList();
T obj = genericType.newInstance()... | [
"private",
"static",
"<",
"T",
">",
"T",
"mapByIndex",
"(",
"byte",
"[",
"]",
"content",
",",
"Class",
"<",
"T",
">",
"genericType",
",",
"ObjectMetaData",
"objectMap",
",",
"Charset",
"charset",
")",
"throws",
"InstantiationException",
",",
"IllegalAccessExce... | 按列顺序映射
@param content
@param genericType
@param objectMap
@return
@throws InstantiationException
@throws IllegalAccessException
@throws InvocationTargetException | [
"按列顺序映射"
] | train | https://github.com/tobato/FastDFS_Client/blob/8e3bfe712f1739028beed7f3a6b2cc4579a231e4/src/main/java/com/github/tobato/fastdfs/domain/proto/mapper/FdfsParamMapper.java#L90-L103 |
FlyingHe/UtilsMaven | src/main/java/com/github/flyinghe/tools/DBUtils.java | DBUtils.get | public static <T> T get(Class<T> clazz, String sql, Object... arg) {
"""
本函数所查找的结果只能返回一条记录,若查找到的多条记录符合要求将返回第一条符合要求的记录
@param clazz 需要查找的对象的所属类的一个类(Class)
@param sql 只能是SELECT语句,SQL语句中的字段别名必须与T类里的相应字段相同
@param arg SQL语句中的参数占位符参数
@return 将查找到的的记录包装成一个对象,并返回该对象,若没有记录则返回null
"""
List<T> list = DB... | java | public static <T> T get(Class<T> clazz, String sql, Object... arg) {
List<T> list = DBUtils.getList(clazz, sql, arg);
if (list.isEmpty()) {
return null;
}
return list.get(0);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"get",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"String",
"sql",
",",
"Object",
"...",
"arg",
")",
"{",
"List",
"<",
"T",
">",
"list",
"=",
"DBUtils",
".",
"getList",
"(",
"clazz",
",",
"sql",
",",
"arg... | 本函数所查找的结果只能返回一条记录,若查找到的多条记录符合要求将返回第一条符合要求的记录
@param clazz 需要查找的对象的所属类的一个类(Class)
@param sql 只能是SELECT语句,SQL语句中的字段别名必须与T类里的相应字段相同
@param arg SQL语句中的参数占位符参数
@return 将查找到的的记录包装成一个对象,并返回该对象,若没有记录则返回null | [
"本函数所查找的结果只能返回一条记录,若查找到的多条记录符合要求将返回第一条符合要求的记录"
] | train | https://github.com/FlyingHe/UtilsMaven/blob/d9605b7bfe0c28a05289252e12d163e114080b4a/src/main/java/com/github/flyinghe/tools/DBUtils.java#L263-L269 |
ineunetOS/knife-commons | knife-commons-utils/src/main/java/com/ineunet/knife/util/StringUtils.java | StringUtils.indexOfAnyBut | public static int indexOfAnyBut(String str, String searchChars) {
"""
<p>Search a String to find the first index of any
character not in the given set of characters.</p>
<p>A <code>null</code> String will return <code>-1</code>.
A <code>null</code> or empty search string will return <code>-1</code>.</p>
<p... | java | public static int indexOfAnyBut(String str, String searchChars) {
if (isEmpty(str) || isEmpty(searchChars)) {
return INDEX_NOT_FOUND;
}
int strLen = str.length();
for (int i = 0; i < strLen; i++) {
char ch = str.charAt(i);
boolean chFound = searchChars... | [
"public",
"static",
"int",
"indexOfAnyBut",
"(",
"String",
"str",
",",
"String",
"searchChars",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"str",
")",
"||",
"isEmpty",
"(",
"searchChars",
")",
")",
"{",
"return",
"INDEX_NOT_FOUND",
";",
"}",
"int",
"strLen",
"... | <p>Search a String to find the first index of any
character not in the given set of characters.</p>
<p>A <code>null</code> String will return <code>-1</code>.
A <code>null</code> or empty search string will return <code>-1</code>.</p>
<pre>
StringUtils.indexOfAnyBut(null, *) = -1
StringUtils.indexOfAnyBut(... | [
"<p",
">",
"Search",
"a",
"String",
"to",
"find",
"the",
"first",
"index",
"of",
"any",
"character",
"not",
"in",
"the",
"given",
"set",
"of",
"characters",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ineunetOS/knife-commons/blob/eae9e59afa020a00ae8977c10d43ac8ae46ae236/knife-commons-utils/src/main/java/com/ineunet/knife/util/StringUtils.java#L1520-L1540 |
apache/incubator-heron | heron/spi/src/java/org/apache/heron/spi/utils/NetworkUtils.java | NetworkUtils.getInetSocketAddress | public static InetSocketAddress getInetSocketAddress(String endpoint) {
"""
Convert an endpoint from String (host:port) to InetSocketAddress
@param endpoint a String in (host:port) format
@return an InetSocketAddress representing the endpoint
"""
String[] array = endpoint.split(":");
return new Ine... | java | public static InetSocketAddress getInetSocketAddress(String endpoint) {
String[] array = endpoint.split(":");
return new InetSocketAddress(array[0], Integer.parseInt(array[1]));
} | [
"public",
"static",
"InetSocketAddress",
"getInetSocketAddress",
"(",
"String",
"endpoint",
")",
"{",
"String",
"[",
"]",
"array",
"=",
"endpoint",
".",
"split",
"(",
"\":\"",
")",
";",
"return",
"new",
"InetSocketAddress",
"(",
"array",
"[",
"0",
"]",
",",
... | Convert an endpoint from String (host:port) to InetSocketAddress
@param endpoint a String in (host:port) format
@return an InetSocketAddress representing the endpoint | [
"Convert",
"an",
"endpoint",
"from",
"String",
"(",
"host",
":",
"port",
")",
"to",
"InetSocketAddress"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/spi/src/java/org/apache/heron/spi/utils/NetworkUtils.java#L534-L537 |
puniverse/capsule | capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java | Jar.getAttribute | public String getAttribute(String section, String name) {
"""
Returns an attribute's value from a non-main section of this JAR's manifest.
@param section the manifest's section
@param name the attribute's name
"""
Attributes attr = getManifest().getAttributes(section);
return attr != nul... | java | public String getAttribute(String section, String name) {
Attributes attr = getManifest().getAttributes(section);
return attr != null ? attr.getValue(name) : null;
} | [
"public",
"String",
"getAttribute",
"(",
"String",
"section",
",",
"String",
"name",
")",
"{",
"Attributes",
"attr",
"=",
"getManifest",
"(",
")",
".",
"getAttributes",
"(",
"section",
")",
";",
"return",
"attr",
"!=",
"null",
"?",
"attr",
".",
"getValue",... | Returns an attribute's value from a non-main section of this JAR's manifest.
@param section the manifest's section
@param name the attribute's name | [
"Returns",
"an",
"attribute",
"s",
"value",
"from",
"a",
"non",
"-",
"main",
"section",
"of",
"this",
"JAR",
"s",
"manifest",
"."
] | train | https://github.com/puniverse/capsule/blob/291a54e501a32aaf0284707b8c1fbff6a566822b/capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java#L234-L237 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/validation/fieldvalidation/AbstractFieldValidator.java | AbstractFieldValidator.error | public void error(final CellField<T> cellField, final String messageKey) {
"""
メッセージキーを指定して、エラー情報を追加します。
<p>エラーメッセージ中の変数は、{@link #getMessageVariables(CellField)}の値を使用します。</p>
@param cellField フィールド情報
@param messageKey メッセージキー
@throws IllegalArgumentException {@literal cellField == null or messageKey == null}
... | java | public void error(final CellField<T> cellField, final String messageKey) {
error(cellField, messageKey, getMessageVariables(cellField));
} | [
"public",
"void",
"error",
"(",
"final",
"CellField",
"<",
"T",
">",
"cellField",
",",
"final",
"String",
"messageKey",
")",
"{",
"error",
"(",
"cellField",
",",
"messageKey",
",",
"getMessageVariables",
"(",
"cellField",
")",
")",
";",
"}"
] | メッセージキーを指定して、エラー情報を追加します。
<p>エラーメッセージ中の変数は、{@link #getMessageVariables(CellField)}の値を使用します。</p>
@param cellField フィールド情報
@param messageKey メッセージキー
@throws IllegalArgumentException {@literal cellField == null or messageKey == null}
@throws IllegalArgumentException {@literal messageKey.length() == 0} | [
"メッセージキーを指定して、エラー情報を追加します。",
"<p",
">",
"エラーメッセージ中の変数は、",
"{"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/validation/fieldvalidation/AbstractFieldValidator.java#L101-L103 |
pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamTransactionMetadataTasks.java | StreamTransactionMetadataTasks.createTxn | public CompletableFuture<Pair<VersionedTransactionData, List<StreamSegmentRecord>>> createTxn(final String scope,
final String stream,
final long le... | java | public CompletableFuture<Pair<VersionedTransactionData, List<StreamSegmentRecord>>> createTxn(final String scope,
final String stream,
final long le... | [
"public",
"CompletableFuture",
"<",
"Pair",
"<",
"VersionedTransactionData",
",",
"List",
"<",
"StreamSegmentRecord",
">",
">",
">",
"createTxn",
"(",
"final",
"String",
"scope",
",",
"final",
"String",
"stream",
",",
"final",
"long",
"lease",
",",
"final",
"O... | Create transaction.
@param scope stream scope.
@param stream stream name.
@param lease Time for which transaction shall remain open with sending any heartbeat.
the scaling operation is initiated on the txn stream.
@param contextOpt operational context
@return transaction i... | [
"Create",
"transaction",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamTransactionMetadataTasks.java#L194-L200 |
ocelotds/ocelot | ocelot-processor/src/main/java/org/ocelotds/processors/visitors/DataServiceVisitorJsBuilder.java | DataServiceVisitorJsBuilder.computeKeys | String computeKeys(ExecutableElement methodElement, List<String> arguments) {
"""
Generate key part for variable part of md5
@param methodElement
@param arguments
@return
"""
String keys = stringJoinAndDecorate(arguments, COMMA, new NothingDecorator());
if (arguments != null && !arguments.isEmpty()) {... | java | String computeKeys(ExecutableElement methodElement, List<String> arguments) {
String keys = stringJoinAndDecorate(arguments, COMMA, new NothingDecorator());
if (arguments != null && !arguments.isEmpty()) {
JsCacheResult jcr = methodElement.getAnnotation(JsCacheResult.class);
// if there is a jcr annotatio... | [
"String",
"computeKeys",
"(",
"ExecutableElement",
"methodElement",
",",
"List",
"<",
"String",
">",
"arguments",
")",
"{",
"String",
"keys",
"=",
"stringJoinAndDecorate",
"(",
"arguments",
",",
"COMMA",
",",
"new",
"NothingDecorator",
"(",
")",
")",
";",
"if"... | Generate key part for variable part of md5
@param methodElement
@param arguments
@return | [
"Generate",
"key",
"part",
"for",
"variable",
"part",
"of",
"md5"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-processor/src/main/java/org/ocelotds/processors/visitors/DataServiceVisitorJsBuilder.java#L218-L228 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java | UCharacterName.getName | public String getName(int ch, int choice) {
"""
Retrieve the name of a Unicode code point.
Depending on <code>choice</code>, the character name written into the
buffer is the "modern" name or the name that was defined in Unicode
version 1.0.
The name contains only "invariant" characters
like A-Z, 0-9, space, ... | java | public String getName(int ch, int choice)
{
if (ch < UCharacter.MIN_VALUE || ch > UCharacter.MAX_VALUE ||
choice > UCharacterNameChoice.CHAR_NAME_CHOICE_COUNT) {
return null;
}
String result = null;
result = getAlgName(ch, choice);
// getting normal... | [
"public",
"String",
"getName",
"(",
"int",
"ch",
",",
"int",
"choice",
")",
"{",
"if",
"(",
"ch",
"<",
"UCharacter",
".",
"MIN_VALUE",
"||",
"ch",
">",
"UCharacter",
".",
"MAX_VALUE",
"||",
"choice",
">",
"UCharacterNameChoice",
".",
"CHAR_NAME_CHOICE_COUNT"... | Retrieve the name of a Unicode code point.
Depending on <code>choice</code>, the character name written into the
buffer is the "modern" name or the name that was defined in Unicode
version 1.0.
The name contains only "invariant" characters
like A-Z, 0-9, space, and '-'.
@param ch the code point for which to get the na... | [
"Retrieve",
"the",
"name",
"of",
"a",
"Unicode",
"code",
"point",
".",
"Depending",
"on",
"<code",
">",
"choice<",
"/",
"code",
">",
"the",
"character",
"name",
"written",
"into",
"the",
"buffer",
"is",
"the",
"modern",
"name",
"or",
"the",
"name",
"that... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UCharacterName.java#L82-L103 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.