Skip to content

Commit a53ecfa

Browse files
committed
Fix new PMD errors introduced by the OpenRewrite recipe
1 parent ba4b2e9 commit a53ecfa

File tree

6 files changed

+6
-1
lines changed

6 files changed

+6
-1
lines changed

geowebcache/core/src/main/java/org/geowebcache/io/ByteArrayResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public long transferTo(WritableByteChannel channel) throws IOException {
103103

104104
/** @see org.geowebcache.io.Resource#transferFrom(java.nio.channels.ReadableByteChannel) */
105105
@Override
106-
@SuppressWarnings("PMD.EmptyControlStatement")
106+
@SuppressWarnings({"PMD.EmptyControlStatement", "PMD.CloseResource"})
107107
public long transferFrom(ReadableByteChannel channel) throws IOException {
108108
if (channel instanceof FileChannel fc) {
109109
offset = 0;

geowebcache/core/src/main/java/org/geowebcache/layer/MetaTile.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@ public void dispose() {
493493
disposableImages = null;
494494
}
495495

496+
@SuppressWarnings("PMD.CloseResource")
496497
protected static void disposePlanarImageChain(PlanarImage pi, HashSet<PlanarImage> visited) {
497498
List sinks = pi.getSinks();
498499
// check all the sinks (the image might be in the middle of a chain)

geowebcache/diskquota/jdbc/src/main/java/org/geowebcache/diskquota/jdbc/JDBCQuotaStore.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,7 @@ public PageStats setTruncated(final TilePage page) throws InterruptedException {
680680
}
681681

682682
@Override
683+
@SuppressWarnings("PMD.CloseResource") // we're closing dataSource, not sure why PMD complains
683684
public void close() throws Exception {
684685
log.info("Closing up the JDBC quota store ");
685686

geowebcache/wms/src/main/java/org/geowebcache/io/codec/ImageDecoderImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ public ImageDecoderImpl(
109109
* @param aggressiveInputStreamOptimization Parameter used if aggressive outputStream optimization must be used.
110110
*/
111111
@Override
112+
@SuppressWarnings("PMD.CloseResource") // the caller is in charge of source's life cycle if its a stream
112113
public BufferedImage decode(Object source, boolean aggressiveInputStreamOptimization, Map<String, Object> map)
113114
throws Exception {
114115

geowebcache/wms/src/main/java/org/geowebcache/io/codec/ImageEncoderImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ public static WriteHelper getWriteHelperForName(String formatName) {
225225
* @param aggressiveOutputStreamOptimization Parameter used if aggressive outputStream optimization must be used.
226226
*/
227227
@Override
228+
@SuppressWarnings("PMD.CloseResource") // the caller is in charge of destination's life cycle if its a stream
228229
public void encode(
229230
RenderedImage image,
230231
Object destination,

geowebcache/wms/src/main/java/org/geowebcache/io/codec/PNGImageEncoder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public boolean isAggressiveOutputStreamSupported() {
8181
}
8282

8383
@Override
84+
@SuppressWarnings("PMD.CloseResource") // the caller is in charge of destination's life cycle if its a stream
8485
public void encode(
8586
RenderedImage image,
8687
Object destination,

0 commit comments

Comments
 (0)