repo stringclasses 199
values | path stringlengths 28 169 | func_name stringlengths 6 98 | original_string stringlengths 91 27.2k | language stringclasses 1
value | code stringlengths 91 27.2k | code_tokens listlengths 21 5.01k | docstring stringlengths 1 6.47k | docstring_tokens listlengths 1 587 | sha stringclasses 199
values | url stringlengths 117 257 | partition stringclasses 1
value | summary stringlengths 3 207 | output stringlengths 170 27.3k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/db/metadata/GeometryMetadataDataSource.java | GeometryMetadataDataSource.count | public int count(String geoPackage, String tableName, BoundingBox boundingBox) {
return count(getGeoPackageId(geoPackage), tableName, boundingBox);
} | java | public int count(String geoPackage, String tableName, BoundingBox boundingBox) {
return count(getGeoPackageId(geoPackage), tableName, boundingBox);
} | [
"public",
"int",
"count",
"(",
"String",
"geoPackage",
",",
"String",
"tableName",
",",
"BoundingBox",
"boundingBox",
")",
"{",
"return",
"count",
"(",
"getGeoPackageId",
"(",
"geoPackage",
")",
",",
"tableName",
",",
"boundingBox",
")",
";",
"}"
] | Query for all table geometry metadata count matching the bounding box in the same projection
@param geoPackage GeoPackage name
@param tableName table name
@param boundingBox bounding box
@return count
@since 1.1.0 | [
"Query",
"for",
"all",
"table",
"geometry",
"metadata",
"count",
"matching",
"the",
"bounding",
"box",
"in",
"the",
"same",
"projection"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/db/metadata/GeometryMetadataDataSource.java#L477-L479 | test | Count the number of documents in a table in a geoPackage | Of course, here is the Java code you requested:
```java
public int count(String geoPackage, String tableName, BoundingBox boundingBox) {
return count(getGeoPackageId(geoPackage), tableName, boundingBox);
}
```
Hope this helps! |
snakerflow/snakerflow | snaker-core/src/main/java/org/snaker/engine/helper/ConfigHelper.java | ConfigHelper.getProperty | public static String getProperty(String key) {
if (key == null) {
return null;
}
return getProperties().getProperty(key);
} | java | public static String getProperty(String key) {
if (key == null) {
return null;
}
return getProperties().getProperty(key);
} | [
"public",
"static",
"String",
"getProperty",
"(",
"String",
"key",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"getProperties",
"(",
")",
".",
"getProperty",
"(",
"key",
")",
";",
"}"
] | 根据key获取配置的字符串value值
@param key
@return | [
"根据key获取配置的字符串value值"
] | 9c8cb3148a76702f1eda22f1d113053cb44b1eff | https://github.com/snakerflow/snakerflow/blob/9c8cb3148a76702f1eda22f1d113053cb44b1eff/snaker-core/src/main/java/org/snaker/engine/helper/ConfigHelper.java#L59-L64 | test | Gets the value of a resource attribute. | Of course, here is the Java code you requested:
```java
public static String getProperty(String key) {
if (key == null) {
return null;
}
return getProperties().getProperty(key);
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/unidata/geoloc/projection/Sinusoidal.java | Sinusoidal.crossSeam | @Override
public boolean crossSeam(ProjectionPoint pt1, ProjectionPoint pt2) {
// either point is infinite
if (ProjectionPointImpl.isInfinite(pt1) || ProjectionPointImpl.isInfinite(pt2)) {
return true;
}
// opposite signed long lines
double x1 = pt1.getX(... | java | @Override
public boolean crossSeam(ProjectionPoint pt1, ProjectionPoint pt2) {
// either point is infinite
if (ProjectionPointImpl.isInfinite(pt1) || ProjectionPointImpl.isInfinite(pt2)) {
return true;
}
// opposite signed long lines
double x1 = pt1.getX(... | [
"@",
"Override",
"public",
"boolean",
"crossSeam",
"(",
"ProjectionPoint",
"pt1",
",",
"ProjectionPoint",
"pt2",
")",
"{",
"// either point is infinite\r",
"if",
"(",
"ProjectionPointImpl",
".",
"isInfinite",
"(",
"pt1",
")",
"||",
"ProjectionPointImpl",
".",
"isInf... | Does the line between these two points cross the projection "seam".
@param pt1 the line goes between these two points
@param pt2 the line goes between these two points
@return false if there is no seam | [
"Does",
"the",
"line",
"between",
"these",
"two",
"points",
"cross",
"the",
"projection",
"seam",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/projection/Sinusoidal.java#L214-L225 | test | This method is used to determine if two points cross the earth radius. | Of course, here is the Java code you requested:
```java
@Override
public boolean crossSeam(ProjectionPoint pt1, ProjectionPoint pt2) {
// either point is infinite
if (ProjectionPointImpl.isInfinite(pt1) || ProjectionPointImpl.isInfinite(pt2)) {
return true;
}
// ... |
kiegroup/droolsjbpm-tools | drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/completion/DSLTree.java | DSLTree.getConditionChildrenList | public ArrayList<String> getConditionChildrenList(String text, boolean addChildren) {
Node[] c = getConditionChildren(text);
this.suggestions.clear();
for (int idx=0; idx < c.length; idx++) {
this.suggestions.add(c[idx].getToken());
if (addChildren) {
this... | java | public ArrayList<String> getConditionChildrenList(String text, boolean addChildren) {
Node[] c = getConditionChildren(text);
this.suggestions.clear();
for (int idx=0; idx < c.length; idx++) {
this.suggestions.add(c[idx].getToken());
if (addChildren) {
this... | [
"public",
"ArrayList",
"<",
"String",
">",
"getConditionChildrenList",
"(",
"String",
"text",
",",
"boolean",
"addChildren",
")",
"{",
"Node",
"[",
"]",
"c",
"=",
"getConditionChildren",
"(",
"text",
")",
";",
"this",
".",
"suggestions",
".",
"clear",
"(",
... | for convienance, the method will return a list of strings
that are children of the last node found. If the editor
wants to generate the children strings, call the method
with true
@param text
@return | [
"for",
"convienance",
"the",
"method",
"will",
"return",
"a",
"list",
"of",
"strings",
"that",
"are",
"children",
"of",
"the",
"last",
"node",
"found",
".",
"If",
"the",
"editor",
"wants",
"to",
"generate",
"the",
"children",
"strings",
"call",
"the",
"met... | 05e1f73c591178360a198dca29f99d73918991db | https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/completion/DSLTree.java#L377-L387 | test | Gets the condition children list. | Of course, here is the Java code you requested:
```java
public ArrayList<String> getConditionChildrenList(String text, boolean addChildren) {
Node[] c = getConditionChildren(text);
this.suggestions.clear();
for (int idx=0; idx < c.length; idx++) {
this.suggestions.add(c[idx].getToke... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/ft2/coverage/adapter/GeoGridCoordinate2D.java | GeoGridCoordinate2D.jump2 | private boolean jump2(double wantLat, double wantLon, int[] rectIndex) {
int row = Math.max( Math.min(rectIndex[0], nrows-1), 0);
int col = Math.max(Math.min(rectIndex[1], ncols - 1), 0);
double lat = latEdge.get(row, col);
double lon = lonEdge.get(row, col);
double diffLat = wantLat - lat;
dou... | java | private boolean jump2(double wantLat, double wantLon, int[] rectIndex) {
int row = Math.max( Math.min(rectIndex[0], nrows-1), 0);
int col = Math.max(Math.min(rectIndex[1], ncols - 1), 0);
double lat = latEdge.get(row, col);
double lon = lonEdge.get(row, col);
double diffLat = wantLat - lat;
dou... | [
"private",
"boolean",
"jump2",
"(",
"double",
"wantLat",
",",
"double",
"wantLon",
",",
"int",
"[",
"]",
"rectIndex",
")",
"{",
"int",
"row",
"=",
"Math",
".",
"max",
"(",
"Math",
".",
"min",
"(",
"rectIndex",
"[",
"0",
"]",
",",
"nrows",
"-",
"1",... | /*
choose x, y such that (matrix multiply) :
(wantx) = (fxx fxy) (x)
(wanty) (fyx fyy) (y)
where fxx = d(fx)/dx ~= delta lon in lon direction
where fxy = d(fx)/dy ~= delta lon in lat direction
where fyx = d(fy)/dx ~= delta lat in lon direction
where fyy = d(fy)/dy ~= delta lat in lat direction
2 linear equat... | [
"/",
"*",
"choose",
"x",
"y",
"such",
"that",
"(",
"matrix",
"multiply",
")",
":"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft2/coverage/adapter/GeoGridCoordinate2D.java#L280-L317 | test | Jump 2 from the original code to the original code. | Of course, here is the Java code you requested:
```java
private boolean jump2(double wantLat, double wantLon, int[] rectIndex) {
int row = Math.max( Math.min(rectIndex[0], nrows-1), 0);
int col = Math.max(Math.min(rectIndex[1], ncols - 1), 0);
double lat = latEdge.get(row, col);
double lon = lonEdge.g... |
TeachingKidsProgramming/TeachingKidsProgramming.Source.Java | src/main/java/org/teachingextensions/approvals/lite/util/ObjectUtils.java | ObjectUtils.isEqual | public static boolean isEqual(Object s1, Object s2) {
return s1 == s2 || (s1 != null) && s1.equals(s2);
} | java | public static boolean isEqual(Object s1, Object s2) {
return s1 == s2 || (s1 != null) && s1.equals(s2);
} | [
"public",
"static",
"boolean",
"isEqual",
"(",
"Object",
"s1",
",",
"Object",
"s2",
")",
"{",
"return",
"s1",
"==",
"s2",
"||",
"(",
"s1",
"!=",
"null",
")",
"&&",
"s1",
".",
"equals",
"(",
"s2",
")",
";",
"}"
] | A convenience function to check if two objects are equal.
@param s1
The first object
@param s2
The second object
@return true if Equal. | [
"A",
"convenience",
"function",
"to",
"check",
"if",
"two",
"objects",
"are",
"equal",
"."
] | 516fee15e537ecdb3f4dcbe3695c5cfde7e930da | https://github.com/TeachingKidsProgramming/TeachingKidsProgramming.Source.Java/blob/516fee15e537ecdb3f4dcbe3695c5cfde7e930da/src/main/java/org/teachingextensions/approvals/lite/util/ObjectUtils.java#L22-L24 | test | Returns true if the two objects are equal. | Of course, here is the Java code you requested:
```java
public static boolean isEqual(Object s1, Object s2) {
return s1 == s2 || (s1 != null) && s1.equals(s2);
}
```
Hope this helps! |
RestComm/jain-slee | container/common/src/main/java/org/mobicents/slee/container/deployment/jboss/DeployableUnit.java | DeployableUnit.parseDUDeployConfig | private void parseDUDeployConfig() throws Exception {
JarFile componentJarFile = new JarFile(diURL.getFile());
try {
// Get the JarEntry for the deploy-config.xml
JarEntry deployInfoXML = componentJarFile
.getJarEntry("META-INF/deploy-config.xml");
if (deployInfoXML != null) {
DeployConfig... | java | private void parseDUDeployConfig() throws Exception {
JarFile componentJarFile = new JarFile(diURL.getFile());
try {
// Get the JarEntry for the deploy-config.xml
JarEntry deployInfoXML = componentJarFile
.getJarEntry("META-INF/deploy-config.xml");
if (deployInfoXML != null) {
DeployConfig... | [
"private",
"void",
"parseDUDeployConfig",
"(",
")",
"throws",
"Exception",
"{",
"JarFile",
"componentJarFile",
"=",
"new",
"JarFile",
"(",
"diURL",
".",
"getFile",
"(",
")",
")",
";",
"try",
"{",
"// Get the JarEntry for the deploy-config.xml\r",
"JarEntry",
"deploy... | Parser for the deployment config xml.
@throws Exception | [
"Parser",
"for",
"the",
"deployment",
"config",
"xml",
"."
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/common/src/main/java/org/mobicents/slee/container/deployment/jboss/DeployableUnit.java#L368-L389 | test | Parses the DU - Deploy - Config. xml file. | Of course, here is the Java code you requested:
```java
private void parseDUDeployConfig() throws Exception {
JarFile componentJarFile = new JarFile(diURL.getFile());
try {
// Get the JarEntry for the deploy-config.xml
JarEntry deployInfoXML = componentJarFile
.getJarEntry("META-INF/deploy-config.... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLFindReferences.java | OCommandExecutorSQLFindReferences.execute | public Object execute(final Map<Object, Object> iArgs) {
if (recordIds.isEmpty() && subQuery == null)
throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet");
if (subQuery != null) {
final List<OIdentifiable> result = new OCommandSQL(subQuery.toStr... | java | public Object execute(final Map<Object, Object> iArgs) {
if (recordIds.isEmpty() && subQuery == null)
throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet");
if (subQuery != null) {
final List<OIdentifiable> result = new OCommandSQL(subQuery.toStr... | [
"public",
"Object",
"execute",
"(",
"final",
"Map",
"<",
"Object",
",",
"Object",
">",
"iArgs",
")",
"{",
"if",
"(",
"recordIds",
".",
"isEmpty",
"(",
")",
"&&",
"subQuery",
"==",
"null",
")",
"throw",
"new",
"OCommandExecutionException",
"(",
"\"Cannot ex... | Execute the FIND REFERENCES. | [
"Execute",
"the",
"FIND",
"REFERENCES",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLFindReferences.java#L104-L115 | test | Execute the
command. | Of course, here is the Java code you requested:
```java
public Object execute(final Map<Object, Object> iArgs) {
if (recordIds.isEmpty() && subQuery == null)
throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet");
if (subQuery != null) {
final Li... |
streamsets/datacollector | kinetica-protolib/src/main/java/com/streamsets/pipeline/stage/kinetica/util/KineticaTableUtils.java | KineticaTableUtils.getTableSchema | private JSONObject getTableSchema(String tableName, ShowTableResponse showTableResponse) throws GPUdbException {
List<String> schemas = showTableResponse.getTypeSchemas();
if (schemas == null || schemas.size() != 1) {
throw new GPUdbException("Error getting schema for table " + tableName);
}
re... | java | private JSONObject getTableSchema(String tableName, ShowTableResponse showTableResponse) throws GPUdbException {
List<String> schemas = showTableResponse.getTypeSchemas();
if (schemas == null || schemas.size() != 1) {
throw new GPUdbException("Error getting schema for table " + tableName);
}
re... | [
"private",
"JSONObject",
"getTableSchema",
"(",
"String",
"tableName",
",",
"ShowTableResponse",
"showTableResponse",
")",
"throws",
"GPUdbException",
"{",
"List",
"<",
"String",
">",
"schemas",
"=",
"showTableResponse",
".",
"getTypeSchemas",
"(",
")",
";",
"if",
... | Get the table's schema as a JSON Object | [
"Get",
"the",
"table",
"s",
"schema",
"as",
"a",
"JSON",
"Object"
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/kinetica-protolib/src/main/java/com/streamsets/pipeline/stage/kinetica/util/KineticaTableUtils.java#L201-L210 | test | Get the schema for a table | Of course, here is the Java code you requested:
```java
private JSONObject getTableSchema(String tableName, ShowTableResponse showTableResponse) throws GPUdbException {
List<String> schemas = showTableResponse.getTypeSchemas();
if (schemas == null || schemas.size() != 1) {
throw new GPUdbException("Err... |
kiegroup/droolsjbpm-tools | drools-eclipse/org.guvnor.eclipse.webdav/src/client/org/eclipse/webdav/client/AbstractResourceHandle.java | AbstractResourceHandle.getProperty | public PropertyStatus getProperty(QualifiedName propertyName) throws DAVException {
Collection names = new HashSet();
names.add(propertyName);
URLTable result = getProperties(names, IContext.DEPTH_ZERO);
URL url = null;
try {
url = new URL(locator.getResourceURL());
... | java | public PropertyStatus getProperty(QualifiedName propertyName) throws DAVException {
Collection names = new HashSet();
names.add(propertyName);
URLTable result = getProperties(names, IContext.DEPTH_ZERO);
URL url = null;
try {
url = new URL(locator.getResourceURL());
... | [
"public",
"PropertyStatus",
"getProperty",
"(",
"QualifiedName",
"propertyName",
")",
"throws",
"DAVException",
"{",
"Collection",
"names",
"=",
"new",
"HashSet",
"(",
")",
";",
"names",
".",
"add",
"(",
"propertyName",
")",
";",
"URLTable",
"result",
"=",
"ge... | Return the property status for the property with the given name.
@param propertyName the name of the property
@return the property status
@exception DAVException if there was a problem getting the property
@see #getProperties(Collection, String) | [
"Return",
"the",
"property",
"status",
"for",
"the",
"property",
"with",
"the",
"given",
"name",
"."
] | 05e1f73c591178360a198dca29f99d73918991db | https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/client/org/eclipse/webdav/client/AbstractResourceHandle.java#L600-L616 | test | Get a property status by name. | Of course, here is the Java code you requested:
```java
public PropertyStatus getProperty(QualifiedName propertyName) throws DAVException {
Collection names = new HashSet();
names.add(propertyName);
URLTable result = getProperties(names, IContext.DEPTH_ZERO);
URL url = null;
tr... |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/dataobjects/CellMap.java | CellMap.put | @Override
public final Object put(final Object key, final Object value) {
try {
CellMapKey mkey = new CellMapKey((String) key);
if (!mkey.isParseSuccess()) {
return null;
}
Cell poiCell = parent.getCellHelper()
.getPoiCellWithRowColFromCurrentPage(mkey.getRowIndex(),
mkey.getColI... | java | @Override
public final Object put(final Object key, final Object value) {
try {
CellMapKey mkey = new CellMapKey((String) key);
if (!mkey.isParseSuccess()) {
return null;
}
Cell poiCell = parent.getCellHelper()
.getPoiCellWithRowColFromCurrentPage(mkey.getRowIndex(),
mkey.getColI... | [
"@",
"Override",
"public",
"final",
"Object",
"put",
"(",
"final",
"Object",
"key",
",",
"final",
"Object",
"value",
")",
"{",
"try",
"{",
"CellMapKey",
"mkey",
"=",
"new",
"CellMapKey",
"(",
"(",
"String",
")",
"key",
")",
";",
"if",
"(",
"!",
"mkey... | /*
(non-Javadoc)
@see java.util.Map#put(java.lang.Object, java.lang.Object) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/dataobjects/CellMap.java#L269-L306 | test | Updates the value of the specified key in this cell map. | Of course, here is the Java code you requested:
```java
@Override
public final Object put(final Object key, final Object value) {
try {
CellMapKey mkey = new CellMapKey((String) key);
if (!mkey.isParseSuccess()) {
return null;
}
Cell poiCell = parent.getCellHelper()
.getPoiCellWithRowCo... |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/utility/CellUtility.java | CellUtility.matchCommentSettings | private static void matchCommentSettings(final Cell newCell, final Cell sourceCell) {
try {
XSSFVMLDrawing sourceVml = getVmlDrawingFromCell(sourceCell);
XSSFVMLDrawing targetVml = getVmlDrawingFromCell(newCell);
CTShape sourceCtShape = getCtShapeFromVml(sourceCell, sourceVml);
CTShape targetCtShape ... | java | private static void matchCommentSettings(final Cell newCell, final Cell sourceCell) {
try {
XSSFVMLDrawing sourceVml = getVmlDrawingFromCell(sourceCell);
XSSFVMLDrawing targetVml = getVmlDrawingFromCell(newCell);
CTShape sourceCtShape = getCtShapeFromVml(sourceCell, sourceVml);
CTShape targetCtShape ... | [
"private",
"static",
"void",
"matchCommentSettings",
"(",
"final",
"Cell",
"newCell",
",",
"final",
"Cell",
"sourceCell",
")",
"{",
"try",
"{",
"XSSFVMLDrawing",
"sourceVml",
"=",
"getVmlDrawingFromCell",
"(",
"sourceCell",
")",
";",
"XSSFVMLDrawing",
"targetVml",
... | Use low level API to match the comments setting.
@param newCell
target cell.
@param sourceCell
source cell. | [
"Use",
"low",
"level",
"API",
"to",
"match",
"the",
"comments",
"setting",
"."
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/utility/CellUtility.java#L613-L634 | test | Handles the creation of a new cell with the comment settings. | Of course, here is the Java code you requested:
```java
private static void matchCommentSettings(final Cell newCell, final Cell sourceCell) {
try {
XSSFVMLDrawing sourceVml = getVmlDrawingFromCell(sourceCell);
XSSFVMLDrawing targetVml = getVmlDrawingFromCell(newCell);
CTShape sourceCtShape = getCtShapeF... |
rest-assured/rest-assured | json-path/src/main/java/io/restassured/path/json/JsonPath.java | JsonPath.getShort | public short getShort(String path) {
//The type returned from Groovy depends on the input, so we need to handle different numerical types.
Object value = get(path);
if (value instanceof Short) {
return (Short) value;
} else if (value instanceof Long) {
return ((Lo... | java | public short getShort(String path) {
//The type returned from Groovy depends on the input, so we need to handle different numerical types.
Object value = get(path);
if (value instanceof Short) {
return (Short) value;
} else if (value instanceof Long) {
return ((Lo... | [
"public",
"short",
"getShort",
"(",
"String",
"path",
")",
"{",
"//The type returned from Groovy depends on the input, so we need to handle different numerical types.",
"Object",
"value",
"=",
"get",
"(",
"path",
")",
";",
"if",
"(",
"value",
"instanceof",
"Short",
")",
... | Get the result of an Object path expression as a short.
@param path The Object path.
@return The object matching the Object path. A {@link java.lang.ClassCastException} will be thrown if the object
cannot be casted to the expected type. | [
"Get",
"the",
"result",
"of",
"an",
"Object",
"path",
"expression",
"as",
"a",
"short",
"."
] | 165a85b65070f5a07fe0045175613fb2c2811642 | https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/json-path/src/main/java/io/restassured/path/json/JsonPath.java#L277-L289 | test | Gets the value of the attribute as a short. | Of course, here is the Java code you requested:
```java
public short getShort(String path) {
//The type returned from Groovy depends on the input, so we need to handle different numerical types.
Object value = get(path);
if (value instanceof Short) {
return (Short) value;
} ... |
moparisthebest/aptIn16 | apt-mirror-api/src/main/java/com/sun/mirror/util/DeclarationFilter.java | DeclarationFilter.filter | public <D extends Declaration> Collection<D>
filter(Collection<? extends Declaration> decls, Class<D> resType) {
ArrayList<D> res = new ArrayList<D>(decls.size());
for (Declaration d : decls) {
if (resType.isInstance(d) && matches(d)) {
res.add(resType.cast(d));
}
}
return res;
} | java | public <D extends Declaration> Collection<D>
filter(Collection<? extends Declaration> decls, Class<D> resType) {
ArrayList<D> res = new ArrayList<D>(decls.size());
for (Declaration d : decls) {
if (resType.isInstance(d) && matches(d)) {
res.add(resType.cast(d));
}
}
return res;
} | [
"public",
"<",
"D",
"extends",
"Declaration",
">",
"Collection",
"<",
"D",
">",
"filter",
"(",
"Collection",
"<",
"?",
"extends",
"Declaration",
">",
"decls",
",",
"Class",
"<",
"D",
">",
"resType",
")",
"{",
"ArrayList",
"<",
"D",
">",
"res",
"=",
"... | Returns the declarations matched by this filter, with the result
being restricted to declarations of a given kind.
Similar to the simpler
{@linkplain #filter(Collection) single-parameter version}
of <tt>filter</tt>, but the result type is specified explicitly.
@param <D> type of the declarations being returned
@pa... | [
"Returns",
"the",
"declarations",
"matched",
"by",
"this",
"filter",
"with",
"the",
"result",
"being",
"restricted",
"to",
"declarations",
"of",
"a",
"given",
"kind",
".",
"Similar",
"to",
"the",
"simpler",
"{",
"@linkplain",
"#filter",
"(",
"Collection",
")",... | de38f7add09e69cb5ff970d1bada079a162358e7 | https://github.com/moparisthebest/aptIn16/blob/de38f7add09e69cb5ff970d1bada079a162358e7/apt-mirror-api/src/main/java/com/sun/mirror/util/DeclarationFilter.java#L266-L275 | test | Returns a collection of Declaration objects that match the given filter. | Of course, here is the Java code you requested:
```java
public <D extends Declaration> Collection<D>
filter(Collection<? extends Declaration> decls, Class<D> resType) {
ArrayList<D> res = new ArrayList<D>(decls.size());
for (Declaration d : decls) {
if (resType.isInstance(d) && matches(d)) {
res.add(r... |
ReactiveX/RxJava | src/main/java/io/reactivex/Flowable.java | Flowable.takeLast | @CheckReturnValue
@NonNull
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final Flowable<T> takeLast(long count, long time, TimeUnit unit, Scheduler scheduler, boolean delayError, int bufferSize) {
ObjectHelper.requireNonNull(unit, "unit is null");
... | java | @CheckReturnValue
@NonNull
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final Flowable<T> takeLast(long count, long time, TimeUnit unit, Scheduler scheduler, boolean delayError, int bufferSize) {
ObjectHelper.requireNonNull(unit, "unit is null");
... | [
"@",
"CheckReturnValue",
"@",
"NonNull",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"FULL",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"CUSTOM",
")",
"public",
"final",
"Flowable",
"<",
"T",
">",
"takeLast",
"(",
"long",
"count",
... | Returns a Flowable that emits at most a specified number of items from the source Publisher that were
emitted in a specified window of time before the Publisher completed, where the timing information is
provided by a given Scheduler.
<p>
<img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/i... | [
"Returns",
"a",
"Flowable",
"that",
"emits",
"at",
"most",
"a",
"specified",
"number",
"of",
"items",
"from",
"the",
"source",
"Publisher",
"that",
"were",
"emitted",
"in",
"a",
"specified",
"window",
"of",
"time",
"before",
"the",
"Publisher",
"completed",
... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L15615-L15627 | test | Returns an Flowable that emits the last element of the stream in the sequence. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@NonNull
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final Flowable<T> takeLast(long count, long time, TimeUnit unit, Scheduler scheduler, boolean delayError, int bufferSize) {
... |
Unidata/thredds | httpservices/src/main/java/ucar/httpservices/HTTPSession.java | HTTPSession.setGlobalCredentials | static public void
setGlobalCredentials(Credentials creds, AuthScope scope)
throws HTTPException
{
assert (creds != null);
if(scope == null) scope = AuthScope.ANY;
CredentialsProvider provider = new BasicCredentialsProvider();
provider.setCredentials(scope, creds);
... | java | static public void
setGlobalCredentials(Credentials creds, AuthScope scope)
throws HTTPException
{
assert (creds != null);
if(scope == null) scope = AuthScope.ANY;
CredentialsProvider provider = new BasicCredentialsProvider();
provider.setCredentials(scope, creds);
... | [
"static",
"public",
"void",
"setGlobalCredentials",
"(",
"Credentials",
"creds",
",",
"AuthScope",
"scope",
")",
"throws",
"HTTPException",
"{",
"assert",
"(",
"creds",
"!=",
"null",
")",
";",
"if",
"(",
"scope",
"==",
"null",
")",
"scope",
"=",
"AuthScope",... | It is convenient to be able to directly set the Credentials
(not the provider) when those credentials are fixed.
@param creds
@param scope where to use it (i.e. on what host)
@throws HTTPException | [
"It",
"is",
"convenient",
"to",
"be",
"able",
"to",
"directly",
"set",
"the",
"Credentials",
"(",
"not",
"the",
"provider",
")",
"when",
"those",
"credentials",
"are",
"fixed",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/httpservices/src/main/java/ucar/httpservices/HTTPSession.java#L795-L804 | test | Set the global credentials for the CDN. | Of course, here is the Java code you requested:
```java
static public void
setGlobalCredentials(Credentials creds, AuthScope scope)
throws HTTPException
{
assert (creds != null);
if(scope == null) scope = AuthScope.ANY;
CredentialsProvider provider = new BasicCredentialsProv... |
stanfy/enroscar | io/src/main/java/com/stanfy/enroscar/io/IoUtils.java | IoUtils.getUncompressedInputStream | public static InputStream getUncompressedInputStream(final String encoding, final InputStream source) throws IOException {
if (ENCODING_GZIP.equalsIgnoreCase(encoding)) {
return new GZIPInputStream(source);
}
if (ENCODING_DEFLATE.equalsIgnoreCase(encoding)) {
final Inflater inflater = new Inflat... | java | public static InputStream getUncompressedInputStream(final String encoding, final InputStream source) throws IOException {
if (ENCODING_GZIP.equalsIgnoreCase(encoding)) {
return new GZIPInputStream(source);
}
if (ENCODING_DEFLATE.equalsIgnoreCase(encoding)) {
final Inflater inflater = new Inflat... | [
"public",
"static",
"InputStream",
"getUncompressedInputStream",
"(",
"final",
"String",
"encoding",
",",
"final",
"InputStream",
"source",
")",
"throws",
"IOException",
"{",
"if",
"(",
"ENCODING_GZIP",
".",
"equalsIgnoreCase",
"(",
"encoding",
")",
")",
"{",
"ret... | Wraps the supplied stream into either {@link GZIPInputStream} or {@link InflaterInputStream}
depending on {@code encoding} parameter value.
@param encoding content encoding, supported values: {@link #ENCODING_GZIP}, {@link #ENCODING_DEFLATE}
@param source source stream
@return the uncompressed {@link InputStream}
@see... | [
"Wraps",
"the",
"supplied",
"stream",
"into",
"either",
"{",
"@link",
"GZIPInputStream",
"}",
"or",
"{",
"@link",
"InflaterInputStream",
"}",
"depending",
"on",
"{",
"@code",
"encoding",
"}",
"parameter",
"value",
"."
] | 0e64f3c309d62e359b55ddcba10e3cc592f5e083 | https://github.com/stanfy/enroscar/blob/0e64f3c309d62e359b55ddcba10e3cc592f5e083/io/src/main/java/com/stanfy/enroscar/io/IoUtils.java#L176-L185 | test | Get an input stream that is compressed according to the given encoding. | Of course, here is the Java code you requested:
```java
public static InputStream getUncompressedInputStream(final String encoding, final InputStream source) throws IOException {
if (ENCODING_GZIP.equalsIgnoreCase(encoding)) {
return new GZIPInputStream(source);
}
if (ENCODING_DEFLATE.equalsIgnoreCas... |
google/guice | core/src/com/google/inject/internal/InjectorImpl.java | InjectorImpl.enterContext | InternalContext enterContext() {
Object[] reference = localContext.get();
if (reference == null) {
reference = new Object[1];
localContext.set(reference);
}
InternalContext ctx = (InternalContext) reference[0];
if (ctx == null) {
reference[0] = ctx = new InternalContext(options, re... | java | InternalContext enterContext() {
Object[] reference = localContext.get();
if (reference == null) {
reference = new Object[1];
localContext.set(reference);
}
InternalContext ctx = (InternalContext) reference[0];
if (ctx == null) {
reference[0] = ctx = new InternalContext(options, re... | [
"InternalContext",
"enterContext",
"(",
")",
"{",
"Object",
"[",
"]",
"reference",
"=",
"localContext",
".",
"get",
"(",
")",
";",
"if",
"(",
"reference",
"==",
"null",
")",
"{",
"reference",
"=",
"new",
"Object",
"[",
"1",
"]",
";",
"localContext",
".... | Looks up thread local context and {@link InternalContext#enter() enters} it or creates a new
context if necessary.
<p>All callers of this are responsible for calling {@link InternalContext#close()}. Typical
usage should look like:
<pre>{@code
InternalContext ctx = injector.enterContext();
try {
... use ctx ...
} fina... | [
"Looks",
"up",
"thread",
"local",
"context",
"and",
"{",
"@link",
"InternalContext#enter",
"()",
"enters",
"}",
"it",
"or",
"creates",
"a",
"new",
"context",
"if",
"necessary",
"."
] | a0552a16d813ead98fe73737fb001db336650251 | https://github.com/google/guice/blob/a0552a16d813ead98fe73737fb001db336650251/core/src/com/google/inject/internal/InjectorImpl.java#L1166-L1179 | test | Enter a context. | Of course, here is the Java code you requested:
```java
InternalContext enterContext() {
Object[] reference = localContext.get();
if (reference == null) {
reference = new Object[1];
localContext.set(reference);
}
InternalContext ctx = (InternalContext) reference[0];
if (ctx == null) {
... |
Unidata/thredds | legacy/src/main/java/ucar/nc2/NetcdfFileWriteable.java | NetcdfFileWriteable.openExisting | static public NetcdfFileWriteable openExisting(String location, boolean fill) throws IOException {
return new NetcdfFileWriteable(location, fill, true);
} | java | static public NetcdfFileWriteable openExisting(String location, boolean fill) throws IOException {
return new NetcdfFileWriteable(location, fill, true);
} | [
"static",
"public",
"NetcdfFileWriteable",
"openExisting",
"(",
"String",
"location",
",",
"boolean",
"fill",
")",
"throws",
"IOException",
"{",
"return",
"new",
"NetcdfFileWriteable",
"(",
"location",
",",
"fill",
",",
"true",
")",
";",
"}"
] | Open an existing Netcdf file for writing data.
Cannot add new objects, you can only read/write data to existing Variables.
Setting fill = false is more efficient, use when you know you will write all data.
@param location name of existing file to open.
@param fill if true, the data is first written with fill value... | [
"Open",
"an",
"existing",
"Netcdf",
"file",
"for",
"writing",
"data",
".",
"Cannot",
"add",
"new",
"objects",
"you",
"can",
"only",
"read",
"/",
"write",
"data",
"to",
"existing",
"Variables",
".",
"Setting",
"fill",
"=",
"false",
"is",
"more",
"efficient"... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/ucar/nc2/NetcdfFileWriteable.java#L59-L61 | test | Open an existing file. | Of course, here is the Java code you requested:
```java
static public NetcdfFileWriteable openExisting(String location, boolean fill) throws IOException {
return new NetcdfFileWriteable(location, fill, true);
}
```
Hope this helps! |
objectify/objectify | src/main/java/com/googlecode/objectify/repackaged/gentyref/GenericTypeReflector.java | GenericTypeReflector.isMissingTypeParameters | static boolean isMissingTypeParameters(Type type) {
if (type instanceof Class) {
for (Class<?> clazz = (Class<?>) type; clazz != null; clazz = clazz.getEnclosingClass()) {
if (clazz.getTypeParameters().length != 0)
return true;
}
return false;
} else if (type instanceof ParameterizedType) {
ret... | java | static boolean isMissingTypeParameters(Type type) {
if (type instanceof Class) {
for (Class<?> clazz = (Class<?>) type; clazz != null; clazz = clazz.getEnclosingClass()) {
if (clazz.getTypeParameters().length != 0)
return true;
}
return false;
} else if (type instanceof ParameterizedType) {
ret... | [
"static",
"boolean",
"isMissingTypeParameters",
"(",
"Type",
"type",
")",
"{",
"if",
"(",
"type",
"instanceof",
"Class",
")",
"{",
"for",
"(",
"Class",
"<",
"?",
">",
"clazz",
"=",
"(",
"Class",
"<",
"?",
">",
")",
"type",
";",
"clazz",
"!=",
"null",... | Checks if the given type is a class that is supposed to have type parameters, but doesn't.
In other words, if it's a really raw type. | [
"Checks",
"if",
"the",
"given",
"type",
"is",
"a",
"class",
"that",
"is",
"supposed",
"to",
"have",
"type",
"parameters",
"but",
"doesn",
"t",
".",
"In",
"other",
"words",
"if",
"it",
"s",
"a",
"really",
"raw",
"type",
"."
] | 4bf325d2e49b400326416977c7d9bbdf5380175b | https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/repackaged/gentyref/GenericTypeReflector.java#L77-L89 | test | Checks if the type has type parameters. | Of course, here is the Java code you requested:
```java
static boolean isMissingTypeParameters(Type type) {
if (type instanceof Class) {
for (Class<?> clazz = (Class<?>) type; clazz != null; clazz = clazz.getEnclosingClass()) {
if (clazz.getTypeParameters().length != 0)
return true;
}
return false;... |
Unidata/thredds | tds/src/main/java/thredds/featurecollection/InvDatasetFeatureCollection.java | InvDatasetFeatureCollection.getFile | public File getFile(String remaining) {
if (null == topDirectory) return null;
int pos = remaining.indexOf(FILES);
StringBuilder fname = new StringBuilder(topDirectory);
if (!topDirectory.endsWith("/"))
fname.append("/");
fname.append((pos > -1) ? remaining.substring(pos + FILES.length() + 1) ... | java | public File getFile(String remaining) {
if (null == topDirectory) return null;
int pos = remaining.indexOf(FILES);
StringBuilder fname = new StringBuilder(topDirectory);
if (!topDirectory.endsWith("/"))
fname.append("/");
fname.append((pos > -1) ? remaining.substring(pos + FILES.length() + 1) ... | [
"public",
"File",
"getFile",
"(",
"String",
"remaining",
")",
"{",
"if",
"(",
"null",
"==",
"topDirectory",
")",
"return",
"null",
";",
"int",
"pos",
"=",
"remaining",
".",
"indexOf",
"(",
"FILES",
")",
";",
"StringBuilder",
"fname",
"=",
"new",
"StringB... | this says that a File URL has to be topDirectory + [FILES/ +] + match.remaining | [
"this",
"says",
"that",
"a",
"File",
"URL",
"has",
"to",
"be",
"topDirectory",
"+",
"[",
"FILES",
"/",
"+",
"]",
"+",
"match",
".",
"remaining"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/tds/src/main/java/thredds/featurecollection/InvDatasetFeatureCollection.java#L578-L586 | test | Get the file from the remaining string | Of course, here is the Java code you requested:
```java
public File getFile(String remaining) {
if (null == topDirectory) return null;
int pos = remaining.indexOf(FILES);
StringBuilder fname = new StringBuilder(topDirectory);
if (!topDirectory.endsWith("/"))
fname.append("/");
fname.append((p... |
arnohaase/a-foundation | a-foundation-benchmark/src/main/java/com/ajjpj/afoundation/concurrent/jdk/j9new/ForkJoinPool.java | ForkJoinPool.commonSubmitterQueue | static WorkQueue commonSubmitterQueue() {
ForkJoinPool p = common;
int r = ThreadLocalRandomHelper.getProbe();
WorkQueue[] ws; int m;
return (p != null && (ws = p.workQueues) != null &&
(m = ws.length - 1) >= 0) ?
ws[m & r & SQMASK] : null;
} | java | static WorkQueue commonSubmitterQueue() {
ForkJoinPool p = common;
int r = ThreadLocalRandomHelper.getProbe();
WorkQueue[] ws; int m;
return (p != null && (ws = p.workQueues) != null &&
(m = ws.length - 1) >= 0) ?
ws[m & r & SQMASK] : null;
} | [
"static",
"WorkQueue",
"commonSubmitterQueue",
"(",
")",
"{",
"ForkJoinPool",
"p",
"=",
"common",
";",
"int",
"r",
"=",
"ThreadLocalRandomHelper",
".",
"getProbe",
"(",
")",
";",
"WorkQueue",
"[",
"]",
"ws",
";",
"int",
"m",
";",
"return",
"(",
"p",
"!="... | Returns common pool queue for an external thread. | [
"Returns",
"common",
"pool",
"queue",
"for",
"an",
"external",
"thread",
"."
] | f3eef2ca89d67775f202a4c28140230a6229291e | https://github.com/arnohaase/a-foundation/blob/f3eef2ca89d67775f202a4c28140230a6229291e/a-foundation-benchmark/src/main/java/com/ajjpj/afoundation/concurrent/jdk/j9new/ForkJoinPool.java#L2427-L2434 | test | Get the common submitter queue. | Of course, here is the Java code you requested:
```java
static WorkQueue commonSubmitterQueue() {
ForkJoinPool p = common;
int r = ThreadLocalRandomHelper.getProbe();
WorkQueue[] ws; int m;
return (p != null && (ws = p.workQueues) != null &&
(m = ws.length - 1) >= 0) ?
... |
Unidata/thredds | ui/src/main/java/ucar/nc2/ui/grib/Grib2ReportPanel.java | Grib2ReportPanel.doGdsSummary | private void doGdsSummary(Formatter f, MCollection dcm, boolean extra) throws IOException {
f.format("Show Unique GDS Templates%n");
Counters counters = new Counters();
counters.add("template");
counters.add("scanMode");
counters.add("scanModeDifference");
for (MFile mfile : dcm.getFilesSorted(... | java | private void doGdsSummary(Formatter f, MCollection dcm, boolean extra) throws IOException {
f.format("Show Unique GDS Templates%n");
Counters counters = new Counters();
counters.add("template");
counters.add("scanMode");
counters.add("scanModeDifference");
for (MFile mfile : dcm.getFilesSorted(... | [
"private",
"void",
"doGdsSummary",
"(",
"Formatter",
"f",
",",
"MCollection",
"dcm",
",",
"boolean",
"extra",
")",
"throws",
"IOException",
"{",
"f",
".",
"format",
"(",
"\"Show Unique GDS Templates%n\"",
")",
";",
"Counters",
"counters",
"=",
"new",
"Counters",... | ///////////////////////////////////////////// | [
"/////////////////////////////////////////////"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/grib/Grib2ReportPanel.java#L897-L910 | test | Show the Unique GDS Templates | Of course, here is the Java code you requested:
```java
private void doGdsSummary(Formatter f, MCollection dcm, boolean extra) throws IOException {
f.format("Show Unique GDS Templates%n");
Counters counters = new Counters();
counters.add("template");
counters.add("scanMode");
counters.add("scanMode... |
lessthanoptimal/GeoRegression | main/src/georegression/metric/Intersection2D_F64.java | Intersection2D_F64.contains | public static boolean contains(EllipseRotated_F64 ellipse , double x , double y ) {
return (UtilEllipse_F64.evaluate(x,y, ellipse) <= 1.0 );
} | java | public static boolean contains(EllipseRotated_F64 ellipse , double x , double y ) {
return (UtilEllipse_F64.evaluate(x,y, ellipse) <= 1.0 );
} | [
"public",
"static",
"boolean",
"contains",
"(",
"EllipseRotated_F64",
"ellipse",
",",
"double",
"x",
",",
"double",
"y",
")",
"{",
"return",
"(",
"UtilEllipse_F64",
".",
"evaluate",
"(",
"x",
",",
"y",
",",
"ellipse",
")",
"<=",
"1.0",
")",
";",
"}"
] | Tests to see if the provided point lies on or is contained inside the ellipse
@param ellipse Ellipse
@param x x-coordinate of point being tested for containment
@param y y-coordinate of point being tested for containment
@return true if inside and false if output | [
"Tests",
"to",
"see",
"if",
"the",
"provided",
"point",
"lies",
"on",
"or",
"is",
"contained",
"inside",
"the",
"ellipse"
] | c067cd44a4e95bd826119f6e658bd82386ef289f | https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/metric/Intersection2D_F64.java#L474-L476 | test | Returns true if the specified ellipse is contained in the image | Of course, here is the Java code you requested:
```java
public static boolean contains(EllipseRotated_F64 ellipse , double x , double y ) {
return (UtilEllipse_F64.evaluate(x,y, ellipse) <= 1.0 );
}
```
Hope this helps! |
fabric8io/fabric8-maven-plugin | enricher/api/src/main/java/io/fabric8/maven/enricher/api/util/GoTimeUtil.java | GoTimeUtil.durationSeconds | public static Integer durationSeconds(String duration) {
BigDecimal ns = durationNs(duration);
if (ns == null) {
return null;
}
BigDecimal sec = ns.divide(new BigDecimal(1_000_000_000));
if (sec.compareTo(new BigDecimal(Integer.MAX_VALUE)) > 0) {
throw ne... | java | public static Integer durationSeconds(String duration) {
BigDecimal ns = durationNs(duration);
if (ns == null) {
return null;
}
BigDecimal sec = ns.divide(new BigDecimal(1_000_000_000));
if (sec.compareTo(new BigDecimal(Integer.MAX_VALUE)) > 0) {
throw ne... | [
"public",
"static",
"Integer",
"durationSeconds",
"(",
"String",
"duration",
")",
"{",
"BigDecimal",
"ns",
"=",
"durationNs",
"(",
"duration",
")",
";",
"if",
"(",
"ns",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"BigDecimal",
"sec",
"=",
"ns",
... | Parses a duration string anr returns its value in seconds. | [
"Parses",
"a",
"duration",
"string",
"anr",
"returns",
"its",
"value",
"in",
"seconds",
"."
] | b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3 | https://github.com/fabric8io/fabric8-maven-plugin/blob/b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3/enricher/api/src/main/java/io/fabric8/maven/enricher/api/util/GoTimeUtil.java#L34-L45 | test | Get duration seconds. | Of course, here is the Java code you requested:
```java
public static Integer durationSeconds(String duration) {
BigDecimal ns = durationNs(duration);
if (ns == null) {
return null;
}
BigDecimal sec = ns.divide(new BigDecimal(1_000_000_000));
if (sec.compareTo(new B... |
lestard/FluxFX | fluxfx/src/main/java/eu/lestard/fluxfx/utils/ViewCellFactory.java | ViewCellFactory.updateViews | public void updateViews(Predicate<T> predicate) {
cache.entrySet()
.stream()
.filter(entry -> predicate.test(entry.getKey()))
.forEach(entry -> updateFunction.accept(entry.getKey(), entry.getValue().getController()));
} | java | public void updateViews(Predicate<T> predicate) {
cache.entrySet()
.stream()
.filter(entry -> predicate.test(entry.getKey()))
.forEach(entry -> updateFunction.accept(entry.getKey(), entry.getValue().getController()));
} | [
"public",
"void",
"updateViews",
"(",
"Predicate",
"<",
"T",
">",
"predicate",
")",
"{",
"cache",
".",
"entrySet",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"entry",
"->",
"predicate",
".",
"test",
"(",
"entry",
".",
"getKey",
"(",
")",
... | Update all views that match the given predicate by invoking the update function ({@link #getUpdateFunction()}). | [
"Update",
"all",
"views",
"that",
"match",
"the",
"given",
"predicate",
"by",
"invoking",
"the",
"update",
"function",
"(",
"{"
] | aa292f3ec63685dcf6ee7fbbfb4b9d98e518645b | https://github.com/lestard/FluxFX/blob/aa292f3ec63685dcf6ee7fbbfb4b9d98e518645b/fluxfx/src/main/java/eu/lestard/fluxfx/utils/ViewCellFactory.java#L68-L73 | test | Updates all views that match the given predicate. | Of course, here is the Java code you requested:
```java
public void updateViews(Predicate<T> predicate) {
cache.entrySet()
.stream()
.filter(entry -> predicate.test(entry.getKey()))
.forEach(entry -> updateFunction.accept(entry.getKey(), entry.getValue().getContr... |
blademainer/common_utils | common_helper/src/main/java/com/xiongyingqi/util/DomainHelper.java | DomainHelper.removeDomain | public static String removeDomain(String str) {
if (str != null && !"".equals(str)) {
int index = str.indexOf("@");
if (index >= 0) {
str = str.substring(0, index);
}
}
return str;
} | java | public static String removeDomain(String str) {
if (str != null && !"".equals(str)) {
int index = str.indexOf("@");
if (index >= 0) {
str = str.substring(0, index);
}
}
return str;
} | [
"public",
"static",
"String",
"removeDomain",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"!=",
"null",
"&&",
"!",
"\"\"",
".",
"equals",
"(",
"str",
")",
")",
"{",
"int",
"index",
"=",
"str",
".",
"indexOf",
"(",
"\"@\"",
")",
";",
"if",
"... | 移除主机字符,例如传入admin@xiongyingqi.com,那么该方法将截取@之前的字符返回admin
@param str
@return | [
"移除主机字符,例如传入admin@xiongyingqi",
".",
"com,那么该方法将截取@之前的字符返回admin"
] | ef6baf0367c16de95a28caab67a7d5842a6d13db | https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/util/DomainHelper.java#L10-L18 | test | Removes the domain from the string. | Of course, here is the Java code you requested:
```java
public static String removeDomain(String str) {
if (str != null && !"".equals(str)) {
int index = str.indexOf("@");
if (index >= 0) {
str = str.substring(0, index);
}
}
return str;
}
... |
streamsets/datacollector | azure-lib/src/main/java/com/streamsets/pipeline/stage/destination/datalake/writer/DataLakeDataGenerator.java | DataLakeDataGenerator.close | private void close(boolean idleClosed) throws IOException, StageException {
closeLock.writeLock().lock();
LOG.debug("Path[{}] - Closing", filePath);
try {
throwIfIdleClosed();
// If this was closed previously, just return
if (isClosed()) {
return;
}
if (generator != nu... | java | private void close(boolean idleClosed) throws IOException, StageException {
closeLock.writeLock().lock();
LOG.debug("Path[{}] - Closing", filePath);
try {
throwIfIdleClosed();
// If this was closed previously, just return
if (isClosed()) {
return;
}
if (generator != nu... | [
"private",
"void",
"close",
"(",
"boolean",
"idleClosed",
")",
"throws",
"IOException",
",",
"StageException",
"{",
"closeLock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"LOG",
".",
"debug",
"(",
"\"Path[{}] - Closing\"",
",",
"filePath",
")",... | Private Methods | [
"Private",
"Methods"
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/azure-lib/src/main/java/com/streamsets/pipeline/stage/destination/datalake/writer/DataLakeDataGenerator.java#L117-L144 | test | Closes the file. | Of course, here is the Java code you requested:
```java
private void close(boolean idleClosed) throws IOException, StageException {
closeLock.writeLock().lock();
LOG.debug("Path[{}] - Closing", filePath);
try {
throwIfIdleClosed();
// If this was closed previously, just return
if (isClose... |
wildfly/wildfly | connector/src/main/java/org/jboss/as/connector/util/AbstractParser.java | AbstractParser.rawAttributeText | public String rawAttributeText(XMLStreamReader reader, String attributeName) {
return rawAttributeText(reader, attributeName, null);
} | java | public String rawAttributeText(XMLStreamReader reader, String attributeName) {
return rawAttributeText(reader, attributeName, null);
} | [
"public",
"String",
"rawAttributeText",
"(",
"XMLStreamReader",
"reader",
",",
"String",
"attributeName",
")",
"{",
"return",
"rawAttributeText",
"(",
"reader",
",",
"attributeName",
",",
"null",
")",
";",
"}"
] | Reads and trims the text for the given attribute and returns it or {@code null}
@param reader source for the attribute text
@param attributeName the name of the attribute
@return the string representing trimmed attribute text or {@code null} if there is none | [
"Reads",
"and",
"trims",
"the",
"text",
"for",
"the",
"given",
"attribute",
"and",
"returns",
"it",
"or",
"{",
"@code",
"null",
"}"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/connector/src/main/java/org/jboss/as/connector/util/AbstractParser.java#L73-L75 | test | Get the raw attribute text. | Of course, here is the Java code you requested:
```java
public String rawAttributeText(XMLStreamReader reader, String attributeName) {
return rawAttributeText(reader, attributeName, null);
}
```
Hope this helps! |
ieb/sparsemapcontent | extensions/memory/src/main/java/uk/co/tfd/sm/memory/ehcache/MapCacheImpl.java | MapCacheImpl.removeChildren | public void removeChildren(String key) {
super.remove(key);
if ( !key.endsWith("/") ) {
key = key + "/";
}
Set<String> keys = super.keySet();
for ( String k : keys) {
if ( (k).startsWith(key) ) {
super.remove(k);
}
}
} | java | public void removeChildren(String key) {
super.remove(key);
if ( !key.endsWith("/") ) {
key = key + "/";
}
Set<String> keys = super.keySet();
for ( String k : keys) {
if ( (k).startsWith(key) ) {
super.remove(k);
}
}
} | [
"public",
"void",
"removeChildren",
"(",
"String",
"key",
")",
"{",
"super",
".",
"remove",
"(",
"key",
")",
";",
"if",
"(",
"!",
"key",
".",
"endsWith",
"(",
"\"/\"",
")",
")",
"{",
"key",
"=",
"key",
"+",
"\"/\"",
";",
"}",
"Set",
"<",
"String"... | {@inheritDoc}
@see org.sakaiproject.nakamura.api.memory.Cache#removeChildren(java.lang.String) | [
"{"
] | 0570fdf868adbbf7734790cbc09fe66480e5f2dc | https://github.com/ieb/sparsemapcontent/blob/0570fdf868adbbf7734790cbc09fe66480e5f2dc/extensions/memory/src/main/java/uk/co/tfd/sm/memory/ehcache/MapCacheImpl.java#L86-L97 | test | Remove all children of a key | Of course, here is the Java code you requested:
```java
public void removeChildren(String key) {
super.remove(key);
if ( !key.endsWith("/") ) {
key = key + "/";
}
Set<String> keys = super.keySet();
for ( String k : keys) {
if ( (k).startsWith(key) ) {
super.remove(k);
}
... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/security/symmetrickey/OSymmetricKey.java | OSymmetricKey.fromKeystore | public static OSymmetricKey fromKeystore(final InputStream is, final String password, final String keyAlias,
final String keyPassword) {
OSymmetricKey sk = null;
try {
KeyStore ks = KeyStore.getInstance("JCEKS"); // JCEKS is required to hold SecretKey entries.
char[] ksPasswdChars = null;
... | java | public static OSymmetricKey fromKeystore(final InputStream is, final String password, final String keyAlias,
final String keyPassword) {
OSymmetricKey sk = null;
try {
KeyStore ks = KeyStore.getInstance("JCEKS"); // JCEKS is required to hold SecretKey entries.
char[] ksPasswdChars = null;
... | [
"public",
"static",
"OSymmetricKey",
"fromKeystore",
"(",
"final",
"InputStream",
"is",
",",
"final",
"String",
"password",
",",
"final",
"String",
"keyAlias",
",",
"final",
"String",
"keyPassword",
")",
"{",
"OSymmetricKey",
"sk",
"=",
"null",
";",
"try",
"{"... | Creates an OSymmetricKey from a Java "JCEKS" KeyStore.
@param is The InputStream used to load the KeyStore.
@param password The password for the KeyStore. May be null.
@param keyAlias The alias name of the key to be used from the KeyStore. Required.
@param keyPassword The password of the key represent... | [
"Creates",
"an",
"OSymmetricKey",
"from",
"a",
"Java",
"JCEKS",
"KeyStore",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/security/symmetrickey/OSymmetricKey.java#L317-L351 | test | Create a OSymmetricKey from a KeyStore. | Of course, here is the Java code you requested:
```java
public static OSymmetricKey fromKeystore(final InputStream is, final String password, final String keyAlias,
final String keyPassword) {
OSymmetricKey sk = null;
try {
KeyStore ks = KeyStore.getInstance("JCEKS"); // JCEKS is required to hold ... |
wro4j/wro4j | wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/PathPatternProcessorDecorator.java | PathPatternProcessorDecorator.process | @Override
public void process(final Resource resource, final Reader reader,
final Writer writer)
throws IOException {
if (resource != null) {
final String uri = resource.getUri();
LOG.debug("matching uri: {}", uri);
if (includes) {
// Match (p1 OR p2 OR .. pn)
for (St... | java | @Override
public void process(final Resource resource, final Reader reader,
final Writer writer)
throws IOException {
if (resource != null) {
final String uri = resource.getUri();
LOG.debug("matching uri: {}", uri);
if (includes) {
// Match (p1 OR p2 OR .. pn)
for (St... | [
"@",
"Override",
"public",
"void",
"process",
"(",
"final",
"Resource",
"resource",
",",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"if",
"(",
"resource",
"!=",
"null",
")",
"{",
"final",
"String",
"ur... | {@inheritDoc} | [
"{"
] | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/PathPatternProcessorDecorator.java#L95-L135 | test | Override the process method to process a single resource. | Of course, here is the Java code you requested:
```java
@Override
public void process(final Resource resource, final Reader reader,
final Writer writer)
throws IOException {
if (resource != null) {
final String uri = resource.getUri();
LOG.debug("matching uri: {}", uri);
if (include... |
sialcasa/mvvmFX | mvvmfx-validation/src/main/java/de/saxsys/mvvmfx/utils/validation/CompositeValidationStatus.java | CompositeValidationStatus.removeMessage | void removeMessage(final Validator validator, final List<? extends ValidationMessage> messages) {
if(messages.isEmpty()) {
return;
}
final int validatorHash = System.identityHashCode(validator);
// if the validator is unknown by the map we haven't stored any messages for it yet that could be removed
if(v... | java | void removeMessage(final Validator validator, final List<? extends ValidationMessage> messages) {
if(messages.isEmpty()) {
return;
}
final int validatorHash = System.identityHashCode(validator);
// if the validator is unknown by the map we haven't stored any messages for it yet that could be removed
if(v... | [
"void",
"removeMessage",
"(",
"final",
"Validator",
"validator",
",",
"final",
"List",
"<",
"?",
"extends",
"ValidationMessage",
">",
"messages",
")",
"{",
"if",
"(",
"messages",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"final",
"int",
"va... | /*
Remove all given messages for the given validator. | [
"/",
"*",
"Remove",
"all",
"given",
"messages",
"for",
"the",
"given",
"validator",
"."
] | 240566a358a8e01c94c0bbb99228140a69690d02 | https://github.com/sialcasa/mvvmFX/blob/240566a358a8e01c94c0bbb99228140a69690d02/mvvmfx-validation/src/main/java/de/saxsys/mvvmfx/utils/validation/CompositeValidationStatus.java#L115-L149 | test | Removes a validation message from the validator. | Of course, here is the Java code you requested:
```java
void removeMessage(final Validator validator, final List<? extends ValidationMessage> messages) {
if(messages.isEmpty()) {
return;
}
final int validatorHash = System.identityHashCode(validator);
// if the validator is unknown by the map we haven't st... |
rupertlssmith/lojix | lojix/search/src/main/com/thesett/aima/search/SearchNode.java | SearchNode.makeNode | public SearchNode<O, T> makeNode(Successor successor) throws SearchNotExhaustiveException
{
SearchNode newNode;
try
{
// Create a new instance of this class
newNode = getClass().newInstance();
// Set the state, operation, parent, depth and cost for the n... | java | public SearchNode<O, T> makeNode(Successor successor) throws SearchNotExhaustiveException
{
SearchNode newNode;
try
{
// Create a new instance of this class
newNode = getClass().newInstance();
// Set the state, operation, parent, depth and cost for the n... | [
"public",
"SearchNode",
"<",
"O",
",",
"T",
">",
"makeNode",
"(",
"Successor",
"successor",
")",
"throws",
"SearchNotExhaustiveException",
"{",
"SearchNode",
"newNode",
";",
"try",
"{",
"// Create a new instance of this class",
"newNode",
"=",
"getClass",
"(",
")",
... | Makes a new node of the same type as this one from a Successor state.
@param successor The successor state to turn into a search node.
@return A search node covering the successor state.
@throws SearchNotExhaustiveException If the successor nodes cannot be created. This may happen when using a
custom node implement... | [
"Makes",
"a",
"new",
"node",
"of",
"the",
"same",
"type",
"as",
"this",
"one",
"from",
"a",
"Successor",
"state",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/search/src/main/com/thesett/aima/search/SearchNode.java#L234-L270 | test | Create a new node from the successor. | Of course, here is the Java code you requested:
```java
public SearchNode<O, T> makeNode(Successor successor) throws SearchNotExhaustiveException
{
SearchNode newNode;
try
{
// Create a new instance of this class
newNode = getClass().newInstance();
// S... |
oblac/jodd | jodd-proxetta/src/main/java/jodd/asm7/SymbolTable.java | SymbolTable.addMergedType | int addMergedType(final int typeTableIndex1, final int typeTableIndex2) {
// TODO sort the arguments? The merge result should be independent of their order.
long data = typeTableIndex1 | (((long) typeTableIndex2) << 32);
int hashCode = hash(Symbol.MERGED_TYPE_TAG, typeTableIndex1 + typeTableIndex2);
Ent... | java | int addMergedType(final int typeTableIndex1, final int typeTableIndex2) {
// TODO sort the arguments? The merge result should be independent of their order.
long data = typeTableIndex1 | (((long) typeTableIndex2) << 32);
int hashCode = hash(Symbol.MERGED_TYPE_TAG, typeTableIndex1 + typeTableIndex2);
Ent... | [
"int",
"addMergedType",
"(",
"final",
"int",
"typeTableIndex1",
",",
"final",
"int",
"typeTableIndex2",
")",
"{",
"// TODO sort the arguments? The merge result should be independent of their order.",
"long",
"data",
"=",
"typeTableIndex1",
"|",
"(",
"(",
"(",
"long",
")",... | Adds a merged type in the type table of this symbol table. Does nothing if the type table
already contains a similar type.
@param typeTableIndex1 a {@link Symbol#TYPE_TAG} type, specified by its index in the type
table.
@param typeTableIndex2 another {@link Symbol#TYPE_TAG} type, specified by its index in the type
tab... | [
"Adds",
"a",
"merged",
"type",
"in",
"the",
"type",
"table",
"of",
"this",
"symbol",
"table",
".",
"Does",
"nothing",
"if",
"the",
"type",
"table",
"already",
"contains",
"a",
"similar",
"type",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/SymbolTable.java#L1185-L1201 | test | Add a merged type. | Of course, here is the Java code you requested:
```java
int addMergedType(final int typeTableIndex1, final int typeTableIndex2) {
// TODO sort the arguments? The merge result should be independent of their order.
long data = typeTableIndex1 | (((long) typeTableIndex2) << 32);
int hashCode = hash(Symbol.MER... |
Unidata/thredds | tds/src/main/java/thredds/server/ncss/view/dsg/station/AbstractStationSubsetWriter.java | AbstractStationSubsetWriter.findClosestStation | public static Station findClosestStation(StationTimeSeriesFeatureCollection stationFeatCol, LatLonPoint pt)
throws IOException {
double lat = pt.getLatitude();
double lon = pt.getLongitude();
double cos = Math.cos(Math.toRadians(lat));
List<StationFeature> stations = stationFeatCol.getStationF... | java | public static Station findClosestStation(StationTimeSeriesFeatureCollection stationFeatCol, LatLonPoint pt)
throws IOException {
double lat = pt.getLatitude();
double lon = pt.getLongitude();
double cos = Math.cos(Math.toRadians(lat));
List<StationFeature> stations = stationFeatCol.getStationF... | [
"public",
"static",
"Station",
"findClosestStation",
"(",
"StationTimeSeriesFeatureCollection",
"stationFeatCol",
",",
"LatLonPoint",
"pt",
")",
"throws",
"IOException",
"{",
"double",
"lat",
"=",
"pt",
".",
"getLatitude",
"(",
")",
";",
"double",
"lon",
"=",
"pt"... | /*
Find the station closest to the specified point.
The metric is (lat-lat0)**2 + (cos(lat0)*(lon-lon0))**2
@param lat latitude value
@param lon longitude value
@return name of station closest to the specified point
@throws IOException if read error | [
"/",
"*",
"Find",
"the",
"station",
"closest",
"to",
"the",
"specified",
"point",
".",
"The",
"metric",
"is",
"(",
"lat",
"-",
"lat0",
")",
"**",
"2",
"+",
"(",
"cos",
"(",
"lat0",
")",
"*",
"(",
"lon",
"-",
"lon0",
"))",
"**",
"2"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/tds/src/main/java/thredds/server/ncss/view/dsg/station/AbstractStationSubsetWriter.java#L211-L232 | test | Find the closest station in the station feature collection | Of course, here is the Java code you requested:
```java
public static Station findClosestStation(StationTimeSeriesFeatureCollection stationFeatCol, LatLonPoint pt)
throws IOException {
double lat = pt.getLatitude();
double lon = pt.getLongitude();
double cos = Math.cos(Math.toRadians(lat));
L... |
OpenEstate/OpenEstate-IO | DaftIE/src/main/java/org/openestate/io/daft_ie/DaftIeDocument.java | DaftIeDocument.newDocument | public static DaftIeDocument newDocument(Daft daft) throws ParserConfigurationException, JAXBException {
if (StringUtils.isBlank(daft.getVersion()))
daft.setVersion(DaftIeUtils.VERSION.toReadableVersion());
Document document = XmlUtils.newDocument();
DaftIeUtils.createMarshaller("UT... | java | public static DaftIeDocument newDocument(Daft daft) throws ParserConfigurationException, JAXBException {
if (StringUtils.isBlank(daft.getVersion()))
daft.setVersion(DaftIeUtils.VERSION.toReadableVersion());
Document document = XmlUtils.newDocument();
DaftIeUtils.createMarshaller("UT... | [
"public",
"static",
"DaftIeDocument",
"newDocument",
"(",
"Daft",
"daft",
")",
"throws",
"ParserConfigurationException",
",",
"JAXBException",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"daft",
".",
"getVersion",
"(",
")",
")",
")",
"daft",
".",
"setV... | Creates a {@link DaftIeDocument} from a {@link Daft} object.
@param daft Java object, that represents the <daft> root element
@return created document
@throws ParserConfigurationException if the parser is not properly configured
@throws JAXBException if a problem with JAXB occurred | [
"Creates",
"a",
"{",
"@link",
"DaftIeDocument",
"}",
"from",
"a",
"{",
"@link",
"Daft",
"}",
"object",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/DaftIE/src/main/java/org/openestate/io/daft_ie/DaftIeDocument.java#L124-L131 | test | Create a new DaftIeDocument from a Daft object. | Of course, here is the Java code you requested:
```java
public static DaftIeDocument newDocument(Daft daft) throws ParserConfigurationException, JAXBException {
if (StringUtils.isBlank(daft.getVersion()))
daft.setVersion(DaftIeUtils.VERSION.toReadableVersion());
Document document = XmlUtil... |
workplacesystems/utilsj | src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedCollection.java | SynchronizedCollection.add | public boolean add(final E object) {
Boolean ret = SyncUtils.synchronizeWrite(lock, new Callback<Boolean>() {
@Override
protected void doAction() {
_return(collection.add(object) ? Boolean.TRUE : Boolean.FALSE);
}
});
return ret.booleanV... | java | public boolean add(final E object) {
Boolean ret = SyncUtils.synchronizeWrite(lock, new Callback<Boolean>() {
@Override
protected void doAction() {
_return(collection.add(object) ? Boolean.TRUE : Boolean.FALSE);
}
});
return ret.booleanV... | [
"public",
"boolean",
"add",
"(",
"final",
"E",
"object",
")",
"{",
"Boolean",
"ret",
"=",
"SyncUtils",
".",
"synchronizeWrite",
"(",
"lock",
",",
"new",
"Callback",
"<",
"Boolean",
">",
"(",
")",
"{",
"@",
"Override",
"protected",
"void",
"doAction",
"("... | ----------------------------------------------------------------------- | [
"-----------------------------------------------------------------------"
] | 1b638be51997eafac4d368c14f62a16624a08d3e | https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedCollection.java#L92-L100 | test | Adds an object to the list of records in the application. | Of course, here is the Java code you requested:
```java
public boolean add(final E object) {
Boolean ret = SyncUtils.synchronizeWrite(lock, new Callback<Boolean>() {
@Override
protected void doAction() {
_return(collection.add(object) ? Boolean.TRUE : Boolean.FALSE);... |
spring-projects/spring-security | config/src/main/java/org/springframework/security/config/annotation/AbstractConfiguredSecurityBuilder.java | AbstractConfiguredSecurityBuilder.removeConfigurer | @SuppressWarnings("unchecked")
public <C extends SecurityConfigurer<O, B>> C removeConfigurer(Class<C> clazz) {
List<SecurityConfigurer<O, B>> configs = this.configurers.remove(clazz);
if (configs == null) {
return null;
}
if (configs.size() != 1) {
throw new IllegalStateException("Only one configurer ex... | java | @SuppressWarnings("unchecked")
public <C extends SecurityConfigurer<O, B>> C removeConfigurer(Class<C> clazz) {
List<SecurityConfigurer<O, B>> configs = this.configurers.remove(clazz);
if (configs == null) {
return null;
}
if (configs.size() != 1) {
throw new IllegalStateException("Only one configurer ex... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"C",
"extends",
"SecurityConfigurer",
"<",
"O",
",",
"B",
">",
">",
"C",
"removeConfigurer",
"(",
"Class",
"<",
"C",
">",
"clazz",
")",
"{",
"List",
"<",
"SecurityConfigurer",
"<",
"O",
"... | Removes and returns the {@link SecurityConfigurer} by its class name or
<code>null</code> if not found. Note that object hierarchies are not considered.
@param clazz
@return | [
"Removes",
"and",
"returns",
"the",
"{",
"@link",
"SecurityConfigurer",
"}",
"by",
"its",
"class",
"name",
"or",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"not",
"found",
".",
"Note",
"that",
"object",
"hierarchies",
"are",
"not",
"considered",
"."
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/AbstractConfiguredSecurityBuilder.java#L271-L282 | test | Removes a security configurer for the given type. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public <C extends SecurityConfigurer<O, B>> C removeConfigurer(Class<C> clazz) {
List<SecurityConfigurer<O, B>> configs = this.configurers.remove(clazz);
if (configs == null) {
return null;
}
if (configs.size() != 1) {
... |
objectify/objectify | src/main/java/com/googlecode/objectify/impl/EntityMetadata.java | EntityMetadata.makeLoadEntityValue | private EntityValue makeLoadEntityValue(final BaseEntity<?> ent) {
if (ent instanceof FullEntity<?>) {
return EntityValue.of((FullEntity<?>)ent);
} else {
// Sadly there's no more graceful way of doing this
final Builder<?> builder = FullEntity.newBuilder(ent.getKey());
for (final String name : ent.getN... | java | private EntityValue makeLoadEntityValue(final BaseEntity<?> ent) {
if (ent instanceof FullEntity<?>) {
return EntityValue.of((FullEntity<?>)ent);
} else {
// Sadly there's no more graceful way of doing this
final Builder<?> builder = FullEntity.newBuilder(ent.getKey());
for (final String name : ent.getN... | [
"private",
"EntityValue",
"makeLoadEntityValue",
"(",
"final",
"BaseEntity",
"<",
"?",
">",
"ent",
")",
"{",
"if",
"(",
"ent",
"instanceof",
"FullEntity",
"<",
"?",
">",
")",
"{",
"return",
"EntityValue",
".",
"of",
"(",
"(",
"FullEntity",
"<",
"?",
">",... | The problem is ProjectionEntity; there's no way to create an EntityValue with a ProjectionEntity
so we can't use the standard translation system for {@code Value<Entity>}. Instead of making the
translation API really complicated, just convert it to a FullEntity. | [
"The",
"problem",
"is",
"ProjectionEntity",
";",
"there",
"s",
"no",
"way",
"to",
"create",
"an",
"EntityValue",
"with",
"a",
"ProjectionEntity",
"so",
"we",
"can",
"t",
"use",
"the",
"standard",
"translation",
"system",
"for",
"{"
] | 4bf325d2e49b400326416977c7d9bbdf5380175b | https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/EntityMetadata.java#L93-L106 | test | Make a load entity value. | Of course, here is the Java code you requested:
```java
private EntityValue makeLoadEntityValue(final BaseEntity<?> ent) {
if (ent instanceof FullEntity<?>) {
return EntityValue.of((FullEntity<?>)ent);
} else {
// Sadly there's no more graceful way of doing this
final Builder<?> builder = FullEntity.newBu... |
eclipse/packagedrone | bundles/org.eclipse.packagedrone.utils/src/org/eclipse/packagedrone/utils/Exceptions.java | Exceptions.wrapException | public static <T> T wrapException ( final Callable<T> callable, final Function<Exception, RuntimeException> func )
{
try
{
return callable.call ();
}
catch ( final RuntimeException e )
{
throw e;
}
catch ( final Exception e )
{
... | java | public static <T> T wrapException ( final Callable<T> callable, final Function<Exception, RuntimeException> func )
{
try
{
return callable.call ();
}
catch ( final RuntimeException e )
{
throw e;
}
catch ( final Exception e )
{
... | [
"public",
"static",
"<",
"T",
">",
"T",
"wrapException",
"(",
"final",
"Callable",
"<",
"T",
">",
"callable",
",",
"final",
"Function",
"<",
"Exception",
",",
"RuntimeException",
">",
"func",
")",
"{",
"try",
"{",
"return",
"callable",
".",
"call",
"(",
... | Call and wrap {@link Exception}s into an exception provided by the
function.
<p>
If the function returns {@code null}, a {@link RuntimeException} will be
created instead.
</p>
@param callable
the {@link Callable} to call
@param <T>
argument type
@return the return value of the callable | [
"Call",
"and",
"wrap",
"{",
"@link",
"Exception",
"}",
"s",
"into",
"an",
"exception",
"provided",
"by",
"the",
"function",
".",
"<p",
">",
"If",
"the",
"function",
"returns",
"{",
"@code",
"null",
"}",
"a",
"{",
"@link",
"RuntimeException",
"}",
"will",... | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.eclipse.packagedrone.utils/src/org/eclipse/packagedrone/utils/Exceptions.java#L72-L97 | test | Wrap exception. | Of course, here is the Java code you requested:
```java
public static <T> T wrapException ( final Callable<T> callable, final Function<Exception, RuntimeException> func )
{
try
{
return callable.call ();
}
catch ( final RuntimeException e )
{
throw e;... |
apache/parquet-mr | parquet-format-structures/src/main/java/org/apache/parquet/format/event/EventBasedThriftReader.java | EventBasedThriftReader.readSetContent | public void readSetContent(SetConsumer eventConsumer, TSet tSet)
throws TException {
for (int i = 0; i < tSet.size; i++) {
eventConsumer.consumeElement(protocol, this, tSet.elemType);
}
} | java | public void readSetContent(SetConsumer eventConsumer, TSet tSet)
throws TException {
for (int i = 0; i < tSet.size; i++) {
eventConsumer.consumeElement(protocol, this, tSet.elemType);
}
} | [
"public",
"void",
"readSetContent",
"(",
"SetConsumer",
"eventConsumer",
",",
"TSet",
"tSet",
")",
"throws",
"TException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"tSet",
".",
"size",
";",
"i",
"++",
")",
"{",
"eventConsumer",
".",
"consu... | reads the set content (elements) from the underlying protocol and passes the events to the set event consumer
@param eventConsumer the consumer
@param tSet the set descriptor
@throws TException if any thrift related error occurs during the reading | [
"reads",
"the",
"set",
"content",
"(",
"elements",
")",
"from",
"the",
"underlying",
"protocol",
"and",
"passes",
"the",
"events",
"to",
"the",
"set",
"event",
"consumer"
] | 62dcc68acaf64012bf731e103be780956f1f446d | https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-format-structures/src/main/java/org/apache/parquet/format/event/EventBasedThriftReader.java#L80-L85 | test | Read the content of a set. | Of course, here is the Java code you requested:
```java
public void readSetContent(SetConsumer eventConsumer, TSet tSet)
throws TException {
for (int i = 0; i < tSet.size; i++) {
eventConsumer.consumeElement(protocol, this, tSet.elemType);
}
}
```
Hope this helps! |
wildfly/wildfly | webservices/server-integration/src/main/java/org/jboss/as/webservices/metadata/AbstractMetaDataBuilderEJB.java | AbstractMetaDataBuilderEJB.buildWebservicesMetaData | private void buildWebservicesMetaData(final Deployment dep, final EJBArchiveMetaData.Builder ejbArchiveMDBuilder) {
final JBossWebservicesMetaData webservicesMD = WSHelper.getOptionalAttachment(dep, JBossWebservicesMetaData.class);
if (webservicesMD == null) return;
// set context root
fin... | java | private void buildWebservicesMetaData(final Deployment dep, final EJBArchiveMetaData.Builder ejbArchiveMDBuilder) {
final JBossWebservicesMetaData webservicesMD = WSHelper.getOptionalAttachment(dep, JBossWebservicesMetaData.class);
if (webservicesMD == null) return;
// set context root
fin... | [
"private",
"void",
"buildWebservicesMetaData",
"(",
"final",
"Deployment",
"dep",
",",
"final",
"EJBArchiveMetaData",
".",
"Builder",
"ejbArchiveMDBuilder",
")",
"{",
"final",
"JBossWebservicesMetaData",
"webservicesMD",
"=",
"WSHelper",
".",
"getOptionalAttachment",
"(",... | Builds webservices meta data. This methods sets:
<ul>
<li>context root</li>
<li>wsdl location resolver</li>
<li>config name</li>
<li>config file</li>
</ul>
@param dep webservice deployment
@param ejbArchiveMD universal EJB meta data model | [
"Builds",
"webservices",
"meta",
"data",
".",
"This",
"methods",
"sets",
":",
"<ul",
">",
"<li",
">",
"context",
"root<",
"/",
"li",
">",
"<li",
">",
"wsdl",
"location",
"resolver<",
"/",
"li",
">",
"<li",
">",
"config",
"name<",
"/",
"li",
">",
"<li... | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/webservices/server-integration/src/main/java/org/jboss/as/webservices/metadata/AbstractMetaDataBuilderEJB.java#L85-L109 | test | Build the webservices metadata. | Of course, here is the Java code you requested:
```java
private void buildWebservicesMetaData(final Deployment dep, final EJBArchiveMetaData.Builder ejbArchiveMDBuilder) {
final JBossWebservicesMetaData webservicesMD = WSHelper.getOptionalAttachment(dep, JBossWebservicesMetaData.class);
if (webservicesM... |
jillesvangurp/urlbuilder | src/main/java/com/github/jillesvangurp/urlbuilder/UrlBuilder.java | UrlBuilder.queryParam | public UrlBuilder queryParam(String name, Number value) {
if(value != null) {
return queryParam(name, value.toString());
} else {
return null;
}
} | java | public UrlBuilder queryParam(String name, Number value) {
if(value != null) {
return queryParam(name, value.toString());
} else {
return null;
}
} | [
"public",
"UrlBuilder",
"queryParam",
"(",
"String",
"name",
",",
"Number",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"return",
"queryParam",
"(",
"name",
",",
"value",
".",
"toString",
"(",
")",
")",
";",
"}",
"else",
"{",
"retu... | Create a query parameter with a number value.
@param name parameter name
@param value value
@return the builder | [
"Create",
"a",
"query",
"parameter",
"with",
"a",
"number",
"value",
"."
] | 22a8a4edf74a08b07cb17aad08c58c9feec8a2c0 | https://github.com/jillesvangurp/urlbuilder/blob/22a8a4edf74a08b07cb17aad08c58c9feec8a2c0/src/main/java/com/github/jillesvangurp/urlbuilder/UrlBuilder.java#L149-L155 | test | Add a query parameter to the URL. | Of course, here is the Java code you requested:
```java
public UrlBuilder queryParam(String name, Number value) {
if(value != null) {
return queryParam(name, value.toString());
} else {
return null;
}
}
```
Hope this helps! |
medcl/elasticsearch-analysis-ik | src/main/java/org/wltea/analyzer/core/AnalyzeContext.java | AnalyzeContext.fillBuffer | int fillBuffer(Reader reader) throws IOException{
int readCount = 0;
if(this.buffOffset == 0){
//首次读取reader
readCount = reader.read(segmentBuff);
}else{
int offset = this.available - this.cursor;
if(offset > 0){
//最近一次读取的>最近一次处理的,将未处理的字串拷贝到segmentBuff头部
Syst... | java | int fillBuffer(Reader reader) throws IOException{
int readCount = 0;
if(this.buffOffset == 0){
//首次读取reader
readCount = reader.read(segmentBuff);
}else{
int offset = this.available - this.cursor;
if(offset > 0){
//最近一次读取的>最近一次处理的,将未处理的字串拷贝到segmentBuff头部
Syst... | [
"int",
"fillBuffer",
"(",
"Reader",
"reader",
")",
"throws",
"IOException",
"{",
"int",
"readCount",
"=",
"0",
";",
"if",
"(",
"this",
".",
"buffOffset",
"==",
"0",
")",
"{",
"//首次读取reader\r",
"readCount",
"=",
"reader",
".",
"read",
"(",
"segmentBuff",
... | 根据context的上下文情况,填充segmentBuff
@param reader
@return 返回待分析的(有效的)字串长度
@throws java.io.IOException | [
"根据context的上下文情况,填充segmentBuff"
] | a1d6ba8ca206d750e68bbf3e53a25284100174bd | https://github.com/medcl/elasticsearch-analysis-ik/blob/a1d6ba8ca206d750e68bbf3e53a25284100174bd/src/main/java/org/wltea/analyzer/core/AnalyzeContext.java#L115-L135 | test | Fill the buffer with data from the reader. | Of course, here is the Java code you requested:
```java
int fillBuffer(Reader reader) throws IOException{
int readCount = 0;
if(this.buffOffset == 0){
//首次读取reader
readCount = reader.read(segmentBuff);
}else{
int offset = this.available - this.cursor;
if(offset > 0){
... |
spring-projects/spring-security | web/src/main/java/org/springframework/security/web/authentication/switchuser/SwitchUserFilter.java | SwitchUserFilter.afterPropertiesSet | @Override
public void afterPropertiesSet() {
Assert.notNull(this.userDetailsService, "userDetailsService must be specified");
Assert.isTrue(this.successHandler != null || this.targetUrl != null,
"You must set either a successHandler or the targetUrl");
if (this.targetUrl != null) {
Assert.isNull(this.succ... | java | @Override
public void afterPropertiesSet() {
Assert.notNull(this.userDetailsService, "userDetailsService must be specified");
Assert.isTrue(this.successHandler != null || this.targetUrl != null,
"You must set either a successHandler or the targetUrl");
if (this.targetUrl != null) {
Assert.isNull(this.succ... | [
"@",
"Override",
"public",
"void",
"afterPropertiesSet",
"(",
")",
"{",
"Assert",
".",
"notNull",
"(",
"this",
".",
"userDetailsService",
",",
"\"userDetailsService must be specified\"",
")",
";",
"Assert",
".",
"isTrue",
"(",
"this",
".",
"successHandler",
"!=",
... | ======================================================================================================== | [
"========================================================================================================"
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/authentication/switchuser/SwitchUserFilter.java#L139-L160 | test | Sets the successHandler and the targetUrl. | Of course, here is the Java code you requested:
```java
@Override
public void afterPropertiesSet() {
Assert.notNull(this.userDetailsService, "userDetailsService must be specified");
Assert.isTrue(this.successHandler != null || this.targetUrl != null,
"You must set either a successHandler or the targetUrl");
... |
deeplearning4j/nd4j | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel3.java | BaseLevel3.symm | @Override
public void symm(char Order, char Side, char Uplo, double alpha, INDArray A, INDArray B, double beta, INDArray C) {
if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL)
OpProfiler.getInstance().processBlasCall(false, A, B, C);
// FIXME: int cast
... | java | @Override
public void symm(char Order, char Side, char Uplo, double alpha, INDArray A, INDArray B, double beta, INDArray C) {
if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL)
OpProfiler.getInstance().processBlasCall(false, A, B, C);
// FIXME: int cast
... | [
"@",
"Override",
"public",
"void",
"symm",
"(",
"char",
"Order",
",",
"char",
"Side",
",",
"char",
"Uplo",
",",
"double",
"alpha",
",",
"INDArray",
"A",
",",
"INDArray",
"B",
",",
"double",
"beta",
",",
"INDArray",
"C",
")",
"{",
"if",
"(",
"Nd4j",
... | her2k performs a rank-2k update of an n-by-n Hermitian matrix c, that is, one of the following operations:
c := alpha*a*conjg(b') + conjg(alpha)*b*conjg(a') + beta*c, for trans = 'N'or'n'
c := alpha*conjg(b')*a + conjg(alpha)*conjg(a')*b + beta*c, for trans = 'C'or'c'
where c is an n-by-n Hermitian matrix;
a and b ar... | [
"her2k",
"performs",
"a",
"rank",
"-",
"2k",
"update",
"of",
"an",
"n",
"-",
"by",
"-",
"n",
"Hermitian",
"matrix",
"c",
"that",
"is",
"one",
"of",
"the",
"following",
"operations",
":",
"c",
":",
"=",
"alpha",
"*",
"a",
"*",
"conjg",
"(",
"b",
"... | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel3.java#L114-L131 | test | Dual method to compute a symmetric matrix of the two data structures. | Of course, here is the Java code you requested:
```java
@Override
public void symm(char Order, char Side, char Uplo, double alpha, INDArray A, INDArray B, double beta, INDArray C) {
if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL)
OpProfiler.getInstance().process... |
spring-projects/spring-security | samples/xml/dms/src/main/java/sample/dms/DataSourcePopulator.java | DataSourcePopulator.createSampleData | private void createSampleData(String username, String password) {
Assert.notNull(documentDao, "DocumentDao required");
Assert.hasText(username, "Username required");
Authentication auth = new UsernamePasswordAuthenticationToken(username, password);
try {
// Set the SecurityContextHolder ThreadLocal so any ... | java | private void createSampleData(String username, String password) {
Assert.notNull(documentDao, "DocumentDao required");
Assert.hasText(username, "Username required");
Authentication auth = new UsernamePasswordAuthenticationToken(username, password);
try {
// Set the SecurityContextHolder ThreadLocal so any ... | [
"private",
"void",
"createSampleData",
"(",
"String",
"username",
",",
"String",
"password",
")",
"{",
"Assert",
".",
"notNull",
"(",
"documentDao",
",",
"\"DocumentDao required\"",
")",
";",
"Assert",
".",
"hasText",
"(",
"username",
",",
"\"Username required\"",... | Creates a directory for the user, and a series of sub-directories. The root
directory is the parent for the user directory. The sub-directories are
"confidential" and "shared". The ROLE_USER will be given read and write access to
"shared". | [
"Creates",
"a",
"directory",
"for",
"the",
"user",
"and",
"a",
"series",
"of",
"sub",
"-",
"directories",
".",
"The",
"root",
"directory",
"is",
"the",
"parent",
"for",
"the",
"user",
"directory",
".",
"The",
"sub",
"-",
"directories",
"are",
"confidential... | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/samples/xml/dms/src/main/java/sample/dms/DataSourcePopulator.java#L102-L138 | test | Create the sample data | Of course, here is the Java code you requested:
```java
private void createSampleData(String username, String password) {
Assert.notNull(documentDao, "DocumentDao required");
Assert.hasText(username, "Username required");
Authentication auth = new UsernamePasswordAuthenticationToken(username, password);
try ... |
oblac/jodd | jodd-core/src/main/java/jodd/util/ArraysUtil.java | ArraysUtil.indexOf | public static int indexOf(double[] array, double value, int startIndex, int endIndex) {
for (int i = startIndex; i < endIndex; i++) {
if (Double.compare(array[i], value) == 0) {
return i;
}
}
return -1;
} | java | public static int indexOf(double[] array, double value, int startIndex, int endIndex) {
for (int i = startIndex; i < endIndex; i++) {
if (Double.compare(array[i], value) == 0) {
return i;
}
}
return -1;
} | [
"public",
"static",
"int",
"indexOf",
"(",
"double",
"[",
"]",
"array",
",",
"double",
"value",
",",
"int",
"startIndex",
",",
"int",
"endIndex",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"startIndex",
";",
"i",
"<",
"endIndex",
";",
"i",
"++",
")",
"... | Finds the first occurrence in <code>double</code> array from specified given position and upto given length. | [
"Finds",
"the",
"first",
"occurrence",
"in",
"<code",
">",
"double<",
"/",
"code",
">",
"array",
"from",
"specified",
"given",
"position",
"and",
"upto",
"given",
"length",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/ArraysUtil.java#L1640-L1647 | test | Gets the index of the specified double value in the specified range of the specified double array. | Of course, here is the Java code you requested:
```java
public static int indexOf(double[] array, double value, int startIndex, int endIndex) {
for (int i = startIndex; i < endIndex; i++) {
if (Double.compare(array[i], value) == 0) {
return i;
}
}
return -1;
}
```
Hope this helps! |
kiegroup/droolsjbpm-tools | drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/util/ArrayUtils.java | ArrayUtils.indexOf | public static int indexOf(Object[] array,
Object objectToFind,
int startIndex) {
if ( array == null ) {
return INDEX_NOT_FOUND;
}
if ( startIndex < 0 ) {
startIndex = 0;
}
if ( objectToFind == nul... | java | public static int indexOf(Object[] array,
Object objectToFind,
int startIndex) {
if ( array == null ) {
return INDEX_NOT_FOUND;
}
if ( startIndex < 0 ) {
startIndex = 0;
}
if ( objectToFind == nul... | [
"public",
"static",
"int",
"indexOf",
"(",
"Object",
"[",
"]",
"array",
",",
"Object",
"objectToFind",
",",
"int",
"startIndex",
")",
"{",
"if",
"(",
"array",
"==",
"null",
")",
"{",
"return",
"INDEX_NOT_FOUND",
";",
"}",
"if",
"(",
"startIndex",
"<",
... | <p>Finds the index of the given object in the array starting at the given index.</p>
<p>This method returns {@link #INDEX_NOT_FOUND} (<code>-1</code>) for a <code>null</code> input array.</p>
<p>A negative startIndex is treated as zero. A startIndex larger than the array
length will return {@link #INDEX_NOT_FOUND} (<... | [
"<p",
">",
"Finds",
"the",
"index",
"of",
"the",
"given",
"object",
"in",
"the",
"array",
"starting",
"at",
"the",
"given",
"index",
".",
"<",
"/",
"p",
">"
] | 05e1f73c591178360a198dca29f99d73918991db | https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/util/ArrayUtils.java#L96-L119 | test | This method returns the index of the first occurrence of the specified object in the specified startIndex. | Of course, here is the Java code you requested:
```java
public static int indexOf(Object[] array,
Object objectToFind,
int startIndex) {
if ( array == null ) {
return INDEX_NOT_FOUND;
}
if ( startIndex < 0 ) {
s... |
intellimate/IzouSDK | src/main/java/org/intellimate/izou/sdk/frameworks/permanentSoundOutput/events/StartEvent.java | StartEvent.createStartEvent | public static Optional<StartEvent> createStartEvent(Identification source, boolean isUsingJava) {
try {
StartEvent startEvent;
if (isUsingJava) {
startEvent = new StartEvent(source);
} else {
startEvent = new StartEvent(source, IS_USING_NON_J... | java | public static Optional<StartEvent> createStartEvent(Identification source, boolean isUsingJava) {
try {
StartEvent startEvent;
if (isUsingJava) {
startEvent = new StartEvent(source);
} else {
startEvent = new StartEvent(source, IS_USING_NON_J... | [
"public",
"static",
"Optional",
"<",
"StartEvent",
">",
"createStartEvent",
"(",
"Identification",
"source",
",",
"boolean",
"isUsingJava",
")",
"{",
"try",
"{",
"StartEvent",
"startEvent",
";",
"if",
"(",
"isUsingJava",
")",
"{",
"startEvent",
"=",
"new",
"St... | creates a new StartEvent
@param source the caller
@param isUsingJava true if using java, false if not (and for example a C-library)
@return the optional StartMusicRequest | [
"creates",
"a",
"new",
"StartEvent"
] | bc8705ad48a6ca12a722f2b787be435949fa5d08 | https://github.com/intellimate/IzouSDK/blob/bc8705ad48a6ca12a722f2b787be435949fa5d08/src/main/java/org/intellimate/izou/sdk/frameworks/permanentSoundOutput/events/StartEvent.java#L66-L78 | test | Create Start Event Optional. | Of course, here is the Java code you requested:
```java
public static Optional<StartEvent> createStartEvent(Identification source, boolean isUsingJava) {
try {
StartEvent startEvent;
if (isUsingJava) {
startEvent = new StartEvent(source);
} else {
... |
jkuhnert/ognl | src/main/java/ognl/Ognl.java | Ognl.createDefaultContext | @Deprecated
public static Map createDefaultContext(Object root)
{
return addDefaultContext(root, null, null, null, new OgnlContext(null, null, null));
} | java | @Deprecated
public static Map createDefaultContext(Object root)
{
return addDefaultContext(root, null, null, null, new OgnlContext(null, null, null));
} | [
"@",
"Deprecated",
"public",
"static",
"Map",
"createDefaultContext",
"(",
"Object",
"root",
")",
"{",
"return",
"addDefaultContext",
"(",
"root",
",",
"null",
",",
"null",
",",
"null",
",",
"new",
"OgnlContext",
"(",
"null",
",",
"null",
",",
"null",
")",... | Creates and returns a new standard naming context for evaluating an OGNL expression.
@param root
the root of the object graph
@return a new Map with the keys <CODE>root</CODE> and <CODE>context</CODE> set
appropriately
@deprecated it will be removed soon | [
"Creates",
"and",
"returns",
"a",
"new",
"standard",
"naming",
"context",
"for",
"evaluating",
"an",
"OGNL",
"expression",
"."
] | 53d51a30c8c299b750dede779d05cb84beee73c3 | https://github.com/jkuhnert/ognl/blob/53d51a30c8c299b750dede779d05cb84beee73c3/src/main/java/ognl/Ognl.java#L156-L160 | test | Create a default context for a node. | Of course, here is the Java code you requested:
```java
@Deprecated
public static Map createDefaultContext(Object root)
{
return addDefaultContext(root, null, null, null, new OgnlContext(null, null, null));
}
```
Hope this helps! |
spring-projects/spring-security | oauth2/oauth2-resource-server/src/main/java/org/springframework/security/oauth2/server/resource/authentication/JwtGrantedAuthoritiesConverter.java | JwtGrantedAuthoritiesConverter.getScopes | private Collection<String> getScopes(Jwt jwt) {
for ( String attributeName : WELL_KNOWN_SCOPE_ATTRIBUTE_NAMES ) {
Object scopes = jwt.getClaims().get(attributeName);
if (scopes instanceof String) {
if (StringUtils.hasText((String) scopes)) {
return Arrays.asList(((String) scopes).split(" "));
} els... | java | private Collection<String> getScopes(Jwt jwt) {
for ( String attributeName : WELL_KNOWN_SCOPE_ATTRIBUTE_NAMES ) {
Object scopes = jwt.getClaims().get(attributeName);
if (scopes instanceof String) {
if (StringUtils.hasText((String) scopes)) {
return Arrays.asList(((String) scopes).split(" "));
} els... | [
"private",
"Collection",
"<",
"String",
">",
"getScopes",
"(",
"Jwt",
"jwt",
")",
"{",
"for",
"(",
"String",
"attributeName",
":",
"WELL_KNOWN_SCOPE_ATTRIBUTE_NAMES",
")",
"{",
"Object",
"scopes",
"=",
"jwt",
".",
"getClaims",
"(",
")",
".",
"get",
"(",
"a... | Gets the scopes from a {@link Jwt} token
@param jwt The {@link Jwt} token
@return The scopes from the token | [
"Gets",
"the",
"scopes",
"from",
"a",
"{"
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/oauth2/oauth2-resource-server/src/main/java/org/springframework/security/oauth2/server/resource/authentication/JwtGrantedAuthoritiesConverter.java#L62-L77 | test | Gets the scopes from the JWT. | Of course, here is the Java code you requested:
```java
private Collection<String> getScopes(Jwt jwt) {
for ( String attributeName : WELL_KNOWN_SCOPE_ATTRIBUTE_NAMES ) {
Object scopes = jwt.getClaims().get(attributeName);
if (scopes instanceof String) {
if (StringUtils.hasText((String) scopes)) {
retu... |
Unidata/thredds | dap4/d4lib/src/main/java/dap4/dap4lib/DSPPrinter.java | DSPPrinter.print | public DSPPrinter
print()
throws DapException
{
DapDataset dmr = this.dsp.getDMR();
if(this.ce == null)
this.ce = CEConstraint.getUniversal(dmr);
this.printer.setIndent(0);
List<DapVariable> topvars = dmr.getTopVariables();
for(int i = 0; i < topva... | java | public DSPPrinter
print()
throws DapException
{
DapDataset dmr = this.dsp.getDMR();
if(this.ce == null)
this.ce = CEConstraint.getUniversal(dmr);
this.printer.setIndent(0);
List<DapVariable> topvars = dmr.getTopVariables();
for(int i = 0; i < topva... | [
"public",
"DSPPrinter",
"print",
"(",
")",
"throws",
"DapException",
"{",
"DapDataset",
"dmr",
"=",
"this",
".",
"dsp",
".",
"getDMR",
"(",
")",
";",
"if",
"(",
"this",
".",
"ce",
"==",
"null",
")",
"this",
".",
"ce",
"=",
"CEConstraint",
".",
"getUn... | Print data from a DSP
- optionally constrained
@throws DapException | [
"Print",
"data",
"from",
"a",
"DSP",
"-",
"optionally",
"constrained"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4lib/src/main/java/dap4/dap4lib/DSPPrinter.java#L114-L133 | test | Print the RA. | Of course, here is the Java code you requested:
```java
public DSPPrinter
print()
throws DapException
{
DapDataset dmr = this.dsp.getDMR();
if(this.ce == null)
this.ce = CEConstraint.getUniversal(dmr);
this.printer.setIndent(0);
List<DapVariable> topvars ... |
Unidata/thredds | bufr/src/main/java/ucar/nc2/iosp/bufr/tables/WmoXmlReader.java | WmoXmlReader.readWmoXmlTableD | static void readWmoXmlTableD(InputStream ios, TableD tableD) throws IOException {
org.jdom2.Document doc;
try {
SAXBuilder builder = new SAXBuilder();
doc = builder.build(ios);
} catch (JDOMException e) {
throw new IOException(e.getMessage());
}
int currSeqno = -1;
T... | java | static void readWmoXmlTableD(InputStream ios, TableD tableD) throws IOException {
org.jdom2.Document doc;
try {
SAXBuilder builder = new SAXBuilder();
doc = builder.build(ios);
} catch (JDOMException e) {
throw new IOException(e.getMessage());
}
int currSeqno = -1;
T... | [
"static",
"void",
"readWmoXmlTableD",
"(",
"InputStream",
"ios",
",",
"TableD",
"tableD",
")",
"throws",
"IOException",
"{",
"org",
".",
"jdom2",
".",
"Document",
"doc",
";",
"try",
"{",
"SAXBuilder",
"builder",
"=",
"new",
"SAXBuilder",
"(",
")",
";",
"do... | /*
<B_TableD_BUFR14_1_0_CREX_6_1_0>
<SNo>2647</SNo>
<Category>10</Category>
<FXY1>310013</FXY1>
<ElementName1_E>(AVHRR (GAC) report)</ElementName1_E>
<FXY2>004005</FXY2>
<ElementName2_E>Minute</ElementName2_E>
<Remarks_E>Minute</Remarks_E>
<Status>Operational</Status>
</B_TableD_BUFR14_1_0_CREX_6_1_0>
14.2.0
<Exportin... | [
"/",
"*",
"<B_TableD_BUFR14_1_0_CREX_6_1_0",
">",
"<SNo",
">",
"2647<",
"/",
"SNo",
">",
"<Category",
">",
"10<",
"/",
"Category",
">",
"<FXY1",
">",
"310013<",
"/",
"FXY1",
">",
"<ElementName1_E",
">",
"(",
"AVHRR",
"(",
"GAC",
")",
"report",
")",
"<",
... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/bufr/src/main/java/ucar/nc2/iosp/bufr/tables/WmoXmlReader.java#L327-L381 | test | Reads the WMO XML file and creates the TableD object. | Of course, here is the Java code you requested:
```java
static void readWmoXmlTableD(InputStream ios, TableD tableD) throws IOException {
org.jdom2.Document doc;
try {
SAXBuilder builder = new SAXBuilder();
doc = builder.build(ios);
} catch (JDOMException e) {
throw new IOException(... |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/factory/GeoPackageManagerImpl.java | GeoPackageManagerImpl.exportGeoPackage | @Override
public void exportGeoPackage(String database, File directory) {
exportGeoPackage(database, database, directory);
} | java | @Override
public void exportGeoPackage(String database, File directory) {
exportGeoPackage(database, database, directory);
} | [
"@",
"Override",
"public",
"void",
"exportGeoPackage",
"(",
"String",
"database",
",",
"File",
"directory",
")",
"{",
"exportGeoPackage",
"(",
"database",
",",
"database",
",",
"directory",
")",
";",
"}"
] | {@inheritDoc} | [
"{"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/factory/GeoPackageManagerImpl.java#L755-L758 | test | Export the CRS file to a GeoPackage file. | Of course, here is the Java code you requested:
```java
@Override
public void exportGeoPackage(String database, File directory) {
exportGeoPackage(database, database, directory);
}
```
Hope this helps! |
Koekiebox-PTY-LTD/Fluid | fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flow/RouteFieldClient.java | RouteFieldClient.updateFieldDateTimeDateAndTime | public Field updateFieldDateTimeDateAndTime(Field routeFieldParam) {
if(routeFieldParam != null && this.serviceTicket != null) {
routeFieldParam.setServiceTicket(this.serviceTicket);
}
if(routeFieldParam != null) {
routeFieldParam.setTypeAsEnum(Field.Type.DateTime);
routeFieldParam.setTypeMetaData(Field... | java | public Field updateFieldDateTimeDateAndTime(Field routeFieldParam) {
if(routeFieldParam != null && this.serviceTicket != null) {
routeFieldParam.setServiceTicket(this.serviceTicket);
}
if(routeFieldParam != null) {
routeFieldParam.setTypeAsEnum(Field.Type.DateTime);
routeFieldParam.setTypeMetaData(Field... | [
"public",
"Field",
"updateFieldDateTimeDateAndTime",
"(",
"Field",
"routeFieldParam",
")",
"{",
"if",
"(",
"routeFieldParam",
"!=",
"null",
"&&",
"this",
".",
"serviceTicket",
"!=",
"null",
")",
"{",
"routeFieldParam",
".",
"setServiceTicket",
"(",
"this",
".",
... | Update an existing Date and Time field.
@param routeFieldParam Field to Update.
@return Updated Field. | [
"Update",
"an",
"existing",
"Date",
"and",
"Time",
"field",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flow/RouteFieldClient.java#L430-L442 | test | Update the Field DateTimeDateAndTime. | Of course, here is the Java code you requested:
```java
public Field updateFieldDateTimeDateAndTime(Field routeFieldParam) {
if(routeFieldParam != null && this.serviceTicket != null) {
routeFieldParam.setServiceTicket(this.serviceTicket);
}
if(routeFieldParam != null) {
routeFieldParam.setTypeAsEnum(Field... |
robeio/robe | robe-hibernate/src/main/java/io/robe/hibernate/transaction/Transaction.java | Transaction.exec | public static void exec(TransactionWrapper transactionWrapper, TransactionExceptionHandler exceptionHandler, FlushMode flushMode) {
checkNotNull(transactionWrapper);
new Transaction(transactionWrapper, exceptionHandler, flushMode);
} | java | public static void exec(TransactionWrapper transactionWrapper, TransactionExceptionHandler exceptionHandler, FlushMode flushMode) {
checkNotNull(transactionWrapper);
new Transaction(transactionWrapper, exceptionHandler, flushMode);
} | [
"public",
"static",
"void",
"exec",
"(",
"TransactionWrapper",
"transactionWrapper",
",",
"TransactionExceptionHandler",
"exceptionHandler",
",",
"FlushMode",
"flushMode",
")",
"{",
"checkNotNull",
"(",
"transactionWrapper",
")",
";",
"new",
"Transaction",
"(",
"transac... | Begins new transaction in a new session and performs operations provided in {@link TransactionWrapper} <br/>
In case of an exception is thrown the {@link TransactionExceptionHandler} will be invoked.
@param transactionWrapper {@link TransactionWrapper}
@param exceptionHandler {@link TransactionExceptionHandler}
@par... | [
"Begins",
"new",
"transaction",
"in",
"a",
"new",
"session",
"and",
"performs",
"operations",
"provided",
"in",
"{",
"@link",
"TransactionWrapper",
"}",
"<br",
"/",
">",
"In",
"case",
"of",
"an",
"exception",
"is",
"thrown",
"the",
"{",
"@link",
"Transaction... | a0a8c7cebd1f70f78cf24a66a002859e937badfe | https://github.com/robeio/robe/blob/a0a8c7cebd1f70f78cf24a66a002859e937badfe/robe-hibernate/src/main/java/io/robe/hibernate/transaction/Transaction.java#L113-L116 | test | Execute a transaction. | Of course, here is the Java code you requested:
```java
public static void exec(TransactionWrapper transactionWrapper, TransactionExceptionHandler exceptionHandler, FlushMode flushMode) {
checkNotNull(transactionWrapper);
new Transaction(transactionWrapper, exceptionHandler, flushMode);
}
```
Hope... |
TooTallNate/Java-WebSocket | src/main/java/org/java_websocket/SSLSocketChannel.java | SSLSocketChannel.enlargeBuffer | private ByteBuffer enlargeBuffer( ByteBuffer buffer, int sessionProposedCapacity ) {
if( sessionProposedCapacity > buffer.capacity() ) {
buffer = ByteBuffer.allocate( sessionProposedCapacity );
} else {
buffer = ByteBuffer.allocate( buffer.capacity() * 2 );
}
return buffer;
} | java | private ByteBuffer enlargeBuffer( ByteBuffer buffer, int sessionProposedCapacity ) {
if( sessionProposedCapacity > buffer.capacity() ) {
buffer = ByteBuffer.allocate( sessionProposedCapacity );
} else {
buffer = ByteBuffer.allocate( buffer.capacity() * 2 );
}
return buffer;
} | [
"private",
"ByteBuffer",
"enlargeBuffer",
"(",
"ByteBuffer",
"buffer",
",",
"int",
"sessionProposedCapacity",
")",
"{",
"if",
"(",
"sessionProposedCapacity",
">",
"buffer",
".",
"capacity",
"(",
")",
")",
"{",
"buffer",
"=",
"ByteBuffer",
".",
"allocate",
"(",
... | Compares <code>sessionProposedCapacity<code> with buffer's capacity. If buffer's capacity is smaller,
returns a buffer with the proposed capacity. If it's equal or larger, returns a buffer
with capacity twice the size of the initial one.
@param buffer - the buffer to be enlarged.
@param sessionPropose... | [
"Compares",
"<code",
">",
"sessionProposedCapacity<code",
">",
"with",
"buffer",
"s",
"capacity",
".",
"If",
"buffer",
"s",
"capacity",
"is",
"smaller",
"returns",
"a",
"buffer",
"with",
"the",
"proposed",
"capacity",
".",
"If",
"it",
"s",
"equal",
"or",
"la... | 73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9 | https://github.com/TooTallNate/Java-WebSocket/blob/73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9/src/main/java/org/java_websocket/SSLSocketChannel.java#L414-L421 | test | Enlarges the given buffer by the given capacity. | Of course, here is the Java code you requested:
```java
private ByteBuffer enlargeBuffer( ByteBuffer buffer, int sessionProposedCapacity ) {
if( sessionProposedCapacity > buffer.capacity() ) {
buffer = ByteBuffer.allocate( sessionProposedCapacity );
} else {
buffer = ByteBuffer.allocate( buffer.capacity() * ... |
ReactiveX/RxJava | src/main/java/io/reactivex/Observable.java | Observable.hide | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Observable<T> hide() {
return RxJavaPlugins.onAssembly(new ObservableHide<T>(this));
} | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Observable<T> hide() {
return RxJavaPlugins.onAssembly(new ObservableHide<T>(this));
} | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Observable",
"<",
"T",
">",
"hide",
"(",
")",
"{",
"return",
"RxJavaPlugins",
".",
"onAssembly",
"(",
"new",
"ObservableHide",
"<",
"T",
">",
"("... | Hides the identity of this Observable and its Disposable.
<p>Allows hiding extra features such as {@link io.reactivex.subjects.Subject}'s
{@link Observer} methods or preventing certain identity-based
optimizations (fusion).
<p>
<img width="640" height="283" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-op... | [
"Hides",
"the",
"identity",
"of",
"this",
"Observable",
"and",
"its",
"Disposable",
".",
"<p",
">",
"Allows",
"hiding",
"extra",
"features",
"such",
"as",
"{",
"@link",
"io",
".",
"reactivex",
".",
"subjects",
".",
"Subject",
"}",
"s",
"{",
"@link",
"Obs... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L9456-L9460 | test | Hides the base class from the source. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Observable<T> hide() {
return RxJavaPlugins.onAssembly(new ObservableHide<T>(this));
}
```
Hope this helps! |
RestComm/jain-slee | container/services/src/main/java/org/mobicents/slee/container/management/SbbManagementImpl.java | SbbManagementImpl.getObjectPool | public SbbObjectPoolImpl getObjectPool(ServiceID serviceID, SbbID sbbID) {
return sbbPoolManagement.getObjectPool(serviceID, sbbID);
} | java | public SbbObjectPoolImpl getObjectPool(ServiceID serviceID, SbbID sbbID) {
return sbbPoolManagement.getObjectPool(serviceID, sbbID);
} | [
"public",
"SbbObjectPoolImpl",
"getObjectPool",
"(",
"ServiceID",
"serviceID",
",",
"SbbID",
"sbbID",
")",
"{",
"return",
"sbbPoolManagement",
".",
"getObjectPool",
"(",
"serviceID",
",",
"sbbID",
")",
";",
"}"
] | /* (non-Javadoc)
@see org.mobicents.slee.container.management.SbbManagement#getObjectPool(javax.slee.ServiceID, javax.slee.SbbID) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/services/src/main/java/org/mobicents/slee/container/management/SbbManagementImpl.java#L103-L105 | test | Get the SbbObjectPool for the given serviceID and sbbID. | Of course, here is the Java code you requested:
```java
public SbbObjectPoolImpl getObjectPool(ServiceID serviceID, SbbID sbbID) {
return sbbPoolManagement.getObjectPool(serviceID, sbbID);
}
```
Hope this helps! |
apache/parquet-mr | parquet-hive/parquet-hive-storage-handler/src/main/java/org/apache/hadoop/hive/ql/io/parquet/convert/HiveSchemaConverter.java | HiveSchemaConverter.convertMapType | private static GroupType convertMapType(final String name, final MapTypeInfo typeInfo) {
final Type keyType = convertType(ParquetHiveSerDe.MAP_KEY.toString(),
typeInfo.getMapKeyTypeInfo(), Repetition.REQUIRED);
final Type valueType = convertType(ParquetHiveSerDe.MAP_VALUE.toString(),
typeInfo.ge... | java | private static GroupType convertMapType(final String name, final MapTypeInfo typeInfo) {
final Type keyType = convertType(ParquetHiveSerDe.MAP_KEY.toString(),
typeInfo.getMapKeyTypeInfo(), Repetition.REQUIRED);
final Type valueType = convertType(ParquetHiveSerDe.MAP_VALUE.toString(),
typeInfo.ge... | [
"private",
"static",
"GroupType",
"convertMapType",
"(",
"final",
"String",
"name",
",",
"final",
"MapTypeInfo",
"typeInfo",
")",
"{",
"final",
"Type",
"keyType",
"=",
"convertType",
"(",
"ParquetHiveSerDe",
".",
"MAP_KEY",
".",
"toString",
"(",
")",
",",
"typ... | 2 elements: "key", "value" | [
"2",
"elements",
":",
"key",
"value"
] | 62dcc68acaf64012bf731e103be780956f1f446d | https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-hive/parquet-hive-storage-handler/src/main/java/org/apache/hadoop/hive/ql/io/parquet/convert/HiveSchemaConverter.java#L125-L131 | test | Convert map type. | Of course, here is the Java code you requested:
```java
private static GroupType convertMapType(final String name, final MapTypeInfo typeInfo) {
final Type keyType = convertType(ParquetHiveSerDe.MAP_KEY.toString(),
typeInfo.getMapKeyTypeInfo(), Repetition.REQUIRED);
final Type valueType = convertType(P... |
abmargb/jamppa | src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java | AbstractHashedMap.isEqualKey | protected boolean isEqualKey(Object key1, Object key2) {
return (key1 == key2 || ((key1 != null) && key1.equals(key2)));
} | java | protected boolean isEqualKey(Object key1, Object key2) {
return (key1 == key2 || ((key1 != null) && key1.equals(key2)));
} | [
"protected",
"boolean",
"isEqualKey",
"(",
"Object",
"key1",
",",
"Object",
"key2",
")",
"{",
"return",
"(",
"key1",
"==",
"key2",
"||",
"(",
"(",
"key1",
"!=",
"null",
")",
"&&",
"key1",
".",
"equals",
"(",
"key2",
")",
")",
")",
";",
"}"
] | Compares two keys, in internal converted form, to see if they are equal.
This implementation uses the equals method. Subclasses can override this
to match differently.
@param key1
the first key to compare passed in from outside
@param key2
the second key extracted from the entry via
<code>entry.key</code>
@return true... | [
"Compares",
"two",
"keys",
"in",
"internal",
"converted",
"form",
"to",
"see",
"if",
"they",
"are",
"equal",
".",
"This",
"implementation",
"uses",
"the",
"equals",
"method",
".",
"Subclasses",
"can",
"override",
"this",
"to",
"match",
"differently",
"."
] | 76f253239923df40904c462e3b88e7278b36b282 | https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L415-L417 | test | Checks if two keys are equal. | Of course, here is the Java code you requested:
```java
protected boolean isEqualKey(Object key1, Object key2) {
return (key1 == key2 || ((key1 != null) && key1.equals(key2)));
}
```
Hope this helps! |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/utility/CommandUtility.java | CommandUtility.indexCommandRange | public static void indexCommandRange(
final ConfigRange sourceConfigRange,
final Map<String, Command> indexMap) {
if (sourceConfigRange.getCommandList() != null) {
for (int i = 0; i < sourceConfigRange.getCommandList()
.size(); i++) {
Command command = sourceConfigRange.getCommandList().get(i)... | java | public static void indexCommandRange(
final ConfigRange sourceConfigRange,
final Map<String, Command> indexMap) {
if (sourceConfigRange.getCommandList() != null) {
for (int i = 0; i < sourceConfigRange.getCommandList()
.size(); i++) {
Command command = sourceConfigRange.getCommandList().get(i)... | [
"public",
"static",
"void",
"indexCommandRange",
"(",
"final",
"ConfigRange",
"sourceConfigRange",
",",
"final",
"Map",
"<",
"String",
",",
"Command",
">",
"indexMap",
")",
"{",
"if",
"(",
"sourceConfigRange",
".",
"getCommandList",
"(",
")",
"!=",
"null",
")"... | Index command range.
@param sourceConfigRange
the source config range
@param indexMap
the index map | [
"Index",
"command",
"range",
"."
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/utility/CommandUtility.java#L400-L412 | test | Index command range. | Of course, here is the Java code you requested:
```java
public static void indexCommandRange(
final ConfigRange sourceConfigRange,
final Map<String, Command> indexMap) {
if (sourceConfigRange.getCommandList() != null) {
for (int i = 0; i < sourceConfigRange.getCommandList()
.size(); i++) {
Co... |
orientechnologies/orientdb | graphdb/src/main/java/com/orientechnologies/orient/graph/graphml/OGraphSONUtility.java | OGraphSONUtility.edgeFromJson | public Edge edgeFromJson(final String json, final Vertex out, final Vertex in) throws IOException {
final JsonParser jp = jsonFactory.createParser(json);
final JsonNode node = jp.readValueAsTree();
return this.edgeFromJson(node, out, in);
} | java | public Edge edgeFromJson(final String json, final Vertex out, final Vertex in) throws IOException {
final JsonParser jp = jsonFactory.createParser(json);
final JsonNode node = jp.readValueAsTree();
return this.edgeFromJson(node, out, in);
} | [
"public",
"Edge",
"edgeFromJson",
"(",
"final",
"String",
"json",
",",
"final",
"Vertex",
"out",
",",
"final",
"Vertex",
"in",
")",
"throws",
"IOException",
"{",
"final",
"JsonParser",
"jp",
"=",
"jsonFactory",
".",
"createParser",
"(",
"json",
")",
";",
"... | Creates an edge from GraphSON using settings supplied in the constructor. | [
"Creates",
"an",
"edge",
"from",
"GraphSON",
"using",
"settings",
"supplied",
"in",
"the",
"constructor",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/orientechnologies/orient/graph/graphml/OGraphSONUtility.java#L150-L154 | test | Create an edge from a JSON string. | Of course, here is the Java code you requested:
```java
public Edge edgeFromJson(final String json, final Vertex out, final Vertex in) throws IOException {
final JsonParser jp = jsonFactory.createParser(json);
final JsonNode node = jp.readValueAsTree();
return this.edgeFromJson(node, out, in);
}
```
Hop... |
Unidata/thredds | ui/src/main/java/ucar/nc2/ui/ToolsUI.java | ToolsUI.createToolsFrame | private static void createToolsFrame() {
// put UI in a JFrame
frame = new JFrame("NetCDF (" + DIALOG_VERSION + ") Tools");
ui = new ToolsUI(prefs, frame);
frame.setIconImage(BAMutil.getImage("netcdfUI"));
frame.addWindowListener(new WindowAdapter() {
@Ove... | java | private static void createToolsFrame() {
// put UI in a JFrame
frame = new JFrame("NetCDF (" + DIALOG_VERSION + ") Tools");
ui = new ToolsUI(prefs, frame);
frame.setIconImage(BAMutil.getImage("netcdfUI"));
frame.addWindowListener(new WindowAdapter() {
@Ove... | [
"private",
"static",
"void",
"createToolsFrame",
"(",
")",
"{",
"// put UI in a JFrame\r",
"frame",
"=",
"new",
"JFrame",
"(",
"\"NetCDF (\"",
"+",
"DIALOG_VERSION",
"+",
"\") Tools\"",
")",
";",
"ui",
"=",
"new",
"ToolsUI",
"(",
"prefs",
",",
"frame",
")",
... | Must call this method on the event thread. | [
"Must",
"call",
"this",
"method",
"on",
"the",
"event",
"thread",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/ToolsUI.java#L1363-L1406 | test | Creates the Tools frame. | Of course, here is the Java code you requested:
```java
private static void createToolsFrame() {
// put UI in a JFrame
frame = new JFrame("NetCDF (" + DIALOG_VERSION + ") Tools");
ui = new ToolsUI(prefs, frame);
frame.setIconImage(BAMutil.getImage("netcdfUI"));
frame.... |
deeplearning4j/nd4j | nd4j-common/src/main/java/org/nd4j/linalg/util/BigDecimalMath.java | BigDecimalMath.log | static public BigDecimal log(BigDecimal x) {
/* the value is undefined if x is negative.
*/
if (x.compareTo(BigDecimal.ZERO) < 0) {
throw new ArithmeticException("Cannot take log of negative " + x.toString());
} else if (x.compareTo(BigDecimal.ONE) == 0) {
/* log... | java | static public BigDecimal log(BigDecimal x) {
/* the value is undefined if x is negative.
*/
if (x.compareTo(BigDecimal.ZERO) < 0) {
throw new ArithmeticException("Cannot take log of negative " + x.toString());
} else if (x.compareTo(BigDecimal.ONE) == 0) {
/* log... | [
"static",
"public",
"BigDecimal",
"log",
"(",
"BigDecimal",
"x",
")",
"{",
"/* the value is undefined if x is negative.\n */",
"if",
"(",
"x",
".",
"compareTo",
"(",
"BigDecimal",
".",
"ZERO",
")",
"<",
"0",
")",
"{",
"throw",
"new",
"ArithmeticException",... | The natural logarithm.
@param x the argument.
@return ln(x).
The precision of the result is implicitly defined by the precision in the argument. | [
"The",
"natural",
"logarithm",
"."
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-common/src/main/java/org/nd4j/linalg/util/BigDecimalMath.java#L449-L501 | test | log of x | Of course, here is the Java code you requested:
```java
static public BigDecimal log(BigDecimal x) {
/* the value is undefined if x is negative.
*/
if (x.compareTo(BigDecimal.ZERO) < 0) {
throw new ArithmeticException("Cannot take log of negative " + x.toString());
} else i... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/stream/NcStreamReader.java | NcStreamReader.readData | public DataResult readData(InputStream is, NetcdfFile ncfile, String location) throws IOException {
byte[] b = new byte[4];
int bytesRead = NcStream.readFully(is, b);
if (bytesRead < b.length)
throw new EOFException(location);
if (NcStream.test(b,NcStream.MAGIC_DATA)) return readData1(is, n... | java | public DataResult readData(InputStream is, NetcdfFile ncfile, String location) throws IOException {
byte[] b = new byte[4];
int bytesRead = NcStream.readFully(is, b);
if (bytesRead < b.length)
throw new EOFException(location);
if (NcStream.test(b,NcStream.MAGIC_DATA)) return readData1(is, n... | [
"public",
"DataResult",
"readData",
"(",
"InputStream",
"is",
",",
"NetcdfFile",
"ncfile",
",",
"String",
"location",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"b",
"=",
"new",
"byte",
"[",
"4",
"]",
";",
"int",
"bytesRead",
"=",
"NcStream",
"... | Read the result of a data request. Only one variable at a time.
@param is read from input stream
@param ncfile need the metadata from here to interpret structure data
@return DataResult
@throws IOException on read error | [
"Read",
"the",
"result",
"of",
"a",
"data",
"request",
".",
"Only",
"one",
"variable",
"at",
"a",
"time",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/stream/NcStreamReader.java#L108-L118 | test | Reads data from an input stream. | Of course, here is the Java code you requested:
```java
public DataResult readData(InputStream is, NetcdfFile ncfile, String location) throws IOException {
byte[] b = new byte[4];
int bytesRead = NcStream.readFully(is, b);
if (bytesRead < b.length)
throw new EOFException(location);
if (NcS... |
deeplearning4j/nd4j | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCSR.java | BaseSparseNDArrayCSR.get | @Override
public INDArray get(INDArrayIndex... indexes) {
//check for row/column vector and point index being 0
if (indexes.length == 1 && indexes[0] instanceof NDArrayIndexAll || (indexes.length == 2 && (isRowVector()
&& indexes[0] instanceof PointIndex && indexes[0].offset(... | java | @Override
public INDArray get(INDArrayIndex... indexes) {
//check for row/column vector and point index being 0
if (indexes.length == 1 && indexes[0] instanceof NDArrayIndexAll || (indexes.length == 2 && (isRowVector()
&& indexes[0] instanceof PointIndex && indexes[0].offset(... | [
"@",
"Override",
"public",
"INDArray",
"get",
"(",
"INDArrayIndex",
"...",
"indexes",
")",
"{",
"//check for row/column vector and point index being 0",
"if",
"(",
"indexes",
".",
"length",
"==",
"1",
"&&",
"indexes",
"[",
"0",
"]",
"instanceof",
"NDArrayIndexAll",
... | Returns a subset of this array based on the specified
indexes
@param indexes the indexes in to the array
@return a view of the array with the specified indices | [
"Returns",
"a",
"subset",
"of",
"this",
"array",
"based",
"on",
"the",
"specified",
"indexes"
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ndarray/BaseSparseNDArrayCSR.java#L118-L153 | test | Get a subset of the vector with the specified indexes | Of course, here is the Java code you requested:
```java
@Override
public INDArray get(INDArrayIndex... indexes) {
//check for row/column vector and point index being 0
if (indexes.length == 1 && indexes[0] instanceof NDArrayIndexAll || (indexes.length == 2 && (isRowVector()
... |
jcodec/jcodec | android/src/main/org/jcodec/api/android/AndroidFrameGrab.java | AndroidFrameGrab.getFrameWithMetadata | public BitmapWithMetadata getFrameWithMetadata(Bitmap bmp) throws IOException {
PictureWithMetadata pictureWithMetadata = getNativeFrameWithMetadata();
if (pictureWithMetadata == null)
return null;
AndroidUtil.toBitmap(pictureWithMetadata.getPicture(), bmp);
return new Bitmap... | java | public BitmapWithMetadata getFrameWithMetadata(Bitmap bmp) throws IOException {
PictureWithMetadata pictureWithMetadata = getNativeFrameWithMetadata();
if (pictureWithMetadata == null)
return null;
AndroidUtil.toBitmap(pictureWithMetadata.getPicture(), bmp);
return new Bitmap... | [
"public",
"BitmapWithMetadata",
"getFrameWithMetadata",
"(",
"Bitmap",
"bmp",
")",
"throws",
"IOException",
"{",
"PictureWithMetadata",
"pictureWithMetadata",
"=",
"getNativeFrameWithMetadata",
"(",
")",
";",
"if",
"(",
"pictureWithMetadata",
"==",
"null",
")",
"return"... | Get frame at current position in AWT image
@return A decoded picture with metadata. A bitmap provided is used.
@throws IOException | [
"Get",
"frame",
"at",
"current",
"position",
"in",
"AWT",
"image"
] | cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75 | https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/android/src/main/org/jcodec/api/android/AndroidFrameGrab.java#L123-L129 | test | Get the frame with metadata bitmap. | Of course, here is the Java code you requested:
```java
public BitmapWithMetadata getFrameWithMetadata(Bitmap bmp) throws IOException {
PictureWithMetadata pictureWithMetadata = getNativeFrameWithMetadata();
if (pictureWithMetadata == null)
return null;
AndroidUtil.toBitmap(pictureW... |
Koekiebox-PTY-LTD/Fluid | fluid-api/src/main/java/com/fluidbpm/program/api/vo/flow/FlowStep.java | FlowStep.setStepProperty | public void setStepProperty(
String nameParam, String valueParam)
{
if(this.getStepProperties() == null)
{
this.setStepProperties(new ArrayList());
}
if(nameParam == null || nameParam.trim().isEmpty())
{
return;
}
if(value... | java | public void setStepProperty(
String nameParam, String valueParam)
{
if(this.getStepProperties() == null)
{
this.setStepProperties(new ArrayList());
}
if(nameParam == null || nameParam.trim().isEmpty())
{
return;
}
if(value... | [
"public",
"void",
"setStepProperty",
"(",
"String",
"nameParam",
",",
"String",
"valueParam",
")",
"{",
"if",
"(",
"this",
".",
"getStepProperties",
"(",
")",
"==",
"null",
")",
"{",
"this",
".",
"setStepProperties",
"(",
"new",
"ArrayList",
"(",
")",
")",... | Sets the property value of the step with
property name {@code nameParam}.
@param nameParam The property name.
@param valueParam The property value. | [
"Sets",
"the",
"property",
"value",
"of",
"the",
"step",
"with",
"property",
"name",
"{",
"@code",
"nameParam",
"}",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/vo/flow/FlowStep.java#L394-L424 | test | Sets the value of a step property. | Of course, here is the Java code you requested:
```java
public void setStepProperty(
String nameParam, String valueParam)
{
if(this.getStepProperties() == null)
{
this.setStepProperties(new ArrayList());
}
if(nameParam == null || nameParam.trim().isEmpty())
... |
objectify/objectify | src/main/java/com/googlecode/objectify/impl/LoadTypeImpl.java | LoadTypeImpl.filter | @Override
public Query<T> filter(final Filter filter) {
final QueryImpl<T> q = createQuery();
q.addFilter(filter);
return q;
} | java | @Override
public Query<T> filter(final Filter filter) {
final QueryImpl<T> q = createQuery();
q.addFilter(filter);
return q;
} | [
"@",
"Override",
"public",
"Query",
"<",
"T",
">",
"filter",
"(",
"final",
"Filter",
"filter",
")",
"{",
"final",
"QueryImpl",
"<",
"T",
">",
"q",
"=",
"createQuery",
"(",
")",
";",
"q",
".",
"addFilter",
"(",
"filter",
")",
";",
"return",
"q",
";"... | /* | [
"/",
"*"
] | 4bf325d2e49b400326416977c7d9bbdf5380175b | https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/LoadTypeImpl.java#L67-L72 | test | Creates a new query with the specified filter. | Of course, here is the Java code you requested:
```java
@Override
public Query<T> filter(final Filter filter) {
final QueryImpl<T> q = createQuery();
q.addFilter(filter);
return q;
}
```
Hope this helps! |
oblac/jodd | jodd-mail/src/main/java/jodd/mail/CommonEmail.java | CommonEmail.valueOrEmptyArray | protected EmailAddress[] valueOrEmptyArray(EmailAddress[] arr) {
if (arr == null) {
arr = EmailAddress.EMPTY_ARRAY;
}
return arr;
} | java | protected EmailAddress[] valueOrEmptyArray(EmailAddress[] arr) {
if (arr == null) {
arr = EmailAddress.EMPTY_ARRAY;
}
return arr;
} | [
"protected",
"EmailAddress",
"[",
"]",
"valueOrEmptyArray",
"(",
"EmailAddress",
"[",
"]",
"arr",
")",
"{",
"if",
"(",
"arr",
"==",
"null",
")",
"{",
"arr",
"=",
"EmailAddress",
".",
"EMPTY_ARRAY",
";",
"}",
"return",
"arr",
";",
"}"
] | ---------------------------------------------------------------- helper | [
"----------------------------------------------------------------",
"helper"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-mail/src/main/java/jodd/mail/CommonEmail.java#L821-L826 | test | valueOrEmptyArray This method checks if the given array is null. | Of course, here is the Java code you requested:
```java
protected EmailAddress[] valueOrEmptyArray(EmailAddress[] arr) {
if (arr == null) {
arr = EmailAddress.EMPTY_ARRAY;
}
return arr;
}
```
Hope this helps! |
Unidata/thredds | dap4/d4core/src/main/java/dap4/core/util/DapUtil.java | DapUtil.getStructurePath | static public List<DapVariable>
getStructurePath(DapVariable var)
{
List<DapNode> path = var.getPath();
List<DapVariable> structpath = new ArrayList<DapVariable>();
for(int i = 0; i < path.size(); i++) {
DapNode node = path.get(i);
switch (node.getSort()) {
... | java | static public List<DapVariable>
getStructurePath(DapVariable var)
{
List<DapNode> path = var.getPath();
List<DapVariable> structpath = new ArrayList<DapVariable>();
for(int i = 0; i < path.size(); i++) {
DapNode node = path.get(i);
switch (node.getSort()) {
... | [
"static",
"public",
"List",
"<",
"DapVariable",
">",
"getStructurePath",
"(",
"DapVariable",
"var",
")",
"{",
"List",
"<",
"DapNode",
">",
"path",
"=",
"var",
".",
"getPath",
"(",
")",
";",
"List",
"<",
"DapVariable",
">",
"structpath",
"=",
"new",
"Arra... | Given a dap variable, get the path from the
top-level variable to and including the given variable
such that all but the last element is a structure. | [
"Given",
"a",
"dap",
"variable",
"get",
"the",
"path",
"from",
"the",
"top",
"-",
"level",
"variable",
"to",
"and",
"including",
"the",
"given",
"variable",
"such",
"that",
"all",
"but",
"the",
"last",
"element",
"is",
"a",
"structure",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4core/src/main/java/dap4/core/util/DapUtil.java#L349-L368 | test | Gets the structure path of a single DapVariable. | Of course, here is the Java code you requested:
```java
static public List<DapVariable>
getStructurePath(DapVariable var)
{
List<DapNode> path = var.getPath();
List<DapVariable> structpath = new ArrayList<DapVariable>();
for(int i = 0; i < path.size(); i++) {
DapNode node = ... |
rest-assured/rest-assured | modules/spring-mock-mvc/src/main/java/io/restassured/module/mockmvc/RestAssuredMockMvc.java | RestAssuredMockMvc.authentication | public static MockMvcAuthenticationScheme authentication(final Object authentication) {
return new MockMvcAuthenticationScheme() {
public void authenticate(MockMvcRequestSpecification mockMvcRequestSpecification) {
mockMvcRequestSpecification.auth().authentication(authentication);
... | java | public static MockMvcAuthenticationScheme authentication(final Object authentication) {
return new MockMvcAuthenticationScheme() {
public void authenticate(MockMvcRequestSpecification mockMvcRequestSpecification) {
mockMvcRequestSpecification.auth().authentication(authentication);
... | [
"public",
"static",
"MockMvcAuthenticationScheme",
"authentication",
"(",
"final",
"Object",
"authentication",
")",
"{",
"return",
"new",
"MockMvcAuthenticationScheme",
"(",
")",
"{",
"public",
"void",
"authenticate",
"(",
"MockMvcRequestSpecification",
"mockMvcRequestSpeci... | Authenticate using the supplied authentication instance (<code>org.springframework.security.core.Authentication</code> from Spring Security). Used as:
<pre>
RestAssured.authentication = authentication(myAuth);
</pre>
or in a {@link MockMvcRequestSpecBuilder}:
<pre>
MockMvcRequestSpecification req = new MockMvcRequestSp... | [
"Authenticate",
"using",
"the",
"supplied",
"authentication",
"instance",
"(",
"<code",
">",
"org",
".",
"springframework",
".",
"security",
".",
"core",
".",
"Authentication<",
"/",
"code",
">",
"from",
"Spring",
"Security",
")",
".",
"Used",
"as",
":",
"<p... | 165a85b65070f5a07fe0045175613fb2c2811642 | https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/modules/spring-mock-mvc/src/main/java/io/restassured/module/mockmvc/RestAssuredMockMvc.java#L839-L845 | test | Create a mock authentication scheme. | Of course, here is the Java code you requested:
```java
public static MockMvcAuthenticationScheme authentication(final Object authentication) {
return new MockMvcAuthenticationScheme() {
public void authenticate(MockMvcRequestSpecification mockMvcRequestSpecification) {
mockMvcReque... |
Unidata/thredds | visad/src/main/java/ucar/nc2/iosp/grid/GridHorizCoordSys.java | GridHorizCoordSys.makeLC | private void makeLC() {
// we have to project in order to find the origin
proj = new LambertConformal(
gds.getDouble(GridDefRecord.LATIN1), gds.getDouble(GridDefRecord.LOV),
gds.getDouble(GridDefRecord.LATIN1), gds.getDouble(GridDefRecord.LATIN2));
LatLonPointImpl startLL =
new LatLo... | java | private void makeLC() {
// we have to project in order to find the origin
proj = new LambertConformal(
gds.getDouble(GridDefRecord.LATIN1), gds.getDouble(GridDefRecord.LOV),
gds.getDouble(GridDefRecord.LATIN1), gds.getDouble(GridDefRecord.LATIN2));
LatLonPointImpl startLL =
new LatLo... | [
"private",
"void",
"makeLC",
"(",
")",
"{",
"// we have to project in order to find the origin",
"proj",
"=",
"new",
"LambertConformal",
"(",
"gds",
".",
"getDouble",
"(",
"GridDefRecord",
".",
"LATIN1",
")",
",",
"gds",
".",
"getDouble",
"(",
"GridDefRecord",
"."... | Make a LambertConformalConic projection | [
"Make",
"a",
"LambertConformalConic",
"projection"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/grid/GridHorizCoordSys.java#L641-L683 | test | Make the Lambert Conformal LatLon Point | Of course, here is the Java code you requested:
```java
private void makeLC() {
// we have to project in order to find the origin
proj = new LambertConformal(
gds.getDouble(GridDefRecord.LATIN1), gds.getDouble(GridDefRecord.LOV),
gds.getDouble(GridDefRecord.LATIN1), gds.getDouble(GridDefRecord.... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/db/document/ODatabaseDocumentAbstract.java | ODatabaseDocumentAbstract.registerHook | public <DB extends ODatabase<?>> DB registerHook(final ORecordHook iHookImpl, final ORecordHook.HOOK_POSITION iPosition) {
checkOpenness();
checkIfActive();
final Map<ORecordHook, ORecordHook.HOOK_POSITION> tmp = new LinkedHashMap<ORecordHook, ORecordHook.HOOK_POSITION>(hooks);
tmp.put(iHookImpl, iPosi... | java | public <DB extends ODatabase<?>> DB registerHook(final ORecordHook iHookImpl, final ORecordHook.HOOK_POSITION iPosition) {
checkOpenness();
checkIfActive();
final Map<ORecordHook, ORecordHook.HOOK_POSITION> tmp = new LinkedHashMap<ORecordHook, ORecordHook.HOOK_POSITION>(hooks);
tmp.put(iHookImpl, iPosi... | [
"public",
"<",
"DB",
"extends",
"ODatabase",
"<",
"?",
">",
">",
"DB",
"registerHook",
"(",
"final",
"ORecordHook",
"iHookImpl",
",",
"final",
"ORecordHook",
".",
"HOOK_POSITION",
"iPosition",
")",
"{",
"checkOpenness",
"(",
")",
";",
"checkIfActive",
"(",
"... | {@inheritDoc} | [
"{"
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/db/document/ODatabaseDocumentAbstract.java#L577-L594 | test | Registers a new record hook. | Of course, here is the Java code you requested:
```java
public <DB extends ODatabase<?>> DB registerHook(final ORecordHook iHookImpl, final ORecordHook.HOOK_POSITION iPosition) {
checkOpenness();
checkIfActive();
final Map<ORecordHook, ORecordHook.HOOK_POSITION> tmp = new LinkedHashMap<ORecordHook, ORecor... |
ReactiveX/RxJava | src/main/java/io/reactivex/Observable.java | Observable.observeOn | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final Observable<T> observeOn(Scheduler scheduler, boolean delayError, int bufferSize) {
ObjectHelper.requireNonNull(scheduler, "scheduler is null");
ObjectHelper.verifyPositive(bufferSize, "bufferSize");
return RxJavaPl... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final Observable<T> observeOn(Scheduler scheduler, boolean delayError, int bufferSize) {
ObjectHelper.requireNonNull(scheduler, "scheduler is null");
ObjectHelper.verifyPositive(bufferSize, "bufferSize");
return RxJavaPl... | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"CUSTOM",
")",
"public",
"final",
"Observable",
"<",
"T",
">",
"observeOn",
"(",
"Scheduler",
"scheduler",
",",
"boolean",
"delayError",
",",
"int",
"bufferSize",
")",
"{",
"ObjectHe... | Modifies an ObservableSource to perform its emissions and notifications on a specified {@link Scheduler},
asynchronously with an unbounded buffer of configurable "island size" and optionally delays onError notifications.
<p>
<img width="640" height="308" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-opera... | [
"Modifies",
"an",
"ObservableSource",
"to",
"perform",
"its",
"emissions",
"and",
"notifications",
"on",
"a",
"specified",
"{",
"@link",
"Scheduler",
"}",
"asynchronously",
"with",
"an",
"unbounded",
"buffer",
"of",
"configurable",
"island",
"size",
"and",
"option... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L9987-L9993 | test | Observes the sequence of items in the source sequence using the specified scheduler. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final Observable<T> observeOn(Scheduler scheduler, boolean delayError, int bufferSize) {
ObjectHelper.requireNonNull(scheduler, "scheduler is null");
ObjectHelper.verifyPo... |
dschulten/hydra-java | spring-hateoas-ext/src/main/java/de/escalon/hypermedia/spring/xhtml/XhtmlWriter.java | XhtmlWriter.recurseBeanProperties | private void recurseBeanProperties(Class<?> beanType, ActionDescriptor actionDescriptor, ActionInputParameter
actionInputParameter, Object currentCallValue, String parentParamName) throws IOException {
// TODO support Option provider by other method args?
final BeanInfo beanInfo = getBeanInf... | java | private void recurseBeanProperties(Class<?> beanType, ActionDescriptor actionDescriptor, ActionInputParameter
actionInputParameter, Object currentCallValue, String parentParamName) throws IOException {
// TODO support Option provider by other method args?
final BeanInfo beanInfo = getBeanInf... | [
"private",
"void",
"recurseBeanProperties",
"(",
"Class",
"<",
"?",
">",
"beanType",
",",
"ActionDescriptor",
"actionDescriptor",
",",
"ActionInputParameter",
"actionInputParameter",
",",
"Object",
"currentCallValue",
",",
"String",
"parentParamName",
")",
"throws",
"IO... | Renders input fields for bean properties of bean to add or update or patch.
@param beanType
to render
@param actionDescriptor
which describes the method
@param actionInputParameter
which requires the bean
@param currentCallValue
sample call value
@throws IOException | [
"Renders",
"input",
"fields",
"for",
"bean",
"properties",
"of",
"bean",
"to",
"add",
"or",
"update",
"or",
"patch",
"."
] | 21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a | https://github.com/dschulten/hydra-java/blob/21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a/spring-hateoas-ext/src/main/java/de/escalon/hypermedia/spring/xhtml/XhtmlWriter.java#L546-L683 | test | Recursively recurse bean properties. | Of course, here is the Java code you requested:
```java
private void recurseBeanProperties(Class<?> beanType, ActionDescriptor actionDescriptor, ActionInputParameter
actionInputParameter, Object currentCallValue, String parentParamName) throws IOException {
// TODO support Option provider by other ... |
Unidata/thredds | legacy/src/main/java/thredds/catalog/ThreddsMetadata.java | ThreddsMetadata.removeDocumentation | public void removeDocumentation(String type) {
Iterator iter = docs.iterator();
while (iter.hasNext()) {
InvDocumentation doc = (InvDocumentation) iter.next();
String dtype = doc.getType();
if ((dtype != null) && dtype.equalsIgnoreCase(type))
iter.remove();
}
} | java | public void removeDocumentation(String type) {
Iterator iter = docs.iterator();
while (iter.hasNext()) {
InvDocumentation doc = (InvDocumentation) iter.next();
String dtype = doc.getType();
if ((dtype != null) && dtype.equalsIgnoreCase(type))
iter.remove();
}
} | [
"public",
"void",
"removeDocumentation",
"(",
"String",
"type",
")",
"{",
"Iterator",
"iter",
"=",
"docs",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"iter",
".",
"hasNext",
"(",
")",
")",
"{",
"InvDocumentation",
"doc",
"=",
"(",
"InvDocumentation",
... | remove all instances of specified type of documentation
@param type type of documentation | [
"remove",
"all",
"instances",
"of",
"specified",
"type",
"of",
"documentation"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/thredds/catalog/ThreddsMetadata.java#L586-L594 | test | Remove the documentation of a type | Of course, here is the Java code you requested:
```java
public void removeDocumentation(String type) {
Iterator iter = docs.iterator();
while (iter.hasNext()) {
InvDocumentation doc = (InvDocumentation) iter.next();
String dtype = doc.getType();
if ((dtype != null) && dtype.equalsIgnoreCase(t... |
wildfly/wildfly | security/subsystem/src/main/java/org/jboss/as/security/plugins/JNDIBasedSecurityManagement.java | JNDIBasedSecurityManagement.setDeepCopySubjectMode | private static void setDeepCopySubjectMode(AuthenticationManager authenticationManager) {
try {
Class<?>[] argsType = { Boolean.class };
Method m = authenticationManager.getClass().getMethod("setDeepCopySubjectOption", argsType);
Object[] deepCopyArgs = { Boolean.TRUE };
... | java | private static void setDeepCopySubjectMode(AuthenticationManager authenticationManager) {
try {
Class<?>[] argsType = { Boolean.class };
Method m = authenticationManager.getClass().getMethod("setDeepCopySubjectOption", argsType);
Object[] deepCopyArgs = { Boolean.TRUE };
... | [
"private",
"static",
"void",
"setDeepCopySubjectMode",
"(",
"AuthenticationManager",
"authenticationManager",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"argsType",
"=",
"{",
"Boolean",
".",
"class",
"}",
";",
"Method",
"m",
"=",
"authenticationMa... | Use reflection to attempt to set the deep copy subject mode on the {@code AuthenticationManager}
@param authenticationManager the {@code AuthenticationManager} | [
"Use",
"reflection",
"to",
"attempt",
"to",
"set",
"the",
"deep",
"copy",
"subject",
"mode",
"on",
"the",
"{",
"@code",
"AuthenticationManager",
"}"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/security/subsystem/src/main/java/org/jboss/as/security/plugins/JNDIBasedSecurityManagement.java#L415-L424 | test | Optional method to set the subject mode of the authentication manager. | Of course, here is the Java code you requested:
```java
private static void setDeepCopySubjectMode(AuthenticationManager authenticationManager) {
try {
Class<?>[] argsType = { Boolean.class };
Method m = authenticationManager.getClass().getMethod("setDeepCopySubjectOption", argsType);
... |
Unidata/thredds | cdm/src/main/java/ucar/ma2/MAMath.java | MAMath.add | public static Array add(Array a, Array b) throws IllegalArgumentException {
Array result = Array.factory(a.getDataType(), a.getShape());
if (a.getElementType() == double.class) {
addDouble(result, a, b);
} else
throw new UnsupportedOperationException();
return result;
} | java | public static Array add(Array a, Array b) throws IllegalArgumentException {
Array result = Array.factory(a.getDataType(), a.getShape());
if (a.getElementType() == double.class) {
addDouble(result, a, b);
} else
throw new UnsupportedOperationException();
return result;
} | [
"public",
"static",
"Array",
"add",
"(",
"Array",
"a",
",",
"Array",
"b",
")",
"throws",
"IllegalArgumentException",
"{",
"Array",
"result",
"=",
"Array",
".",
"factory",
"(",
"a",
".",
"getDataType",
"(",
")",
",",
"a",
".",
"getShape",
"(",
")",
")",... | Add elements of two arrays together, allocating the result array.
The result type and the operation type are taken from the type of a.
@param a add values from here
@param b add values from here
@return result = a + b
@throws IllegalArgumentException a and b are not conformable
@throws UnsupportedOperationExcepti... | [
"Add",
"elements",
"of",
"two",
"arrays",
"together",
"allocating",
"the",
"result",
"array",
".",
"The",
"result",
"type",
"and",
"the",
"operation",
"type",
"are",
"taken",
"from",
"the",
"type",
"of",
"a",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/ma2/MAMath.java#L30-L40 | test | Adds two arrays of the same type. | Of course, here is the Java code you requested:
```java
public static Array add(Array a, Array b) throws IllegalArgumentException {
Array result = Array.factory(a.getDataType(), a.getShape());
if (a.getElementType() == double.class) {
addDouble(result, a, b);
} else
throw new Unsupport... |
spring-projects/spring-security | web/src/main/java/org/springframework/security/web/firewall/StrictHttpFirewall.java | StrictHttpFirewall.setAllowedHttpMethods | public void setAllowedHttpMethods(Collection<String> allowedHttpMethods) {
if (allowedHttpMethods == null) {
throw new IllegalArgumentException("allowedHttpMethods cannot be null");
}
if (allowedHttpMethods == ALLOW_ANY_HTTP_METHOD) {
this.allowedHttpMethods = ALLOW_ANY_HTTP_METHOD;
} else {
this.allow... | java | public void setAllowedHttpMethods(Collection<String> allowedHttpMethods) {
if (allowedHttpMethods == null) {
throw new IllegalArgumentException("allowedHttpMethods cannot be null");
}
if (allowedHttpMethods == ALLOW_ANY_HTTP_METHOD) {
this.allowedHttpMethods = ALLOW_ANY_HTTP_METHOD;
} else {
this.allow... | [
"public",
"void",
"setAllowedHttpMethods",
"(",
"Collection",
"<",
"String",
">",
"allowedHttpMethods",
")",
"{",
"if",
"(",
"allowedHttpMethods",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"allowedHttpMethods cannot be null\"",
")",
";... | <p>
Determines which HTTP methods should be allowed. The default is to allow "DELETE", "GET", "HEAD", "OPTIONS",
"PATCH", "POST", and "PUT".
</p>
@param allowedHttpMethods the case-sensitive collection of HTTP methods that are allowed.
@see #setUnsafeAllowAnyHttpMethod(boolean)
@since 5.1 | [
"<p",
">",
"Determines",
"which",
"HTTP",
"methods",
"should",
"be",
"allowed",
".",
"The",
"default",
"is",
"to",
"allow",
"DELETE",
"GET",
"HEAD",
"OPTIONS",
"PATCH",
"POST",
"and",
"PUT",
".",
"<",
"/",
"p",
">"
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/firewall/StrictHttpFirewall.java#L134-L143 | test | Sets the allowed HTTP methods. | Of course, here is the Java code you requested:
```java
public void setAllowedHttpMethods(Collection<String> allowedHttpMethods) {
if (allowedHttpMethods == null) {
throw new IllegalArgumentException("allowedHttpMethods cannot be null");
}
if (allowedHttpMethods == ALLOW_ANY_HTTP_METHOD) {
this.allowedHttp... |
RestComm/jain-slee | container/common/src/main/java/org/mobicents/slee/container/deployment/jboss/SLEESubDeployer.java | SLEESubDeployer.showStatus | public String showStatus() throws DeploymentException {
String output = "";
output += "<p>Deployable Units List:</p>";
for (String key : deployableUnits.keySet()) {
output += "<" + key + "> [" + deployableUnits.get(key)
+ "]<br>";
for (String duComponent : deployableUnits.get(key).getComponent... | java | public String showStatus() throws DeploymentException {
String output = "";
output += "<p>Deployable Units List:</p>";
for (String key : deployableUnits.keySet()) {
output += "<" + key + "> [" + deployableUnits.get(key)
+ "]<br>";
for (String duComponent : deployableUnits.get(key).getComponent... | [
"public",
"String",
"showStatus",
"(",
")",
"throws",
"DeploymentException",
"{",
"String",
"output",
"=",
"\"\"",
";",
"output",
"+=",
"\"<p>Deployable Units List:</p>\"",
";",
"for",
"(",
"String",
"key",
":",
"deployableUnits",
".",
"keySet",
"(",
")",
")",
... | MBean operation for getting Deployer status. | [
"MBean",
"operation",
"for",
"getting",
"Deployer",
"status",
"."
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/common/src/main/java/org/mobicents/slee/container/deployment/jboss/SLEESubDeployer.java#L338-L369 | test | Show the status of the deployment manager. | Of course, here is the Java code you requested:
```java
public String showStatus() throws DeploymentException {
String output = "";
output += "<p>Deployable Units List:</p>";
for (String key : deployableUnits.keySet()) {
output += "<" + key + "> [" + deployableUnits.get(key)
+ "]<br>";
for (S... |
tony19/logback-android | logback-android/src/main/java/ch/qos/logback/classic/pattern/MDCConverter.java | MDCConverter.outputMDCForAllKeys | private String outputMDCForAllKeys(Map<String, String> mdcPropertyMap) {
StringBuilder buf = new StringBuilder();
boolean first = true;
for (Map.Entry<String, String> entry : mdcPropertyMap.entrySet()) {
if (first) {
first = false;
} else {
buf.append(", ");
}
//forma... | java | private String outputMDCForAllKeys(Map<String, String> mdcPropertyMap) {
StringBuilder buf = new StringBuilder();
boolean first = true;
for (Map.Entry<String, String> entry : mdcPropertyMap.entrySet()) {
if (first) {
first = false;
} else {
buf.append(", ");
}
//forma... | [
"private",
"String",
"outputMDCForAllKeys",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"mdcPropertyMap",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"boolean",
"first",
"=",
"true",
";",
"for",
"(",
"Map",
".",
"Entry"... | if no key is specified, return all the values present in the MDC, in the format "k1=v1, k2=v2, ..." | [
"if",
"no",
"key",
"is",
"specified",
"return",
"all",
"the",
"values",
"present",
"in",
"the",
"MDC",
"in",
"the",
"format",
"k1",
"=",
"v1",
"k2",
"=",
"v2",
"..."
] | 028489c11ccfc1237a53923db06f22a90b41809c | https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/classic/pattern/MDCConverter.java#L69-L82 | test | Output the MDC for all keys. | Of course, here is the Java code you requested:
```java
private String outputMDCForAllKeys(Map<String, String> mdcPropertyMap) {
StringBuilder buf = new StringBuilder();
boolean first = true;
for (Map.Entry<String, String> entry : mdcPropertyMap.entrySet()) {
if (first) {
first = false;
... |
Unidata/thredds | visad/src/main/java/ucar/nc2/iosp/gempak/GempakFileReader.java | GempakFileReader.getInstance | public static GempakFileReader getInstance(RandomAccessFile raf, boolean fullCheck) throws IOException {
GempakFileReader gfr = new GempakFileReader();
gfr.init(raf, fullCheck);
return gfr;
} | java | public static GempakFileReader getInstance(RandomAccessFile raf, boolean fullCheck) throws IOException {
GempakFileReader gfr = new GempakFileReader();
gfr.init(raf, fullCheck);
return gfr;
} | [
"public",
"static",
"GempakFileReader",
"getInstance",
"(",
"RandomAccessFile",
"raf",
",",
"boolean",
"fullCheck",
")",
"throws",
"IOException",
"{",
"GempakFileReader",
"gfr",
"=",
"new",
"GempakFileReader",
"(",
")",
";",
"gfr",
".",
"init",
"(",
"raf",
",",
... | Initialize the file, read in all the metadata (ala DM_OPEN)
@param raf RandomAccessFile to read.
@param fullCheck if true, check entire structure
@return a GempakFileReader
@throws IOException problem reading file | [
"Initialize",
"the",
"file",
"read",
"in",
"all",
"the",
"metadata",
"(",
"ala",
"DM_OPEN",
")"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/gempak/GempakFileReader.java#L108-L112 | test | Get a new instance of the GempakFileReader class. | Of course, here is the Java code you requested:
```java
public static GempakFileReader getInstance(RandomAccessFile raf, boolean fullCheck) throws IOException {
GempakFileReader gfr = new GempakFileReader();
gfr.init(raf, fullCheck);
return gfr;
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/ma2/Index.java | Index.getIndexIterator | IndexIterator getIndexIterator(Array maa) {
if (fastIterator)
return new IteratorFast(size, maa);
else
return new IteratorImpl(maa);
} | java | IndexIterator getIndexIterator(Array maa) {
if (fastIterator)
return new IteratorFast(size, maa);
else
return new IteratorImpl(maa);
} | [
"IndexIterator",
"getIndexIterator",
"(",
"Array",
"maa",
")",
"{",
"if",
"(",
"fastIterator",
")",
"return",
"new",
"IteratorFast",
"(",
"size",
",",
"maa",
")",
";",
"else",
"return",
"new",
"IteratorImpl",
"(",
"maa",
")",
";",
"}"
] | Get an index iterator for traversing the array in canonical order.
@param maa the array to iterate through
@return an index iterator for traversing the array in canonical order.
@see IndexIterator | [
"Get",
"an",
"index",
"iterator",
"for",
"traversing",
"the",
"array",
"in",
"canonical",
"order",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/ma2/Index.java#L457-L462 | test | Returns an iterator over the array of bytes. | Of course, here is the Java code you requested:
```java
IndexIterator getIndexIterator(Array maa) {
if (fastIterator)
return new IteratorFast(size, maa);
else
return new IteratorImpl(maa);
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/nc2/ft/FeatureDatasetFactoryManager.java | FeatureDatasetFactoryManager.wrap | static public FeatureDataset wrap(FeatureType wantFeatureType, NetcdfDataset ncd, ucar.nc2.util.CancelTask task, Formatter errlog) throws IOException {
if (debug) System.out.println("wrap " + ncd.getLocation() + " want = " + wantFeatureType);
// the case where we dont know what type it is
if ((wantFeat... | java | static public FeatureDataset wrap(FeatureType wantFeatureType, NetcdfDataset ncd, ucar.nc2.util.CancelTask task, Formatter errlog) throws IOException {
if (debug) System.out.println("wrap " + ncd.getLocation() + " want = " + wantFeatureType);
// the case where we dont know what type it is
if ((wantFeat... | [
"static",
"public",
"FeatureDataset",
"wrap",
"(",
"FeatureType",
"wantFeatureType",
",",
"NetcdfDataset",
"ncd",
",",
"ucar",
".",
"nc2",
".",
"util",
".",
"CancelTask",
"task",
",",
"Formatter",
"errlog",
")",
"throws",
"IOException",
"{",
"if",
"(",
"debug"... | Wrap a NetcdfDataset as a FeatureDataset.
@param wantFeatureType open this kind of FeatureDataset; may be null, which means search all factories.
If datatype is not null, only return FeatureDataset with objects of that type
@param ncd the NetcdfDataset to wrap as a FeatureDataset
@param task use... | [
"Wrap",
"a",
"NetcdfDataset",
"as",
"a",
"FeatureDataset",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft/FeatureDatasetFactoryManager.java#L281-L310 | test | Wrap a NetCDFDataset with a feature type. | Of course, here is the Java code you requested:
```java
static public FeatureDataset wrap(FeatureType wantFeatureType, NetcdfDataset ncd, ucar.nc2.util.CancelTask task, Formatter errlog) throws IOException {
if (debug) System.out.println("wrap " + ncd.getLocation() + " want = " + wantFeatureType);
// the c... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/index/OIndexChangesWrapper.java | OIndexChangesWrapper.toKeys | @Override
public Set<Object> toKeys() {
if (source.isRebuilding())
throwRebuildException();
final Set<Object> keys = delegate.toKeys();
if (source.getRebuildVersion() != indexRebuildVersion)
throwRebuildException();
return keys;
} | java | @Override
public Set<Object> toKeys() {
if (source.isRebuilding())
throwRebuildException();
final Set<Object> keys = delegate.toKeys();
if (source.getRebuildVersion() != indexRebuildVersion)
throwRebuildException();
return keys;
} | [
"@",
"Override",
"public",
"Set",
"<",
"Object",
">",
"toKeys",
"(",
")",
"{",
"if",
"(",
"source",
".",
"isRebuilding",
"(",
")",
")",
"throwRebuildException",
"(",
")",
";",
"final",
"Set",
"<",
"Object",
">",
"keys",
"=",
"delegate",
".",
"toKeys",
... | {@inheritDoc} | [
"{"
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/index/OIndexChangesWrapper.java#L109-L120 | test | Override toKeys to return a set of all the keys in the target. | Of course, here is the Java code you requested:
```java
@Override
public Set<Object> toKeys() {
if (source.isRebuilding())
throwRebuildException();
final Set<Object> keys = delegate.toKeys();
if (source.getRebuildVersion() != indexRebuildVersion)
throwRebuildException();
return keys;
... |
wildfly/wildfly | security/api/src/main/java/org/jboss/as/security/api/ConnectionSecurityContext.java | ConnectionSecurityContext.pushIdentity | public static ContextStateCache pushIdentity(final Principal principal, final Object credential) throws Exception {
SecurityContext current = SecurityContextAssociation.getSecurityContext();
SecurityContext nextContext = SecurityContextFactory.createSecurityContext(principal, credential, new Subject(),... | java | public static ContextStateCache pushIdentity(final Principal principal, final Object credential) throws Exception {
SecurityContext current = SecurityContextAssociation.getSecurityContext();
SecurityContext nextContext = SecurityContextFactory.createSecurityContext(principal, credential, new Subject(),... | [
"public",
"static",
"ContextStateCache",
"pushIdentity",
"(",
"final",
"Principal",
"principal",
",",
"final",
"Object",
"credential",
")",
"throws",
"Exception",
"{",
"SecurityContext",
"current",
"=",
"SecurityContextAssociation",
".",
"getSecurityContext",
"(",
")",
... | Push a new {@link Principal} and Credential pair.
This method is to be called before an EJB invocation is passed through it's security interceptor, at that point the
Principal and Credential pair can be verified.
Note: This method should be called from within a {@link PrivilegedAction}.
@param principal - The altern... | [
"Push",
"a",
"new",
"{",
"@link",
"Principal",
"}",
"and",
"Credential",
"pair",
"."
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/security/api/src/main/java/org/jboss/as/security/api/ConnectionSecurityContext.java#L102-L112 | test | Push identity into the cache. | Of course, here is the Java code you requested:
```java
public static ContextStateCache pushIdentity(final Principal principal, final Object credential) throws Exception {
SecurityContext current = SecurityContextAssociation.getSecurityContext();
SecurityContext nextContext = SecurityContextFactory.cr... |
OpenEstate/OpenEstate-IO | ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java | ObjectFactory.createKennungUrsprung | @XmlElementDecl(namespace = "http://www.immoxml.de", name = "kennung_ursprung")
public JAXBElement<String> createKennungUrsprung(String value) {
return new JAXBElement<String>(_KennungUrsprung_QNAME, String.class, null, value);
} | java | @XmlElementDecl(namespace = "http://www.immoxml.de", name = "kennung_ursprung")
public JAXBElement<String> createKennungUrsprung(String value) {
return new JAXBElement<String>(_KennungUrsprung_QNAME, String.class, null, value);
} | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"http://www.immoxml.de\"",
",",
"name",
"=",
"\"kennung_ursprung\"",
")",
"public",
"JAXBElement",
"<",
"String",
">",
"createKennungUrsprung",
"(",
"String",
"value",
")",
"{",
"return",
"new",
"JAXBElement",
"<",
"... | Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"String",
"}",
"{",
"@code",
">",
"}}"
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java#L2327-L2330 | test | Create an instance of a Kennung Ursprung in einen Methode. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "kennung_ursprung")
public JAXBElement<String> createKennungUrsprung(String value) {
return new JAXBElement<String>(_KennungUrsprung_QNAME, String.class, null, value);
}
```
Hope this he... |
Unidata/thredds | cdm/src/main/java/thredds/filesystem/MFileOS.java | MFileOS.getExistingFile | static public MFileOS getExistingFile(String filename) {
if (filename == null) return null;
File file = new File(filename);
if (file.exists()) return new MFileOS(file);
return null;
} | java | static public MFileOS getExistingFile(String filename) {
if (filename == null) return null;
File file = new File(filename);
if (file.exists()) return new MFileOS(file);
return null;
} | [
"static",
"public",
"MFileOS",
"getExistingFile",
"(",
"String",
"filename",
")",
"{",
"if",
"(",
"filename",
"==",
"null",
")",
"return",
"null",
";",
"File",
"file",
"=",
"new",
"File",
"(",
"filename",
")",
";",
"if",
"(",
"file",
".",
"exists",
"("... | Make MFileOS if file exists, otherwise return null
@param filename
@return MFileOS or null | [
"Make",
"MFileOS",
"if",
"file",
"exists",
"otherwise",
"return",
"null"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/thredds/filesystem/MFileOS.java#L55-L60 | test | Gets an existing file from a filename. | Of course, here is the Java code you requested:
```java
static public MFileOS getExistingFile(String filename) {
if (filename == null) return null;
File file = new File(filename);
if (file.exists()) return new MFileOS(file);
return null;
}
```
Hope this helps! |
OpenEstate/OpenEstate-IO | OpenImmo/src/main/java/org/openestate/io/openimmo/OpenImmoUtils.java | OpenImmoUtils.createDocument | public static OpenImmoDocument createDocument(String xmlString) throws SAXException, IOException, ParserConfigurationException {
return createDocument(XmlUtils.newDocument(xmlString, true));
} | java | public static OpenImmoDocument createDocument(String xmlString) throws SAXException, IOException, ParserConfigurationException {
return createDocument(XmlUtils.newDocument(xmlString, true));
} | [
"public",
"static",
"OpenImmoDocument",
"createDocument",
"(",
"String",
"xmlString",
")",
"throws",
"SAXException",
",",
"IOException",
",",
"ParserConfigurationException",
"{",
"return",
"createDocument",
"(",
"XmlUtils",
".",
"newDocument",
"(",
"xmlString",
",",
"... | Creates a {@link OpenImmoDocument} from a {@link String}.
@param xmlString XML string
@return created document or null, of the document is not supported by this format
@throws SAXException if XML is invalid
@throws IOException if reading failed
@throws ParserConfigurationException if t... | [
"Creates",
"a",
"{",
"@link",
"OpenImmoDocument",
"}",
"from",
"a",
"{",
"@link",
"String",
"}",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/java/org/openestate/io/openimmo/OpenImmoUtils.java#L126-L128 | test | Create an OpenImmoDocument from the given XML string. | Of course, here is the Java code you requested:
```java
public static OpenImmoDocument createDocument(String xmlString) throws SAXException, IOException, ParserConfigurationException {
return createDocument(XmlUtils.newDocument(xmlString, true));
}
```
Hope this helps! |
Unidata/thredds | udunits/src/main/java/ucar/units/UnitID.java | UnitID.newUnitID | public static UnitID newUnitID(final String name, final String plural,
final String symbol) {
UnitID id;
try {
id = name == null
? new UnitSymbol(symbol)
: UnitName.newUnitName(name, plural, symbol);
}
catch (final NameException e) {
id = null; // can't happen
}
return id;
} | java | public static UnitID newUnitID(final String name, final String plural,
final String symbol) {
UnitID id;
try {
id = name == null
? new UnitSymbol(symbol)
: UnitName.newUnitName(name, plural, symbol);
}
catch (final NameException e) {
id = null; // can't happen
}
return id;
} | [
"public",
"static",
"UnitID",
"newUnitID",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"plural",
",",
"final",
"String",
"symbol",
")",
"{",
"UnitID",
"id",
";",
"try",
"{",
"id",
"=",
"name",
"==",
"null",
"?",
"new",
"UnitSymbol",
"(",
"s... | Factory method for constructing an identifier from a name, plural, and
symbol.
@param name
The name for the unit. May be <code>null
</code>.
@param plural
The plural form of the name. If <code>null
</code> and
<code>name</code> is non-<code>
null</code>, then regular
plural-forming rules are used on the name.
@param s... | [
"Factory",
"method",
"for",
"constructing",
"an",
"identifier",
"from",
"a",
"name",
"plural",
"and",
"symbol",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/udunits/src/main/java/ucar/units/UnitID.java#L34-L46 | test | Create a new unit ID. | Of course, here is the Java code you requested:
```java
public static UnitID newUnitID(final String name, final String plural,
final String symbol) {
UnitID id;
try {
id = name == null
? new UnitSymbol(symbol)
: UnitName.newUnitName(name, plural, symbol);
}
catch (final NameException e) {
id... |
Netflix/hollow | hollow/src/main/java/com/netflix/hollow/api/consumer/HollowConsumer.java | HollowConsumer.getAPI | public <T extends HollowAPI> T getAPI(Class<T> apiClass) {
return apiClass.cast(updater.getAPI());
} | java | public <T extends HollowAPI> T getAPI(Class<T> apiClass) {
return apiClass.cast(updater.getAPI());
} | [
"public",
"<",
"T",
"extends",
"HollowAPI",
">",
"T",
"getAPI",
"(",
"Class",
"<",
"T",
">",
"apiClass",
")",
"{",
"return",
"apiClass",
".",
"cast",
"(",
"updater",
".",
"getAPI",
"(",
")",
")",
";",
"}"
] | Equivalent to calling {@link #getAPI()} and casting to the specified API.
@param apiClass the class of the API
@param <T> the type of the API
@return the API which wraps the underlying dataset | [
"Equivalent",
"to",
"calling",
"{",
"@link",
"#getAPI",
"()",
"}",
"and",
"casting",
"to",
"the",
"specified",
"API",
"."
] | 43ca100034a01050fb764170bd32b085ac9a3c22 | https://github.com/Netflix/hollow/blob/43ca100034a01050fb764170bd32b085ac9a3c22/hollow/src/main/java/com/netflix/hollow/api/consumer/HollowConsumer.java#L306-L308 | test | Get the Hollow API object. | Of course, here is the Java code you requested:
```java
public <T extends HollowAPI> T getAPI(Class<T> apiClass) {
return apiClass.cast(updater.getAPI());
}
```
Hope this helps! |
oblac/jodd | jodd-core/src/main/java/jodd/io/findfile/FindFile.java | FindFile.searchPath | public FindFile searchPath(final String searchPath) {
if (searchPath.indexOf(File.pathSeparatorChar) != -1) {
String[] paths = StringUtil.split(searchPath, File.pathSeparator);
for (String path : paths) {
addPath(new File(path));
}
} else {
addPath(new File(searchPath));
}
return this;
} | java | public FindFile searchPath(final String searchPath) {
if (searchPath.indexOf(File.pathSeparatorChar) != -1) {
String[] paths = StringUtil.split(searchPath, File.pathSeparator);
for (String path : paths) {
addPath(new File(path));
}
} else {
addPath(new File(searchPath));
}
return this;
} | [
"public",
"FindFile",
"searchPath",
"(",
"final",
"String",
"searchPath",
")",
"{",
"if",
"(",
"searchPath",
".",
"indexOf",
"(",
"File",
".",
"pathSeparatorChar",
")",
"!=",
"-",
"1",
")",
"{",
"String",
"[",
"]",
"paths",
"=",
"StringUtil",
".",
"split... | Specifies the search path. If provided path contains
{@link File#pathSeparator} than string will be tokenized
and each part will be added separately as a search path. | [
"Specifies",
"the",
"search",
"path",
".",
"If",
"provided",
"path",
"contains",
"{"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/io/findfile/FindFile.java#L200-L210 | test | Add a search path to the find file. | Of course, here is the Java code you requested:
```java
public FindFile searchPath(final String searchPath) {
if (searchPath.indexOf(File.pathSeparatorChar) != -1) {
String[] paths = StringUtil.split(searchPath, File.pathSeparator);
for (String path : paths) {
addPath(new File(path));
}
} else {
ad... |
oblac/jodd | jodd-http/src/main/java/jodd/http/HttpMultiMap.java | HttpMultiMap.iterator | @Override
public Iterator<Map.Entry<String, V>> iterator() {
final MapEntry[] e = {head.after};
return new Iterator<Map.Entry<String, V>>() {
@Override
public boolean hasNext() {
return e[0] != head;
}
@Override
@SuppressWarnings("unchecked")
public Map.Entry<String, V> next() {
if (!ha... | java | @Override
public Iterator<Map.Entry<String, V>> iterator() {
final MapEntry[] e = {head.after};
return new Iterator<Map.Entry<String, V>>() {
@Override
public boolean hasNext() {
return e[0] != head;
}
@Override
@SuppressWarnings("unchecked")
public Map.Entry<String, V> next() {
if (!ha... | [
"@",
"Override",
"public",
"Iterator",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"V",
">",
">",
"iterator",
"(",
")",
"{",
"final",
"MapEntry",
"[",
"]",
"e",
"=",
"{",
"head",
".",
"after",
"}",
";",
"return",
"new",
"Iterator",
"<",
"Map",
... | Returns iterator of all entries. | [
"Returns",
"iterator",
"of",
"all",
"entries",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-http/src/main/java/jodd/http/HttpMultiMap.java#L359-L385 | test | Returns an iterator over the entries in this map. | Of course, here is the Java code you requested:
```java
@Override
public Iterator<Map.Entry<String, V>> iterator() {
final MapEntry[] e = {head.after};
return new Iterator<Map.Entry<String, V>>() {
@Override
public boolean hasNext() {
return e[0] != head;
}
@Override
@SuppressWarnings("unchec... |
PeterisP/morphology | src/main/java/lv/semti/morphology/lexicon/Ending.java | Ending.stem | public String stem (String word) throws WrongEndingException {
if (!word.endsWith(ending))
throw new WrongEndingException("Gļuks - vārds (" + word + ") nebeidzas ar norādīto galotni (" + ending + ")");
return word.substring(0, word.length()- ending.length());
} | java | public String stem (String word) throws WrongEndingException {
if (!word.endsWith(ending))
throw new WrongEndingException("Gļuks - vārds (" + word + ") nebeidzas ar norādīto galotni (" + ending + ")");
return word.substring(0, word.length()- ending.length());
} | [
"public",
"String",
"stem",
"(",
"String",
"word",
")",
"throws",
"WrongEndingException",
"{",
"if",
"(",
"!",
"word",
".",
"endsWith",
"(",
"ending",
")",
")",
"throw",
"new",
"WrongEndingException",
"(",
"\"Gļuks - vārds (\" +",
"w",
"rd +",
"\"",
" nebeidza... | tiek pieņemts, ka izsaucošā funkcija nodrošina, ka vārds tiešām beidzas ar šo galotni. | [
"tiek",
"pieņemts",
"ka",
"izsaucošā",
"funkcija",
"nodrošina",
"ka",
"vārds",
"tiešām",
"beidzas",
"ar",
"šo",
"galotni",
"."
] | a7805b7cbf09fc46ebe7f2dd4009a0807a7e2783 | https://github.com/PeterisP/morphology/blob/a7805b7cbf09fc46ebe7f2dd4009a0807a7e2783/src/main/java/lv/semti/morphology/lexicon/Ending.java#L133-L137 | test | stem a word | Of course, here is the Java code you requested:
```java
public String stem (String word) throws WrongEndingException {
if (!word.endsWith(ending))
throw new WrongEndingException("Gļuks - vārds (" + word + ") nebeidzas ar norādīto galotni (" + ending + ")");
return word.substring(0, word.length()- ending.length(... |
blademainer/common_utils | commons-file/src/main/java/info/monitorenter/util/StringUtil.java | StringUtil.isEmpty | public static boolean isEmpty(final String test) {
boolean result;
if (test == null) {
result = true;
} else {
result = test.trim().length() == 0;
}
return result;
} | java | public static boolean isEmpty(final String test) {
boolean result;
if (test == null) {
result = true;
} else {
result = test.trim().length() == 0;
}
return result;
} | [
"public",
"static",
"boolean",
"isEmpty",
"(",
"final",
"String",
"test",
")",
"{",
"boolean",
"result",
";",
"if",
"(",
"test",
"==",
"null",
")",
"{",
"result",
"=",
"true",
";",
"}",
"else",
"{",
"result",
"=",
"test",
".",
"trim",
"(",
")",
"."... | Returns true if the argument is null or consists of whitespaces only.
<p>
@param test
the <code>String</code> to test.
@return true if the argument is null or consists of whitespaces only. | [
"Returns",
"true",
"if",
"the",
"argument",
"is",
"null",
"or",
"consists",
"of",
"whitespaces",
"only",
".",
"<p",
">"
] | ef6baf0367c16de95a28caab67a7d5842a6d13db | https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/commons-file/src/main/java/info/monitorenter/util/StringUtil.java#L215-L223 | test | Checks if a string is empty. | Of course, here is the Java code you requested:
```java
public static boolean isEmpty(final String test) {
boolean result;
if (test == null) {
result = true;
} else {
result = test.trim().length() == 0;
}
return result;
}
```
Hope this helps! |
jboss/jboss-common-core | src/main/java/org/jboss/util/xml/catalog/Catalog.java | Catalog.parseCatalog | public synchronized void parseCatalog(URL aUrl) throws IOException {
catalogCwd = aUrl;
base = aUrl;
default_override = catalogManager.getPreferPublic();
catalogManager.debug.message(4, "Parse catalog: " + aUrl.toString());
DataInputStream inStream = null;
boolean parsed = false;
for (int... | java | public synchronized void parseCatalog(URL aUrl) throws IOException {
catalogCwd = aUrl;
base = aUrl;
default_override = catalogManager.getPreferPublic();
catalogManager.debug.message(4, "Parse catalog: " + aUrl.toString());
DataInputStream inStream = null;
boolean parsed = false;
for (int... | [
"public",
"synchronized",
"void",
"parseCatalog",
"(",
"URL",
"aUrl",
")",
"throws",
"IOException",
"{",
"catalogCwd",
"=",
"aUrl",
";",
"base",
"=",
"aUrl",
";",
"default_override",
"=",
"catalogManager",
".",
"getPreferPublic",
"(",
")",
";",
"catalogManager",... | Parse a catalog document, augmenting internal data structures.
<p>This method supports catalog files stored in jar files: e.g.,
jar:file:///path/to/filename.jar!/path/to/catalog.xml". That URI
doesn't survive transmogrification through the URI processing that
the parseCatalog(String) performs and passing it as an inpu... | [
"Parse",
"a",
"catalog",
"document",
"augmenting",
"internal",
"data",
"structures",
"."
] | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/xml/catalog/Catalog.java#L652-L692 | test | Parse the catalog from the given URL. | Of course, here is the Java code you requested:
```java
public synchronized void parseCatalog(URL aUrl) throws IOException {
catalogCwd = aUrl;
base = aUrl;
default_override = catalogManager.getPreferPublic();
catalogManager.debug.message(4, "Parse catalog: " + aUrl.toString());
DataInputStream i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.