Skip to content

Commit

Permalink
Some more extra semicolons removed
Browse files Browse the repository at this point in the history
  • Loading branch information
aaime committed Jun 28, 2024
1 parent f8c0049 commit fd081a2
Show file tree
Hide file tree
Showing 22 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public void testBundleFileResourceV2() throws Exception {
}

private boolean startsWithJPEGHeader(File f) {
try (FileInputStream fis = new FileInputStream(f); ) {
try (FileInputStream fis = new FileInputStream(f)) {

byte[] fileHeader = new byte[JFIFHeader.length];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ static void validate(Node rootNode) throws SAXException, IOException {
static String getCurrentSchemaVersion() {

Document dom;
try (InputStream is = XMLConfiguration.class.getResourceAsStream("geowebcache.xsd"); ) {
try (InputStream is = XMLConfiguration.class.getResourceAsStream("geowebcache.xsd")) {
dom = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(is);
} catch (Exception e) {
throw new RuntimeException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ private File findOrCreateConfFile() throws IOException {
// grab template from classpath
try {
try (InputStream templateStream = getClass().getResourceAsStream(templateLocation);
OutputStream output = new FileOutputStream(xmlFile); ) {
OutputStream output = new FileOutputStream(xmlFile)) {
IOUtils.copy(templateStream, output);
output.flush();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void saveMatrix(byte[] data, TileLayer layer, String gridSetId, int zoomL
throws IOException {
// Persist
File fh = new File(createFilePath(gridSetId, zoomLevel));
try (FileOutputStream fos = new FileOutputStream(fh); ) {
try (FileOutputStream fos = new FileOutputStream(fh)) {
fos.write(data);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public GreenTileException(RequestFilter reqFilter) {
private Resource getGreenTile() {
byte[] green = new byte[659];

try (InputStream is = GreenTileException.class.getResourceAsStream("green.png"); ) {
try (InputStream is = GreenTileException.class.getResourceAsStream("green.png")) {
int ret = is.read(green);
log.info("Read " + ret + " from gree PNG file (expected 659).");
} catch (IOException ioe) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public long transferTo(WritableByteChannel target) throws IOException {
// FileLock lock = in.lock();

try (FileInputStream fis = new FileInputStream(file);
FileChannel in = fis.getChannel(); ) {
FileChannel in = fis.getChannel()) {
final long size = in.size();
long written = 0;
while ((written += in.transferTo(written, size, target)) < size) ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ public boolean writeTileToStream(final int tileIdx, Resource target) throws IOEx
param = formatModifier.adjustImageWriteParam(param);
}
try (OutputStream outputStream = target.getOutputStream();
ImageOutputStream imgOut = new MemoryCacheImageOutputStream(outputStream); ) {
ImageOutputStream imgOut = new MemoryCacheImageOutputStream(outputStream)) {
writer.setOutput(imgOut);
IIOImage image = new IIOImage(tile, null, null);
writer.write(null, image, param);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public enum RequestType {

public enum HttpRequestMode {
Get,
FormPost;
FormPost
}

private String[] wmsUrl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public void testTilRangeDelete() throws Exception {
layerName, tos[0].xyz, srs.toString(), mime.getFormat(), parameters);
fbs.get(firstTO);
try (InputStream is = firstTO.getBlob().getInputStream();
InputStream is2 = bytes.getInputStream(); ) {
InputStream is2 = bytes.getInputStream()) {
Assert.assertTrue(IOUtils.contentEquals(is, is2));
}
TileObject lastTO =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void testHit() throws Exception {
Resource result = transCache.get("foo");
assertThat(result, notNullValue());
assertThat(r.getLastModified(), equalTo(r.getLastModified()));
try (InputStream is = result.getInputStream(); ) {
try (InputStream is = result.getInputStream()) {
assertThat(is.read(), equalTo(1));
assertThat(is.read(), equalTo(2));
assertThat(is.read(), equalTo(3));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public static Matcher<Resource> resource(final Resource expected) {
public boolean matches(Object item) {
if (item instanceof Resource) {
try (InputStream itemStream = ((Resource) item).getInputStream();
InputStream expectedStream = expected.getInputStream(); ) {
InputStream expectedStream = expected.getInputStream()) {
return IOUtils.contentEquals(itemStream, expectedStream);
} catch (IOException e) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@

public enum ExpirationPolicy {
LRU,
LFU;
LFU
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void setUp() throws Exception {
// copy configuration file to cache directory
try (InputStream in = getClass().getResourceAsStream("/geowebcache-diskquota.xml");
FileOutputStream out =
new FileOutputStream(new File(cacheDir, "geowebcache-diskquota.xml")); ) {
new FileOutputStream(new File(cacheDir, "geowebcache-diskquota.xml"))) {
int c;
while ((c = in.read()) != -1) {
out.write(c);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ protected BasicDataSource getDataSource() throws IOException, SQLException {
protected void cleanupDatabase(DataSource dataSource) throws SQLException {
// cleanup
try (Connection cx = dataSource.getConnection();
Statement st = cx.createStatement(); ) {
Statement st = cx.createStatement()) {
try {
st.execute("DROP TABLE TILEPAGE CASCADE");
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected BasicDataSource getDataSource() throws IOException, SQLException {

// cleanup
try (Connection cx = dataSource.getConnection();
Statement st = cx.createStatement(); ) {
Statement st = cx.createStatement()) {
try {
st.execute("DROP TABLE TILEPAGE CASCADE CONSTRAINTS");
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private void assertLatestUpdate(String expected, String fileName)
throws IOException, XMLStreamException, FactoryConfigurationError {

try (InputStream stream = getClass().getResourceAsStream("test-data/" + fileName);
Reader feed = new BufferedReader(new InputStreamReader(stream, UTF_8)); ) {
Reader feed = new BufferedReader(new InputStreamReader(stream, UTF_8))) {
StaxGeoRSSReader reader = new StaxGeoRSSReader(feed);
GeoRSSTileRangeBuilder b = new GeoRSSTileRangeBuilder(layer, gridsetId, 10);
b.buildTileRangeMask(reader, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ ResponseEntity<?> doGet(HttpServletRequest request, HttpServletResponse response

response.setContentType(mime.getFormat());
try (InputStream inputStream = resource.openStream();
ServletOutputStream outputStream = response.getOutputStream(); ) {
ServletOutputStream outputStream = response.getOutputStream()) {
StreamUtils.copy(inputStream, outputStream);
} catch (IOException e) {
return new ResponseEntity<>("Internal error", HttpStatus.INTERNAL_SERVER_ERROR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public boolean get(final TileObject tile) throws StorageException {
ByteArrayInputStream byteIn =
new ByteArrayInputStream(gtTile.getData());
GZIPInputStream gzIn =
new GZIPInputStream(byteIn); ) {
new GZIPInputStream(byteIn)) {
IOUtils.copy(gzIn, byteOut);
bytes = byteOut.toByteArray();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void copyData() throws Exception {
URL template =
org.geotools.mbtiles.MBTilesFileVectorTileTest.class.getResource("planet.mbtiles");
try (InputStream in = template.openStream();
OutputStream out = new FileOutputStream(file); ) {
OutputStream out = new FileOutputStream(file)) {
IOUtils.copy(in, out);
}
layer = "planet";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private static void rawSqlitle(File rootDirectory, File seedFile, long[][] tiles
ExecutorService executor = Executors.newFixedThreadPool(WORKERS);
long startTime = System.currentTimeMillis();
try (Connection connection =
DriverManager.getConnection("jdbc:sqlite:" + seedFile.getPath()); ) {
DriverManager.getConnection("jdbc:sqlite:" + seedFile.getPath())) {
for (int i = 0; i < tiles.length; i++) {
long[] tile = tiles[i];
executor.submit((Runnable) () -> getTile(connection, tile));
Expand Down Expand Up @@ -383,7 +383,7 @@ private static byte[] getTile(Connection connection, long[] xyz) {
statement.setLong(1, xyz[2]);
statement.setLong(2, xyz[0]);
statement.setLong(3, xyz[1]);
try (ResultSet resultSet = statement.executeQuery(); ) {
try (ResultSet resultSet = statement.executeQuery()) {
if (resultSet.next()) {
// the tile exists
byte[] data = resultSet.getBytes(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected File buildFile(String... pathParts) {

protected void writeToFile(File file, String content) {
Utils.createFileParents(file);
try (FileWriter writer = new FileWriter(file); ) {
try (FileWriter writer = new FileWriter(file)) {
writer.write(content);
writer.flush();
} catch (Exception exception) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected void writeResponse(HttpServletResponse response) {
response.setContentLength(data.length);
response.setHeader("content-disposition", "inline;filename=wms-getcapabilities.xml");

try (OutputStream os = response.getOutputStream(); ) {
try (OutputStream os = response.getOutputStream()) {
os.write(data);
os.flush();
} catch (IOException ioe) {
Expand Down

0 comments on commit fd081a2

Please sign in to comment.