repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
javabits/yar | yar-guice/src/main/java/org/javabits/yar/guice/Reflections.java | Reflections.getRawType | @SuppressWarnings("unckecked")
public static Class<?> getRawType(Type type) {
if (type instanceof Class<?>) {
// type is a normal class.
return (Class<?>) type;
} else if (type instanceof ParameterizedType) {
ParameterizedType parameterizedType = (ParameterizedTy... | java | @SuppressWarnings("unckecked")
public static Class<?> getRawType(Type type) {
if (type instanceof Class<?>) {
// type is a normal class.
return (Class<?>) type;
} else if (type instanceof ParameterizedType) {
ParameterizedType parameterizedType = (ParameterizedTy... | [
"@",
"SuppressWarnings",
"(",
"\"unckecked\"",
")",
"public",
"static",
"Class",
"<",
"?",
">",
"getRawType",
"(",
"Type",
"type",
")",
"{",
"if",
"(",
"type",
"instanceof",
"Class",
"<",
"?",
">",
")",
"{",
"// type is a normal class.",
"return",
"(",
"Cl... | Copy paste from Guice MoreTypes | [
"Copy",
"paste",
"from",
"Guice",
"MoreTypes"
] | e146a86611ca4831e8334c9a98fd7086cee9c03e | https://github.com/javabits/yar/blob/e146a86611ca4831e8334c9a98fd7086cee9c03e/yar-guice/src/main/java/org/javabits/yar/guice/Reflections.java#L62-L93 | train |
labai/ted | ted-driver/src/main/java/ted/driver/sys/TedDaoPostgres.java | TedDaoPostgres.eventQueueReserveTask | public TaskRec eventQueueReserveTask(long taskId) {
String sqlLogId = "reserve_task";
String sql = "update tedtask set status = 'WORK', startTs = $now, nextTs = null"
+ " where status in ('NEW','RETRY') and system = '$sys'"
+ " and taskid in ("
+ " select taskid from tedtask "
+ " where status in (... | java | public TaskRec eventQueueReserveTask(long taskId) {
String sqlLogId = "reserve_task";
String sql = "update tedtask set status = 'WORK', startTs = $now, nextTs = null"
+ " where status in ('NEW','RETRY') and system = '$sys'"
+ " and taskid in ("
+ " select taskid from tedtask "
+ " where status in (... | [
"public",
"TaskRec",
"eventQueueReserveTask",
"(",
"long",
"taskId",
")",
"{",
"String",
"sqlLogId",
"=",
"\"reserve_task\"",
";",
"String",
"sql",
"=",
"\"update tedtask set status = 'WORK', startTs = $now, nextTs = null\"",
"+",
"\" where status in ('NEW','RETRY') and system = ... | used in eventQueue | [
"used",
"in",
"eventQueue"
] | 2ee197246a78d842c18d6780c48fd903b00608a6 | https://github.com/labai/ted/blob/2ee197246a78d842c18d6780c48fd903b00608a6/ted-driver/src/main/java/ted/driver/sys/TedDaoPostgres.java#L131-L148 | train |
eFaps/eFaps-Kernel | src/main/java/org/efaps/admin/ui/field/Field.java | Field.initialize | public static void initialize()
{
if (InfinispanCache.get().exists(Field.IDCACHE)) {
InfinispanCache.get().<Long, Field>getCache(Field.IDCACHE).clear();
} else {
InfinispanCache.get().<Long, Field>getCache(Field.IDCACHE);
InfinispanCache.get().<Long, Field>getCach... | java | public static void initialize()
{
if (InfinispanCache.get().exists(Field.IDCACHE)) {
InfinispanCache.get().<Long, Field>getCache(Field.IDCACHE).clear();
} else {
InfinispanCache.get().<Long, Field>getCache(Field.IDCACHE);
InfinispanCache.get().<Long, Field>getCach... | [
"public",
"static",
"void",
"initialize",
"(",
")",
"{",
"if",
"(",
"InfinispanCache",
".",
"get",
"(",
")",
".",
"exists",
"(",
"Field",
".",
"IDCACHE",
")",
")",
"{",
"InfinispanCache",
".",
"get",
"(",
")",
".",
"<",
"Long",
",",
"Field",
">",
"... | Reset the cache. | [
"Reset",
"the",
"cache",
"."
] | 04b96548f518c2386a93f5ec2b9349f9b9063859 | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/admin/ui/field/Field.java#L761-L769 | train |
navnorth/LRJavaLib | src/com/navnorth/learningregistry/LRExporter.java | LRExporter.configure | public void configure() throws LRException
{
// Trim or nullify strings
nodeHost = StringUtil.nullifyBadInput(nodeHost);
publishAuthUser = StringUtil.nullifyBadInput(publishAuthUser);
publishAuthPassword = StringUtil.nullifyBadInput(publishAuthPassword);
// Throw an exce... | java | public void configure() throws LRException
{
// Trim or nullify strings
nodeHost = StringUtil.nullifyBadInput(nodeHost);
publishAuthUser = StringUtil.nullifyBadInput(publishAuthUser);
publishAuthPassword = StringUtil.nullifyBadInput(publishAuthPassword);
// Throw an exce... | [
"public",
"void",
"configure",
"(",
")",
"throws",
"LRException",
"{",
"// Trim or nullify strings",
"nodeHost",
"=",
"StringUtil",
".",
"nullifyBadInput",
"(",
"nodeHost",
")",
";",
"publishAuthUser",
"=",
"StringUtil",
".",
"nullifyBadInput",
"(",
"publishAuthUser",... | Attempt to configure the exporter with the values used in the constructor
This must be called before an exporter can be used and after any setting of configuration values
@throws LRException | [
"Attempt",
"to",
"configure",
"the",
"exporter",
"with",
"the",
"values",
"used",
"in",
"the",
"constructor",
"This",
"must",
"be",
"called",
"before",
"an",
"exporter",
"can",
"be",
"used",
"and",
"after",
"any",
"setting",
"of",
"configuration",
"values"
] | 27af28b9f80d772273592414e7d0dccffaac09e1 | https://github.com/navnorth/LRJavaLib/blob/27af28b9f80d772273592414e7d0dccffaac09e1/src/com/navnorth/learningregistry/LRExporter.java#L161-L186 | train |
navnorth/LRJavaLib | src/com/navnorth/learningregistry/LRExporter.java | LRExporter.addDocument | public void addDocument(LREnvelope envelope) throws LRException
{
if(!configured)
{
throw new LRException(LRException.NOT_CONFIGURED);
}
docs.add(envelope.getSendableData());
} | java | public void addDocument(LREnvelope envelope) throws LRException
{
if(!configured)
{
throw new LRException(LRException.NOT_CONFIGURED);
}
docs.add(envelope.getSendableData());
} | [
"public",
"void",
"addDocument",
"(",
"LREnvelope",
"envelope",
")",
"throws",
"LRException",
"{",
"if",
"(",
"!",
"configured",
")",
"{",
"throw",
"new",
"LRException",
"(",
"LRException",
".",
"NOT_CONFIGURED",
")",
";",
"}",
"docs",
".",
"add",
"(",
"en... | Adds an envelope to the exporter
@param envelope envelope to add to the exporter
@throws LRException NOT_CONFIGURED | [
"Adds",
"an",
"envelope",
"to",
"the",
"exporter"
] | 27af28b9f80d772273592414e7d0dccffaac09e1 | https://github.com/navnorth/LRJavaLib/blob/27af28b9f80d772273592414e7d0dccffaac09e1/src/com/navnorth/learningregistry/LRExporter.java#L194-L202 | train |
Teddy-Zhu/SilentGo | framework/src/main/java/com/silentgo/servlet/http/Request.java | Request.forward | public void forward(String controllerName) throws Throwable {
SilentGo instance = SilentGo.me();
((ActionChain) instance.getConfig().getActionChain().getObject()).doAction(instance.getConfig().getCtx().get().getActionParam());
} | java | public void forward(String controllerName) throws Throwable {
SilentGo instance = SilentGo.me();
((ActionChain) instance.getConfig().getActionChain().getObject()).doAction(instance.getConfig().getCtx().get().getActionParam());
} | [
"public",
"void",
"forward",
"(",
"String",
"controllerName",
")",
"throws",
"Throwable",
"{",
"SilentGo",
"instance",
"=",
"SilentGo",
".",
"me",
"(",
")",
";",
"(",
"(",
"ActionChain",
")",
"instance",
".",
"getConfig",
"(",
")",
".",
"getActionChain",
"... | forward to another controller
@param controllerName
@throws Throwable | [
"forward",
"to",
"another",
"controller"
] | 27f58b0cafe56b2eb9fc6993efa9ca2b529661e1 | https://github.com/Teddy-Zhu/SilentGo/blob/27f58b0cafe56b2eb9fc6993efa9ca2b529661e1/framework/src/main/java/com/silentgo/servlet/http/Request.java#L101-L104 | train |
FlyingHe/UtilsMaven | src/main/java/com/github/flyinghe/depdcy/XSSFSheetXMLHandlerPlus.java | XSSFSheetXMLHandlerPlus.characters | @Override
public void characters(char[] ch, int start, int length)
throws SAXException {
if (vIsOpen) {
value.append(ch, start, length);
}
if (fIsOpen) {
formula.append(ch, start, length);
}
if (hfIsOpen) {
headerFooter.append(ch, s... | java | @Override
public void characters(char[] ch, int start, int length)
throws SAXException {
if (vIsOpen) {
value.append(ch, start, length);
}
if (fIsOpen) {
formula.append(ch, start, length);
}
if (hfIsOpen) {
headerFooter.append(ch, s... | [
"@",
"Override",
"public",
"void",
"characters",
"(",
"char",
"[",
"]",
"ch",
",",
"int",
"start",
",",
"int",
"length",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"vIsOpen",
")",
"{",
"value",
".",
"append",
"(",
"ch",
",",
"start",
",",
"length... | Captures characters only if a suitable element is open.
Originally was just "v"; extended for inlineStr also. | [
"Captures",
"characters",
"only",
"if",
"a",
"suitable",
"element",
"is",
"open",
".",
"Originally",
"was",
"just",
"v",
";",
"extended",
"for",
"inlineStr",
"also",
"."
] | d9605b7bfe0c28a05289252e12d163e114080b4a | https://github.com/FlyingHe/UtilsMaven/blob/d9605b7bfe0c28a05289252e12d163e114080b4a/src/main/java/com/github/flyinghe/depdcy/XSSFSheetXMLHandlerPlus.java#L446-L458 | train |
FlyingHe/UtilsMaven | src/main/java/com/github/flyinghe/depdcy/XSSFSheetXMLHandlerPlus.java | XSSFSheetXMLHandlerPlus.checkForEmptyCellComments | private void checkForEmptyCellComments(XSSFSheetXMLHandlerPlus.EmptyCellCommentsCheckType type) {
if (commentCellRefs != null && !commentCellRefs.isEmpty()) {
// If we've reached the end of the sheet data, output any
// comments we haven't yet already handled
if (type == XSS... | java | private void checkForEmptyCellComments(XSSFSheetXMLHandlerPlus.EmptyCellCommentsCheckType type) {
if (commentCellRefs != null && !commentCellRefs.isEmpty()) {
// If we've reached the end of the sheet data, output any
// comments we haven't yet already handled
if (type == XSS... | [
"private",
"void",
"checkForEmptyCellComments",
"(",
"XSSFSheetXMLHandlerPlus",
".",
"EmptyCellCommentsCheckType",
"type",
")",
"{",
"if",
"(",
"commentCellRefs",
"!=",
"null",
"&&",
"!",
"commentCellRefs",
".",
"isEmpty",
"(",
")",
")",
"{",
"// If we've reached the ... | Do a check for, and output, comments in otherwise empty cells. | [
"Do",
"a",
"check",
"for",
"and",
"output",
"comments",
"in",
"otherwise",
"empty",
"cells",
"."
] | d9605b7bfe0c28a05289252e12d163e114080b4a | https://github.com/FlyingHe/UtilsMaven/blob/d9605b7bfe0c28a05289252e12d163e114080b4a/src/main/java/com/github/flyinghe/depdcy/XSSFSheetXMLHandlerPlus.java#L463-L516 | train |
FlyingHe/UtilsMaven | src/main/java/com/github/flyinghe/depdcy/XSSFSheetXMLHandlerPlus.java | XSSFSheetXMLHandlerPlus.outputEmptyCellComment | private void outputEmptyCellComment(CellAddress cellRef) {
XSSFComment comment = commentsTable.findCellComment(cellRef);
output.cell(cellRef.formatAsString(), null, comment);
} | java | private void outputEmptyCellComment(CellAddress cellRef) {
XSSFComment comment = commentsTable.findCellComment(cellRef);
output.cell(cellRef.formatAsString(), null, comment);
} | [
"private",
"void",
"outputEmptyCellComment",
"(",
"CellAddress",
"cellRef",
")",
"{",
"XSSFComment",
"comment",
"=",
"commentsTable",
".",
"findCellComment",
"(",
"cellRef",
")",
";",
"output",
".",
"cell",
"(",
"cellRef",
".",
"formatAsString",
"(",
")",
",",
... | Output an empty-cell comment. | [
"Output",
"an",
"empty",
"-",
"cell",
"comment",
"."
] | d9605b7bfe0c28a05289252e12d163e114080b4a | https://github.com/FlyingHe/UtilsMaven/blob/d9605b7bfe0c28a05289252e12d163e114080b4a/src/main/java/com/github/flyinghe/depdcy/XSSFSheetXMLHandlerPlus.java#L522-L525 | train |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java | GeometryIndexService.format | public String format(GeometryIndex index) {
if (index.hasChild()) {
return "geometry" + index.getValue() + "." + format(index.getChild());
}
switch (index.getType()) {
case TYPE_VERTEX:
return "vertex" + index.getValue();
case TYPE_EDGE:
return "edge" + index.getValue();
default:
return "g... | java | public String format(GeometryIndex index) {
if (index.hasChild()) {
return "geometry" + index.getValue() + "." + format(index.getChild());
}
switch (index.getType()) {
case TYPE_VERTEX:
return "vertex" + index.getValue();
case TYPE_EDGE:
return "edge" + index.getValue();
default:
return "g... | [
"public",
"String",
"format",
"(",
"GeometryIndex",
"index",
")",
"{",
"if",
"(",
"index",
".",
"hasChild",
"(",
")",
")",
"{",
"return",
"\"geometry\"",
"+",
"index",
".",
"getValue",
"(",
")",
"+",
"\".\"",
"+",
"format",
"(",
"index",
".",
"getChild... | Format a given geometry index, creating something like "geometry2.vertex1".
@param index
The geometry index to format.
@return Returns the string value resulting from the index. | [
"Format",
"a",
"given",
"geometry",
"index",
"creating",
"something",
"like",
"geometry2",
".",
"vertex1",
"."
] | 09a214fede69c9c01e41630828c4abbb551a557d | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java#L99-L111 | train |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java | GeometryIndexService.getVertex | public Coordinate getVertex(Geometry geometry, GeometryIndex index) throws GeometryIndexNotFoundException {
if (index.hasChild()) {
if (geometry.getGeometries() != null && geometry.getGeometries().length > index.getValue()) {
return getVertex(geometry.getGeometries()[index.getValue()], index.getChild());
}
... | java | public Coordinate getVertex(Geometry geometry, GeometryIndex index) throws GeometryIndexNotFoundException {
if (index.hasChild()) {
if (geometry.getGeometries() != null && geometry.getGeometries().length > index.getValue()) {
return getVertex(geometry.getGeometries()[index.getValue()], index.getChild());
}
... | [
"public",
"Coordinate",
"getVertex",
"(",
"Geometry",
"geometry",
",",
"GeometryIndex",
"index",
")",
"throws",
"GeometryIndexNotFoundException",
"{",
"if",
"(",
"index",
".",
"hasChild",
"(",
")",
")",
"{",
"if",
"(",
"geometry",
".",
"getGeometries",
"(",
")... | Given a certain geometry, get the vertex the index points to. This only works if the index actually points to a
vertex.
@param geometry
The geometry to search in.
@param index
The index that points to a vertex within the given geometry.
@return Returns the vertex if it exists.
@throws GeometryIndexNotFoundException
Th... | [
"Given",
"a",
"certain",
"geometry",
"get",
"the",
"vertex",
"the",
"index",
"points",
"to",
".",
"This",
"only",
"works",
"if",
"the",
"index",
"actually",
"points",
"to",
"a",
"vertex",
"."
] | 09a214fede69c9c01e41630828c4abbb551a557d | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java#L190-L202 | train |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java | GeometryIndexService.isVertex | public boolean isVertex(GeometryIndex index) {
if (index.hasChild()) {
return isVertex(index.getChild());
}
return index.getType() == GeometryIndexType.TYPE_VERTEX;
} | java | public boolean isVertex(GeometryIndex index) {
if (index.hasChild()) {
return isVertex(index.getChild());
}
return index.getType() == GeometryIndexType.TYPE_VERTEX;
} | [
"public",
"boolean",
"isVertex",
"(",
"GeometryIndex",
"index",
")",
"{",
"if",
"(",
"index",
".",
"hasChild",
"(",
")",
")",
"{",
"return",
"isVertex",
"(",
"index",
".",
"getChild",
"(",
")",
")",
";",
"}",
"return",
"index",
".",
"getType",
"(",
"... | Does the given index point to a vertex or not? We look at the deepest level to check this.
@param index
The index to check.
@return true or false. | [
"Does",
"the",
"given",
"index",
"point",
"to",
"a",
"vertex",
"or",
"not?",
"We",
"look",
"at",
"the",
"deepest",
"level",
"to",
"check",
"this",
"."
] | 09a214fede69c9c01e41630828c4abbb551a557d | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java#L243-L248 | train |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java | GeometryIndexService.isEdge | public boolean isEdge(GeometryIndex index) {
if (index.hasChild()) {
return isEdge(index.getChild());
}
return index.getType() == GeometryIndexType.TYPE_EDGE;
} | java | public boolean isEdge(GeometryIndex index) {
if (index.hasChild()) {
return isEdge(index.getChild());
}
return index.getType() == GeometryIndexType.TYPE_EDGE;
} | [
"public",
"boolean",
"isEdge",
"(",
"GeometryIndex",
"index",
")",
"{",
"if",
"(",
"index",
".",
"hasChild",
"(",
")",
")",
"{",
"return",
"isEdge",
"(",
"index",
".",
"getChild",
"(",
")",
")",
";",
"}",
"return",
"index",
".",
"getType",
"(",
")",
... | Does the given index point to an edge or not? We look at the deepest level to check this.
@param index
The index to check.
@return true or false. | [
"Does",
"the",
"given",
"index",
"point",
"to",
"an",
"edge",
"or",
"not?",
"We",
"look",
"at",
"the",
"deepest",
"level",
"to",
"check",
"this",
"."
] | 09a214fede69c9c01e41630828c4abbb551a557d | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java#L257-L262 | train |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java | GeometryIndexService.isGeometry | public boolean isGeometry(GeometryIndex index) {
if (index.hasChild()) {
return isGeometry(index.getChild());
}
return index.getType() == GeometryIndexType.TYPE_GEOMETRY;
} | java | public boolean isGeometry(GeometryIndex index) {
if (index.hasChild()) {
return isGeometry(index.getChild());
}
return index.getType() == GeometryIndexType.TYPE_GEOMETRY;
} | [
"public",
"boolean",
"isGeometry",
"(",
"GeometryIndex",
"index",
")",
"{",
"if",
"(",
"index",
".",
"hasChild",
"(",
")",
")",
"{",
"return",
"isGeometry",
"(",
"index",
".",
"getChild",
"(",
")",
")",
";",
"}",
"return",
"index",
".",
"getType",
"(",... | Does the given index point to a sub-geometry or not? We look at the deepest level to check this.
@param index
The index to check.
@return true or false. | [
"Does",
"the",
"given",
"index",
"point",
"to",
"a",
"sub",
"-",
"geometry",
"or",
"not?",
"We",
"look",
"at",
"the",
"deepest",
"level",
"to",
"check",
"this",
"."
] | 09a214fede69c9c01e41630828c4abbb551a557d | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java#L271-L276 | train |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java | GeometryIndexService.getType | public GeometryIndexType getType(GeometryIndex index) {
if (index.hasChild()) {
return getType(index.getChild());
}
return index.getType();
} | java | public GeometryIndexType getType(GeometryIndex index) {
if (index.hasChild()) {
return getType(index.getChild());
}
return index.getType();
} | [
"public",
"GeometryIndexType",
"getType",
"(",
"GeometryIndex",
"index",
")",
"{",
"if",
"(",
"index",
".",
"hasChild",
"(",
")",
")",
"{",
"return",
"getType",
"(",
"index",
".",
"getChild",
"(",
")",
")",
";",
"}",
"return",
"index",
".",
"getType",
... | Get the type of sub-part the given index points to. We look at the deepest level to check this.
@param index
The index to check.
@return true or false. | [
"Get",
"the",
"type",
"of",
"sub",
"-",
"part",
"the",
"given",
"index",
"points",
"to",
".",
"We",
"look",
"at",
"the",
"deepest",
"level",
"to",
"check",
"this",
"."
] | 09a214fede69c9c01e41630828c4abbb551a557d | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java#L297-L302 | train |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java | GeometryIndexService.getGeometryType | public String getGeometryType(Geometry geometry, GeometryIndex index) throws GeometryIndexNotFoundException {
if (index != null && index.getType() == GeometryIndexType.TYPE_GEOMETRY) {
if (geometry.getGeometries() != null && geometry.getGeometries().length > index.getValue()) {
return getGeometryType(geometry.... | java | public String getGeometryType(Geometry geometry, GeometryIndex index) throws GeometryIndexNotFoundException {
if (index != null && index.getType() == GeometryIndexType.TYPE_GEOMETRY) {
if (geometry.getGeometries() != null && geometry.getGeometries().length > index.getValue()) {
return getGeometryType(geometry.... | [
"public",
"String",
"getGeometryType",
"(",
"Geometry",
"geometry",
",",
"GeometryIndex",
"index",
")",
"throws",
"GeometryIndexNotFoundException",
"{",
"if",
"(",
"index",
"!=",
"null",
"&&",
"index",
".",
"getType",
"(",
")",
"==",
"GeometryIndexType",
".",
"T... | What is the geometry type of the sub-geometry pointed to by the given index? If the index points to a vertex or
edge, the geometry type at the parent level is returned.
@param geometry
The geometry wherein to search.
@param index
The index pointing to a vertex/edge/sub-geometry. In the case of a vertex/edge, the paren... | [
"What",
"is",
"the",
"geometry",
"type",
"of",
"the",
"sub",
"-",
"geometry",
"pointed",
"to",
"by",
"the",
"given",
"index?",
"If",
"the",
"index",
"points",
"to",
"a",
"vertex",
"or",
"edge",
"the",
"geometry",
"type",
"at",
"the",
"parent",
"level",
... | 09a214fede69c9c01e41630828c4abbb551a557d | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java#L317-L326 | train |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java | GeometryIndexService.getValue | public int getValue(GeometryIndex index) {
if (index.hasChild()) {
return getValue(index.getChild());
}
return index.getValue();
} | java | public int getValue(GeometryIndex index) {
if (index.hasChild()) {
return getValue(index.getChild());
}
return index.getValue();
} | [
"public",
"int",
"getValue",
"(",
"GeometryIndex",
"index",
")",
"{",
"if",
"(",
"index",
".",
"hasChild",
"(",
")",
")",
"{",
"return",
"getValue",
"(",
"index",
".",
"getChild",
"(",
")",
")",
";",
"}",
"return",
"index",
".",
"getValue",
"(",
")",... | Returns the value of the innermost child index.
@param index
The index to recursively search.
@return The value of the deepest child. | [
"Returns",
"the",
"value",
"of",
"the",
"innermost",
"child",
"index",
"."
] | 09a214fede69c9c01e41630828c4abbb551a557d | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java#L356-L361 | train |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java | GeometryIndexService.getParent | public GeometryIndex getParent(GeometryIndex index) {
GeometryIndex parent = new GeometryIndex(index);
GeometryIndex deepestParent = null;
GeometryIndex p = parent;
while (p.hasChild()) {
deepestParent = p;
p = p.getChild();
}
if (deepestParent != null) {
deepestParent.setChild(null);
}
return ... | java | public GeometryIndex getParent(GeometryIndex index) {
GeometryIndex parent = new GeometryIndex(index);
GeometryIndex deepestParent = null;
GeometryIndex p = parent;
while (p.hasChild()) {
deepestParent = p;
p = p.getChild();
}
if (deepestParent != null) {
deepestParent.setChild(null);
}
return ... | [
"public",
"GeometryIndex",
"getParent",
"(",
"GeometryIndex",
"index",
")",
"{",
"GeometryIndex",
"parent",
"=",
"new",
"GeometryIndex",
"(",
"index",
")",
";",
"GeometryIndex",
"deepestParent",
"=",
"null",
";",
"GeometryIndex",
"p",
"=",
"parent",
";",
"while"... | Returns a new index that is one level higher than this index. Useful to get the index of a ring for a vertex.
@param index
@return the parent index | [
"Returns",
"a",
"new",
"index",
"that",
"is",
"one",
"level",
"higher",
"than",
"this",
"index",
".",
"Useful",
"to",
"get",
"the",
"index",
"of",
"a",
"ring",
"for",
"a",
"vertex",
"."
] | 09a214fede69c9c01e41630828c4abbb551a557d | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java#L369-L381 | train |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java | GeometryIndexService.getNextVertex | public GeometryIndex getNextVertex(GeometryIndex index) {
if (index.hasChild()) {
return new GeometryIndex(index.getType(), index.getValue(), getNextVertex(index.getChild()));
} else {
return new GeometryIndex(GeometryIndexType.TYPE_VERTEX, index.getValue() + 1, null);
}
} | java | public GeometryIndex getNextVertex(GeometryIndex index) {
if (index.hasChild()) {
return new GeometryIndex(index.getType(), index.getValue(), getNextVertex(index.getChild()));
} else {
return new GeometryIndex(GeometryIndexType.TYPE_VERTEX, index.getValue() + 1, null);
}
} | [
"public",
"GeometryIndex",
"getNextVertex",
"(",
"GeometryIndex",
"index",
")",
"{",
"if",
"(",
"index",
".",
"hasChild",
"(",
")",
")",
"{",
"return",
"new",
"GeometryIndex",
"(",
"index",
".",
"getType",
"(",
")",
",",
"index",
".",
"getValue",
"(",
")... | Given a certain index, find the next vertex in line.
@param index
The index to start out from. Must point to either a vertex or and edge.
@return Returns the next vertex index. Note that no geometry is given, and so no actual checking is done. It just
returns the theoretical answer. | [
"Given",
"a",
"certain",
"index",
"find",
"the",
"next",
"vertex",
"in",
"line",
"."
] | 09a214fede69c9c01e41630828c4abbb551a557d | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java#L500-L506 | train |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java | GeometryIndexService.getSiblingVertices | public Coordinate[] getSiblingVertices(Geometry geometry, GeometryIndex index)
throws GeometryIndexNotFoundException {
if (index.hasChild() && geometry.getGeometries() != null &&
geometry.getGeometries().length > index.getValue()) {
return getSiblingVertices(geometry.getGeometries()[index.getValue()], inde... | java | public Coordinate[] getSiblingVertices(Geometry geometry, GeometryIndex index)
throws GeometryIndexNotFoundException {
if (index.hasChild() && geometry.getGeometries() != null &&
geometry.getGeometries().length > index.getValue()) {
return getSiblingVertices(geometry.getGeometries()[index.getValue()], inde... | [
"public",
"Coordinate",
"[",
"]",
"getSiblingVertices",
"(",
"Geometry",
"geometry",
",",
"GeometryIndex",
"index",
")",
"throws",
"GeometryIndexNotFoundException",
"{",
"if",
"(",
"index",
".",
"hasChild",
"(",
")",
"&&",
"geometry",
".",
"getGeometries",
"(",
... | Get the full list of sibling vertices in the form of a coordinate array.
@param geometry
The geometry wherein to search for a certain coordinate array.
@param index
An index pointing to a vertex or edge within the geometry. This index will then naturally be a part of
a coordinate array. It is this array we're looking ... | [
"Get",
"the",
"full",
"list",
"of",
"sibling",
"vertices",
"in",
"the",
"form",
"of",
"a",
"coordinate",
"array",
"."
] | 09a214fede69c9c01e41630828c4abbb551a557d | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/GeometryIndexService.java#L573-L588 | train |
passwordmaker/java-passwordmaker-lib | src/main/java/org/daveware/passwordmaker/LeetLevel.java | LeetLevel.fromString | public static LeetLevel fromString(String str)
throws Exception {
if (str == null || str.equalsIgnoreCase("null") || str.length() == 0)
return LEVEL1;
try {
int i = Integer.parseInt(str);
if (i >= 1 && i <= LEVELS.length)
return LEVELS[i -... | java | public static LeetLevel fromString(String str)
throws Exception {
if (str == null || str.equalsIgnoreCase("null") || str.length() == 0)
return LEVEL1;
try {
int i = Integer.parseInt(str);
if (i >= 1 && i <= LEVELS.length)
return LEVELS[i -... | [
"public",
"static",
"LeetLevel",
"fromString",
"(",
"String",
"str",
")",
"throws",
"Exception",
"{",
"if",
"(",
"str",
"==",
"null",
"||",
"str",
".",
"equalsIgnoreCase",
"(",
"\"null\"",
")",
"||",
"str",
".",
"length",
"(",
")",
"==",
"0",
")",
"ret... | Converts a string to a leet level.
@param str The string to parse the leet level from.
@return The leet level if valid.
@throws Exception upon invalid level. | [
"Converts",
"a",
"string",
"to",
"a",
"leet",
"level",
"."
] | 18c22fca7dd9a47f08161425b85a5bd257afbb2b | https://github.com/passwordmaker/java-passwordmaker-lib/blob/18c22fca7dd9a47f08161425b85a5bd257afbb2b/src/main/java/org/daveware/passwordmaker/LeetLevel.java#L66-L79 | train |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/LocalVariableTypeTable.java | LocalVariableTypeTable.addLocalTypeVariable | public void addLocalTypeVariable(VariableElement ve, String signature, int index)
{
localTypeVariables.add(new LocalTypeVariable(ve, signature, index));
} | java | public void addLocalTypeVariable(VariableElement ve, String signature, int index)
{
localTypeVariables.add(new LocalTypeVariable(ve, signature, index));
} | [
"public",
"void",
"addLocalTypeVariable",
"(",
"VariableElement",
"ve",
",",
"String",
"signature",
",",
"int",
"index",
")",
"{",
"localTypeVariables",
".",
"add",
"(",
"new",
"LocalTypeVariable",
"(",
"ve",
",",
"signature",
",",
"index",
")",
")",
";",
"}... | Adds a entry into LocalTypeVariableTable if variable is of generic type
@param ve
@param index | [
"Adds",
"a",
"entry",
"into",
"LocalTypeVariableTable",
"if",
"variable",
"is",
"of",
"generic",
"type"
] | 4e84e313018d487f1a8cca3952d71bc21e77d16b | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/LocalVariableTypeTable.java#L61-L64 | train |
btaz/data-util | src/main/java/com/btaz/util/files/FileSplitter.java | FileSplitter.writePartToFile | private static File writePartToFile(File splitDir, List<String> data) {
BufferedWriter writer = null;
File splitFile;
try {
splitFile = File.createTempFile("split-", ".part", splitDir);
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(splitFile.getA... | java | private static File writePartToFile(File splitDir, List<String> data) {
BufferedWriter writer = null;
File splitFile;
try {
splitFile = File.createTempFile("split-", ".part", splitDir);
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(splitFile.getA... | [
"private",
"static",
"File",
"writePartToFile",
"(",
"File",
"splitDir",
",",
"List",
"<",
"String",
">",
"data",
")",
"{",
"BufferedWriter",
"writer",
"=",
"null",
";",
"File",
"splitFile",
";",
"try",
"{",
"splitFile",
"=",
"File",
".",
"createTempFile",
... | This method writes a partial input file to a split file
@param splitDir split file directory
@param data data
@return <code>File</code> new split file | [
"This",
"method",
"writes",
"a",
"partial",
"input",
"file",
"to",
"a",
"split",
"file"
] | f01de64854c456a88a31ffbe8bac6d605151b496 | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/files/FileSplitter.java#L124-L153 | train |
btaz/data-util | src/main/java/com/btaz/util/files/FileSplitter.java | FileSplitter.storageCalculation | private static long storageCalculation(int rows, int lineChars, long totalCharacters) {
long size = (long) Math.ceil((rows* ARRAY_LIST_ROW_OVERHEAD + lineChars + totalCharacters) * LIST_CAPACITY_MULTIPLIER);
return size;
} | java | private static long storageCalculation(int rows, int lineChars, long totalCharacters) {
long size = (long) Math.ceil((rows* ARRAY_LIST_ROW_OVERHEAD + lineChars + totalCharacters) * LIST_CAPACITY_MULTIPLIER);
return size;
} | [
"private",
"static",
"long",
"storageCalculation",
"(",
"int",
"rows",
",",
"int",
"lineChars",
",",
"long",
"totalCharacters",
")",
"{",
"long",
"size",
"=",
"(",
"long",
")",
"Math",
".",
"ceil",
"(",
"(",
"rows",
"*",
"ARRAY_LIST_ROW_OVERHEAD",
"+",
"li... | This calculation attempts to calculate how much storage x number of rows may use in an ArrayList assuming that
capacity may be up to 1.5 times the actual space used.
@param rows rows
@param lineChars the amount of new character data we want to add
@param totalCharacters total amount of characters already stored
@return... | [
"This",
"calculation",
"attempts",
"to",
"calculate",
"how",
"much",
"storage",
"x",
"number",
"of",
"rows",
"may",
"use",
"in",
"an",
"ArrayList",
"assuming",
"that",
"capacity",
"may",
"be",
"up",
"to",
"1",
".",
"5",
"times",
"the",
"actual",
"space",
... | f01de64854c456a88a31ffbe8bac6d605151b496 | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/files/FileSplitter.java#L163-L166 | train |
Teddy-Zhu/SilentGo | framework/src/main/java/com/silentgo/servlet/oreilly/multipart/MultipartParser.java | MultipartParser.extractBoundary | private String extractBoundary(String line) {
// Use lastIndexOf() because IE 4.01 on Win98 has been known to send the
// "boundary=" string multiple times. Thanks to David Wall for this fix.
int index = line.lastIndexOf("boundary=");
if (index == -1) {
return null;
}
String boundary = li... | java | private String extractBoundary(String line) {
// Use lastIndexOf() because IE 4.01 on Win98 has been known to send the
// "boundary=" string multiple times. Thanks to David Wall for this fix.
int index = line.lastIndexOf("boundary=");
if (index == -1) {
return null;
}
String boundary = li... | [
"private",
"String",
"extractBoundary",
"(",
"String",
"line",
")",
"{",
"// Use lastIndexOf() because IE 4.01 on Win98 has been known to send the",
"// \"boundary=\" string multiple times. Thanks to David Wall for this fix.",
"int",
"index",
"=",
"line",
".",
"lastIndexOf",
"(",
... | Extracts and returns the boundary token from a line.
@return the boundary token. | [
"Extracts",
"and",
"returns",
"the",
"boundary",
"token",
"from",
"a",
"line",
"."
] | 27f58b0cafe56b2eb9fc6993efa9ca2b529661e1 | https://github.com/Teddy-Zhu/SilentGo/blob/27f58b0cafe56b2eb9fc6993efa9ca2b529661e1/framework/src/main/java/com/silentgo/servlet/oreilly/multipart/MultipartParser.java#L338-L356 | train |
Teddy-Zhu/SilentGo | framework/src/main/java/com/silentgo/servlet/oreilly/multipart/MultipartParser.java | MultipartParser.extractContentType | private static String extractContentType(String line) throws IOException {
// Convert the line to a lowercase string
line = line.toLowerCase();
// Get the content type, if any
// Note that Opera at least puts extra info after the type, so handle
// that. For example: Content-Type: text/plain; nam... | java | private static String extractContentType(String line) throws IOException {
// Convert the line to a lowercase string
line = line.toLowerCase();
// Get the content type, if any
// Note that Opera at least puts extra info after the type, so handle
// that. For example: Content-Type: text/plain; nam... | [
"private",
"static",
"String",
"extractContentType",
"(",
"String",
"line",
")",
"throws",
"IOException",
"{",
"// Convert the line to a lowercase string",
"line",
"=",
"line",
".",
"toLowerCase",
"(",
")",
";",
"// Get the content type, if any",
"// Note that Opera at leas... | Extracts and returns the content type from a line, or null if the
line was empty.
@return content type, or null if line was empty.
@exception IOException if the line is malformatted. | [
"Extracts",
"and",
"returns",
"the",
"content",
"type",
"from",
"a",
"line",
"or",
"null",
"if",
"the",
"line",
"was",
"empty",
"."
] | 27f58b0cafe56b2eb9fc6993efa9ca2b529661e1 | https://github.com/Teddy-Zhu/SilentGo/blob/27f58b0cafe56b2eb9fc6993efa9ca2b529661e1/framework/src/main/java/com/silentgo/servlet/oreilly/multipart/MultipartParser.java#L436-L450 | train |
Teddy-Zhu/SilentGo | framework/src/main/java/com/silentgo/servlet/oreilly/multipart/MultipartParser.java | MultipartParser.readLine | private String readLine() throws IOException {
StringBuffer sbuf = new StringBuffer();
int result;
String line;
do {
result = in.readLine(buf, 0, buf.length); // does +=
if (result != -1) {
sbuf.append(new String(buf, 0, result, encoding));
}
} while (result == buf.length... | java | private String readLine() throws IOException {
StringBuffer sbuf = new StringBuffer();
int result;
String line;
do {
result = in.readLine(buf, 0, buf.length); // does +=
if (result != -1) {
sbuf.append(new String(buf, 0, result, encoding));
}
} while (result == buf.length... | [
"private",
"String",
"readLine",
"(",
")",
"throws",
"IOException",
"{",
"StringBuffer",
"sbuf",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"int",
"result",
";",
"String",
"line",
";",
"do",
"{",
"result",
"=",
"in",
".",
"readLine",
"(",
"buf",
",",
"... | Read the next line of input.
@return a String containing the next line of input from the stream,
or null to indicate the end of the stream.
@exception IOException if an input or output exception has occurred. | [
"Read",
"the",
"next",
"line",
"of",
"input",
"."
] | 27f58b0cafe56b2eb9fc6993efa9ca2b529661e1 | https://github.com/Teddy-Zhu/SilentGo/blob/27f58b0cafe56b2eb9fc6993efa9ca2b529661e1/framework/src/main/java/com/silentgo/servlet/oreilly/multipart/MultipartParser.java#L459-L486 | train |
aehrc/ontology-core | ontology-model/src/main/java/au/csiro/ontology/util/SnomedMetadata.java | SnomedMetadata.getNeverGroupedIds | public Set<String> getNeverGroupedIds() {
String s = props.getProperty("neverGroupedIds");
if(s == null) return Collections.emptySet();
Set<String> res = new HashSet<String>();
String[] parts = s.split("[,]");
for(String part : parts) {
res.add(part);
... | java | public Set<String> getNeverGroupedIds() {
String s = props.getProperty("neverGroupedIds");
if(s == null) return Collections.emptySet();
Set<String> res = new HashSet<String>();
String[] parts = s.split("[,]");
for(String part : parts) {
res.add(part);
... | [
"public",
"Set",
"<",
"String",
">",
"getNeverGroupedIds",
"(",
")",
"{",
"String",
"s",
"=",
"props",
".",
"getProperty",
"(",
"\"neverGroupedIds\"",
")",
";",
"if",
"(",
"s",
"==",
"null",
")",
"return",
"Collections",
".",
"emptySet",
"(",
")",
";",
... | Returns the set of ids of SNOMED roles that should never be placed in a
role group.
@return Set of ids of SNOMED roles that should never be placed in a role
group. | [
"Returns",
"the",
"set",
"of",
"ids",
"of",
"SNOMED",
"roles",
"that",
"should",
"never",
"be",
"placed",
"in",
"a",
"role",
"group",
"."
] | 446aa691119f2bbcb8d184566084b8da7a07a44e | https://github.com/aehrc/ontology-core/blob/446aa691119f2bbcb8d184566084b8da7a07a44e/ontology-model/src/main/java/au/csiro/ontology/util/SnomedMetadata.java#L137-L147 | train |
aehrc/ontology-core | ontology-model/src/main/java/au/csiro/ontology/util/SnomedMetadata.java | SnomedMetadata.getRightIdentityIds | public Map<String, String> getRightIdentityIds() {
String s = props.getProperty("rightIdentityIds");
if(s == null) return Collections.emptyMap();
Map<String, String> res = new HashMap<String, String>();
String[] parts = s.split("[,]");
res.put(parts[0], parts[1]);
... | java | public Map<String, String> getRightIdentityIds() {
String s = props.getProperty("rightIdentityIds");
if(s == null) return Collections.emptyMap();
Map<String, String> res = new HashMap<String, String>();
String[] parts = s.split("[,]");
res.put(parts[0], parts[1]);
... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getRightIdentityIds",
"(",
")",
"{",
"String",
"s",
"=",
"props",
".",
"getProperty",
"(",
"\"rightIdentityIds\"",
")",
";",
"if",
"(",
"s",
"==",
"null",
")",
"return",
"Collections",
".",
"emptyMap",
... | Returns the right identity axioms that cannot be represented in RF1 or
RF2 formats. An example is direct-substance o has-active-ingredient [
direct-substance. The key of the returned map is the first element in the
LHS and the value is the second element in the LHS. The RHS, because it
is a right identity axiom, is alw... | [
"Returns",
"the",
"right",
"identity",
"axioms",
"that",
"cannot",
"be",
"represented",
"in",
"RF1",
"or",
"RF2",
"formats",
".",
"An",
"example",
"is",
"direct",
"-",
"substance",
"o",
"has",
"-",
"active",
"-",
"ingredient",
"[",
"direct",
"-",
"substanc... | 446aa691119f2bbcb8d184566084b8da7a07a44e | https://github.com/aehrc/ontology-core/blob/446aa691119f2bbcb8d184566084b8da7a07a44e/ontology-model/src/main/java/au/csiro/ontology/util/SnomedMetadata.java#L168-L176 | train |
eyp/serfj | src/main/java/net/sf/serfj/serializers/Base64Serializer.java | Base64Serializer.serialize | public String serialize(Object object) {
ObjectOutputStream oos = null;
ByteArrayOutputStream bos = null;
try {
bos = new ByteArrayOutputStream();
oos = new ObjectOutputStream(bos);
oos.writeObject(object);
return new String(Base64.encodeBase64(bos.toByteArray()));
} catch (IOException e) {
LOGGE... | java | public String serialize(Object object) {
ObjectOutputStream oos = null;
ByteArrayOutputStream bos = null;
try {
bos = new ByteArrayOutputStream();
oos = new ObjectOutputStream(bos);
oos.writeObject(object);
return new String(Base64.encodeBase64(bos.toByteArray()));
} catch (IOException e) {
LOGGE... | [
"public",
"String",
"serialize",
"(",
"Object",
"object",
")",
"{",
"ObjectOutputStream",
"oos",
"=",
"null",
";",
"ByteArrayOutputStream",
"bos",
"=",
"null",
";",
"try",
"{",
"bos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"oos",
"=",
"new",
"... | Serialize object to an encoded base64 string. | [
"Serialize",
"object",
"to",
"an",
"encoded",
"base64",
"string",
"."
] | e617592af6f24e59ea58443f2785c44aa2312189 | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/serializers/Base64Serializer.java#L40-L63 | train |
eyp/serfj | src/main/java/net/sf/serfj/serializers/Base64Serializer.java | Base64Serializer.deserialize | public Object deserialize(String data) {
if ((data == null) || (data.length() == 0)) {
return null;
}
ObjectInputStream ois = null;
ByteArrayInputStream bis = null;
try {
bis = new ByteArrayInputStream(Base64.decodeBase64(data.getBytes()));
ois = new ObjectInputStream(bis);
return ois.readObject()... | java | public Object deserialize(String data) {
if ((data == null) || (data.length() == 0)) {
return null;
}
ObjectInputStream ois = null;
ByteArrayInputStream bis = null;
try {
bis = new ByteArrayInputStream(Base64.decodeBase64(data.getBytes()));
ois = new ObjectInputStream(bis);
return ois.readObject()... | [
"public",
"Object",
"deserialize",
"(",
"String",
"data",
")",
"{",
"if",
"(",
"(",
"data",
"==",
"null",
")",
"||",
"(",
"data",
".",
"length",
"(",
")",
"==",
"0",
")",
")",
"{",
"return",
"null",
";",
"}",
"ObjectInputStream",
"ois",
"=",
"null"... | Deserialze base 64 encoded string data to Object. | [
"Deserialze",
"base",
"64",
"encoded",
"string",
"data",
"to",
"Object",
"."
] | e617592af6f24e59ea58443f2785c44aa2312189 | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/serializers/Base64Serializer.java#L68-L96 | train |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/ClassFile.java | ClassFile.getMethodIndex | int getMethodIndex(ExecutableElement method)
{
TypeElement declaringClass = (TypeElement) method.getEnclosingElement();
String fullyQualifiedname = declaringClass.getQualifiedName().toString();
return getRefIndex(Methodref.class, fullyQualifiedname, method.getSimpleName().toString(), Descrip... | java | int getMethodIndex(ExecutableElement method)
{
TypeElement declaringClass = (TypeElement) method.getEnclosingElement();
String fullyQualifiedname = declaringClass.getQualifiedName().toString();
return getRefIndex(Methodref.class, fullyQualifiedname, method.getSimpleName().toString(), Descrip... | [
"int",
"getMethodIndex",
"(",
"ExecutableElement",
"method",
")",
"{",
"TypeElement",
"declaringClass",
"=",
"(",
"TypeElement",
")",
"method",
".",
"getEnclosingElement",
"(",
")",
";",
"String",
"fullyQualifiedname",
"=",
"declaringClass",
".",
"getQualifiedName",
... | Returns the constant map index to method
@param method
@return | [
"Returns",
"the",
"constant",
"map",
"index",
"to",
"method"
] | 4e84e313018d487f1a8cca3952d71bc21e77d16b | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/ClassFile.java#L234-L239 | train |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/ClassFile.java | ClassFile.getRefIndex | protected int getRefIndex(Class<? extends Ref> refType, String fullyQualifiedname, String name, String descriptor)
{
String internalForm = fullyQualifiedname.replace('.', '/');
for (ConstantInfo ci : listConstantInfo(refType))
{
Ref mr = (Ref) ci;
int classIndex = mr.... | java | protected int getRefIndex(Class<? extends Ref> refType, String fullyQualifiedname, String name, String descriptor)
{
String internalForm = fullyQualifiedname.replace('.', '/');
for (ConstantInfo ci : listConstantInfo(refType))
{
Ref mr = (Ref) ci;
int classIndex = mr.... | [
"protected",
"int",
"getRefIndex",
"(",
"Class",
"<",
"?",
"extends",
"Ref",
">",
"refType",
",",
"String",
"fullyQualifiedname",
",",
"String",
"name",
",",
"String",
"descriptor",
")",
"{",
"String",
"internalForm",
"=",
"fullyQualifiedname",
".",
"replace",
... | Returns the constant map index to reference
@param refType
@param fullyQualifiedname
@param name
@param descriptor
@return | [
"Returns",
"the",
"constant",
"map",
"index",
"to",
"reference"
] | 4e84e313018d487f1a8cca3952d71bc21e77d16b | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/ClassFile.java#L248-L275 | train |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/ClassFile.java | ClassFile.getNameIndex | public int getNameIndex(CharSequence name)
{
for (ConstantInfo ci : listConstantInfo(Utf8.class))
{
Utf8 utf8 = (Utf8) ci;
String str = utf8.getString();
if (str.contentEquals(name))
{
return constantPoolIndexMap.get(ci);
}
... | java | public int getNameIndex(CharSequence name)
{
for (ConstantInfo ci : listConstantInfo(Utf8.class))
{
Utf8 utf8 = (Utf8) ci;
String str = utf8.getString();
if (str.contentEquals(name))
{
return constantPoolIndexMap.get(ci);
}
... | [
"public",
"int",
"getNameIndex",
"(",
"CharSequence",
"name",
")",
"{",
"for",
"(",
"ConstantInfo",
"ci",
":",
"listConstantInfo",
"(",
"Utf8",
".",
"class",
")",
")",
"{",
"Utf8",
"utf8",
"=",
"(",
"Utf8",
")",
"ci",
";",
"String",
"str",
"=",
"utf8",... | Returns the constant map index to name
@param name
@return | [
"Returns",
"the",
"constant",
"map",
"index",
"to",
"name"
] | 4e84e313018d487f1a8cca3952d71bc21e77d16b | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/ClassFile.java#L281-L293 | train |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/ClassFile.java | ClassFile.getNameAndTypeIndex | public int getNameAndTypeIndex(String name, String descriptor)
{
for (ConstantInfo ci : listConstantInfo(NameAndType.class))
{
NameAndType nat = (NameAndType) ci;
int nameIndex = nat.getName_index();
String str = getString(nameIndex);
if (name.equals(s... | java | public int getNameAndTypeIndex(String name, String descriptor)
{
for (ConstantInfo ci : listConstantInfo(NameAndType.class))
{
NameAndType nat = (NameAndType) ci;
int nameIndex = nat.getName_index();
String str = getString(nameIndex);
if (name.equals(s... | [
"public",
"int",
"getNameAndTypeIndex",
"(",
"String",
"name",
",",
"String",
"descriptor",
")",
"{",
"for",
"(",
"ConstantInfo",
"ci",
":",
"listConstantInfo",
"(",
"NameAndType",
".",
"class",
")",
")",
"{",
"NameAndType",
"nat",
"=",
"(",
"NameAndType",
"... | Returns the constant map index to name and type
@param name
@param descriptor
@return | [
"Returns",
"the",
"constant",
"map",
"index",
"to",
"name",
"and",
"type"
] | 4e84e313018d487f1a8cca3952d71bc21e77d16b | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/ClassFile.java#L300-L318 | train |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/ClassFile.java | ClassFile.getConstantIndex | public final int getConstantIndex(int constant)
{
for (ConstantInfo ci : listConstantInfo(ConstantInteger.class))
{
ConstantInteger ic = (ConstantInteger) ci;
if (constant == ic.getConstant())
{
return constantPoolIndexMap.get(ci);
}
... | java | public final int getConstantIndex(int constant)
{
for (ConstantInfo ci : listConstantInfo(ConstantInteger.class))
{
ConstantInteger ic = (ConstantInteger) ci;
if (constant == ic.getConstant())
{
return constantPoolIndexMap.get(ci);
}
... | [
"public",
"final",
"int",
"getConstantIndex",
"(",
"int",
"constant",
")",
"{",
"for",
"(",
"ConstantInfo",
"ci",
":",
"listConstantInfo",
"(",
"ConstantInteger",
".",
"class",
")",
")",
"{",
"ConstantInteger",
"ic",
"=",
"(",
"ConstantInteger",
")",
"ci",
"... | Returns the constant map index to integer constant
@param constant
@return | [
"Returns",
"the",
"constant",
"map",
"index",
"to",
"integer",
"constant"
] | 4e84e313018d487f1a8cca3952d71bc21e77d16b | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/ClassFile.java#L324-L335 | train |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/ClassFile.java | ClassFile.getIndexedType | Object getIndexedType(int index)
{
Object ae = indexedElementMap.get(index);
if (ae == null)
{
throw new VerifyError("constant pool at "+index+" not proper type");
}
return ae;
} | java | Object getIndexedType(int index)
{
Object ae = indexedElementMap.get(index);
if (ae == null)
{
throw new VerifyError("constant pool at "+index+" not proper type");
}
return ae;
} | [
"Object",
"getIndexedType",
"(",
"int",
"index",
")",
"{",
"Object",
"ae",
"=",
"indexedElementMap",
".",
"get",
"(",
"index",
")",
";",
"if",
"(",
"ae",
"==",
"null",
")",
"{",
"throw",
"new",
"VerifyError",
"(",
"\"constant pool at \"",
"+",
"index",
"... | Returns a element from constant map
@param index
@return | [
"Returns",
"a",
"element",
"from",
"constant",
"map"
] | 4e84e313018d487f1a8cca3952d71bc21e77d16b | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/ClassFile.java#L534-L542 | train |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/ClassFile.java | ClassFile.getFieldDescription | public String getFieldDescription(int index)
{
ConstantInfo constantInfo = getConstantInfo(index);
if (constantInfo instanceof Fieldref)
{
Fieldref fr = (Fieldref) getConstantInfo(index);
int nt = fr.getName_and_type_index();
NameAndType nat = (NameAndType... | java | public String getFieldDescription(int index)
{
ConstantInfo constantInfo = getConstantInfo(index);
if (constantInfo instanceof Fieldref)
{
Fieldref fr = (Fieldref) getConstantInfo(index);
int nt = fr.getName_and_type_index();
NameAndType nat = (NameAndType... | [
"public",
"String",
"getFieldDescription",
"(",
"int",
"index",
")",
"{",
"ConstantInfo",
"constantInfo",
"=",
"getConstantInfo",
"(",
"index",
")",
";",
"if",
"(",
"constantInfo",
"instanceof",
"Fieldref",
")",
"{",
"Fieldref",
"fr",
"=",
"(",
"Fieldref",
")"... | Returns a descriptor to fields at index.
@param index
@return | [
"Returns",
"a",
"descriptor",
"to",
"fields",
"at",
"index",
"."
] | 4e84e313018d487f1a8cca3952d71bc21e77d16b | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/ClassFile.java#L548-L561 | train |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/ClassFile.java | ClassFile.getMethodDescription | public String getMethodDescription(int index)
{
ConstantInfo constantInfo = getConstantInfo(index);
if (constantInfo instanceof Methodref)
{
Methodref mr = (Methodref) getConstantInfo(index);
int nt = mr.getName_and_type_index();
NameAndType nat = (NameAnd... | java | public String getMethodDescription(int index)
{
ConstantInfo constantInfo = getConstantInfo(index);
if (constantInfo instanceof Methodref)
{
Methodref mr = (Methodref) getConstantInfo(index);
int nt = mr.getName_and_type_index();
NameAndType nat = (NameAnd... | [
"public",
"String",
"getMethodDescription",
"(",
"int",
"index",
")",
"{",
"ConstantInfo",
"constantInfo",
"=",
"getConstantInfo",
"(",
"index",
")",
";",
"if",
"(",
"constantInfo",
"instanceof",
"Methodref",
")",
"{",
"Methodref",
"mr",
"=",
"(",
"Methodref",
... | Returns a descriptor to method at index.
@param index
@return | [
"Returns",
"a",
"descriptor",
"to",
"method",
"at",
"index",
"."
] | 4e84e313018d487f1a8cca3952d71bc21e77d16b | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/ClassFile.java#L567-L589 | train |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/ClassFile.java | ClassFile.getClassDescription | public String getClassDescription(int index)
{
Clazz cz = (Clazz) getConstantInfo(index);
int ni = cz.getName_index();
return getString(ni);
} | java | public String getClassDescription(int index)
{
Clazz cz = (Clazz) getConstantInfo(index);
int ni = cz.getName_index();
return getString(ni);
} | [
"public",
"String",
"getClassDescription",
"(",
"int",
"index",
")",
"{",
"Clazz",
"cz",
"=",
"(",
"Clazz",
")",
"getConstantInfo",
"(",
"index",
")",
";",
"int",
"ni",
"=",
"cz",
".",
"getName_index",
"(",
")",
";",
"return",
"getString",
"(",
"ni",
"... | Returns a descriptor to class at index.
@param index
@return | [
"Returns",
"a",
"descriptor",
"to",
"class",
"at",
"index",
"."
] | 4e84e313018d487f1a8cca3952d71bc21e77d16b | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/ClassFile.java#L595-L600 | train |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/ClassFile.java | ClassFile.referencesMethod | public boolean referencesMethod(ExecutableElement method)
{
TypeElement declaringClass = (TypeElement) method.getEnclosingElement();
String fullyQualifiedname = declaringClass.getQualifiedName().toString();
String name = method.getSimpleName().toString();
assert name.indexOf('.') == ... | java | public boolean referencesMethod(ExecutableElement method)
{
TypeElement declaringClass = (TypeElement) method.getEnclosingElement();
String fullyQualifiedname = declaringClass.getQualifiedName().toString();
String name = method.getSimpleName().toString();
assert name.indexOf('.') == ... | [
"public",
"boolean",
"referencesMethod",
"(",
"ExecutableElement",
"method",
")",
"{",
"TypeElement",
"declaringClass",
"=",
"(",
"TypeElement",
")",
"method",
".",
"getEnclosingElement",
"(",
")",
";",
"String",
"fullyQualifiedname",
"=",
"declaringClass",
".",
"ge... | Return true if class contains method ref to given method
@param method
@return | [
"Return",
"true",
"if",
"class",
"contains",
"method",
"ref",
"to",
"given",
"method"
] | 4e84e313018d487f1a8cca3952d71bc21e77d16b | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/ClassFile.java#L636-L644 | train |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/ClassFile.java | ClassFile.getString | public final String getString(int index)
{
Utf8 utf8 = (Utf8) getConstantInfo(index);
return utf8.getString();
} | java | public final String getString(int index)
{
Utf8 utf8 = (Utf8) getConstantInfo(index);
return utf8.getString();
} | [
"public",
"final",
"String",
"getString",
"(",
"int",
"index",
")",
"{",
"Utf8",
"utf8",
"=",
"(",
"Utf8",
")",
"getConstantInfo",
"(",
"index",
")",
";",
"return",
"utf8",
".",
"getString",
"(",
")",
";",
"}"
] | Return a constant string at index.
@param index
@return | [
"Return",
"a",
"constant",
"string",
"at",
"index",
"."
] | 4e84e313018d487f1a8cca3952d71bc21e77d16b | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/ClassFile.java#L687-L691 | train |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/model/El.java | El.getMethod | public static ExecutableElement getMethod(TypeElement typeElement, String name, TypeMirror... parameters)
{
List<ExecutableElement> allMethods = getAllMethods(typeElement, name, parameters);
if (allMethods.isEmpty())
{
return null;
}
else
{
Col... | java | public static ExecutableElement getMethod(TypeElement typeElement, String name, TypeMirror... parameters)
{
List<ExecutableElement> allMethods = getAllMethods(typeElement, name, parameters);
if (allMethods.isEmpty())
{
return null;
}
else
{
Col... | [
"public",
"static",
"ExecutableElement",
"getMethod",
"(",
"TypeElement",
"typeElement",
",",
"String",
"name",
",",
"TypeMirror",
"...",
"parameters",
")",
"{",
"List",
"<",
"ExecutableElement",
">",
"allMethods",
"=",
"getAllMethods",
"(",
"typeElement",
",",
"n... | Returns the most specific named method in typeElement,
or null if such method was not found
@param typeElement Class
@param name Method name
@param parameters Method parameters
@return | [
"Returns",
"the",
"most",
"specific",
"named",
"method",
"in",
"typeElement",
"or",
"null",
"if",
"such",
"method",
"was",
"not",
"found"
] | 4e84e313018d487f1a8cca3952d71bc21e77d16b | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/model/El.java#L286-L298 | train |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/model/El.java | El.getEffectiveMethods | public static List<? extends ExecutableElement> getEffectiveMethods(TypeElement cls)
{
List<ExecutableElement> list = new ArrayList<>();
while (cls != null)
{
for (ExecutableElement method : ElementFilter.methodsIn(cls.getEnclosedElements()))
{
if (!ov... | java | public static List<? extends ExecutableElement> getEffectiveMethods(TypeElement cls)
{
List<ExecutableElement> list = new ArrayList<>();
while (cls != null)
{
for (ExecutableElement method : ElementFilter.methodsIn(cls.getEnclosedElements()))
{
if (!ov... | [
"public",
"static",
"List",
"<",
"?",
"extends",
"ExecutableElement",
">",
"getEffectiveMethods",
"(",
"TypeElement",
"cls",
")",
"{",
"List",
"<",
"ExecutableElement",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"while",
"(",
"cls",
"!=",
"... | Return effective methods for a class. All methods accessible at class
are returned. That includes superclass methods which are not override.
@param cls
@return | [
"Return",
"effective",
"methods",
"for",
"a",
"class",
".",
"All",
"methods",
"accessible",
"at",
"class",
"are",
"returned",
".",
"That",
"includes",
"superclass",
"methods",
"which",
"are",
"not",
"override",
"."
] | 4e84e313018d487f1a8cca3952d71bc21e77d16b | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/model/El.java#L461-L476 | train |
btaz/data-util | src/main/java/com/btaz/util/collections/Lists.java | Lists.createList | public static <T> List<T> createList(T... args) {
ArrayList<T> newList = new ArrayList<T>();
Collections.addAll(newList, args);
return newList;
} | java | public static <T> List<T> createList(T... args) {
ArrayList<T> newList = new ArrayList<T>();
Collections.addAll(newList, args);
return newList;
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"createList",
"(",
"T",
"...",
"args",
")",
"{",
"ArrayList",
"<",
"T",
">",
"newList",
"=",
"new",
"ArrayList",
"<",
"T",
">",
"(",
")",
";",
"Collections",
".",
"addAll",
"(",
"newList",
... | Convenience method for building a list from vararg arguments
@param args argument list
@param <T> list type
@return a new list created from var args | [
"Convenience",
"method",
"for",
"building",
"a",
"list",
"from",
"vararg",
"arguments"
] | f01de64854c456a88a31ffbe8bac6d605151b496 | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/collections/Lists.java#L15-L19 | train |
btaz/data-util | src/main/java/com/btaz/util/collections/Lists.java | Lists.arrayToList | public static <T> List<T> arrayToList(T [] array) {
return new ArrayList<T>(Arrays.asList(array));
} | java | public static <T> List<T> arrayToList(T [] array) {
return new ArrayList<T>(Arrays.asList(array));
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"arrayToList",
"(",
"T",
"[",
"]",
"array",
")",
"{",
"return",
"new",
"ArrayList",
"<",
"T",
">",
"(",
"Arrays",
".",
"asList",
"(",
"array",
")",
")",
";",
"}"
] | Convenience method for building a list from an array
@param array
@param <T> list type
@return a new list created from var args | [
"Convenience",
"method",
"for",
"building",
"a",
"list",
"from",
"an",
"array"
] | f01de64854c456a88a31ffbe8bac6d605151b496 | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/collections/Lists.java#L27-L29 | train |
btaz/data-util | src/main/java/com/btaz/util/collections/Lists.java | Lists.subList | public static <T> List<T> subList(List<T> list, Criteria<T> criteria) {
ArrayList<T> subList = new ArrayList<T>();
for(T item : list) {
if(criteria.meetsCriteria(item)) {
subList.add(item);
}
}
return subList;
} | java | public static <T> List<T> subList(List<T> list, Criteria<T> criteria) {
ArrayList<T> subList = new ArrayList<T>();
for(T item : list) {
if(criteria.meetsCriteria(item)) {
subList.add(item);
}
}
return subList;
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"subList",
"(",
"List",
"<",
"T",
">",
"list",
",",
"Criteria",
"<",
"T",
">",
"criteria",
")",
"{",
"ArrayList",
"<",
"T",
">",
"subList",
"=",
"new",
"ArrayList",
"<",
"T",
">",
"(",
"... | Extract a sub list from another list
@param list original list
@param criteria criteria used to determine whether or not to extract item
@param <T> list type
@return {@code List} of sub list items | [
"Extract",
"a",
"sub",
"list",
"from",
"another",
"list"
] | f01de64854c456a88a31ffbe8bac6d605151b496 | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/collections/Lists.java#L38-L46 | train |
AdeptInternet/auth-java | saml/src/main/java/org/adeptnet/auth/saml/SAMLClient.java | SAMLClient.generateAuthnRequest | public String generateAuthnRequest(final String requestId) throws SAMLException {
final String request = _createAuthnRequest(requestId);
try {
final byte[] compressed = deflate(request.getBytes("UTF-8"));
return DatatypeConverter.printBase64Binary(compressed);
} ... | java | public String generateAuthnRequest(final String requestId) throws SAMLException {
final String request = _createAuthnRequest(requestId);
try {
final byte[] compressed = deflate(request.getBytes("UTF-8"));
return DatatypeConverter.printBase64Binary(compressed);
} ... | [
"public",
"String",
"generateAuthnRequest",
"(",
"final",
"String",
"requestId",
")",
"throws",
"SAMLException",
"{",
"final",
"String",
"request",
"=",
"_createAuthnRequest",
"(",
"requestId",
")",
";",
"try",
"{",
"final",
"byte",
"[",
"]",
"compressed",
"=",
... | Create a new AuthnRequest suitable for sending to an HTTPRedirect binding
endpoint on the IdP. The SPConfig will be used to fill in the ACS and
issuer, and the IdP will be used to set the destination.
@param requestId random generated RequestId
@return a deflated, base64-encoded AuthnRequest
@throws org.adeptnet.auth.... | [
"Create",
"a",
"new",
"AuthnRequest",
"suitable",
"for",
"sending",
"to",
"an",
"HTTPRedirect",
"binding",
"endpoint",
"on",
"the",
"IdP",
".",
"The",
"SPConfig",
"will",
"be",
"used",
"to",
"fill",
"in",
"the",
"ACS",
"and",
"issuer",
"and",
"the",
"IdP",... | 644116ed1f50bf899b9cecc5e3682bac7abf7007 | https://github.com/AdeptInternet/auth-java/blob/644116ed1f50bf899b9cecc5e3682bac7abf7007/saml/src/main/java/org/adeptnet/auth/saml/SAMLClient.java#L452-L463 | train |
AdeptInternet/auth-java | saml/src/main/java/org/adeptnet/auth/saml/SAMLClient.java | SAMLClient.validateResponsePOST | public AttributeSet validateResponsePOST(final String _authnResponse) throws SAMLException {
final byte[] decoded = DatatypeConverter.parseBase64Binary(_authnResponse);
final String authnResponse;
try {
authnResponse = new String(decoded, "UTF-8");
if (LOG.isTraceEnabled(... | java | public AttributeSet validateResponsePOST(final String _authnResponse) throws SAMLException {
final byte[] decoded = DatatypeConverter.parseBase64Binary(_authnResponse);
final String authnResponse;
try {
authnResponse = new String(decoded, "UTF-8");
if (LOG.isTraceEnabled(... | [
"public",
"AttributeSet",
"validateResponsePOST",
"(",
"final",
"String",
"_authnResponse",
")",
"throws",
"SAMLException",
"{",
"final",
"byte",
"[",
"]",
"decoded",
"=",
"DatatypeConverter",
".",
"parseBase64Binary",
"(",
"_authnResponse",
")",
";",
"final",
"Stri... | Check an authnResponse and return the subject if validation succeeds. The
NameID from the subject in the first valid assertion is returned along
with the attributes.
@param _authnResponse a base64-encoded AuthnResponse from the SP
@throws SAMLException if validation failed.
@return the authenticated subject/attributes... | [
"Check",
"an",
"authnResponse",
"and",
"return",
"the",
"subject",
"if",
"validation",
"succeeds",
".",
"The",
"NameID",
"from",
"the",
"subject",
"in",
"the",
"first",
"valid",
"assertion",
"is",
"returned",
"along",
"with",
"the",
"attributes",
"."
] | 644116ed1f50bf899b9cecc5e3682bac7abf7007 | https://github.com/AdeptInternet/auth-java/blob/644116ed1f50bf899b9cecc5e3682bac7abf7007/saml/src/main/java/org/adeptnet/auth/saml/SAMLClient.java#L520-L541 | train |
btaz/data-util | src/main/java/com/btaz/util/xml/model/querypath/PathQueryParser.java | PathQueryParser.treeWalker | private void treeWalker(Node node, int level, List<PathQueryMatcher> queryMatchers, List<Node> collector) {
MatchType matchType = queryMatchers.get(level).match(level, node);
if(matchType == MatchType.NOT_A_MATCH) {
// no reason to scan deeper
//noinspection UnnecessaryReturnStat... | java | private void treeWalker(Node node, int level, List<PathQueryMatcher> queryMatchers, List<Node> collector) {
MatchType matchType = queryMatchers.get(level).match(level, node);
if(matchType == MatchType.NOT_A_MATCH) {
// no reason to scan deeper
//noinspection UnnecessaryReturnStat... | [
"private",
"void",
"treeWalker",
"(",
"Node",
"node",
",",
"int",
"level",
",",
"List",
"<",
"PathQueryMatcher",
">",
"queryMatchers",
",",
"List",
"<",
"Node",
">",
"collector",
")",
"{",
"MatchType",
"matchType",
"=",
"queryMatchers",
".",
"get",
"(",
"l... | Recursive BFS tree walker
@param node current node | [
"Recursive",
"BFS",
"tree",
"walker"
] | f01de64854c456a88a31ffbe8bac6d605151b496 | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/xml/model/querypath/PathQueryParser.java#L135-L157 | train |
eyp/serfj | src/main/java/net/sf/serfj/util/UrlUtils.java | UrlUtils.capitalize | public String capitalize(String string) {
if (string == null || string.length() < 1) {
return "";
}
return string.substring(0, 1).toUpperCase() + string.substring(1);
} | java | public String capitalize(String string) {
if (string == null || string.length() < 1) {
return "";
}
return string.substring(0, 1).toUpperCase() + string.substring(1);
} | [
"public",
"String",
"capitalize",
"(",
"String",
"string",
")",
"{",
"if",
"(",
"string",
"==",
"null",
"||",
"string",
".",
"length",
"(",
")",
"<",
"1",
")",
"{",
"return",
"\"\"",
";",
"}",
"return",
"string",
".",
"substring",
"(",
"0",
",",
"1... | Changes the first character to uppercase.
@param string
String.
@return Same string with first character in uppercase. | [
"Changes",
"the",
"first",
"character",
"to",
"uppercase",
"."
] | e617592af6f24e59ea58443f2785c44aa2312189 | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/util/UrlUtils.java#L118-L123 | train |
eyp/serfj | src/main/java/net/sf/serfj/util/UrlUtils.java | UrlUtils.singularize | public String singularize(String noun) {
String singular = noun;
if (singulars.get(noun) != null) {
singular = singulars.get(noun);
} else if (noun.matches(".*is$")) {
// Singular of *is => *es
singular = noun.substring(0, noun.length() - 2) + "es";
} else if (noun.matches(".*ies$")) {
// Singular o... | java | public String singularize(String noun) {
String singular = noun;
if (singulars.get(noun) != null) {
singular = singulars.get(noun);
} else if (noun.matches(".*is$")) {
// Singular of *is => *es
singular = noun.substring(0, noun.length() - 2) + "es";
} else if (noun.matches(".*ies$")) {
// Singular o... | [
"public",
"String",
"singularize",
"(",
"String",
"noun",
")",
"{",
"String",
"singular",
"=",
"noun",
";",
"if",
"(",
"singulars",
".",
"get",
"(",
"noun",
")",
"!=",
"null",
")",
"{",
"singular",
"=",
"singulars",
".",
"get",
"(",
"noun",
")",
";",... | Gets the singular of a plural.
@param noun
Name.
@return if the name was at singular, it does anything. If the name was a
plural, returns its singular. | [
"Gets",
"the",
"singular",
"of",
"a",
"plural",
"."
] | e617592af6f24e59ea58443f2785c44aa2312189 | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/util/UrlUtils.java#L143-L169 | train |
eyp/serfj | src/main/java/net/sf/serfj/util/UrlUtils.java | UrlUtils.getExtension | public String getExtension(String url) {
int dotIndex = url.lastIndexOf('.');
String extension = null;
if (dotIndex > 0) {
extension = url.substring(dotIndex + 1);
}
return extension;
} | java | public String getExtension(String url) {
int dotIndex = url.lastIndexOf('.');
String extension = null;
if (dotIndex > 0) {
extension = url.substring(dotIndex + 1);
}
return extension;
} | [
"public",
"String",
"getExtension",
"(",
"String",
"url",
")",
"{",
"int",
"dotIndex",
"=",
"url",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"String",
"extension",
"=",
"null",
";",
"if",
"(",
"dotIndex",
">",
"0",
")",
"{",
"extension",
"=",
"url... | Gets the extension used in the URL, if any.
@param url
An URl without query string params..
@return an extension, or null if there isn't any. | [
"Gets",
"the",
"extension",
"used",
"in",
"the",
"URL",
"if",
"any",
"."
] | e617592af6f24e59ea58443f2785c44aa2312189 | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/util/UrlUtils.java#L178-L185 | train |
btaz/data-util | src/main/java/com/btaz/util/writer/HtmlTableWriter.java | HtmlTableWriter.write | public void write(String... columns) throws DataUtilException {
if(columns.length != tableColumns) {
throw new DataUtilException("Invalid column count. Expected " + tableColumns + " but found: "
+ columns.length);
}
try {
if(currentRow == 0) {
... | java | public void write(String... columns) throws DataUtilException {
if(columns.length != tableColumns) {
throw new DataUtilException("Invalid column count. Expected " + tableColumns + " but found: "
+ columns.length);
}
try {
if(currentRow == 0) {
... | [
"public",
"void",
"write",
"(",
"String",
"...",
"columns",
")",
"throws",
"DataUtilException",
"{",
"if",
"(",
"columns",
".",
"length",
"!=",
"tableColumns",
")",
"{",
"throw",
"new",
"DataUtilException",
"(",
"\"Invalid column count. Expected \"",
"+",
"tableCo... | Write a row to the table. The first row will be the header row
@param columns columns
@throws DataUtilException exception | [
"Write",
"a",
"row",
"to",
"the",
"table",
".",
"The",
"first",
"row",
"will",
"be",
"the",
"header",
"row"
] | f01de64854c456a88a31ffbe8bac6d605151b496 | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/writer/HtmlTableWriter.java#L96-L121 | train |
btaz/data-util | src/main/java/com/btaz/util/writer/HtmlTableWriter.java | HtmlTableWriter.writeRow | private void writeRow(String... columns) throws IOException {
StringBuilder html = new StringBuilder();
html.append("<tr>");
for(String data : columns) {
html.append("<td>").append(data).append("</td>");
}
html.append("</tr>\n");
writer.write(html.toString());... | java | private void writeRow(String... columns) throws IOException {
StringBuilder html = new StringBuilder();
html.append("<tr>");
for(String data : columns) {
html.append("<td>").append(data).append("</td>");
}
html.append("</tr>\n");
writer.write(html.toString());... | [
"private",
"void",
"writeRow",
"(",
"String",
"...",
"columns",
")",
"throws",
"IOException",
"{",
"StringBuilder",
"html",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"html",
".",
"append",
"(",
"\"<tr>\"",
")",
";",
"for",
"(",
"String",
"data",
":",
"... | Write data to file
@param columns column data
@throws IOException exception | [
"Write",
"data",
"to",
"file"
] | f01de64854c456a88a31ffbe8bac6d605151b496 | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/writer/HtmlTableWriter.java#L128-L136 | train |
btaz/data-util | src/main/java/com/btaz/util/writer/HtmlTableWriter.java | HtmlTableWriter.writeTop | private void writeTop() throws IOException {
// setup output HTML file
File outputFile = new File(outputDirectory, createFilename(currentPageNumber));
writer = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(outputFile, false), Charset.forName(encoding)));
... | java | private void writeTop() throws IOException {
// setup output HTML file
File outputFile = new File(outputDirectory, createFilename(currentPageNumber));
writer = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(outputFile, false), Charset.forName(encoding)));
... | [
"private",
"void",
"writeTop",
"(",
")",
"throws",
"IOException",
"{",
"// setup output HTML file",
"File",
"outputFile",
"=",
"new",
"File",
"(",
"outputDirectory",
",",
"createFilename",
"(",
"currentPageNumber",
")",
")",
";",
"writer",
"=",
"new",
"BufferedWri... | Write the top part of the HTML document
@throws IOException exception | [
"Write",
"the",
"top",
"part",
"of",
"the",
"HTML",
"document"
] | f01de64854c456a88a31ffbe8bac6d605151b496 | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/writer/HtmlTableWriter.java#L142-L165 | train |
btaz/data-util | src/main/java/com/btaz/util/writer/HtmlTableWriter.java | HtmlTableWriter.writeBottom | private void writeBottom(boolean hasNext) throws IOException {
String template = Template.readResourceAsStream("com/btaz/util/templates/html-table-footer.ftl");
Map<String,Object> map = new HashMap<String,Object>();
String prev = " ";
String next = "";
if(currentPageNumber > 1) {... | java | private void writeBottom(boolean hasNext) throws IOException {
String template = Template.readResourceAsStream("com/btaz/util/templates/html-table-footer.ftl");
Map<String,Object> map = new HashMap<String,Object>();
String prev = " ";
String next = "";
if(currentPageNumber > 1) {... | [
"private",
"void",
"writeBottom",
"(",
"boolean",
"hasNext",
")",
"throws",
"IOException",
"{",
"String",
"template",
"=",
"Template",
".",
"readResourceAsStream",
"(",
"\"com/btaz/util/templates/html-table-footer.ftl\"",
")",
";",
"Map",
"<",
"String",
",",
"Object",... | Write bottom part of the HTML page
@param hasNext has next, true if there's supposed to be another page following this one | [
"Write",
"bottom",
"part",
"of",
"the",
"HTML",
"page"
] | f01de64854c456a88a31ffbe8bac6d605151b496 | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/writer/HtmlTableWriter.java#L171-L188 | train |
btaz/data-util | src/main/java/com/btaz/util/writer/HtmlTableWriter.java | HtmlTableWriter.close | public void close() throws DataUtilException {
// render footer
try {
if(writer != null) {
writeBottom(false);
}
} catch (IOException e) {
throw new DataUtilException("Failed to close the HTML table file", e);
}
} | java | public void close() throws DataUtilException {
// render footer
try {
if(writer != null) {
writeBottom(false);
}
} catch (IOException e) {
throw new DataUtilException("Failed to close the HTML table file", e);
}
} | [
"public",
"void",
"close",
"(",
")",
"throws",
"DataUtilException",
"{",
"// render footer",
"try",
"{",
"if",
"(",
"writer",
"!=",
"null",
")",
"{",
"writeBottom",
"(",
"false",
")",
";",
"}",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
... | Close the HTML table and resources
@throws DataUtilException exception | [
"Close",
"the",
"HTML",
"table",
"and",
"resources"
] | f01de64854c456a88a31ffbe8bac6d605151b496 | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/writer/HtmlTableWriter.java#L209-L218 | train |
sahasbhop/formatted-log | formatted-log/src/main/java/com/github/sahasbhop/flog/FLog.java | FLog.setEnableFileLog | public static void setEnableFileLog(boolean enable, String path, String fileName) {
sEnableFileLog = enable;
if (enable && path != null && fileName != null) {
sLogFilePath = path.trim();
sLogFileName = fileName.trim();
if (!sLogFilePath.endsWith("/")) {
... | java | public static void setEnableFileLog(boolean enable, String path, String fileName) {
sEnableFileLog = enable;
if (enable && path != null && fileName != null) {
sLogFilePath = path.trim();
sLogFileName = fileName.trim();
if (!sLogFilePath.endsWith("/")) {
... | [
"public",
"static",
"void",
"setEnableFileLog",
"(",
"boolean",
"enable",
",",
"String",
"path",
",",
"String",
"fileName",
")",
"{",
"sEnableFileLog",
"=",
"enable",
";",
"if",
"(",
"enable",
"&&",
"path",
"!=",
"null",
"&&",
"fileName",
"!=",
"null",
")"... | Enable writing debugging log to a target file
@param enable enabling a file log
@param path directory path to create and save a log file
@param fileName target log file name | [
"Enable",
"writing",
"debugging",
"log",
"to",
"a",
"target",
"file"
] | 0a3952df6b68fbfa0bbb2c0ea0a8bf9ea26ea6e3 | https://github.com/sahasbhop/formatted-log/blob/0a3952df6b68fbfa0bbb2c0ea0a8bf9ea26ea6e3/formatted-log/src/main/java/com/github/sahasbhop/flog/FLog.java#L75-L86 | train |
btaz/data-util | src/main/java/com/btaz/util/tf/Strings.java | Strings.buildList | public static List<String> buildList(String... args) {
List<String> newList = new ArrayList<String>();
Collections.addAll(newList, args);
return newList;
} | java | public static List<String> buildList(String... args) {
List<String> newList = new ArrayList<String>();
Collections.addAll(newList, args);
return newList;
} | [
"public",
"static",
"List",
"<",
"String",
">",
"buildList",
"(",
"String",
"...",
"args",
")",
"{",
"List",
"<",
"String",
">",
"newList",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"Collections",
".",
"addAll",
"(",
"newList",
",",
... | This method builds a list of string object from a variable argument list as input
@param args variable argument list
@return {@code List} of {@code String} objects | [
"This",
"method",
"builds",
"a",
"list",
"of",
"string",
"object",
"from",
"a",
"variable",
"argument",
"list",
"as",
"input"
] | f01de64854c456a88a31ffbe8bac6d605151b496 | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/tf/Strings.java#L17-L21 | train |
btaz/data-util | src/main/java/com/btaz/util/tf/Strings.java | Strings.asCommaSeparatedValues | public static String asCommaSeparatedValues(String... args) {
List<String> newList = new ArrayList<String>();
Collections.addAll(newList, args);
return Strings.asTokenSeparatedValues(",", newList);
} | java | public static String asCommaSeparatedValues(String... args) {
List<String> newList = new ArrayList<String>();
Collections.addAll(newList, args);
return Strings.asTokenSeparatedValues(",", newList);
} | [
"public",
"static",
"String",
"asCommaSeparatedValues",
"(",
"String",
"...",
"args",
")",
"{",
"List",
"<",
"String",
">",
"newList",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"Collections",
".",
"addAll",
"(",
"newList",
",",
"args",
... | This method converts a collection of strings to a comma separated list of strings
@param args list of string arguments
@return {@code String} new comma separated string | [
"This",
"method",
"converts",
"a",
"collection",
"of",
"strings",
"to",
"a",
"comma",
"separated",
"list",
"of",
"strings"
] | f01de64854c456a88a31ffbe8bac6d605151b496 | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/tf/Strings.java#L37-L41 | train |
btaz/data-util | src/main/java/com/btaz/util/tf/Strings.java | Strings.asTokenSeparatedValues | public static String asTokenSeparatedValues(String token, Collection<String> strings) {
StringBuilder newString = new StringBuilder();
boolean first = true;
for(String str : strings) {
if(! first) {
newString.append(token);
}
first = false;
... | java | public static String asTokenSeparatedValues(String token, Collection<String> strings) {
StringBuilder newString = new StringBuilder();
boolean first = true;
for(String str : strings) {
if(! first) {
newString.append(token);
}
first = false;
... | [
"public",
"static",
"String",
"asTokenSeparatedValues",
"(",
"String",
"token",
",",
"Collection",
"<",
"String",
">",
"strings",
")",
"{",
"StringBuilder",
"newString",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"boolean",
"first",
"=",
"true",
";",
"for",
... | This method converts a collection of strings to a token separated list of strings
@param strings Collection of strings
@return {@code String} new token separated string | [
"This",
"method",
"converts",
"a",
"collection",
"of",
"strings",
"to",
"a",
"token",
"separated",
"list",
"of",
"strings"
] | f01de64854c456a88a31ffbe8bac6d605151b496 | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/tf/Strings.java#L79-L90 | train |
passwordmaker/java-passwordmaker-lib | src/main/java/org/daveware/passwordmaker/AccountManager.java | AccountManager.generatePassword | public SecureCharArray generatePassword(CharSequence masterPassword, String inputText) {
return generatePassword(masterPassword, inputText, null);
} | java | public SecureCharArray generatePassword(CharSequence masterPassword, String inputText) {
return generatePassword(masterPassword, inputText, null);
} | [
"public",
"SecureCharArray",
"generatePassword",
"(",
"CharSequence",
"masterPassword",
",",
"String",
"inputText",
")",
"{",
"return",
"generatePassword",
"(",
"masterPassword",
",",
"inputText",
",",
"null",
")",
";",
"}"
] | Same as the other version with username being sent null.
@param masterPassword master password to use
@param inputText the input text
@return the generated password
@see #generatePassword(CharSequence, String, String) | [
"Same",
"as",
"the",
"other",
"version",
"with",
"username",
"being",
"sent",
"null",
"."
] | 18c22fca7dd9a47f08161425b85a5bd257afbb2b | https://github.com/passwordmaker/java-passwordmaker-lib/blob/18c22fca7dd9a47f08161425b85a5bd257afbb2b/src/main/java/org/daveware/passwordmaker/AccountManager.java#L71-L73 | train |
passwordmaker/java-passwordmaker-lib | src/main/java/org/daveware/passwordmaker/AccountManager.java | AccountManager.generatePassword | public SecureUTF8String generatePassword(CharSequence masterPassword, String inputText, String username) {
SecureUTF8String securedMasterPassword;
if ( ! (masterPassword instanceof SecureUTF8String) ) {
securedMasterPassword = new SecureUTF8String(masterPassword.toString());
} else {... | java | public SecureUTF8String generatePassword(CharSequence masterPassword, String inputText, String username) {
SecureUTF8String securedMasterPassword;
if ( ! (masterPassword instanceof SecureUTF8String) ) {
securedMasterPassword = new SecureUTF8String(masterPassword.toString());
} else {... | [
"public",
"SecureUTF8String",
"generatePassword",
"(",
"CharSequence",
"masterPassword",
",",
"String",
"inputText",
",",
"String",
"username",
")",
"{",
"SecureUTF8String",
"securedMasterPassword",
";",
"if",
"(",
"!",
"(",
"masterPassword",
"instanceof",
"SecureUTF8St... | Generate the password based on the masterPassword from the matching account from the inputtext
@param masterPassword - the masterpassword to use
@param inputText - the input text // url to use to find the account and generate the password
@param username - (optional) the username to override the account's username unl... | [
"Generate",
"the",
"password",
"based",
"on",
"the",
"masterPassword",
"from",
"the",
"matching",
"account",
"from",
"the",
"inputtext"
] | 18c22fca7dd9a47f08161425b85a5bd257afbb2b | https://github.com/passwordmaker/java-passwordmaker-lib/blob/18c22fca7dd9a47f08161425b85a5bd257afbb2b/src/main/java/org/daveware/passwordmaker/AccountManager.java#L84-L106 | train |
passwordmaker/java-passwordmaker-lib | src/main/java/org/daveware/passwordmaker/AccountManager.java | AccountManager.getAccountForInputText | public Account getAccountForInputText(String inputText) {
if ( selectedProfile != null ) return selectedProfile;
Account account = pwmProfiles.findAccountByUrl(inputText);
if ( account == null ) return getDefaultAccount();
return account;
} | java | public Account getAccountForInputText(String inputText) {
if ( selectedProfile != null ) return selectedProfile;
Account account = pwmProfiles.findAccountByUrl(inputText);
if ( account == null ) return getDefaultAccount();
return account;
} | [
"public",
"Account",
"getAccountForInputText",
"(",
"String",
"inputText",
")",
"{",
"if",
"(",
"selectedProfile",
"!=",
"null",
")",
"return",
"selectedProfile",
";",
"Account",
"account",
"=",
"pwmProfiles",
".",
"findAccountByUrl",
"(",
"inputText",
")",
";",
... | Public for testing | [
"Public",
"for",
"testing"
] | 18c22fca7dd9a47f08161425b85a5bd257afbb2b | https://github.com/passwordmaker/java-passwordmaker-lib/blob/18c22fca7dd9a47f08161425b85a5bd257afbb2b/src/main/java/org/daveware/passwordmaker/AccountManager.java#L109-L114 | train |
passwordmaker/java-passwordmaker-lib | src/main/java/org/daveware/passwordmaker/AccountManager.java | AccountManager.decodeFavoritesUrls | public void decodeFavoritesUrls(String encodedUrlList, boolean clearFirst) {
int start = 0;
int end = encodedUrlList.length();
if ( encodedUrlList.startsWith("<") ) start++;
if ( encodedUrlList.endsWith(">") ) end--;
encodedUrlList = encodedUrlList.substring(start, end);
... | java | public void decodeFavoritesUrls(String encodedUrlList, boolean clearFirst) {
int start = 0;
int end = encodedUrlList.length();
if ( encodedUrlList.startsWith("<") ) start++;
if ( encodedUrlList.endsWith(">") ) end--;
encodedUrlList = encodedUrlList.substring(start, end);
... | [
"public",
"void",
"decodeFavoritesUrls",
"(",
"String",
"encodedUrlList",
",",
"boolean",
"clearFirst",
")",
"{",
"int",
"start",
"=",
"0",
";",
"int",
"end",
"=",
"encodedUrlList",
".",
"length",
"(",
")",
";",
"if",
"(",
"encodedUrlList",
".",
"startsWith"... | Decodes a list of favorites urls from a series of <url1>,<url2>...
Will then put them into the list of favorites, optionally clearing first
@param encodedUrlList - String encoded version of the list
@param clearFirst - clear the list of favorites first | [
"Decodes",
"a",
"list",
"of",
"favorites",
"urls",
"from",
"a",
"series",
"of",
"<",
";",
"url1>",
";",
"<",
";",
"url2>",
";",
"..."
] | 18c22fca7dd9a47f08161425b85a5bd257afbb2b | https://github.com/passwordmaker/java-passwordmaker-lib/blob/18c22fca7dd9a47f08161425b85a5bd257afbb2b/src/main/java/org/daveware/passwordmaker/AccountManager.java#L232-L242 | train |
passwordmaker/java-passwordmaker-lib | src/main/java/org/daveware/passwordmaker/AccountManager.java | AccountManager.setCurrentPasswordHashPassword | public void setCurrentPasswordHashPassword(String newPassword) {
this.passwordSalt = UUID.randomUUID().toString();
try {
this.currentPasswordHash = pwm.makePassword(new SecureUTF8String(newPassword),
masterPwdHashAccount, getPasswordSalt());
} catch (Exception ig... | java | public void setCurrentPasswordHashPassword(String newPassword) {
this.passwordSalt = UUID.randomUUID().toString();
try {
this.currentPasswordHash = pwm.makePassword(new SecureUTF8String(newPassword),
masterPwdHashAccount, getPasswordSalt());
} catch (Exception ig... | [
"public",
"void",
"setCurrentPasswordHashPassword",
"(",
"String",
"newPassword",
")",
"{",
"this",
".",
"passwordSalt",
"=",
"UUID",
".",
"randomUUID",
"(",
")",
".",
"toString",
"(",
")",
";",
"try",
"{",
"this",
".",
"currentPasswordHash",
"=",
"pwm",
"."... | This will salt and hash the password to store
@param newPassword - the new password | [
"This",
"will",
"salt",
"and",
"hash",
"the",
"password",
"to",
"store"
] | 18c22fca7dd9a47f08161425b85a5bd257afbb2b | https://github.com/passwordmaker/java-passwordmaker-lib/blob/18c22fca7dd9a47f08161425b85a5bd257afbb2b/src/main/java/org/daveware/passwordmaker/AccountManager.java#L272-L280 | train |
eyp/serfj | src/main/java/net/sf/serfj/UrlInspector.java | UrlInspector.isMainId | private Boolean isMainId(String id, String resource, String lastElement) {
Boolean isMainId = false;
if (id == null) {
if (!utils.singularize(utils.cleanURL(lastElement)).equals(resource) && resource == null) {
isMainId = true;
}
}
return isMainId;
} | java | private Boolean isMainId(String id, String resource, String lastElement) {
Boolean isMainId = false;
if (id == null) {
if (!utils.singularize(utils.cleanURL(lastElement)).equals(resource) && resource == null) {
isMainId = true;
}
}
return isMainId;
} | [
"private",
"Boolean",
"isMainId",
"(",
"String",
"id",
",",
"String",
"resource",
",",
"String",
"lastElement",
")",
"{",
"Boolean",
"isMainId",
"=",
"false",
";",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"if",
"(",
"!",
"utils",
".",
"singularize",
"(... | Checks if is the main id, or it is a secondary id.
@param id
Current id.
@param resource
Current resource.
@param lastElement
Last element of the URL.
@return true if is the main id, false otherwise. | [
"Checks",
"if",
"is",
"the",
"main",
"id",
"or",
"it",
"is",
"a",
"secondary",
"id",
"."
] | e617592af6f24e59ea58443f2785c44aa2312189 | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/UrlInspector.java#L117-L125 | train |
eyp/serfj | src/main/java/net/sf/serfj/UrlInspector.java | UrlInspector.isResource | Boolean isResource(String resource) {
Boolean isResource = false;
if (!utils.isIdentifier(resource)) {
try {
String clazz = getControllerClass(resource);
if (clazz != null) {
Class.forName(clazz);
isResource = true;
}
} catch (ClassNotFoundException e) {
// It isn't a resource becaus... | java | Boolean isResource(String resource) {
Boolean isResource = false;
if (!utils.isIdentifier(resource)) {
try {
String clazz = getControllerClass(resource);
if (clazz != null) {
Class.forName(clazz);
isResource = true;
}
} catch (ClassNotFoundException e) {
// It isn't a resource becaus... | [
"Boolean",
"isResource",
"(",
"String",
"resource",
")",
"{",
"Boolean",
"isResource",
"=",
"false",
";",
"if",
"(",
"!",
"utils",
".",
"isIdentifier",
"(",
"resource",
")",
")",
"{",
"try",
"{",
"String",
"clazz",
"=",
"getControllerClass",
"(",
"resource... | Checks if a string represents a resource or not. If there is a class
which could be instantiated then is a resource, elsewhere it isn't
@param resource
String that coulb be a resource.
@return true if chunk is a resource. | [
"Checks",
"if",
"a",
"string",
"represents",
"a",
"resource",
"or",
"not",
".",
"If",
"there",
"is",
"a",
"class",
"which",
"could",
"be",
"instantiated",
"then",
"is",
"a",
"resource",
"elsewhere",
"it",
"isn",
"t"
] | e617592af6f24e59ea58443f2785c44aa2312189 | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/UrlInspector.java#L192-L206 | train |
eyp/serfj | src/main/java/net/sf/serfj/UrlInspector.java | UrlInspector.getControllerClass | String getControllerClass(String resource) {
ControllerFinder finder = new ControllerFinder(config);
String controllerClass = finder.findResource(resource);
LOGGER.debug("Controller class: {}", controllerClass);
return controllerClass;
} | java | String getControllerClass(String resource) {
ControllerFinder finder = new ControllerFinder(config);
String controllerClass = finder.findResource(resource);
LOGGER.debug("Controller class: {}", controllerClass);
return controllerClass;
} | [
"String",
"getControllerClass",
"(",
"String",
"resource",
")",
"{",
"ControllerFinder",
"finder",
"=",
"new",
"ControllerFinder",
"(",
"config",
")",
";",
"String",
"controllerClass",
"=",
"finder",
".",
"findResource",
"(",
"resource",
")",
";",
"LOGGER",
".",... | Gets controller class for a resource.
@param resource
Resource that will managed by the controller class.
@return The fully qualified name of the controller class for this
resource and extension. | [
"Gets",
"controller",
"class",
"for",
"a",
"resource",
"."
] | e617592af6f24e59ea58443f2785c44aa2312189 | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/UrlInspector.java#L216-L221 | train |
eyp/serfj | src/main/java/net/sf/serfj/UrlInspector.java | UrlInspector.getSerializerClass | protected String getSerializerClass(String resource, String urlLastElement) {
String serializerClass = null;
String extension = this.utils.getExtension(urlLastElement);
if (extension != null) {
SerializerFinder finder = new SerializerFinder(config, extension);
serializerClass = finder.findResource(resource)... | java | protected String getSerializerClass(String resource, String urlLastElement) {
String serializerClass = null;
String extension = this.utils.getExtension(urlLastElement);
if (extension != null) {
SerializerFinder finder = new SerializerFinder(config, extension);
serializerClass = finder.findResource(resource)... | [
"protected",
"String",
"getSerializerClass",
"(",
"String",
"resource",
",",
"String",
"urlLastElement",
")",
"{",
"String",
"serializerClass",
"=",
"null",
";",
"String",
"extension",
"=",
"this",
".",
"utils",
".",
"getExtension",
"(",
"urlLastElement",
")",
"... | Gets serializer class for a resource. If the last part of the URL has an
extension, then could be a Serializer class to render the result in a
specific way. If the extension is .xml it hopes that a
ResourceNameXmlSerializer exists to render the resource as Xml. The
extension can be anything.
@param resource
Resource t... | [
"Gets",
"serializer",
"class",
"for",
"a",
"resource",
".",
"If",
"the",
"last",
"part",
"of",
"the",
"URL",
"has",
"an",
"extension",
"then",
"could",
"be",
"a",
"Serializer",
"class",
"to",
"render",
"the",
"result",
"in",
"a",
"specific",
"way",
".",
... | e617592af6f24e59ea58443f2785c44aa2312189 | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/UrlInspector.java#L237-L245 | train |
btaz/data-util | src/main/java/com/btaz/util/files/FileCat.java | FileCat.concatenate | public static void concatenate(List<File> files, File concatenatedFile) {
BufferedWriter writer;
try {
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(concatenatedFile.getAbsoluteFile(),
false), DataUtilDefaults.charSet));
FileInputSt... | java | public static void concatenate(List<File> files, File concatenatedFile) {
BufferedWriter writer;
try {
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(concatenatedFile.getAbsoluteFile(),
false), DataUtilDefaults.charSet));
FileInputSt... | [
"public",
"static",
"void",
"concatenate",
"(",
"List",
"<",
"File",
">",
"files",
",",
"File",
"concatenatedFile",
")",
"{",
"BufferedWriter",
"writer",
";",
"try",
"{",
"writer",
"=",
"new",
"BufferedWriter",
"(",
"new",
"OutputStreamWriter",
"(",
"new",
"... | This method will concatenate one or more files
@param files files to concatenate
@param concatenatedFile concatenated output file | [
"This",
"method",
"will",
"concatenate",
"one",
"or",
"more",
"files"
] | f01de64854c456a88a31ffbe8bac6d605151b496 | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/files/FileCat.java#L18-L44 | train |
Teddy-Zhu/SilentGo | framework/src/main/java/com/silentgo/servlet/http/HttpStatus.java | HttpStatus.getMessage | public static String getMessage(int code)
{
Code codeEnum = getCode(code);
if (codeEnum != null)
{
return codeEnum.getMessage();
}
else
{
return Integer.toString(code);
}
} | java | public static String getMessage(int code)
{
Code codeEnum = getCode(code);
if (codeEnum != null)
{
return codeEnum.getMessage();
}
else
{
return Integer.toString(code);
}
} | [
"public",
"static",
"String",
"getMessage",
"(",
"int",
"code",
")",
"{",
"Code",
"codeEnum",
"=",
"getCode",
"(",
"code",
")",
";",
"if",
"(",
"codeEnum",
"!=",
"null",
")",
"{",
"return",
"codeEnum",
".",
"getMessage",
"(",
")",
";",
"}",
"else",
"... | Get the status message for a specific code.
@param code
the code to look up
@return the specific message, or the code number itself if code
does not match known list. | [
"Get",
"the",
"status",
"message",
"for",
"a",
"specific",
"code",
"."
] | 27f58b0cafe56b2eb9fc6993efa9ca2b529661e1 | https://github.com/Teddy-Zhu/SilentGo/blob/27f58b0cafe56b2eb9fc6993efa9ca2b529661e1/framework/src/main/java/com/silentgo/servlet/http/HttpStatus.java#L342-L353 | train |
passwordmaker/java-passwordmaker-lib | src/main/java/org/daveware/passwordmaker/AlgorithmType.java | AlgorithmType.fromRdfString | public static Pair<AlgorithmType, Boolean> fromRdfString(String str, boolean convert)
throws IncompatibleException {
// default
if (str.length() == 0)
return pair(MD5, true);
// Search the list of registered algorithms
for (AlgorithmType algoType : TYPES) {
... | java | public static Pair<AlgorithmType, Boolean> fromRdfString(String str, boolean convert)
throws IncompatibleException {
// default
if (str.length() == 0)
return pair(MD5, true);
// Search the list of registered algorithms
for (AlgorithmType algoType : TYPES) {
... | [
"public",
"static",
"Pair",
"<",
"AlgorithmType",
",",
"Boolean",
">",
"fromRdfString",
"(",
"String",
"str",
",",
"boolean",
"convert",
")",
"throws",
"IncompatibleException",
"{",
"// default",
"if",
"(",
"str",
".",
"length",
"(",
")",
"==",
"0",
")",
"... | Converts a string to an algorithm type.
@param str The algorithm type. Valid values are: md4, md5, sha1, sha256,
rmd160. Any of those valid types can be prefixed with "hmac-".
@param convert - if the broken version of sha256 is found, just replace with non-broken version, instead of throwing
@return The algorithm type... | [
"Converts",
"a",
"string",
"to",
"an",
"algorithm",
"type",
"."
] | 18c22fca7dd9a47f08161425b85a5bd257afbb2b | https://github.com/passwordmaker/java-passwordmaker-lib/blob/18c22fca7dd9a47f08161425b85a5bd257afbb2b/src/main/java/org/daveware/passwordmaker/AlgorithmType.java#L88-L128 | train |
pierre/ning-service-skeleton | jdbi/src/main/java/com/ning/jetty/jdbi/log/Slf4jLogging.java | Slf4jLogging.log | @Override
protected void log(final String msg) {
if (config.getLogLevel().equals(LogLevel.DEBUG)) {
logger.debug(msg);
} else if (config.getLogLevel().equals(LogLevel.TRACE)) {
logger.trace(msg);
} else if (config.getLogLevel().equals(LogLevel.INFO)) {
log... | java | @Override
protected void log(final String msg) {
if (config.getLogLevel().equals(LogLevel.DEBUG)) {
logger.debug(msg);
} else if (config.getLogLevel().equals(LogLevel.TRACE)) {
logger.trace(msg);
} else if (config.getLogLevel().equals(LogLevel.INFO)) {
log... | [
"@",
"Override",
"protected",
"void",
"log",
"(",
"final",
"String",
"msg",
")",
"{",
"if",
"(",
"config",
".",
"getLogLevel",
"(",
")",
".",
"equals",
"(",
"LogLevel",
".",
"DEBUG",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"msg",
")",
";",
"}",... | Log the statement passed in
@param msg the message to log | [
"Log",
"the",
"statement",
"passed",
"in"
] | 766369c8c975d262ede212e81d89b65c589090b7 | https://github.com/pierre/ning-service-skeleton/blob/766369c8c975d262ede212e81d89b65c589090b7/jdbi/src/main/java/com/ning/jetty/jdbi/log/Slf4jLogging.java#L53-L66 | train |
eyp/serfj | src/main/java/net/sf/serfj/client/Client.java | Client.getRequest | public Object getRequest(String restUrl, Map<String, String> params) throws IOException, WebServiceException {
HttpURLConnection conn = null;
try {
// Make the URL
urlString = new StringBuilder(this.host).append(restUrl);
urlString.append(this.makeParamsString(params, true));
LOGGER.debug("Doing HTTP... | java | public Object getRequest(String restUrl, Map<String, String> params) throws IOException, WebServiceException {
HttpURLConnection conn = null;
try {
// Make the URL
urlString = new StringBuilder(this.host).append(restUrl);
urlString.append(this.makeParamsString(params, true));
LOGGER.debug("Doing HTTP... | [
"public",
"Object",
"getRequest",
"(",
"String",
"restUrl",
",",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"IOException",
",",
"WebServiceException",
"{",
"HttpURLConnection",
"conn",
"=",
"null",
";",
"try",
"{",
"// Make the URL",
"u... | Do a GET HTTP request to the given REST-URL.
@param restUrl
REST URL.
@param params
Parameters for adding to the query string.
@throws IOException
if the request go bad. | [
"Do",
"a",
"GET",
"HTTP",
"request",
"to",
"the",
"given",
"REST",
"-",
"URL",
"."
] | e617592af6f24e59ea58443f2785c44aa2312189 | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/client/Client.java#L88-L118 | train |
eyp/serfj | src/main/java/net/sf/serfj/client/Client.java | Client.putRequest | public Object putRequest(String restUrl, Map<String, String> params) throws IOException, WebServiceException {
return this.postRequest(HttpMethod.PUT, restUrl, params);
} | java | public Object putRequest(String restUrl, Map<String, String> params) throws IOException, WebServiceException {
return this.postRequest(HttpMethod.PUT, restUrl, params);
} | [
"public",
"Object",
"putRequest",
"(",
"String",
"restUrl",
",",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"IOException",
",",
"WebServiceException",
"{",
"return",
"this",
".",
"postRequest",
"(",
"HttpMethod",
".",
"PUT",
",",
"res... | Do a PUT HTTP request to the given REST-URL.
@param restUrl
REST URL.
@param params
Parameters for adding to the query string.
@throws IOException
if the request go bad. | [
"Do",
"a",
"PUT",
"HTTP",
"request",
"to",
"the",
"given",
"REST",
"-",
"URL",
"."
] | e617592af6f24e59ea58443f2785c44aa2312189 | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/client/Client.java#L144-L146 | train |
eyp/serfj | src/main/java/net/sf/serfj/client/Client.java | Client.deleteRequest | public Object deleteRequest(String restUrl, Map<String, String> params) throws IOException, WebServiceException {
return this.postRequest(HttpMethod.DELETE, restUrl, params);
} | java | public Object deleteRequest(String restUrl, Map<String, String> params) throws IOException, WebServiceException {
return this.postRequest(HttpMethod.DELETE, restUrl, params);
} | [
"public",
"Object",
"deleteRequest",
"(",
"String",
"restUrl",
",",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"IOException",
",",
"WebServiceException",
"{",
"return",
"this",
".",
"postRequest",
"(",
"HttpMethod",
".",
"DELETE",
",",
... | Do a DELETE HTTP request to the given REST-URL.
@param restUrl
REST URL.
@param params
Parameters for adding to the query string.
@throws IOException
if the request go bad. | [
"Do",
"a",
"DELETE",
"HTTP",
"request",
"to",
"the",
"given",
"REST",
"-",
"URL",
"."
] | e617592af6f24e59ea58443f2785c44aa2312189 | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/client/Client.java#L158-L160 | train |
eyp/serfj | src/main/java/net/sf/serfj/client/Client.java | Client.makeParamsString | private String makeParamsString(Map<String, String> params, boolean isGet) {
StringBuilder url = new StringBuilder();
if (params != null) {
boolean first = true;
for (Map.Entry<String, String> entry : params.entrySet()) {
if (first) {
if (isGet) {
url.append("?");
}
first = false;
... | java | private String makeParamsString(Map<String, String> params, boolean isGet) {
StringBuilder url = new StringBuilder();
if (params != null) {
boolean first = true;
for (Map.Entry<String, String> entry : params.entrySet()) {
if (first) {
if (isGet) {
url.append("?");
}
first = false;
... | [
"private",
"String",
"makeParamsString",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"params",
",",
"boolean",
"isGet",
")",
"{",
"StringBuilder",
"url",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"params",
"!=",
"null",
")",
"{",
"boolean... | Adds params to a query string. It will encode params' values to not get
errors in the connection.
@param params
Parameters and their values.
@param isGet
Indicates a GET request. A GET request has to mark the first
parameter with the '?' symbol. In a POST request it doesn't
have to do it.
@return a string with the par... | [
"Adds",
"params",
"to",
"a",
"query",
"string",
".",
"It",
"will",
"encode",
"params",
"values",
"to",
"not",
"get",
"errors",
"in",
"the",
"connection",
"."
] | e617592af6f24e59ea58443f2785c44aa2312189 | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/client/Client.java#L281-L311 | train |
eyp/serfj | src/main/java/net/sf/serfj/client/Client.java | Client.deserialize | private Object deserialize(String serializedObject, String extension) throws IOException {
LOGGER.debug("Deserializing object [{}] to [{}]", serializedObject, extension);
SerializerFinder finder = new SerializerFinder(extension);
String serializerClass = finder.findResource(null);
if (serializerClass == null) {... | java | private Object deserialize(String serializedObject, String extension) throws IOException {
LOGGER.debug("Deserializing object [{}] to [{}]", serializedObject, extension);
SerializerFinder finder = new SerializerFinder(extension);
String serializerClass = finder.findResource(null);
if (serializerClass == null) {... | [
"private",
"Object",
"deserialize",
"(",
"String",
"serializedObject",
",",
"String",
"extension",
")",
"throws",
"IOException",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Deserializing object [{}] to [{}]\"",
",",
"serializedObject",
",",
"extension",
")",
";",
"Serializer... | Deserializes a serialized object that came within the response after a
REST call.
@param serializedObject
Serialized object.
@param extension
URL's extension (json, 64, xml, etc...).
@return a deserialized object.
@throws IOException
if object can't be deserialized. | [
"Deserializes",
"a",
"serialized",
"object",
"that",
"came",
"within",
"the",
"response",
"after",
"a",
"REST",
"call",
"."
] | e617592af6f24e59ea58443f2785c44aa2312189 | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/client/Client.java#L325-L345 | train |
fcrepo4-labs/fcrepo4-client | fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpHelper.java | HttpHelper.execute | public HttpResponse execute( final HttpUriRequest request ) throws IOException, ReadOnlyException {
if ( readOnly ) {
switch ( request.getMethod().toLowerCase() ) {
case "copy": case "delete": case "move": case "patch": case "post": case "put":
throw new ReadOnlyE... | java | public HttpResponse execute( final HttpUriRequest request ) throws IOException, ReadOnlyException {
if ( readOnly ) {
switch ( request.getMethod().toLowerCase() ) {
case "copy": case "delete": case "move": case "patch": case "post": case "put":
throw new ReadOnlyE... | [
"public",
"HttpResponse",
"execute",
"(",
"final",
"HttpUriRequest",
"request",
")",
"throws",
"IOException",
",",
"ReadOnlyException",
"{",
"if",
"(",
"readOnly",
")",
"{",
"switch",
"(",
"request",
".",
"getMethod",
"(",
")",
".",
"toLowerCase",
"(",
")",
... | Execute a request for a subclass.
@param request request to be executed
@return response containing response to request
@throws IOException
@throws ReadOnlyException | [
"Execute",
"a",
"request",
"for",
"a",
"subclass",
"."
] | 21eaf27200c5b2542095f6ebb9dd8ec865b95bbd | https://github.com/fcrepo4-labs/fcrepo4-client/blob/21eaf27200c5b2542095f6ebb9dd8ec865b95bbd/fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpHelper.java#L173-L184 | train |
fcrepo4-labs/fcrepo4-client | fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpHelper.java | HttpHelper.queryString | private static String queryString( final Map<String, List<String>> params ) {
final StringBuilder builder = new StringBuilder();
if (params != null && params.size() > 0) {
for (final Iterator<String> it = params.keySet().iterator(); it.hasNext(); ) {
final String key = it.nex... | java | private static String queryString( final Map<String, List<String>> params ) {
final StringBuilder builder = new StringBuilder();
if (params != null && params.size() > 0) {
for (final Iterator<String> it = params.keySet().iterator(); it.hasNext(); ) {
final String key = it.nex... | [
"private",
"static",
"String",
"queryString",
"(",
"final",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"params",
")",
"{",
"final",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"params",
"!=",
"null"... | Encode URL parameters as a query string.
@param params Query parameters | [
"Encode",
"URL",
"parameters",
"as",
"a",
"query",
"string",
"."
] | 21eaf27200c5b2542095f6ebb9dd8ec865b95bbd | https://github.com/fcrepo4-labs/fcrepo4-client/blob/21eaf27200c5b2542095f6ebb9dd8ec865b95bbd/fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpHelper.java#L190-L207 | train |
fcrepo4-labs/fcrepo4-client | fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpHelper.java | HttpHelper.createGetMethod | public HttpGet createGetMethod(final String path, final Map<String, List<String>> params) {
return new HttpGet(repositoryURL + path + queryString(params));
} | java | public HttpGet createGetMethod(final String path, final Map<String, List<String>> params) {
return new HttpGet(repositoryURL + path + queryString(params));
} | [
"public",
"HttpGet",
"createGetMethod",
"(",
"final",
"String",
"path",
",",
"final",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"params",
")",
"{",
"return",
"new",
"HttpGet",
"(",
"repositoryURL",
"+",
"path",
"+",
"queryString",
"(",
... | Create GET method with list of parameters
@param path Resource path, relative to repository baseURL
@param params Query parameters
@return GET method | [
"Create",
"GET",
"method",
"with",
"list",
"of",
"parameters"
] | 21eaf27200c5b2542095f6ebb9dd8ec865b95bbd | https://github.com/fcrepo4-labs/fcrepo4-client/blob/21eaf27200c5b2542095f6ebb9dd8ec865b95bbd/fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpHelper.java#L224-L226 | train |
fcrepo4-labs/fcrepo4-client | fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpHelper.java | HttpHelper.createPatchMethod | public HttpPatch createPatchMethod(final String path, final String sparqlUpdate) throws FedoraException {
if ( isBlank(sparqlUpdate) ) {
throw new FedoraException("SPARQL Update command must not be blank");
}
final HttpPatch patch = new HttpPatch(repositoryURL + path);
patch... | java | public HttpPatch createPatchMethod(final String path, final String sparqlUpdate) throws FedoraException {
if ( isBlank(sparqlUpdate) ) {
throw new FedoraException("SPARQL Update command must not be blank");
}
final HttpPatch patch = new HttpPatch(repositoryURL + path);
patch... | [
"public",
"HttpPatch",
"createPatchMethod",
"(",
"final",
"String",
"path",
",",
"final",
"String",
"sparqlUpdate",
")",
"throws",
"FedoraException",
"{",
"if",
"(",
"isBlank",
"(",
"sparqlUpdate",
")",
")",
"{",
"throw",
"new",
"FedoraException",
"(",
"\"SPARQL... | Create a request to update triples with SPARQL Update.
@param path The datastream path.
@param sparqlUpdate SPARQL Update command.
@return created patch based on parameters
@throws FedoraException | [
"Create",
"a",
"request",
"to",
"update",
"triples",
"with",
"SPARQL",
"Update",
"."
] | 21eaf27200c5b2542095f6ebb9dd8ec865b95bbd | https://github.com/fcrepo4-labs/fcrepo4-client/blob/21eaf27200c5b2542095f6ebb9dd8ec865b95bbd/fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpHelper.java#L244-L253 | train |
fcrepo4-labs/fcrepo4-client | fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpHelper.java | HttpHelper.createPostMethod | public HttpPost createPostMethod(final String path, final Map<String, List<String>> params) {
return new HttpPost(repositoryURL + path + queryString(params));
} | java | public HttpPost createPostMethod(final String path, final Map<String, List<String>> params) {
return new HttpPost(repositoryURL + path + queryString(params));
} | [
"public",
"HttpPost",
"createPostMethod",
"(",
"final",
"String",
"path",
",",
"final",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"params",
")",
"{",
"return",
"new",
"HttpPost",
"(",
"repositoryURL",
"+",
"path",
"+",
"queryString",
"(",... | Create POST method with list of parameters
@param path Resource path, relative to repository baseURL
@param params Query parameters
@return PUT method | [
"Create",
"POST",
"method",
"with",
"list",
"of",
"parameters"
] | 21eaf27200c5b2542095f6ebb9dd8ec865b95bbd | https://github.com/fcrepo4-labs/fcrepo4-client/blob/21eaf27200c5b2542095f6ebb9dd8ec865b95bbd/fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpHelper.java#L261-L263 | train |
fcrepo4-labs/fcrepo4-client | fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpHelper.java | HttpHelper.createPutMethod | public HttpPut createPutMethod(final String path, final Map<String, List<String>> params) {
return new HttpPut(repositoryURL + path + queryString(params));
} | java | public HttpPut createPutMethod(final String path, final Map<String, List<String>> params) {
return new HttpPut(repositoryURL + path + queryString(params));
} | [
"public",
"HttpPut",
"createPutMethod",
"(",
"final",
"String",
"path",
",",
"final",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"params",
")",
"{",
"return",
"new",
"HttpPut",
"(",
"repositoryURL",
"+",
"path",
"+",
"queryString",
"(",
... | Create PUT method with list of parameters
@param path Resource path, relative to repository baseURL
@param params Query parameters
@return PUT method | [
"Create",
"PUT",
"method",
"with",
"list",
"of",
"parameters"
] | 21eaf27200c5b2542095f6ebb9dd8ec865b95bbd | https://github.com/fcrepo4-labs/fcrepo4-client/blob/21eaf27200c5b2542095f6ebb9dd8ec865b95bbd/fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpHelper.java#L271-L273 | train |
fcrepo4-labs/fcrepo4-client | fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpHelper.java | HttpHelper.createTriplesPutMethod | public HttpPut createTriplesPutMethod(final String path, final InputStream updatedProperties,
final String contentType) throws FedoraException {
if ( updatedProperties == null ) {
throw new FedoraException("updatedProperties must not be null");
} els... | java | public HttpPut createTriplesPutMethod(final String path, final InputStream updatedProperties,
final String contentType) throws FedoraException {
if ( updatedProperties == null ) {
throw new FedoraException("updatedProperties must not be null");
} els... | [
"public",
"HttpPut",
"createTriplesPutMethod",
"(",
"final",
"String",
"path",
",",
"final",
"InputStream",
"updatedProperties",
",",
"final",
"String",
"contentType",
")",
"throws",
"FedoraException",
"{",
"if",
"(",
"updatedProperties",
"==",
"null",
")",
"{",
"... | Create a request to update triples.
@param path The datastream path.
@param updatedProperties InputStream containing RDF.
@param contentType Content type of the RDF in updatedProperties (e.g., "text/rdf+n3" or
"application/rdf+xml").
@return PUT method
@throws FedoraException | [
"Create",
"a",
"request",
"to",
"update",
"triples",
"."
] | 21eaf27200c5b2542095f6ebb9dd8ec865b95bbd | https://github.com/fcrepo4-labs/fcrepo4-client/blob/21eaf27200c5b2542095f6ebb9dd8ec865b95bbd/fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpHelper.java#L318-L330 | train |
fcrepo4-labs/fcrepo4-client | fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpHelper.java | HttpHelper.createCopyMethod | public HttpCopy createCopyMethod(final String sourcePath, final String destinationPath) {
return new HttpCopy(repositoryURL + sourcePath, repositoryURL + destinationPath);
} | java | public HttpCopy createCopyMethod(final String sourcePath, final String destinationPath) {
return new HttpCopy(repositoryURL + sourcePath, repositoryURL + destinationPath);
} | [
"public",
"HttpCopy",
"createCopyMethod",
"(",
"final",
"String",
"sourcePath",
",",
"final",
"String",
"destinationPath",
")",
"{",
"return",
"new",
"HttpCopy",
"(",
"repositoryURL",
"+",
"sourcePath",
",",
"repositoryURL",
"+",
"destinationPath",
")",
";",
"}"
] | Create COPY method
@param sourcePath Source path, relative to repository baseURL
@param destinationPath Destination path, relative to repository baseURL
@return COPY method | [
"Create",
"COPY",
"method"
] | 21eaf27200c5b2542095f6ebb9dd8ec865b95bbd | https://github.com/fcrepo4-labs/fcrepo4-client/blob/21eaf27200c5b2542095f6ebb9dd8ec865b95bbd/fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpHelper.java#L401-L403 | train |
fcrepo4-labs/fcrepo4-client | fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpHelper.java | HttpHelper.createMoveMethod | public HttpMove createMoveMethod(final String sourcePath, final String destinationPath) {
return new HttpMove(repositoryURL + sourcePath, repositoryURL + destinationPath);
} | java | public HttpMove createMoveMethod(final String sourcePath, final String destinationPath) {
return new HttpMove(repositoryURL + sourcePath, repositoryURL + destinationPath);
} | [
"public",
"HttpMove",
"createMoveMethod",
"(",
"final",
"String",
"sourcePath",
",",
"final",
"String",
"destinationPath",
")",
"{",
"return",
"new",
"HttpMove",
"(",
"repositoryURL",
"+",
"sourcePath",
",",
"repositoryURL",
"+",
"destinationPath",
")",
";",
"}"
] | Create MOVE method
@param sourcePath Source path, relative to repository baseURL
@param destinationPath Destination path, relative to repository baseURL
@return MOVE method | [
"Create",
"MOVE",
"method"
] | 21eaf27200c5b2542095f6ebb9dd8ec865b95bbd | https://github.com/fcrepo4-labs/fcrepo4-client/blob/21eaf27200c5b2542095f6ebb9dd8ec865b95bbd/fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpHelper.java#L411-L413 | train |
passwordmaker/java-passwordmaker-lib | src/main/java/org/daveware/passwordmaker/LeetEncoder.java | LeetEncoder.leetConvert | public static void leetConvert(LeetLevel level, SecureCharArray message)
throws Exception {
// pre-allocate an array that is 4 times the size of the message. I don't
// see anything in the leet-table that is larger than 3 characters, but I'm
// using 4-characters to calcualte the si... | java | public static void leetConvert(LeetLevel level, SecureCharArray message)
throws Exception {
// pre-allocate an array that is 4 times the size of the message. I don't
// see anything in the leet-table that is larger than 3 characters, but I'm
// using 4-characters to calcualte the si... | [
"public",
"static",
"void",
"leetConvert",
"(",
"LeetLevel",
"level",
",",
"SecureCharArray",
"message",
")",
"throws",
"Exception",
"{",
"// pre-allocate an array that is 4 times the size of the message. I don't",
"// see anything in the leet-table that is larger than 3 characters, b... | Converts a SecureCharArray into a new SecureCharArray with any applicable
characters converted to leet-speak.
@param level What level of leet to use. Each leet corresponds to a different
leet lookup table.
@param message The array to convert.
@throws Exception upon sizing error. | [
"Converts",
"a",
"SecureCharArray",
"into",
"a",
"new",
"SecureCharArray",
"with",
"any",
"applicable",
"characters",
"converted",
"to",
"leet",
"-",
"speak",
"."
] | 18c22fca7dd9a47f08161425b85a5bd257afbb2b | https://github.com/passwordmaker/java-passwordmaker-lib/blob/18c22fca7dd9a47f08161425b85a5bd257afbb2b/src/main/java/org/daveware/passwordmaker/LeetEncoder.java#L67-L95 | train |
eyp/serfj | src/main/java/net/sf/serfj/config/SystemConfig.java | SystemConfig.getValue | public String getValue(final ConfigParam param) {
if (param == null) {
return null;
}
// Buscamos en las variables del sistema
Object obj = System.getProperty(param.getName());
// Si no, se busca en el fichero de configuracion
if (obj == null) {
ob... | java | public String getValue(final ConfigParam param) {
if (param == null) {
return null;
}
// Buscamos en las variables del sistema
Object obj = System.getProperty(param.getName());
// Si no, se busca en el fichero de configuracion
if (obj == null) {
ob... | [
"public",
"String",
"getValue",
"(",
"final",
"ConfigParam",
"param",
")",
"{",
"if",
"(",
"param",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"// Buscamos en las variables del sistema",
"Object",
"obj",
"=",
"System",
".",
"getProperty",
"(",
"param"... | Devuelve el valor del parametro de configuracion que se recibe. Si el valor es null y el parametro tiene un valor
por defecto, entonces este valor es el que se devuelve.
@param param - Parametro del que se quiere obtener el valor.
@return el valor del parametro. | [
"Devuelve",
"el",
"valor",
"del",
"parametro",
"de",
"configuracion",
"que",
"se",
"recibe",
".",
"Si",
"el",
"valor",
"es",
"null",
"y",
"el",
"parametro",
"tiene",
"un",
"valor",
"por",
"defecto",
"entonces",
"este",
"valor",
"es",
"el",
"que",
"se",
"... | e617592af6f24e59ea58443f2785c44aa2312189 | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/config/SystemConfig.java#L110-L128 | train |
eyp/serfj | src/main/java/net/sf/serfj/config/SystemConfig.java | SystemConfig.init | private void init() throws ConfigFileIOException {
this.props = new Properties();
log.info("Reading config file: {}", this.configFile);
boolean ok = true;
try {
// El fichero esta en el CLASSPATH
this.props.load(SystemConfig.class.getResourceAsStream(this.configFi... | java | private void init() throws ConfigFileIOException {
this.props = new Properties();
log.info("Reading config file: {}", this.configFile);
boolean ok = true;
try {
// El fichero esta en el CLASSPATH
this.props.load(SystemConfig.class.getResourceAsStream(this.configFi... | [
"private",
"void",
"init",
"(",
")",
"throws",
"ConfigFileIOException",
"{",
"this",
".",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"log",
".",
"info",
"(",
"\"Reading config file: {}\"",
",",
"this",
".",
"configFile",
")",
";",
"boolean",
"ok",
"... | Inicializa la configuracion. | [
"Inicializa",
"la",
"configuracion",
"."
] | e617592af6f24e59ea58443f2785c44aa2312189 | https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/config/SystemConfig.java#L164-L188 | train |
btaz/data-util | src/main/java/com/btaz/util/files/SortController.java | SortController.sortFile | public static void sortFile(File sortDir, File inputFile, File outputFile, Comparator<String> comparator,
boolean skipHeader) {
sortFile(sortDir, inputFile, outputFile, comparator, skipHeader, DEFAULT_MAX_BYTES, MERGE_FACTOR);
} | java | public static void sortFile(File sortDir, File inputFile, File outputFile, Comparator<String> comparator,
boolean skipHeader) {
sortFile(sortDir, inputFile, outputFile, comparator, skipHeader, DEFAULT_MAX_BYTES, MERGE_FACTOR);
} | [
"public",
"static",
"void",
"sortFile",
"(",
"File",
"sortDir",
",",
"File",
"inputFile",
",",
"File",
"outputFile",
",",
"Comparator",
"<",
"String",
">",
"comparator",
",",
"boolean",
"skipHeader",
")",
"{",
"sortFile",
"(",
"sortDir",
",",
"inputFile",
",... | Sort a file, write sorted data to output file. Use the default max bytes size and the default merge factor.
@param inputFile input file
@param outputFile output file
@param comparator comparator used to sort rows | [
"Sort",
"a",
"file",
"write",
"sorted",
"data",
"to",
"output",
"file",
".",
"Use",
"the",
"default",
"max",
"bytes",
"size",
"and",
"the",
"default",
"merge",
"factor",
"."
] | f01de64854c456a88a31ffbe8bac6d605151b496 | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/files/SortController.java#L26-L29 | train |
btaz/data-util | src/main/java/com/btaz/util/files/SortController.java | SortController.sortFile | public static void sortFile(File sortDir, File inputFile, File outputFile, Comparator<String> comparator,
boolean skipHeader, long maxBytes, int mergeFactor) {
// validation
if(comparator == null) {
comparator = Lexical.ascending();
}
// steps... | java | public static void sortFile(File sortDir, File inputFile, File outputFile, Comparator<String> comparator,
boolean skipHeader, long maxBytes, int mergeFactor) {
// validation
if(comparator == null) {
comparator = Lexical.ascending();
}
// steps... | [
"public",
"static",
"void",
"sortFile",
"(",
"File",
"sortDir",
",",
"File",
"inputFile",
",",
"File",
"outputFile",
",",
"Comparator",
"<",
"String",
">",
"comparator",
",",
"boolean",
"skipHeader",
",",
"long",
"maxBytes",
",",
"int",
"mergeFactor",
")",
"... | Sort a file, write sorted data to output file.
@param inputFile input file
@param outputFile output file
@param comparator comparator used to sort rows | [
"Sort",
"a",
"file",
"write",
"sorted",
"data",
"to",
"output",
"file",
"."
] | f01de64854c456a88a31ffbe8bac6d605151b496 | https://github.com/btaz/data-util/blob/f01de64854c456a88a31ffbe8bac6d605151b496/src/main/java/com/btaz/util/files/SortController.java#L37-L48 | train |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/Assembler.java | Assembler.setWideIndex | public void setWideIndex(boolean wideIndex)
{
this.wideIndex = wideIndex;
if (types != null)
{
for (TypeASM t : types.values())
{
Assembler as = (Assembler) t;
as.setWideIndex(wideIndex);
}
}
} | java | public void setWideIndex(boolean wideIndex)
{
this.wideIndex = wideIndex;
if (types != null)
{
for (TypeASM t : types.values())
{
Assembler as = (Assembler) t;
as.setWideIndex(wideIndex);
}
}
} | [
"public",
"void",
"setWideIndex",
"(",
"boolean",
"wideIndex",
")",
"{",
"this",
".",
"wideIndex",
"=",
"wideIndex",
";",
"if",
"(",
"types",
"!=",
"null",
")",
"{",
"for",
"(",
"TypeASM",
"t",
":",
"types",
".",
"values",
"(",
")",
")",
"{",
"Assemb... | Set goto and jsr to use wide index
@param wideIndex | [
"Set",
"goto",
"and",
"jsr",
"to",
"use",
"wide",
"index"
] | 4e84e313018d487f1a8cca3952d71bc21e77d16b | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/Assembler.java#L106-L117 | train |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/Assembler.java | Assembler.fixAddress | public void fixAddress(String name) throws IOException
{
Label label = labels.get(name);
if (label == null)
{
label = new Label(name);
labels.put(name, label);
}
int pos = position();
label.setAddress(pos);
labelMap.put(pos, label);
... | java | public void fixAddress(String name) throws IOException
{
Label label = labels.get(name);
if (label == null)
{
label = new Label(name);
labels.put(name, label);
}
int pos = position();
label.setAddress(pos);
labelMap.put(pos, label);
... | [
"public",
"void",
"fixAddress",
"(",
"String",
"name",
")",
"throws",
"IOException",
"{",
"Label",
"label",
"=",
"labels",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"label",
"==",
"null",
")",
"{",
"label",
"=",
"new",
"Label",
"(",
"name",
")",
... | Fixes address here for object
@param name
@throws IOException | [
"Fixes",
"address",
"here",
"for",
"object"
] | 4e84e313018d487f1a8cca3952d71bc21e77d16b | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/Assembler.java#L124-L135 | train |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/Assembler.java | Assembler.createBranch | public Branch createBranch(String name) throws IOException
{
Label label = labels.get(name);
if (label == null)
{
label = new Label(name);
labels.put(name, label);
}
return label.createBranch(position());
} | java | public Branch createBranch(String name) throws IOException
{
Label label = labels.get(name);
if (label == null)
{
label = new Label(name);
labels.put(name, label);
}
return label.createBranch(position());
} | [
"public",
"Branch",
"createBranch",
"(",
"String",
"name",
")",
"throws",
"IOException",
"{",
"Label",
"label",
"=",
"labels",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"label",
"==",
"null",
")",
"{",
"label",
"=",
"new",
"Label",
"(",
"name",
"... | Creates a branch for possibly unknown address
@param name
@return
@throws IOException | [
"Creates",
"a",
"branch",
"for",
"possibly",
"unknown",
"address"
] | 4e84e313018d487f1a8cca3952d71bc21e77d16b | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/Assembler.java#L159-L168 | train |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/Assembler.java | Assembler.ifeq | public void ifeq(String target) throws IOException
{
if (wideIndex)
{
out.writeByte(NOT_IFEQ);
out.writeShort(WIDEFIXOFFSET);
Branch branch = createBranch(target);
out.writeByte(GOTO_W);
out.writeInt(branch);
}
else
... | java | public void ifeq(String target) throws IOException
{
if (wideIndex)
{
out.writeByte(NOT_IFEQ);
out.writeShort(WIDEFIXOFFSET);
Branch branch = createBranch(target);
out.writeByte(GOTO_W);
out.writeInt(branch);
}
else
... | [
"public",
"void",
"ifeq",
"(",
"String",
"target",
")",
"throws",
"IOException",
"{",
"if",
"(",
"wideIndex",
")",
"{",
"out",
".",
"writeByte",
"(",
"NOT_IFEQ",
")",
";",
"out",
".",
"writeShort",
"(",
"WIDEFIXOFFSET",
")",
";",
"Branch",
"branch",
"=",... | eq succeeds if and only if value == 0
@param target
@throws IOException | [
"eq",
"succeeds",
"if",
"and",
"only",
"if",
"value",
"==",
"0"
] | 4e84e313018d487f1a8cca3952d71bc21e77d16b | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/Assembler.java#L998-L1014 | train |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/Assembler.java | Assembler.ifne | public void ifne(String target) throws IOException
{
if (wideIndex)
{
out.writeByte(NOT_IFNE);
out.writeShort(WIDEFIXOFFSET);
Branch branch = createBranch(target);
out.writeByte(GOTO_W);
out.writeInt(branch);
}
else
... | java | public void ifne(String target) throws IOException
{
if (wideIndex)
{
out.writeByte(NOT_IFNE);
out.writeShort(WIDEFIXOFFSET);
Branch branch = createBranch(target);
out.writeByte(GOTO_W);
out.writeInt(branch);
}
else
... | [
"public",
"void",
"ifne",
"(",
"String",
"target",
")",
"throws",
"IOException",
"{",
"if",
"(",
"wideIndex",
")",
"{",
"out",
".",
"writeByte",
"(",
"NOT_IFNE",
")",
";",
"out",
".",
"writeShort",
"(",
"WIDEFIXOFFSET",
")",
";",
"Branch",
"branch",
"=",... | ne succeeds if and only if value != 0
@param target
@throws IOException | [
"ne",
"succeeds",
"if",
"and",
"only",
"if",
"value",
"!",
"=",
"0"
] | 4e84e313018d487f1a8cca3952d71bc21e77d16b | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/Assembler.java#L1021-L1037 | train |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/Assembler.java | Assembler.iflt | public void iflt(String target) throws IOException
{
if (wideIndex)
{
out.writeByte(NOT_IFLT);
out.writeShort(WIDEFIXOFFSET);
Branch branch = createBranch(target);
out.writeByte(GOTO_W);
out.writeInt(branch);
}
else
... | java | public void iflt(String target) throws IOException
{
if (wideIndex)
{
out.writeByte(NOT_IFLT);
out.writeShort(WIDEFIXOFFSET);
Branch branch = createBranch(target);
out.writeByte(GOTO_W);
out.writeInt(branch);
}
else
... | [
"public",
"void",
"iflt",
"(",
"String",
"target",
")",
"throws",
"IOException",
"{",
"if",
"(",
"wideIndex",
")",
"{",
"out",
".",
"writeByte",
"(",
"NOT_IFLT",
")",
";",
"out",
".",
"writeShort",
"(",
"WIDEFIXOFFSET",
")",
";",
"Branch",
"branch",
"=",... | lt succeeds if and only if value < 0
@param target
@throws IOException | [
"lt",
"succeeds",
"if",
"and",
"only",
"if",
"value",
"<",
";",
"0"
] | 4e84e313018d487f1a8cca3952d71bc21e77d16b | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/Assembler.java#L1044-L1060 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.