Skip to content

Commit 78cc2f5

Browse files
committed
lint
1 parent c0392b3 commit 78cc2f5

File tree

31 files changed

+173
-137
lines changed

31 files changed

+173
-137
lines changed

geowebcache/azureblob/pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
<artifactId>gwc-core</artifactId>
3838
<version>${project.version}</version>
3939
</dependency>
40-
<dependency>
41-
<groupId>jakarta.annotation</groupId>
42-
<artifactId>jakarta.annotation-api</artifactId>
43-
<version>1.3.5</version>
44-
<scope>provided</scope>
45-
</dependency>
40+
<dependency>
41+
<groupId>jakarta.annotation</groupId>
42+
<artifactId>jakarta.annotation-api</artifactId>
43+
<version>1.3.5</version>
44+
<scope>provided</scope>
45+
</dependency>
4646

4747
<dependency>
4848
<groupId>com.azure</groupId>

geowebcache/azureblob/src/main/java/org/geowebcache/azure/DeleteManager.java

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ public Long deleteParallel(List<String> keys) throws StorageException {
118118

119119
public boolean scheduleAsyncDelete(final String prefix) throws StorageException {
120120
final long timestamp = currentTimeSeconds();
121-
String msg = "Issuing bulk delete on '%s/%s' for objects older than %d".formatted(
122-
client.getContainerName(), prefix, timestamp);
121+
String msg = "Issuing bulk delete on '%s/%s' for objects older than %d"
122+
.formatted(client.getContainerName(), prefix, timestamp);
123123
log.info(msg);
124124

125125
try {
@@ -158,8 +158,8 @@ public void issuePendingBulkDeletes() throws StorageException {
158158
final String prefix = e.getKey().toString();
159159
final long timestamp = Long.parseLong(e.getValue().toString());
160160
if (log.isLoggable(Level.INFO))
161-
log.info("Restarting pending bulk delete on '%s/%s':%d".formatted(
162-
client.getContainerName(), prefix, timestamp));
161+
log.info("Restarting pending bulk delete on '%s/%s':%d"
162+
.formatted(client.getContainerName(), prefix, timestamp));
163163
if (!asyncDelete(prefix, timestamp)) {
164164
deletesToClear.add(prefix);
165165
}
@@ -217,7 +217,8 @@ public Long call() throws Exception {
217217
try {
218218
checkInterrupted();
219219
if (log.isLoggable(Level.INFO))
220-
log.info("Running bulk delete on '%s/%s':%d".formatted(client.getContainerName(), prefix, timestamp));
220+
log.info("Running bulk delete on '%s/%s':%d"
221+
.formatted(client.getContainerName(), prefix, timestamp));
221222

222223
BlobContainerClient container = client.getContainer();
223224

@@ -235,21 +236,21 @@ public Long call() throws Exception {
235236
}
236237
}
237238
} catch (InterruptedException | IllegalStateException e) {
238-
log.info("Azure bulk delete aborted for '%s/%s'. Will resume on next startup.".formatted(
239-
client.getContainerName(), prefix));
239+
log.info("Azure bulk delete aborted for '%s/%s'. Will resume on next startup."
240+
.formatted(client.getContainerName(), prefix));
240241
throw e;
241242
} catch (RuntimeException e) {
242243
log.log(
243244
Level.WARNING,
244-
"Unknown error performing bulk Azure blobs delete of '%s/%s'".formatted(
245-
client.getContainerName(), prefix),
245+
"Unknown error performing bulk Azure blobs delete of '%s/%s'"
246+
.formatted(client.getContainerName(), prefix),
246247
e);
247248
throw e;
248249
}
249250

250251
if (log.isLoggable(Level.INFO))
251-
log.info("Finished bulk delete on '%s/%s':%d. %d objects deleted".formatted(
252-
client.getContainerName(), prefix, timestamp, count));
252+
log.info("Finished bulk delete on '%s/%s':%d. %d objects deleted"
253+
.formatted(client.getContainerName(), prefix, timestamp, count));
253254

254255
clearPendingBulkDelete(prefix, timestamp);
255256
return count;
@@ -280,8 +281,8 @@ private void clearPendingBulkDelete(final String prefix, final long timestamp) t
280281
if (timestamp >= storedTimestamp) {
281282
client.putProperties(pendingDeletesKey, deletes);
282283
} else if (log.isLoggable(Level.INFO)) {
283-
log.info("bulk delete finished but there's a newer one ongoing for container '%s/%s'".formatted(
284-
client.getContainerName(), prefix));
284+
log.info("bulk delete finished but there's a newer one ongoing for container '%s/%s'"
285+
.formatted(client.getContainerName(), prefix));
285286
}
286287
} catch (StorageException e) {
287288
throw new UncheckedIOException(e);
@@ -322,8 +323,8 @@ public Long call() throws Exception {
322323
try {
323324
checkInterrupted();
324325
if (log.isLoggable(Level.FINER)) {
325-
log.finer("Running delete delete on list of items on '%s':%s ... (only the first 100 items listed)".formatted(
326-
client.getContainerName(), keys.subList(0, Math.min(keys.size(), 100))));
326+
log.finer("Running delete delete on list of items on '%s':%s ... (only the first 100 items listed)"
327+
.formatted(client.getContainerName(), keys.subList(0, Math.min(keys.size(), 100))));
327328
}
328329

329330
BlobContainerClient container = client.getContainer();

geowebcache/core/pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@
101101
<groupId>org.springframework</groupId>
102102
<artifactId>spring-webmvc</artifactId>
103103
</dependency>
104-
<dependency>
105-
<groupId>jakarta.annotation</groupId>
106-
<artifactId>jakarta.annotation-api</artifactId>
107-
<version>1.3.5</version>
108-
<scope>provided</scope>
109-
</dependency>
104+
<dependency>
105+
<groupId>jakarta.annotation</groupId>
106+
<artifactId>jakarta.annotation-api</artifactId>
107+
<version>1.3.5</version>
108+
<scope>provided</scope>
109+
</dependency>
110110
<dependency>
111111
<groupId>org.springframework</groupId>
112112
<artifactId>spring-jdbc</artifactId>

geowebcache/core/src/main/java/org/geowebcache/config/XMLConfiguration.java

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,7 @@ public static XStream getConfiguredXStreamWithContext(
431431
if (extension instanceof ContextualConfigurationProvider provider
432432
&&
433433
// Check if the context is applicable for the provider
434-
(providerContext == null
435-
|| !provider.appliesTo(providerContext))) {
434+
(providerContext == null || !provider.appliesTo(providerContext))) {
436435
// If so, try the next one
437436
continue;
438437
}
@@ -957,7 +956,9 @@ public synchronized void addBlobStore(BlobStoreInfo info) {
957956
}
958957
// ensure there isn't a BlobStoreInfo with the same name already
959958
if (getBlobStoreNames().contains(info.getName())) {
960-
throw new IllegalArgumentException("Failed to add BlobStoreInfo. A BlobStoreInfo with name \"%s\" already exists".formatted(info.getName()));
959+
throw new IllegalArgumentException(
960+
"Failed to add BlobStoreInfo. A BlobStoreInfo with name \"%s\" already exists"
961+
.formatted(info.getName()));
961962
}
962963
// add the BlobStoreInfo
963964
final List<BlobStoreInfo> blobStores = getGwcConfig().getBlobStores();
@@ -978,8 +979,7 @@ public synchronized void addBlobStore(BlobStoreInfo info) {
978979
if (ExceptionUtils.isOrSuppresses(e, UnsuitableStorageException.class)) {
979980
// Can't store here, roll back
980981
blobStores.remove(info);
981-
throw new ConfigurationPersistenceException(
982-
"Unable to add BlobStoreInfo \"%s\"".formatted(info), e);
982+
throw new ConfigurationPersistenceException("Unable to add BlobStoreInfo \"%s\"".formatted(info), e);
983983
}
984984
throw new ConfigurationPersistenceException(e);
985985
}
@@ -990,7 +990,9 @@ public synchronized void addBlobStore(BlobStoreInfo info) {
990990
public synchronized void removeBlobStore(String name) {
991991
// ensure there is a BlobStoreInfo with the name
992992
final BlobStoreInfo infoToRemove = getBlobStore(name)
993-
.orElseThrow(() -> new NoSuchElementException("Failed to remove BlobStoreInfo. A BlobStoreInfo with name \"%s\" does not exist.".formatted(name)));
993+
.orElseThrow(() -> new NoSuchElementException(
994+
"Failed to remove BlobStoreInfo. A BlobStoreInfo with name \"%s\" does not exist."
995+
.formatted(name)));
994996
// remove the BlobStoreInfo
995997
final List<BlobStoreInfo> blobStores = getGwcConfig().getBlobStores();
996998
blobStores.remove(infoToRemove);
@@ -1000,8 +1002,7 @@ public synchronized void removeBlobStore(String name) {
10001002
} catch (IOException ioe) {
10011003
// save failed, roll back the delete
10021004
blobStores.add(infoToRemove);
1003-
throw new ConfigurationPersistenceException(
1004-
"Unable to remove BlobStoreInfo \"%s\"".formatted(name), ioe);
1005+
throw new ConfigurationPersistenceException("Unable to remove BlobStoreInfo \"%s\"".formatted(name), ioe);
10051006
}
10061007
try {
10071008
blobStoreListeners.safeForEach(listener -> {
@@ -1021,8 +1022,9 @@ public synchronized void modifyBlobStore(BlobStoreInfo info) {
10211022
// ensure there is a BlobStoreInfo with the name
10221023
final Optional<BlobStoreInfo> optionalInfo = getBlobStore(info.getName());
10231024
if (optionalInfo.isEmpty()) {
1024-
throw new NoSuchElementException("Failed to modify BlobStoreInfo. A BlobStoreInfo with name \"%s\" does not exist.".formatted(
1025-
info.getName()));
1025+
throw new NoSuchElementException(
1026+
"Failed to modify BlobStoreInfo. A BlobStoreInfo with name \"%s\" does not exist."
1027+
.formatted(info.getName()));
10261028
}
10271029
// remove existing and add the new one
10281030
final List<BlobStoreInfo> blobStores = getGwcConfig().getBlobStores();
@@ -1048,8 +1050,7 @@ public synchronized void modifyBlobStore(BlobStoreInfo info) {
10481050
// Can't store here, roll back
10491051
blobStores.remove(info);
10501052
blobStores.add(infoToRemove);
1051-
throw new ConfigurationPersistenceException(
1052-
"Unable to modify BlobStoreInfo \"%s\"".formatted(info), e);
1053+
throw new ConfigurationPersistenceException("Unable to modify BlobStoreInfo \"%s\"".formatted(info), e);
10531054
}
10541055
throw new ConfigurationPersistenceException(e);
10551056
}
@@ -1150,8 +1151,9 @@ public void renameBlobStore(String oldName, String newName)
11501151
if (blobStoreInfoToRevert == null) {
11511152
// we're really messed up now as we couldn't find the BlobStoreInfo that was just
11521153
// renamed.
1153-
throw new ConfigurationPersistenceException("Error reverting BlobStoreInfo modification. Could not revert rename from \"%s\" to \"%s\"".formatted(
1154-
oldName, newName));
1154+
throw new ConfigurationPersistenceException(
1155+
"Error reverting BlobStoreInfo modification. Could not revert rename from \"%s\" to \"%s\""
1156+
.formatted(oldName, newName));
11551157
}
11561158
// revert the name and add it back to the list
11571159
blobStoreInfoToRevert.setName(oldName);
@@ -1165,8 +1167,8 @@ public void renameBlobStore(String oldName, String newName)
11651167
});
11661168
} catch (IOException | GeoWebCacheException e) {
11671169
throw new ConfigurationPersistenceException(
1168-
"Exception while handling listeners for renaming blobstore \"%s\" to \"%s\"".formatted(
1169-
oldName, newName),
1170+
"Exception while handling listeners for renaming blobstore \"%s\" to \"%s\""
1171+
.formatted(oldName, newName),
11701172
e);
11711173
}
11721174
}

geowebcache/core/src/main/java/org/geowebcache/demo/Demo.java

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ private static String generateHTML(TileLayerDispatcher tileLayerDispatcher, Grid
129129
buf.append(ServletUtils.gwcHtmlHeader("", "GWC Demos"));
130130
buf.append("<body>\n");
131131
buf.append(ServletUtils.gwcHtmlLogoLink(""));
132-
buf.append("""
132+
buf.append(
133+
"""
133134
<table cellspacing="10" border="0">
134135
<tr><td><strong>Layer name:</strong></td>
135136
<td><strong>Enabled:</strong></td>
@@ -141,7 +142,8 @@ private static String generateHTML(TileLayerDispatcher tileLayerDispatcher, Grid
141142

142143
buf.append("</table>\n");
143144
buf.append("<br />");
144-
buf.append("""
145+
buf.append(
146+
"""
145147
<strong>These are just quick demos. GeoWebCache also supports:</strong><br />
146148
<ul><li>WMTS, TMS, Virtual Earth and Google Maps</li>
147149
<li>Proxying GetFeatureInfo, GetLegend and other WMS requests</li>
@@ -158,7 +160,8 @@ <li>RESTful interface for seeding and configuration (beta)</li>
158160
<form form id="kill" action="\
159161
""")
160162
.append(reloadPath)
161-
.append("""
163+
.append(
164+
"""
162165
" method="post">\
163166
<input type="hidden" name="reload_configuration" value="1" />\
164167
<span><input style="padding: 0; margin-bottom: -12px; border: 1;"type="submit" value="Reload TileLayerConfiguration"></span>\
@@ -230,10 +233,15 @@ private static void outputKMLSupport(StringBuffer buf, TileLayer layer) {
230233
.filter(type -> type instanceof ImageMime || XMLMime.kml.equals(type) || XMLMime.kmz.equals(type))
231234
.map(type -> {
232235
if (XMLMime.kmz.equals(type)) {
233-
return "<a href=\"%sservice/kml/%s.kml.kmz\">kmz</a>".formatted(prefix, escapeHtml4(layer.getName()));
236+
return "<a href=\"%sservice/kml/%s.kml.kmz\">kmz</a>"
237+
.formatted(prefix, escapeHtml4(layer.getName()));
234238
} else {
235-
return "<a href=\"%sservice/kml/%s.%s.kml\">%s</a>".formatted(
236-
prefix, escapeHtml4(layer.getName()), type.getFileExtension(), type.getFileExtension());
239+
return "<a href=\"%sservice/kml/%s.%s.kml\">%s</a>"
240+
.formatted(
241+
prefix,
242+
escapeHtml4(layer.getName()),
243+
type.getFileExtension(),
244+
type.getFileExtension());
237245
}
238246
})
239247
.collect(Collectors.joining(", ")));
@@ -242,8 +250,8 @@ private static void outputKMLSupport(StringBuffer buf, TileLayer layer) {
242250
}
243251

244252
private static String generateDemoUrl(String layerName, String gridSetId, MimeType type) {
245-
return "<a href=\"demo/%s?gridSet=%s&format=%s\">%s</a>".formatted(
246-
layerName, gridSetId, type.getFormat(), type.getFileExtension());
253+
return "<a href=\"demo/%s?gridSet=%s&format=%s\">%s</a>"
254+
.formatted(layerName, gridSetId, type.getFormat(), type.getFileExtension());
247255
}
248256

249257
private static String generateHTML(TileLayer layer, String gridSetStr, String formatStr)
@@ -277,7 +285,8 @@ private static String generateHTML(TileLayer layer, String gridSetStr, String fo
277285
buf.append(" ").append(escapeHtml4(gridSubset.getName()));
278286
buf.append(" ").append(escapeHtml4(formatStr));
279287
buf.append("</title>\n");
280-
buf.append("""
288+
buf.append(
289+
"""
281290
<style type="text/css">
282291
body { font-family: sans-serif; font-weight: bold; font-size: .8em; }
283292
body { border: 0px; margin: 0px; padding: 0px; }
@@ -301,7 +310,8 @@ private static String generateHTML(TileLayer layer, String gridSetStr, String fo
301310
.append("</div>\n");
302311

303312
buf.append("<div id=\"map\"></div>\n" + "<div id=\"info\"></div>\n");
304-
buf.append("""
313+
buf.append(
314+
"""
305315
<div id="tooltip" class="tooltip">
306316
<div class="tooltip-header">
307317
<span>Attributes</span>

geowebcache/core/src/main/java/org/geowebcache/filter/parameters/CaseNormalizingParameterFilter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
public abstract class CaseNormalizingParameterFilter extends ParameterFilter {
2323
@Serial
2424
private static final long serialVersionUID = 1761619452677321350L;
25+
2526
protected CaseNormalizer normalize;
2627

2728
public CaseNormalizingParameterFilter() {

geowebcache/core/src/main/java/org/geowebcache/storage/MetastoreRemover.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ private Map<String, String> toMap(String paramsKvp) {
181181
}
182182

183183
private void migrateTileDates(JdbcTemplate template, final FilePathGenerator generator) {
184-
String query = """
184+
String query =
185+
"""
185186
select layers.value as layer, gridsets.value as gridset, \
186187
tiles.parameters_id, tiles.z, tiles.x, tiles.y, created, formats.value as format\s
187188
from tiles join layers on layers.id = tiles.layer_id\s

geowebcache/core/src/test/java/org/geowebcache/config/DefaultGridsetsConfigurationGridsetConformanceTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ protected Matcher<GridSet> infoEquals(int expected) {
5555

5656
@Override
5757
public boolean matches(Object item) {
58-
return item instanceof GridSet gs
59-
&& gs.getDescription().equals(Integer.toString(expected));
58+
return item instanceof GridSet gs && gs.getDescription().equals(Integer.toString(expected));
6059
}
6160
};
6261
}

geowebcache/core/src/test/java/org/geowebcache/config/XMLConfigurationGridsetConformanceTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ protected Matcher<GridSet> infoEquals(int expected) {
8383

8484
@Override
8585
public boolean matches(Object item) {
86-
return item instanceof GridSet gs
87-
&& (Objects.equals(gs.getDescription(), Integer.toString(expected)));
86+
return item instanceof GridSet gs && (Objects.equals(gs.getDescription(), Integer.toString(expected)));
8887
}
8988
};
9089
}

geowebcache/core/src/test/java/org/geowebcache/filter/parameters/FloatParameterFilterTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ public void testToXML() throws Exception {
125125

126126
@Test
127127
public void testFromXML() throws Exception {
128-
Object o = xs.fromXML("""
128+
Object o = xs.fromXML(
129+
"""
129130
<floatParameterFilter>
130131
<key>TEST</key>
131132
<defaultValue>Default</defaultValue>

0 commit comments

Comments
 (0)