Skip to content

Commit bf649f9

Browse files
committed
Fix new PMD errors introduced by the OpenRewrite recipe
1 parent 65ce678 commit bf649f9

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
@@ -490,6 +490,7 @@ public void dispose() {
490490
disposableImages = null;
491491
}
492492

493+
@SuppressWarnings("PMD.CloseResource")
493494
protected static void disposePlanarImageChain(PlanarImage pi, HashSet<PlanarImage> visited) {
494495
List sinks = pi.getSinks();
495496
// 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
@@ -87,6 +87,7 @@ public ImageDecoderImpl(
8787
* @param aggressiveInputStreamOptimization Parameter used if aggressive outputStream optimization must be used.
8888
*/
8989
@Override
90+
@SuppressWarnings("PMD.CloseResource") // the caller is in charge of source's life cycle if its a stream
9091
public BufferedImage decode(Object source, boolean aggressiveInputStreamOptimization, Map<String, Object> map)
9192
throws Exception {
9293

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
@@ -238,6 +238,7 @@ public static WriteHelper getWriteHelperForName(String formatName) {
238238
* @param aggressiveOutputStreamOptimization Parameter used if aggressive outputStream optimization must be used.
239239
*/
240240
@Override
241+
@SuppressWarnings("PMD.CloseResource") // the caller is in charge of destination's life cycle if its a stream
241242
public void encode(
242243
RenderedImage image,
243244
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
@@ -83,6 +83,7 @@ public boolean isAggressiveOutputStreamSupported() {
8383
}
8484

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

0 commit comments

Comments
 (0)