_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q176200 | FeatureIndexManager.deleteIndex | test | public boolean deleteIndex(FeatureIndexType type, long geomId) {
if (type == null) {
throw new GeoPackageException("FeatureIndexType is required to delete index");
}
boolean deleted = false;
switch (type) {
case GEOPACKAGE:
deleted = featureTableIndex.deleteIndex(geomId) > 0;
break;
case METADATA:
deleted = featureIndexer.deleteIndex(geomId);
break;
case RTREE:
// Updated by triggers, ignore for RTree
deleted = true;
break;
default:
throw new GeoPackageException("Unsupported FeatureIndexType: " + type);
}
return deleted;
} | java | {
"resource": ""
} |
q176201 | FeatureIndexManager.isIndexed | test | public boolean isIndexed() {
boolean indexed = false;
for (FeatureIndexType type : indexLocationQueryOrder) {
indexed = isIndexed(type);
if (indexed) {
break;
}
}
return indexed;
} | java | {
"resource": ""
} |
q176202 | FeatureIndexManager.getIndexedTypes | test | public List<FeatureIndexType> getIndexedTypes() {
List<FeatureIndexType> indexed = new ArrayList<>();
for (FeatureIndexType type : indexLocationQueryOrder) {
if (isIndexed(type)) {
indexed.add(type);
}
}
return indexed;
} | java | {
"resource": ""
} |
q176203 | FeatureIndexManager.query | test | public FeatureIndexResults query() {
FeatureIndexResults results = null;
switch (getIndexedType()) {
case GEOPACKAGE:
long count = featureTableIndex.count();
CloseableIterator<GeometryIndex> geometryIndices = featureTableIndex.query();
results = new FeatureIndexGeoPackageResults(featureTableIndex, count, geometryIndices);
break;
case METADATA:
Cursor geometryMetadata = featureIndexer.query();
results = new FeatureIndexMetadataResults(featureIndexer, geometryMetadata);
break;
case RTREE:
UserCustomCursor cursor = rTreeIndexTableDao.queryForAll();
results = new FeatureIndexRTreeResults(rTreeIndexTableDao,
cursor);
break;
default:
FeatureCursor featureCursor = featureDao.queryForAll();
results = new FeatureIndexFeatureResults(featureCursor);
}
return results;
} | java | {
"resource": ""
} |
q176204 | FeatureIndexManager.count | test | public long count() {
long count = 0;
switch (getIndexedType()) {
case GEOPACKAGE:
count = featureTableIndex.count();
break;
case METADATA:
count = featureIndexer.count();
break;
case RTREE:
count = rTreeIndexTableDao.count();
break;
default:
count = manualFeatureQuery.countWithGeometries();
}
return count;
} | java | {
"resource": ""
} |
q176205 | FeatureIndexManager.getBoundingBox | test | public BoundingBox getBoundingBox() {
BoundingBox bounds = null;
switch (getIndexedType()) {
case GEOPACKAGE:
bounds = featureTableIndex.getBoundingBox();
break;
case METADATA:
bounds = featureIndexer.getBoundingBox();
break;
case RTREE:
bounds = rTreeIndexTableDao.getBoundingBox();
break;
default:
bounds = manualFeatureQuery.getBoundingBox();
}
return bounds;
} | java | {
"resource": ""
} |
q176206 | FeatureIndexManager.query | test | public FeatureIndexResults query(BoundingBox boundingBox, Projection projection) {
FeatureIndexResults results = null;
switch (getIndexedType()) {
case GEOPACKAGE:
long count = featureTableIndex.count(boundingBox, projection);
CloseableIterator<GeometryIndex> geometryIndices = featureTableIndex.query(boundingBox, projection);
results = new FeatureIndexGeoPackageResults(featureTableIndex, count, geometryIndices);
break;
case METADATA:
Cursor geometryMetadata = featureIndexer.query(boundingBox, projection);
results = new FeatureIndexMetadataResults(featureIndexer, geometryMetadata);
break;
case RTREE:
UserCustomCursor cursor = rTreeIndexTableDao.query(
boundingBox, projection);
results = new FeatureIndexRTreeResults(rTreeIndexTableDao,
cursor);
break;
default:
results = manualFeatureQuery.query(boundingBox, projection);
}
return results;
} | java | {
"resource": ""
} |
q176207 | FeatureIndexManager.getIndexedType | test | private FeatureIndexType getIndexedType() {
FeatureIndexType indexType = FeatureIndexType.NONE;
// Check for an indexed type
for (FeatureIndexType type : indexLocationQueryOrder) {
if (isIndexed(type)) {
indexType = type;
break;
}
}
return indexType;
} | java | {
"resource": ""
} |
q176208 | ContextIOUtils.getInternalFile | test | public static File getInternalFile(Context context, String filePath) {
File internalFile = null;
if (filePath != null) {
internalFile = new File(context.getFilesDir(), filePath);
} else {
internalFile = context.getFilesDir();
}
return internalFile;
} | java | {
"resource": ""
} |
q176209 | ContextIOUtils.getInternalFilePath | test | public static String getInternalFilePath(Context context, String filePath) {
return getInternalFile(context, filePath).getAbsolutePath();
} | java | {
"resource": ""
} |
q176210 | StyleMappingRow.getGeometryType | test | public GeometryType getGeometryType() {
GeometryType geometryType = null;
String geometryTypeName = getGeometryTypeName();
if (geometryTypeName != null) {
geometryType = GeometryType.fromName(geometryTypeName);
}
return geometryType;
} | java | {
"resource": ""
} |
q176211 | StyleMappingRow.setGeometryType | test | public void setGeometryType(GeometryType geometryType) {
String geometryTypeName = null;
if (geometryType != null) {
geometryTypeName = geometryType.getName();
}
setValue(getGeometryTypeNameColumnIndex(), geometryTypeName);
} | java | {
"resource": ""
} |
q176212 | UrlTileGenerator.hasBoundingBox | test | private boolean hasBoundingBox(String url) {
String replacedUrl = replaceBoundingBox(url, boundingBox);
boolean hasBoundingBox = !replacedUrl.equals(url);
return hasBoundingBox;
} | java | {
"resource": ""
} |
q176213 | UrlTileGenerator.replaceXYZ | test | private String replaceXYZ(String url, int z, long x, long y) {
url = url.replaceAll(
context.getString(R.string.tile_generator_variable_z),
String.valueOf(z));
url = url.replaceAll(
context.getString(R.string.tile_generator_variable_x),
String.valueOf(x));
url = url.replaceAll(
context.getString(R.string.tile_generator_variable_y),
String.valueOf(y));
return url;
} | java | {
"resource": ""
} |
q176214 | UrlTileGenerator.hasXYZ | test | private boolean hasXYZ(String url) {
String replacedUrl = replaceXYZ(url, 0, 0, 0);
boolean hasXYZ = !replacedUrl.equals(url);
return hasXYZ;
} | java | {
"resource": ""
} |
q176215 | UrlTileGenerator.replaceBoundingBox | test | private String replaceBoundingBox(String url, int z, long x, long y) {
BoundingBox boundingBox = TileBoundingBoxUtils.getProjectedBoundingBox(
projection, x, y, z);
url = replaceBoundingBox(url, boundingBox);
return url;
} | java | {
"resource": ""
} |
q176216 | UrlTileGenerator.replaceBoundingBox | test | private String replaceBoundingBox(String url, BoundingBox boundingBox) {
url = url.replaceAll(
context.getString(R.string.tile_generator_variable_min_lat),
String.valueOf(boundingBox.getMinLatitude()));
url = url.replaceAll(
context.getString(R.string.tile_generator_variable_max_lat),
String.valueOf(boundingBox.getMaxLatitude()));
url = url.replaceAll(
context.getString(R.string.tile_generator_variable_min_lon),
String.valueOf(boundingBox.getMinLongitude()));
url = url.replaceAll(
context.getString(R.string.tile_generator_variable_max_lon),
String.valueOf(boundingBox.getMaxLongitude()));
return url;
} | java | {
"resource": ""
} |
q176217 | FeatureCursor.getGeometry | test | public GeoPackageGeometryData getGeometry() {
GeoPackageGeometryData geometry = null;
int columnIndex = getTable().getGeometryColumnIndex();
int type = getType(columnIndex);
if (type != FIELD_TYPE_NULL) {
byte[] geometryBytes = getBlob(columnIndex);
if (geometryBytes != null) {
geometry = new GeoPackageGeometryData(geometryBytes);
}
}
return geometry;
} | java | {
"resource": ""
} |
q176218 | FeatureIndexer.index | test | private boolean index(long geoPackageId, FeatureRow row, boolean possibleUpdate) {
boolean indexed = false;
GeoPackageGeometryData geomData = row.getGeometry();
if (geomData != null) {
// Get the envelope
GeometryEnvelope envelope = geomData.getEnvelope();
// If no envelope, build one from the geometry
if (envelope == null) {
Geometry geometry = geomData.getGeometry();
if (geometry != null) {
envelope = GeometryEnvelopeBuilder.buildEnvelope(geometry);
}
}
// Create the new index row
if (envelope != null) {
GeometryMetadata metadata = geometryMetadataDataSource.populate(geoPackageId, featureDao.getTableName(), row.getId(), envelope);
if (possibleUpdate) {
geometryMetadataDataSource.createOrUpdate(metadata);
} else {
geometryMetadataDataSource.create(metadata);
}
indexed = true;
}
}
return indexed;
} | java | {
"resource": ""
} |
q176219 | FeatureIndexer.updateLastIndexed | test | private void updateLastIndexed(GeoPackageMetadataDb db, long geoPackageId) {
long indexedTime = (new Date()).getTime();
TableMetadataDataSource ds = new TableMetadataDataSource(db);
if (!ds.updateLastIndexed(geoPackageId, featureDao.getTableName(), indexedTime)) {
throw new GeoPackageException("Failed to update last indexed time. Table: GeoPackage Id: "
+ geoPackageId + ", Table: " + featureDao.getTableName() + ", Last Indexed: " + indexedTime);
}
} | java | {
"resource": ""
} |
q176220 | FeatureIndexer.deleteIndex | test | public boolean deleteIndex() {
TableMetadataDataSource tableMetadataDataSource = new TableMetadataDataSource(db);
boolean deleted = tableMetadataDataSource.delete(featureDao.getDatabase(), featureDao.getTableName());
return deleted;
} | java | {
"resource": ""
} |
q176221 | FeatureIndexer.deleteIndex | test | public boolean deleteIndex(long geomId) {
boolean deleted = geometryMetadataDataSource.delete(
featureDao.getDatabase(), featureDao.getTableName(), geomId);
return deleted;
} | java | {
"resource": ""
} |
q176222 | FeatureIndexer.isIndexed | test | public boolean isIndexed() {
boolean indexed = false;
Date lastIndexed = getLastIndexed();
if (lastIndexed != null) {
Contents contents = featureDao.getGeometryColumns().getContents();
Date lastChange = contents.getLastChange();
indexed = lastIndexed.equals(lastChange) || lastIndexed.after(lastChange);
}
return indexed;
} | java | {
"resource": ""
} |
q176223 | FeatureIndexer.query | test | public Cursor query() {
Cursor cursor = geometryMetadataDataSource.query(featureDao.getDatabase(), featureDao.getTableName());
return cursor;
} | java | {
"resource": ""
} |
q176224 | FeatureIndexer.query | test | public Cursor query(BoundingBox boundingBox) {
Cursor cursor = geometryMetadataDataSource.query(featureDao.getDatabase(), featureDao.getTableName(), boundingBox);
return cursor;
} | java | {
"resource": ""
} |
q176225 | FeatureIndexer.count | test | public int count(BoundingBox boundingBox) {
int count = geometryMetadataDataSource.count(featureDao.getDatabase(), featureDao.getTableName(), boundingBox);
return count;
} | java | {
"resource": ""
} |
q176226 | FeatureIndexer.query | test | public Cursor query(GeometryEnvelope envelope) {
Cursor cursor = geometryMetadataDataSource.query(featureDao.getDatabase(), featureDao.getTableName(), envelope);
return cursor;
} | java | {
"resource": ""
} |
q176227 | FeatureIndexer.count | test | public int count(GeometryEnvelope envelope) {
int count = geometryMetadataDataSource.count(featureDao.getDatabase(), featureDao.getTableName(), envelope);
return count;
} | java | {
"resource": ""
} |
q176228 | FeatureIndexer.query | test | public Cursor query(BoundingBox boundingBox,
Projection projection) {
BoundingBox featureBoundingBox = getFeatureBoundingBox(boundingBox,
projection);
Cursor cursor = query(featureBoundingBox);
return cursor;
} | java | {
"resource": ""
} |
q176229 | FeatureIndexer.count | test | public long count(BoundingBox boundingBox, Projection projection) {
BoundingBox featureBoundingBox = getFeatureBoundingBox(boundingBox,
projection);
long count = count(featureBoundingBox);
return count;
} | java | {
"resource": ""
} |
q176230 | FeatureIndexer.getFeatureBoundingBox | test | private BoundingBox getFeatureBoundingBox(BoundingBox boundingBox,
Projection projection) {
ProjectionTransform projectionTransform = projection
.getTransformation(featureDao.getProjection());
BoundingBox featureBoundingBox = boundingBox
.transform(projectionTransform);
return featureBoundingBox;
} | java | {
"resource": ""
} |
q176231 | FeatureIndexer.getGeometryMetadata | test | public GeometryMetadata getGeometryMetadata(Cursor cursor) {
GeometryMetadata geometryMetadata = GeometryMetadataDataSource.createGeometryMetadata(cursor);
return geometryMetadata;
} | java | {
"resource": ""
} |
q176232 | FeatureIndexer.getFeatureRow | test | public FeatureRow getFeatureRow(Cursor cursor) {
GeometryMetadata geometryMetadata = getGeometryMetadata(cursor);
FeatureRow featureRow = getFeatureRow(geometryMetadata);
return featureRow;
} | java | {
"resource": ""
} |
q176233 | FeatureIndexer.getFeatureRow | test | public FeatureRow getFeatureRow(GeometryMetadata geometryMetadata) {
long geomId = geometryMetadata.getId();
// Get the row or lock for reading
FeatureRow row = featureRowSync.getRowOrLock(geomId);
if (row == null) {
// Query for the row and set in the sync
try {
row = featureDao.queryForIdRow(geomId);
} finally {
featureRowSync.setRow(geomId, row);
}
}
return row;
} | java | {
"resource": ""
} |
q176234 | FeatureTileTableLinker.getTileDaosForFeatureTable | test | public List<TileDao> getTileDaosForFeatureTable(String featureTable) {
List<TileDao> tileDaos = new ArrayList<TileDao>();
List<String> tileTables = getTileTablesForFeatureTable(featureTable);
for (String tileTable : tileTables) {
if (geoPackage.isTileTable(tileTable)) {
TileDao tileDao = geoPackage.getTileDao(tileTable);
tileDaos.add(tileDao);
}
}
return tileDaos;
} | java | {
"resource": ""
} |
q176235 | FeatureTileTableLinker.getFeatureDaosForTileTable | test | public List<FeatureDao> getFeatureDaosForTileTable(String tileTable) {
List<FeatureDao> featureDaos = new ArrayList<FeatureDao>();
List<String> featureTables = getFeatureTablesForTileTable(tileTable);
for (String featureTable : featureTables) {
if (geoPackage.isFeatureTable(featureTable)) {
FeatureDao featureDao = geoPackage.getFeatureDao(featureTable);
featureDaos.add(featureDao);
}
}
return featureDaos;
} | java | {
"resource": ""
} |
q176236 | FeatureTileGenerator.getBoundingBox | test | private static BoundingBox getBoundingBox(GeoPackage geoPackage,
FeatureTiles featureTiles, BoundingBox boundingBox,
Projection projection) {
String tableName = featureTiles.getFeatureDao().getTableName();
boolean manualQuery = boundingBox == null;
BoundingBox featureBoundingBox = geoPackage.getBoundingBox(projection,
tableName, manualQuery);
if (featureBoundingBox != null) {
if (boundingBox == null) {
boundingBox = featureBoundingBox;
} else {
boundingBox = boundingBox.overlap(featureBoundingBox);
}
}
if (boundingBox != null) {
boundingBox = featureTiles.expandBoundingBox(boundingBox,
projection);
}
return boundingBox;
} | java | {
"resource": ""
} |
q176237 | UserMappingDao.queryByIds | test | public UserCustomCursor queryByIds(long baseId, long relatedId) {
return query(buildWhereIds(baseId, relatedId),
buildWhereIdsArgs(baseId, relatedId));
} | java | {
"resource": ""
} |
q176238 | UserMappingDao.uniqueBaseIds | test | public List<Long> uniqueBaseIds() {
return querySingleColumnTypedResults(
"SELECT DISTINCT " + CoreSQLUtils.quoteWrap(UserMappingTable.COLUMN_BASE_ID) + " FROM "
+ CoreSQLUtils.quoteWrap(getTableName()), null);
} | java | {
"resource": ""
} |
q176239 | UserMappingDao.uniqueRelatedIds | test | public List<Long> uniqueRelatedIds() {
return querySingleColumnTypedResults(
"SELECT DISTINCT " + CoreSQLUtils.quoteWrap(UserMappingTable.COLUMN_RELATED_ID) + " FROM "
+ CoreSQLUtils.quoteWrap(getTableName()), null);
} | java | {
"resource": ""
} |
q176240 | UserMappingDao.deleteByBaseId | test | public int deleteByBaseId(long baseId) {
StringBuilder where = new StringBuilder();
where.append(buildWhere(UserMappingTable.COLUMN_BASE_ID, baseId));
String[] whereArgs = buildWhereArgs(new Object[]{baseId});
int deleted = delete(where.toString(), whereArgs);
return deleted;
} | java | {
"resource": ""
} |
q176241 | UserMappingDao.deleteByRelatedId | test | public int deleteByRelatedId(long relatedId) {
StringBuilder where = new StringBuilder();
where.append(buildWhere(UserMappingTable.COLUMN_RELATED_ID, relatedId));
String[] whereArgs = buildWhereArgs(new Object[]{relatedId});
int deleted = delete(where.toString(), whereArgs);
return deleted;
} | java | {
"resource": ""
} |
q176242 | UserMappingDao.deleteByIds | test | public int deleteByIds(long baseId, long relatedId) {
return delete(buildWhereIds(baseId, relatedId),
buildWhereIdsArgs(baseId, relatedId));
} | java | {
"resource": ""
} |
q176243 | UserMappingDao.buildWhereIds | test | private String buildWhereIds(long baseId, long relatedId) {
StringBuilder where = new StringBuilder();
where.append(buildWhere(UserMappingTable.COLUMN_BASE_ID, baseId));
where.append(" AND ");
where.append(buildWhere(UserMappingTable.COLUMN_RELATED_ID, relatedId));
return where.toString();
} | java | {
"resource": ""
} |
q176244 | GeoPackageMetadataDataSource.create | test | public void create(GeoPackageMetadata metadata) {
ContentValues values = new ContentValues();
values.put(GeoPackageMetadata.COLUMN_NAME, metadata.getName());
values.put(GeoPackageMetadata.COLUMN_EXTERNAL_PATH, metadata.getExternalPath());
long insertId = db.insert(
GeoPackageMetadata.TABLE_NAME, null,
values);
if (insertId == -1) {
throw new GeoPackageException(
"Failed to insert GeoPackage metadata. Name: "
+ metadata.getName() + ", External Path: "
+ metadata.getExternalPath());
}
metadata.setId(insertId);
} | java | {
"resource": ""
} |
q176245 | GeoPackageMetadataDataSource.delete | test | public boolean delete(String database) {
GeoPackageMetadata metadata = get(database);
if (metadata != null) {
TableMetadataDataSource tableDs = new TableMetadataDataSource(db);
tableDs.delete(metadata.getId());
}
String whereClause = GeoPackageMetadata.COLUMN_NAME + " = ?";
String[] whereArgs = new String[]{database};
int deleteCount = db.delete(
GeoPackageMetadata.TABLE_NAME,
whereClause, whereArgs);
return deleteCount > 0;
} | java | {
"resource": ""
} |
q176246 | GeoPackageMetadataDataSource.rename | test | public boolean rename(GeoPackageMetadata metadata, String newName) {
boolean renamed = rename(metadata.getName(), newName);
if (renamed) {
metadata.setName(newName);
}
return renamed;
} | java | {
"resource": ""
} |
q176247 | GeoPackageMetadataDataSource.rename | test | public boolean rename(String name, String newName) {
String whereClause = GeoPackageMetadata.COLUMN_NAME + " = ?";
String[] whereArgs = new String[]{name};
ContentValues values = new ContentValues();
values.put(GeoPackageMetadata.COLUMN_NAME, newName);
int updateCount = db.update(
GeoPackageMetadata.TABLE_NAME, values,
whereClause, whereArgs);
return updateCount > 0;
} | java | {
"resource": ""
} |
q176248 | GeoPackageMetadataDataSource.getAll | test | public List<GeoPackageMetadata> getAll() {
List<GeoPackageMetadata> allMetadata = new ArrayList<GeoPackageMetadata>();
Cursor cursor = db.query(
GeoPackageMetadata.TABLE_NAME,
GeoPackageMetadata.COLUMNS, null, null, null, null, null);
try {
while (cursor.moveToNext()) {
GeoPackageMetadata metadata = createGeoPackageMetadata(cursor);
allMetadata.add(metadata);
}
} finally {
cursor.close();
}
return allMetadata;
} | java | {
"resource": ""
} |
q176249 | GeoPackageMetadataDataSource.get | test | public GeoPackageMetadata get(String database) {
GeoPackageMetadata metadata = null;
String selection = GeoPackageMetadata.COLUMN_NAME + " = ?";
String[] selectionArgs = new String[]{database};
Cursor cursor = db.query(
GeoPackageMetadata.TABLE_NAME,
GeoPackageMetadata.COLUMNS, selection, selectionArgs, null, null, null);
try {
if (cursor.moveToNext()) {
metadata = createGeoPackageMetadata(cursor);
}
} finally {
cursor.close();
}
return metadata;
} | java | {
"resource": ""
} |
q176250 | GeoPackageMetadataDataSource.get | test | public GeoPackageMetadata get(long id) {
GeoPackageMetadata metadata = null;
String selection = GeoPackageMetadata.COLUMN_ID + " = ?";
String[] selectionArgs = new String[]{String.valueOf(id)};
Cursor cursor = db.query(
GeoPackageMetadata.TABLE_NAME,
GeoPackageMetadata.COLUMNS, selection, selectionArgs, null, null, null);
try {
if (cursor.moveToNext()) {
metadata = createGeoPackageMetadata(cursor);
}
} finally {
cursor.close();
}
return metadata;
} | java | {
"resource": ""
} |
q176251 | GeoPackageMetadataDataSource.getOrCreate | test | public GeoPackageMetadata getOrCreate(String geoPackage) {
GeoPackageMetadata metadata = get(geoPackage);
if (metadata == null) {
metadata = new GeoPackageMetadata();
metadata.setName(geoPackage);
create(metadata);
}
return metadata;
} | java | {
"resource": ""
} |
q176252 | GeoPackageMetadataDataSource.isExternal | test | public boolean isExternal(String database) {
GeoPackageMetadata metadata = get(database);
return get(database) != null && metadata.getExternalPath() != null;
} | java | {
"resource": ""
} |
q176253 | GeoPackageMetadataDataSource.getExternalAtPath | test | public GeoPackageMetadata getExternalAtPath(String path) {
GeoPackageMetadata metadata = null;
String selection = GeoPackageMetadata.COLUMN_EXTERNAL_PATH + " = ?";
String[] selectionArgs = new String[]{path};
Cursor cursor = db.query(
GeoPackageMetadata.TABLE_NAME,
GeoPackageMetadata.COLUMNS, selection, selectionArgs, null, null, null);
try {
if (cursor.moveToNext()) {
metadata = createGeoPackageMetadata(cursor);
}
} finally {
cursor.close();
}
return metadata;
} | java | {
"resource": ""
} |
q176254 | GeoPackageMetadataDataSource.getMetadataWhereNameLike | test | public List<String> getMetadataWhereNameLike(String like, String sortColumn) {
return getMetadataWhereNameLike(like, sortColumn, false);
} | java | {
"resource": ""
} |
q176255 | GeoPackageMetadataDataSource.getMetadataWhereNameNotLike | test | public List<String> getMetadataWhereNameNotLike(String notLike, String sortColumn) {
return getMetadataWhereNameLike(notLike, sortColumn, true);
} | java | {
"resource": ""
} |
q176256 | GeoPackageMetadataDataSource.getMetadataWhereNameLike | test | private List<String> getMetadataWhereNameLike(String like, String sortColumn, boolean notLike) {
List<String> names = new ArrayList<>();
StringBuilder where = new StringBuilder(GeoPackageMetadata.COLUMN_NAME);
if (notLike) {
where.append(" not");
}
where.append(" like ?");
String[] whereArgs = new String[]{like};
Cursor cursor = db.query(GeoPackageMetadata.TABLE_NAME, new String[]{GeoPackageMetadata.COLUMN_NAME}, where.toString(), whereArgs, null, null, sortColumn);
try {
while (cursor.moveToNext()) {
names.add(cursor.getString(0));
}
} finally {
cursor.close();
}
return names;
} | java | {
"resource": ""
} |
q176257 | GeoPackageMetadataDataSource.createGeoPackageMetadata | test | private GeoPackageMetadata createGeoPackageMetadata(Cursor cursor) {
GeoPackageMetadata metadata = new GeoPackageMetadata();
metadata.setId(cursor.getLong(0));
metadata.setName(cursor.getString(1));
metadata.setExternalPath(cursor.getString(2));
return metadata;
} | java | {
"resource": ""
} |
q176258 | ParallaxFactory.onViewCreated | test | public View onViewCreated(View view, Context context, AttributeSet attrs) {
if (view == null) {
return null;
}
view = onViewCreatedInternal(view, context, attrs);
for (OnViewCreatedListener listener : otherListeners) {
if (listener != null) {
view = listener.onViewCreated(view, context, attrs);
}
}
return view;
} | java | {
"resource": ""
} |
q176259 | ParallaxContainer.addParallaxView | test | private void addParallaxView(View view, int pageIndex) {
if (view instanceof ViewGroup) {
// recurse children
ViewGroup viewGroup = (ViewGroup) view;
for (int i = 0, childCount = viewGroup.getChildCount(); i < childCount; i++) {
addParallaxView(viewGroup.getChildAt(i), pageIndex);
}
}
ParallaxViewTag tag = (ParallaxViewTag) view.getTag(R.id.parallax_view_tag);
if (tag != null) {
// only track view if it has a parallax tag
tag.index = pageIndex;
parallaxViews.add(view);
}
} | java | {
"resource": ""
} |
q176260 | ParallaxLayoutInflater.onCreateView | test | @Override
protected View onCreateView(String name, AttributeSet attrs) throws ClassNotFoundException {
// This mimics the {@code PhoneLayoutInflater} in the way it tries to inflate the base
// classes, if this fails its pretty certain the app will fail at this point.
View view = null;
for (String prefix : sClassPrefixList) {
try {
view = createView(name, prefix, attrs);
} catch (ClassNotFoundException ignored) {
}
}
// In this case we want to let the base class take a crack
// at it.
if (view == null) { view = super.onCreateView(name, attrs); }
return mParallaxFactory.onViewCreated(view, view.getContext(), attrs);
} | java | {
"resource": ""
} |
q176261 | ParallaxLayoutInflater.createCustomViewInternal | test | private View createCustomViewInternal(View parent, View view, String name, Context context,
AttributeSet attrs) {
// I by no means advise anyone to do this normally, but Google have locked down access to
// the createView() method, so we never get a callback with attributes at the end of the
// createViewFromTag chain (which would solve all this unnecessary rubbish).
// We at the very least try to optimise this as much as possible.
// We only call for customViews (As they are the ones that never go through onCreateView(...)).
// We also maintain the Field reference and make it accessible which will make a pretty
// significant difference to performance on Android 4.0+.
// If CustomViewCreation is off skip this.
if (view == null && name.indexOf('.') > -1) {
if (mConstructorArgs == null) {
mConstructorArgs = ReflectionUtils.getField(LayoutInflater.class, "mConstructorArgs");
}
final Object[] mConstructorArgsArr =
(Object[]) ReflectionUtils.getValue(mConstructorArgs, this);
final Object lastContext = mConstructorArgsArr[0];
mConstructorArgsArr[0] = parent != null ? parent.getContext() : context;
ReflectionUtils.setValue(mConstructorArgs, this, mConstructorArgsArr);
try {
view = createView(name, null, attrs);
} catch (ClassNotFoundException ignored) {
} finally {
mConstructorArgsArr[0] = lastContext;
ReflectionUtils.setValue(mConstructorArgs, this, mConstructorArgsArr);
}
}
return view;
} | java | {
"resource": ""
} |
q176262 | SMTPAppender.subAppend | test | protected void subAppend(CyclicBuffer<ILoggingEvent> cb, ILoggingEvent event) {
if(includeCallerData) {
event.getCallerData();
}
event.prepareForDeferredProcessing();
cb.add(event);
} | java | {
"resource": ""
} |
q176263 | ContextInitializer.findConfigFileFromSystemProperties | test | private URL findConfigFileFromSystemProperties(boolean updateStatus) {
String logbackConfigFile = OptionHelper.getSystemProperty(CONFIG_FILE_PROPERTY);
if (logbackConfigFile != null) {
URL result = null;
try {
File file = new File(logbackConfigFile);
if (file.exists() && file.isFile()) {
if (updateStatus) {
statusOnResourceSearch(logbackConfigFile, this.classLoader, logbackConfigFile);
}
result = file.toURI().toURL();
} else {
result = new URL(logbackConfigFile);
}
return result;
} catch (MalformedURLException e) {
// so, resource is not a URL:
// attempt to get the resource from the class path
result = Loader.getResource(logbackConfigFile, this.classLoader);
if (result != null) {
return result;
}
} finally {
if (updateStatus) {
statusOnResourceSearch(logbackConfigFile, this.classLoader, result != null ? result.toString() : null);
}
}
}
return null;
} | java | {
"resource": ""
} |
q176264 | ContextInitializer.getResource | test | private URL getResource(String filename, ClassLoader myClassLoader, boolean updateStatus) {
URL url = myClassLoader.getResource(filename);
if (updateStatus) {
String resourcePath = null;
if (url != null) {
resourcePath = filename;
}
statusOnResourceSearch(filename, myClassLoader, resourcePath);
}
return url;
} | java | {
"resource": ""
} |
q176265 | ContextInitializer.autoConfig | test | public void autoConfig() throws JoranException {
StatusListenerConfigHelper.installIfAsked(loggerContext);
new AndroidContextUtil().setupProperties(loggerContext);
boolean verbose = true;
boolean configured = false;
JoranConfigurator configurator = new JoranConfigurator();
configurator.setContext(loggerContext);
// search system property
if (!configured) {
URL url = findConfigFileFromSystemProperties(verbose);
if (url != null) {
configurator.doConfigure(url);
configured = true;
}
}
// search assets
if (!configured) {
URL assetsConfigUrl = findConfigFileURLFromAssets(verbose);
if (assetsConfigUrl != null) {
configurator.doConfigure(assetsConfigUrl);
configured = true;
}
}
} | java | {
"resource": ""
} |
q176266 | ContextInitializer.statusOnResourceSearch | test | private void statusOnResourceSearch(String resourceName, ClassLoader classLoader, String path) {
StatusManager sm = loggerContext.getStatusManager();
if (path == null) {
sm.add(new InfoStatus("Could NOT find resource [" + resourceName + "]",
loggerContext));
} else {
sm.add(new InfoStatus("Found resource [" + resourceName + "] at [" + path + "]",
loggerContext));
}
} | java | {
"resource": ""
} |
q176267 | ServerSocketListener.socketAddressToString | test | private String socketAddressToString(SocketAddress address) {
String addr = address.toString();
int i = addr.indexOf("/");
if (i >= 0) {
addr = addr.substring(i + 1);
}
return addr;
} | java | {
"resource": ""
} |
q176268 | ExecutorServiceUtil.newExecutorService | test | static public ExecutorService newExecutorService() {
return new ThreadPoolExecutor(CoreConstants.CORE_POOL_SIZE,
CoreConstants.MAX_POOL_SIZE,
0L, TimeUnit.MILLISECONDS,
new SynchronousQueue<Runnable>(),
THREAD_FACTORY);
} | java | {
"resource": ""
} |
q176269 | ConverterUtil.startConverters | test | public static <E> void startConverters(Converter<E> head) {
Converter<E> c = head;
while (c != null) {
// CompositeConverter is a subclass of DynamicConverter
if (c instanceof CompositeConverter) {
CompositeConverter<E> cc = (CompositeConverter<E>) c;
Converter<E> childConverter = cc.childConverter;
startConverters(childConverter);
cc.start();
} else if (c instanceof DynamicConverter) {
DynamicConverter<E> dc = (DynamicConverter<E>) c;
dc.start();
}
c = c.getNext();
}
} | java | {
"resource": ""
} |
q176270 | RollingFileAppender.subAppend | test | @Override
protected void subAppend(E event) {
// The roll-over check must precede actual writing. This is the
// only correct behavior for time driven triggers.
// We need to synchronize on triggeringPolicy so that only one rollover
// occurs at a time
synchronized (triggeringPolicy) {
if (triggeringPolicy.isTriggeringEvent(currentlyActiveFile, event)) {
rollover();
}
}
super.subAppend(event);
} | java | {
"resource": ""
} |
q176271 | InterpretationContext.addSubstitutionProperty | test | public void addSubstitutionProperty(String key, String value) {
if (key == null || value == null) {
return;
}
// values with leading or trailing spaces are bad. We remove them now.
value = value.trim();
propertiesMap.put(key, value);
} | java | {
"resource": ""
} |
q176272 | InterpretationContext.getProperty | test | public String getProperty(String key) {
String v = propertiesMap.get(key);
if (v != null) {
return v;
} else {
return context.getProperty(key);
}
} | java | {
"resource": ""
} |
q176273 | Parser.compile | test | public Converter<E> compile(final Node top, Map<String, String> converterMap) {
Compiler<E> compiler = new Compiler<E>(top, converterMap);
compiler.setContext(context);
//compiler.setStatusManager(statusManager);
return compiler.compile();
} | java | {
"resource": ""
} |
q176274 | Parser.E | test | Node E() throws ScanException {
Node t = T();
if (t == null) {
return null;
}
Node eOpt = Eopt();
if (eOpt != null) {
t.setNext(eOpt);
}
return t;
} | java | {
"resource": ""
} |
q176275 | Parser.T | test | Node T() throws ScanException {
Token t = getCurentToken();
expectNotNull(t, "a LITERAL or '%'");
switch (t.getType()) {
case Token.LITERAL:
advanceTokenPointer();
return new Node(Node.LITERAL, t.getValue());
case Token.PERCENT:
advanceTokenPointer();
// System.out.println("% token found");
FormatInfo fi;
Token u = getCurentToken();
FormattingNode c;
expectNotNull(u, "a FORMAT_MODIFIER, SIMPLE_KEYWORD or COMPOUND_KEYWORD");
if (u.getType() == Token.FORMAT_MODIFIER) {
fi = FormatInfo.valueOf((String) u.getValue());
advanceTokenPointer();
c = C();
c.setFormatInfo(fi);
} else {
c = C();
}
return c;
default:
return null;
}
} | java | {
"resource": ""
} |
q176276 | AlmostAsIsEscapeUtil.escape | test | public void escape(String escapeChars, StringBuffer buf, char next,
int pointer) {
super.escape(""+CoreConstants.PERCENT_CHAR+CoreConstants.RIGHT_PARENTHESIS_CHAR, buf, next, pointer);
} | java | {
"resource": ""
} |
q176277 | FileNamePattern.toRegexForFixedDate | test | public String toRegexForFixedDate(Date date) {
StringBuilder buf = new StringBuilder();
Converter<Object> p = headTokenConverter;
while (p != null) {
if (p instanceof LiteralConverter) {
buf.append(p.convert(null));
} else if (p instanceof IntegerTokenConverter) {
buf.append(FileFinder.regexEscapePath("(\\d+)"));
} else if (p instanceof DateTokenConverter) {
DateTokenConverter<Object> dtc = (DateTokenConverter<Object>) p;
if (dtc.isPrimary()) {
buf.append(p.convert(date));
} else {
buf.append(FileFinder.regexEscapePath(dtc.toRegex()));
}
}
p = p.getNext();
}
return buf.toString();
} | java | {
"resource": ""
} |
q176278 | AbstractEventEvaluatorAction.begin | test | public void begin(InterpretationContext ec, String name, Attributes attributes) {
// Let us forget about previous errors (in this instance)
inError = false;
evaluator = null;
String className = attributes.getValue(CLASS_ATTRIBUTE);
if (OptionHelper.isEmpty(className)) {
className = defaultClassName();
addInfo("Assuming default evaluator class [" + className + "]");
}
if (OptionHelper.isEmpty(className)) {
className = defaultClassName();
inError = true;
addError("Mandatory \"" + CLASS_ATTRIBUTE
+ "\" attribute not set for <evaluator>");
return;
}
String evaluatorName = attributes.getValue(Action.NAME_ATTRIBUTE);
if (OptionHelper.isEmpty(evaluatorName)) {
inError = true;
addError("Mandatory \"" + NAME_ATTRIBUTE
+ "\" attribute not set for <evaluator>");
return;
}
try {
evaluator = (EventEvaluator<?>) OptionHelper.instantiateByClassName(
className, ch.qos.logback.core.boolex.EventEvaluator.class, context);
evaluator.setContext(this.context);
evaluator.setName(evaluatorName);
ec.pushObject(evaluator);
addInfo("Adding evaluator named [" + evaluatorName
+ "] to the object stack");
} catch (Exception oops) {
inError = true;
addError("Could not create evaluator of type " + className + "].", oops);
}
} | java | {
"resource": ""
} |
q176279 | AbstractEventEvaluatorAction.end | test | @SuppressWarnings("unchecked")
public void end(InterpretationContext ec, String e) {
if (inError) {
return;
}
if (evaluator instanceof LifeCycle) {
((LifeCycle) evaluator).start();
addInfo("Starting evaluator named [" + evaluator.getName() + "]");
}
Object o = ec.peekObject();
if (o != evaluator) {
addWarn("The object on the top the of the stack is not the evaluator pushed earlier.");
} else {
ec.popObject();
try {
Map<String, EventEvaluator<?>> evaluatorMap = (Map<String, EventEvaluator<?>>) context
.getObject(CoreConstants.EVALUATOR_MAP);
if(evaluatorMap == null) {
addError("Could not find EvaluatorMap");
} else {
evaluatorMap.put(evaluator.getName(), evaluator);
}
} catch (Exception ex) {
addError("Could not set evaluator named [" + evaluator + "].", ex);
}
}
} | java | {
"resource": ""
} |
q176280 | ContextSelectorStaticBinder.init | test | public void init(LoggerContext defaultLoggerContext, Object key) throws ClassNotFoundException,
NoSuchMethodException, InstantiationException, IllegalAccessException,
InvocationTargetException {
if(this.key == null) {
this.key = key;
} else if (this.key != key) {
throw new IllegalAccessException("Only certain classes can access this method.");
}
String contextSelectorStr = OptionHelper
.getSystemProperty(ClassicConstants.LOGBACK_CONTEXT_SELECTOR);
if (contextSelectorStr == null) {
contextSelector = new DefaultContextSelector(defaultLoggerContext);
} else if (contextSelectorStr.equals("JNDI")) {
throw new RuntimeException("JNDI not supported");
} else {
contextSelector = dynamicalContextSelector(defaultLoggerContext,
contextSelectorStr);
}
} | java | {
"resource": ""
} |
q176281 | ContextSelectorStaticBinder.dynamicalContextSelector | test | static ContextSelector dynamicalContextSelector(
LoggerContext defaultLoggerContext, String contextSelectorStr)
throws ClassNotFoundException, SecurityException, NoSuchMethodException,
IllegalArgumentException, InstantiationException, IllegalAccessException,
InvocationTargetException {
Class<?> contextSelectorClass = Loader.loadClass(contextSelectorStr);
Constructor cons = contextSelectorClass
.getConstructor(new Class[] { LoggerContext.class });
return (ContextSelector) cons.newInstance(defaultLoggerContext);
} | java | {
"resource": ""
} |
q176282 | AndroidContextUtil.setupProperties | test | public void setupProperties(LoggerContext context) {
// legacy properties
Properties props = new Properties();
props.setProperty(CoreConstants.DATA_DIR_KEY, getFilesDirectoryPath());
final String extDir = getMountedExternalStorageDirectoryPath();
if (extDir != null) {
props.setProperty(CoreConstants.EXT_DIR_KEY, extDir);
}
props.setProperty(CoreConstants.PACKAGE_NAME_KEY, getPackageName());
props.setProperty(CoreConstants.VERSION_CODE_KEY, getVersionCode());
props.setProperty(CoreConstants.VERSION_NAME_KEY, getVersionName());
context.putProperties(props);
} | java | {
"resource": ""
} |
q176283 | AndroidContextUtil.getMountedExternalStorageDirectoryPath | test | public String getMountedExternalStorageDirectoryPath() {
String path = null;
String state = Environment.getExternalStorageState();
if (state.equals(Environment.MEDIA_MOUNTED) ||
state.equals(Environment.MEDIA_MOUNTED_READ_ONLY)) {
path = absPath(Environment.getExternalStorageDirectory());
}
return path;
} | java | {
"resource": ""
} |
q176284 | AndroidContextUtil.getDatabaseDirectoryPath | test | public String getDatabaseDirectoryPath() {
return this.context != null
&& this.context.getDatabasePath("x") != null
? this.context.getDatabasePath("x").getParent()
: "";
} | java | {
"resource": ""
} |
q176285 | FileAppender.getAbsoluteFilePath | test | private String getAbsoluteFilePath(String filename) {
// In Android, relative paths created with File() are relative
// to root, so fix it by prefixing the path to the app's "files"
// directory.
// This transformation is rather expensive, since it involves loading the
// Android manifest from the APK (which is a ZIP file), and parsing it to
// retrieve the application package name. This should be avoided if
// possible as it may perceptibly delay the app launch time.
if (EnvUtil.isAndroidOS() && !new File(filename).isAbsolute()) {
String dataDir = context.getProperty(CoreConstants.DATA_DIR_KEY);
filename = FileUtil.prefixRelativePath(dataDir, filename);
}
return filename;
} | java | {
"resource": ""
} |
q176286 | OnErrorEvaluator.evaluate | test | public boolean evaluate(ILoggingEvent event) throws NullPointerException,
EvaluationException {
return event.getLevel().levelInt >= Level.ERROR_INT;
} | java | {
"resource": ""
} |
q176287 | MDCBasedDiscriminator.getDiscriminatingValue | test | public String getDiscriminatingValue(ILoggingEvent event) {
// http://jira.qos.ch/browse/LBCLASSIC-213
Map<String, String> mdcMap = event.getMDCPropertyMap();
if (mdcMap == null) {
return defaultValue;
}
String mdcValue = mdcMap.get(key);
if (mdcValue == null) {
return defaultValue;
} else {
return mdcValue;
}
} | java | {
"resource": ""
} |
q176288 | ReconfigureOnChangeFilter.updateMaskIfNecessary | test | private void updateMaskIfNecessary(long now) {
final long timeElapsedSinceLastMaskUpdateCheck = now - lastMaskCheck;
lastMaskCheck = now;
if (timeElapsedSinceLastMaskUpdateCheck < MASK_INCREASE_THRESHOLD && (mask < MAX_MASK)) {
mask = (mask << 1) | 1;
} else if (timeElapsedSinceLastMaskUpdateCheck > MASK_DECREASE_THRESHOLD) {
mask = mask >>> 2;
}
} | java | {
"resource": ""
} |
q176289 | FilterAttachableImpl.getFilterChainDecision | test | public FilterReply getFilterChainDecision(E event) {
final Filter<E>[] filterArrray = filterList.asTypedArray();
final int len = filterArrray.length;
for (int i = 0; i < len; i++) {
final FilterReply r = filterArrray[i].decide(event);
if (r == FilterReply.DENY || r == FilterReply.ACCEPT) {
return r;
}
}
// no decision
return FilterReply.NEUTRAL;
} | java | {
"resource": ""
} |
q176290 | SSLContextFactoryBean.createKeyManagers | test | private KeyManager[] createKeyManagers(ContextAware context)
throws NoSuchProviderException, NoSuchAlgorithmException,
UnrecoverableKeyException, KeyStoreException {
if (getKeyStore() == null) return null;
KeyStore keyStore = getKeyStore().createKeyStore();
context.addInfo(
"key store of type '" + keyStore.getType()
+ "' provider '" + keyStore.getProvider()
+ "': " + getKeyStore().getLocation());
KeyManagerFactory kmf = getKeyManagerFactory().createKeyManagerFactory();
context.addInfo("key manager algorithm '" + kmf.getAlgorithm()
+ "' provider '" + kmf.getProvider() + "'");
char[] passphrase = getKeyStore().getPassword().toCharArray();
kmf.init(keyStore, passphrase);
return kmf.getKeyManagers();
} | java | {
"resource": ""
} |
q176291 | SSLContextFactoryBean.createTrustManagers | test | private TrustManager[] createTrustManagers(ContextAware context)
throws NoSuchProviderException, NoSuchAlgorithmException,
KeyStoreException {
if (getTrustStore() == null) return null;
KeyStore trustStore = getTrustStore().createKeyStore();
context.addInfo(
"trust store of type '" + trustStore.getType()
+ "' provider '" + trustStore.getProvider()
+ "': " + getTrustStore().getLocation());
TrustManagerFactory tmf = getTrustManagerFactory()
.createTrustManagerFactory();
context.addInfo("trust manager algorithm '" + tmf.getAlgorithm()
+ "' provider '" + tmf.getProvider() + "'");
tmf.init(trustStore);
return tmf.getTrustManagers();
} | java | {
"resource": ""
} |
q176292 | SSLContextFactoryBean.keyStoreFromSystemProperties | test | private KeyStoreFactoryBean keyStoreFromSystemProperties(String property) {
if (System.getProperty(property) == null) return null;
KeyStoreFactoryBean keyStore = new KeyStoreFactoryBean();
keyStore.setLocation(locationFromSystemProperty(property));
keyStore.setProvider(System.getProperty(property + "Provider"));
keyStore.setPassword(System.getProperty(property + "Password"));
keyStore.setType(System.getProperty(property + "Type"));
return keyStore;
} | java | {
"resource": ""
} |
q176293 | SSLContextFactoryBean.locationFromSystemProperty | test | private String locationFromSystemProperty(String name) {
String location = System.getProperty(name);
if (location != null && !location.startsWith("file:")) {
location = "file:" + location;
}
return location;
} | java | {
"resource": ""
} |
q176294 | LocationUtil.urlForResource | test | public static URL urlForResource(String location)
throws MalformedURLException, FileNotFoundException {
if (location == null) {
throw new NullPointerException("location is required");
}
URL url = null;
if (!location.matches(SCHEME_PATTERN)) {
url = Loader.getResourceBySelfClassLoader(location);
}
else if (location.startsWith(CLASSPATH_SCHEME)) {
String path = location.substring(CLASSPATH_SCHEME.length());
if (path.startsWith("/")) {
path = path.substring(1);
}
if (path.length() == 0) {
throw new MalformedURLException("path is required");
}
url = Loader.getResourceBySelfClassLoader(path);
}
else {
url = new URL(location);
}
if (url == null) {
throw new FileNotFoundException(location);
}
return url;
} | java | {
"resource": ""
} |
q176295 | EnsureExceptionHandling.chainHandlesThrowable | test | public boolean chainHandlesThrowable(Converter<ILoggingEvent> head) {
Converter<ILoggingEvent> c = head;
while (c != null) {
if (c instanceof ThrowableHandlingConverter) {
return true;
}
c = c.getNext();
}
return false;
} | java | {
"resource": ""
} |
q176296 | ShutdownHookBase.stop | test | protected void stop() {
addInfo("Logback context being closed via shutdown hook");
Context hookContext = getContext();
if (hookContext instanceof ContextBase) {
ContextBase context = (ContextBase) hookContext;
context.stop();
}
} | java | {
"resource": ""
} |
q176297 | StatusPrinter.printInCaseOfErrorsOrWarnings | test | public static void printInCaseOfErrorsOrWarnings(Context context, long threshold) {
if (context == null) {
throw new IllegalArgumentException("Context argument cannot be null");
}
StatusManager sm = context.getStatusManager();
if (sm == null) {
ps.println("WARN: Context named \"" + context.getName()
+ "\" has no status manager");
} else {
StatusUtil statusUtil = new StatusUtil(context);
if (statusUtil.getHighestLevel(threshold) >= ErrorStatus.WARN) {
print(sm, threshold);
}
}
} | java | {
"resource": ""
} |
q176298 | StatusPrinter.printIfErrorsOccured | test | public static void printIfErrorsOccured(Context context) {
if (context == null) {
throw new IllegalArgumentException("Context argument cannot be null");
}
StatusManager sm = context.getStatusManager();
if (sm == null) {
ps.println("WARN: Context named \"" + context.getName()
+ "\" has no status manager");
} else {
StatusUtil statusUtil = new StatusUtil(context);
if (statusUtil.getHighestLevel(0) == ErrorStatus.ERROR) {
print(sm);
}
}
} | java | {
"resource": ""
} |
q176299 | StatusPrinter.print | test | public static void print(Context context, long threshold) {
if (context == null) {
throw new IllegalArgumentException("Context argument cannot be null");
}
StatusManager sm = context.getStatusManager();
if (sm == null) {
ps.println("WARN: Context named \"" + context.getName()
+ "\" has no status manager");
} else {
print(sm, threshold);
}
} | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.