style(api): replace ignored exceptions with Java's unnamed pattern (_) (#976)

This commit is contained in:
brios
2026-04-30 07:42:40 +02:00
committed by GitHub
parent 1757d786c1
commit 72cd021d0a
29 changed files with 56 additions and 56 deletions
@@ -37,7 +37,7 @@ public class AppUserController {
if (configured != null) { if (configured != null) {
maxUploadSizeMb = configured; maxUploadSizeMb = configured;
} }
} catch (Exception ignored) { } catch (Exception _) {
// fall back to default // fall back to default
} }
@@ -127,7 +127,7 @@ public final class NativeLibraries {
} }
public static void ensureInitialized() { public static void ensureInitialized() {
NativeLibraries ignored = Holder.INSTANCE; NativeLibraries _ = Holder.INSTANCE;
} }
public boolean isAvailable(Library library) { public boolean isAvailable(Library library) {
@@ -25,7 +25,7 @@ import java.util.stream.Stream;
public class ArchiveService { public class ArchiveService {
private static final int LOCK_STRIPE_COUNT = 256; private static final int LOCK_STRIPE_COUNT = 256;
private final ReentrantLock[] lockStripes = IntStream.range(0, LOCK_STRIPE_COUNT) private final ReentrantLock[] lockStripes = IntStream.range(0, LOCK_STRIPE_COUNT)
.mapToObj(ignored -> new ReentrantLock()) .mapToObj(_ -> new ReentrantLock())
.toArray(ReentrantLock[]::new); .toArray(ReentrantLock[]::new);
// Route through the JVM-wide serialized native loader. // Route through the JVM-wide serialized native loader.
@@ -919,7 +919,7 @@ public class BookRuleEvaluatorService {
if (isNumericField(field)) { if (isNumericField(field)) {
try { try {
return Double.parseDouble(value.toString()); return Double.parseDouble(value.toString());
} catch (NumberFormatException ignored) { } catch (NumberFormatException _) {
} }
} }
@@ -174,7 +174,7 @@ public class AppSettingService {
if (sessionDurationStr != null && !sessionDurationStr.isBlank()) { if (sessionDurationStr != null && !sessionDurationStr.isBlank()) {
try { try {
builder.oidcSessionDurationHours(Integer.parseInt(sessionDurationStr)); builder.oidcSessionDurationHours(Integer.parseInt(sessionDurationStr));
} catch (NumberFormatException ignored) { } catch (NumberFormatException _) {
} }
} }
@@ -45,7 +45,7 @@ public class AuditService {
String ipAddress = null; String ipAddress = null;
try { try {
ipAddress = RequestUtils.getCurrentRequest().getRemoteAddr(); ipAddress = RequestUtils.getCurrentRequest().getRemoteAddr();
} catch (Exception ignored) { } catch (Exception _) {
// Non-HTTP context (scheduled tasks, etc.) // Non-HTTP context (scheduled tasks, etc.)
} }
@@ -106,12 +106,12 @@ public class PhysicalBookService {
// Try full date format first (YYYY-MM-DD) // Try full date format first (YYYY-MM-DD)
try { try {
return LocalDate.parse(trimmed, DateTimeFormatter.ISO_LOCAL_DATE); return LocalDate.parse(trimmed, DateTimeFormatter.ISO_LOCAL_DATE);
} catch (DateTimeParseException ignored) {} } catch (DateTimeParseException _) {}
// Try year only format (YYYY) // Try year only format (YYYY)
try { try {
int year = Integer.parseInt(trimmed); int year = Integer.parseInt(trimmed);
return LocalDate.of(year, 1, 1); return LocalDate.of(year, 1, 1);
} catch (NumberFormatException ignored) {} } catch (NumberFormatException _) {}
return null; return null;
} }
@@ -428,7 +428,7 @@ public class FilenamePatternExtractor {
private void setSeriesNumber(BookMetadata metadata, String value) { private void setSeriesNumber(BookMetadata metadata, String value) {
try { try {
metadata.setSeriesNumber(Float.parseFloat(value)); metadata.setSeriesNumber(Float.parseFloat(value));
} catch (NumberFormatException ignored) { } catch (NumberFormatException _) {
} }
} }
@@ -590,7 +590,7 @@ public class FilenamePatternExtractor {
private void setSeriesTotal(BookMetadata metadata, String value) { private void setSeriesTotal(BookMetadata metadata, String value) {
try { try {
metadata.setSeriesTotal(Integer.parseInt(value)); metadata.setSeriesTotal(Integer.parseInt(value));
} catch (NumberFormatException ignored) { } catch (NumberFormatException _) {
} }
} }
@@ -264,7 +264,7 @@ public class CustomFontService {
FontFormat detectedFormat = null; FontFormat detectedFormat = null;
try { try {
detectedFormat = FontFormat.fromMimeType(detectedMime); detectedFormat = FontFormat.fromMimeType(detectedMime);
} catch (IllegalArgumentException ignored) { } catch (IllegalArgumentException _) {
// Tika may return a generic MIME treated as unknown format below // Tika may return a generic MIME treated as unknown format below
} }
@@ -390,17 +390,17 @@ public class KoboReadingStateService {
try { try {
Instant instant = Instant.parse(trimmed).truncatedTo(ChronoUnit.SECONDS); Instant instant = Instant.parse(trimmed).truncatedTo(ChronoUnit.SECONDS);
return KOBO_TIMESTAMP_FORMAT.format(instant); return KOBO_TIMESTAMP_FORMAT.format(instant);
} catch (Exception ignored) { } catch (Exception _) {
} }
try { try {
OffsetDateTime offsetDateTime = OffsetDateTime.parse(trimmed); OffsetDateTime offsetDateTime = OffsetDateTime.parse(trimmed);
return KOBO_TIMESTAMP_FORMAT.format(offsetDateTime.toInstant().truncatedTo(ChronoUnit.SECONDS)); return KOBO_TIMESTAMP_FORMAT.format(offsetDateTime.toInstant().truncatedTo(ChronoUnit.SECONDS));
} catch (Exception ignored) { } catch (Exception _) {
} }
try { try {
LocalDateTime localDateTime = LocalDateTime.parse(trimmed, LOCAL_TIMESTAMP_FORMAT); LocalDateTime localDateTime = LocalDateTime.parse(trimmed, LOCAL_TIMESTAMP_FORMAT);
return KOBO_TIMESTAMP_FORMAT.format(localDateTime.toInstant(ZoneOffset.UTC).truncatedTo(ChronoUnit.SECONDS)); return KOBO_TIMESTAMP_FORMAT.format(localDateTime.toInstant(ZoneOffset.UTC).truncatedTo(ChronoUnit.SECONDS));
} catch (Exception ignored) { } catch (Exception _) {
} }
return value; return value;
} }
@@ -505,16 +505,16 @@ public class KoboReadingStateService {
String trimmed = value.trim(); String trimmed = value.trim();
try { try {
return Instant.parse(trimmed); return Instant.parse(trimmed);
} catch (Exception ignored) { } catch (Exception _) {
} }
try { try {
return OffsetDateTime.parse(trimmed).toInstant(); return OffsetDateTime.parse(trimmed).toInstant();
} catch (Exception ignored) { } catch (Exception _) {
} }
try { try {
LocalDateTime localDateTime = LocalDateTime.parse(trimmed, LOCAL_TIMESTAMP_FORMAT); LocalDateTime localDateTime = LocalDateTime.parse(trimmed, LOCAL_TIMESTAMP_FORMAT);
return localDateTime.toInstant(ZoneOffset.UTC); return localDateTime.toInstant(ZoneOffset.UTC);
} catch (Exception ignored) { } catch (Exception _) {
} }
return null; return null;
} }
@@ -864,13 +864,13 @@ public class CoverImageGenerator {
throw new RuntimeException("JPEG encoding failed", e); throw new RuntimeException("JPEG encoding failed", e);
} finally { } finally {
if (writer != null) writer.dispose(); if (writer != null) writer.dispose();
if (ios != null) try { ios.close(); } catch (IOException ignored) {} if (ios != null) try { ios.close(); } catch (IOException _) {}
} }
} }
private void cleanup(Graphics2D g, BufferedImage... images) { private void cleanup(Graphics2D g, BufferedImage... images) {
if (g != null) try { g.dispose(); } catch (Exception ignored) {} if (g != null) try { g.dispose(); } catch (Exception _) {}
for (BufferedImage img : images) for (BufferedImage img : images)
if (img != null) try { img.flush(); } catch (Exception ignored) {} if (img != null) try { img.flush(); } catch (Exception _) {}
} }
} }
@@ -115,7 +115,7 @@ public class AudiobookMetadataExtractor implements FileMetadataExtractor {
if (yearInt >= 1 && yearInt <= 9999) { if (yearInt >= 1 && yearInt <= 9999) {
builder.publishedDate(LocalDate.of(yearInt, 1, 1)); builder.publishedDate(LocalDate.of(yearInt, 1, 1));
} }
} catch (NumberFormatException ignored) { } catch (NumberFormatException _) {
} }
} }
@@ -141,7 +141,7 @@ public class AudiobookMetadataExtractor implements FileMetadataExtractor {
try { try {
String trackNum = trackNo.contains("/") ? trackNo.split("/")[0] : trackNo; String trackNum = trackNo.contains("/") ? trackNo.split("/")[0] : trackNo;
builder.seriesNumber((float) Integer.parseInt(trackNum.trim())); builder.seriesNumber((float) Integer.parseInt(trackNum.trim()));
} catch (NumberFormatException ignored) { } catch (NumberFormatException _) {
} }
} }
@@ -149,7 +149,7 @@ public class AudiobookMetadataExtractor implements FileMetadataExtractor {
if (StringUtils.isNotBlank(trackTotal)) { if (StringUtils.isNotBlank(trackTotal)) {
try { try {
builder.seriesTotal(Integer.parseInt(trackTotal.trim())); builder.seriesTotal(Integer.parseInt(trackTotal.trim()));
} catch (NumberFormatException ignored) { } catch (NumberFormatException _) {
} }
} }
@@ -328,7 +328,7 @@ public class AudiobookMetadataExtractor implements FileMetadataExtractor {
return str; return str;
} }
} }
} catch (Exception ignored) { } catch (Exception _) {
} }
return "Chapter " + (index + 1); return "Chapter " + (index + 1);
@@ -232,7 +232,7 @@ public class EpubMetadataExtractor implements FileMetadataExtractor {
try { try {
builderMeta.seriesNumber(Float.parseFloat(content)); builderMeta.seriesNumber(Float.parseFloat(content));
seriesIndexFound = true; seriesIndexFound = true;
} catch (NumberFormatException ignored) { } catch (NumberFormatException _) {
} }
} }
@@ -243,7 +243,7 @@ public class EpubMetadataExtractor implements FileMetadataExtractor {
JSONObject jsonroot = new JSONObject(content); JSONObject jsonroot = new JSONObject(content);
Object value = jsonroot.opt("#value#"); Object value = jsonroot.opt("#value#");
safeParseInt(String.valueOf(value), builderMeta::pageCount); safeParseInt(String.valueOf(value), builderMeta::pageCount);
} catch (JSONException ignored) { } catch (JSONException _) {
} }
} else if ("calibre:user_metadata".equals(prop)) { } else if ("calibre:user_metadata".equals(prop)) {
try { try {
@@ -428,14 +428,14 @@ public class EpubMetadataExtractor implements FileMetadataExtractor {
private static void safeParseInt(String value, java.util.function.IntConsumer setter) { private static void safeParseInt(String value, java.util.function.IntConsumer setter) {
try { try {
setter.accept(Integer.parseInt(value)); setter.accept(Integer.parseInt(value));
} catch (NumberFormatException ignored) { } catch (NumberFormatException _) {
} }
} }
private static void safeParseDouble(String value, java.util.function.DoubleConsumer setter) { private static void safeParseDouble(String value, java.util.function.DoubleConsumer setter) {
try { try {
setter.accept(Double.parseDouble(value)); setter.accept(Double.parseDouble(value));
} catch (NumberFormatException ignored) { } catch (NumberFormatException _) {
} }
} }
@@ -531,19 +531,19 @@ public class EpubMetadataExtractor implements FileMetadataExtractor {
try { try {
return LocalDate.parse(value); return LocalDate.parse(value);
} catch (Exception ignored) { } catch (Exception _) {
} }
try { try {
return OffsetDateTime.parse(value).toLocalDate(); return OffsetDateTime.parse(value).toLocalDate();
} catch (Exception ignored) { } catch (Exception _) {
} }
// Try parsing first 10 characters for ISO date format with extra content // Try parsing first 10 characters for ISO date format with extra content
if (value.length() >= 10) { if (value.length() >= 10) {
try { try {
return LocalDate.parse(value.substring(0, 10)); return LocalDate.parse(value.substring(0, 10));
} catch (Exception ignored) { } catch (Exception _) {
} }
} }
@@ -259,7 +259,7 @@ public class PdfMetadataExtractor implements FileMetadataExtractor {
if (StringUtils.isNotBlank(tags)) { if (StringUtils.isNotBlank(tags)) {
Arrays.stream(tags.split(";")).map(String::trim).forEach(knownNonCategories::add); Arrays.stream(tags.split(";")).map(String::trim).forEach(knownNonCategories::add);
} }
} catch (Exception ignored) {} } catch (Exception _) {}
subjects.removeAll(knownNonCategories); subjects.removeAll(knownNonCategories);
@@ -861,7 +861,7 @@ public class AmazonBookParser implements BookParser, DetailedMetadataProvider {
for (String pattern : DATE_PATTERNS) { for (String pattern : DATE_PATTERNS) {
try { try {
return LocalDate.parse(trimmedDate, DateTimeFormatter.ofPattern(pattern, Locale.ENGLISH)); return LocalDate.parse(trimmedDate, DateTimeFormatter.ofPattern(pattern, Locale.ENGLISH));
} catch (DateTimeParseException ignored) { } catch (DateTimeParseException _) {
} }
} }
@@ -869,7 +869,7 @@ public class AmazonBookParser implements BookParser, DetailedMetadataProvider {
for (String pattern : DATE_PATTERNS) { for (String pattern : DATE_PATTERNS) {
try { try {
return LocalDate.parse(trimmedDate, DateTimeFormatter.ofPattern(pattern, localeInfo.locale())); return LocalDate.parse(trimmedDate, DateTimeFormatter.ofPattern(pattern, localeInfo.locale()));
} catch (DateTimeParseException ignored) { } catch (DateTimeParseException _) {
} }
} }
} }
@@ -275,7 +275,7 @@ public class ComicvineBookParser implements BookParser, DetailedMetadataProvider
if (volume.getCountOfIssues() != null && volume.getCountOfIssues() >= requestedIssue) { if (volume.getCountOfIssues() != null && volume.getCountOfIssues() >= requestedIssue) {
score += 20; score += 20;
} }
} catch (NumberFormatException ignored) {} } catch (NumberFormatException _) {}
Set<String> majorPublishers = Set.of("Marvel", "DC Comics", "Image Comics", "Dark Horse Comics", "IDW Publishing", "Dynamite Entertainment", "BOOM! Studios", "Valiant Entertainment"); Set<String> majorPublishers = Set.of("Marvel", "DC Comics", "Image Comics", "Dark Horse Comics", "IDW Publishing", "Dynamite Entertainment", "BOOM! Studios", "Valiant Entertainment");
if (volume.getPublisher() != null && volume.getPublisher().getName() != null) { if (volume.getPublisher() != null && volume.getPublisher().getName() != null) {
@@ -290,7 +290,7 @@ public class ComicvineBookParser implements BookParser, DetailedMetadataProvider
if (year >= 2000) score += 5; if (year >= 2000) score += 5;
if (year >= 2010) score += 5; if (year >= 2010) score += 5;
if (year >= 2020) score += 5; if (year >= 2020) score += 5;
} catch (NumberFormatException ignored) {} } catch (NumberFormatException _) {}
} }
return score; return score;
@@ -523,7 +523,7 @@ public class ComicvineBookParser implements BookParser, DetailedMetadataProvider
log.debug("Rate limiting: sleeping {}ms before next request", sleepTime); log.debug("Rate limiting: sleeping {}ms before next request", sleepTime);
try { try {
Thread.sleep(sleepTime); Thread.sleep(sleepTime);
} catch (InterruptedException ignored) { } catch (InterruptedException _) {
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
} }
} }
@@ -554,7 +554,7 @@ public class ComicvineBookParser implements BookParser, DetailedMetadataProvider
response.statusCode(), retriesLeft); response.statusCode(), retriesLeft);
try { try {
Thread.sleep(2000); Thread.sleep(2000);
} catch (InterruptedException ignored) {} } catch (InterruptedException _) {}
return sendRequestWithRetry(uri, responseType, retriesLeft - 1); return sendRequestWithRetry(uri, responseType, retriesLeft - 1);
} else { } else {
log.error("Comicvine API returned status code {}. Body: {}", response.statusCode(), response.body()); log.error("Comicvine API returned status code {}. Body: {}", response.statusCode(), response.body());
@@ -564,7 +564,7 @@ public class ComicvineBookParser implements BookParser, DetailedMetadataProvider
log.warn("IOException during ComicVine request. Retrying... ({} retries left)", retriesLeft, e); log.warn("IOException during ComicVine request. Retrying... ({} retries left)", retriesLeft, e);
try { try {
Thread.sleep(1000); Thread.sleep(1000);
} catch (InterruptedException ignored) {} } catch (InterruptedException _) {}
return sendRequestWithRetry(uri, responseType, retriesLeft - 1); return sendRequestWithRetry(uri, responseType, retriesLeft - 1);
} else { } else {
log.error("Error fetching data from Comicvine API after retries", e); log.error("Error fetching data from Comicvine API after retries", e);
@@ -888,7 +888,7 @@ public class ComicvineBookParser implements BookParser, DetailedMetadataProvider
year = y; year = y;
yearString = yearMatcher.group(0); yearString = yearMatcher.group(0);
} }
} catch (NumberFormatException ignored) {} } catch (NumberFormatException _) {}
} }
String cleaned = term; String cleaned = term;
@@ -294,7 +294,7 @@ public class GoogleParser implements BookParser {
if (seriesNumber == null && seriesInfo.getBookDisplayNumber() != null) { if (seriesNumber == null && seriesInfo.getBookDisplayNumber() != null) {
try { try {
seriesNumber = Float.parseFloat(seriesInfo.getBookDisplayNumber()); seriesNumber = Float.parseFloat(seriesInfo.getBookDisplayNumber());
} catch (NumberFormatException ignored) { } catch (NumberFormatException _) {
// Not a valid number, ignore // Not a valid number, ignore
} }
} }
@@ -236,7 +236,7 @@ public class HardcoverParser implements BookParser {
if (book.getFeaturedBookSeries().getPosition() != null) { if (book.getFeaturedBookSeries().getPosition() != null) {
try { try {
metadata.setSeriesNumber(Float.parseFloat(String.valueOf(book.getFeaturedBookSeries().getPosition()))); metadata.setSeriesNumber(Float.parseFloat(String.valueOf(book.getFeaturedBookSeries().getPosition())));
} catch (NumberFormatException ignored) { } catch (NumberFormatException _) {
} }
} }
} }
@@ -321,7 +321,7 @@ public class HardcoverParser implements BookParser {
if (doc.getFeaturedSeries().getPosition() != null) { if (doc.getFeaturedSeries().getPosition() != null) {
try { try {
metadata.setSeriesNumber(Float.parseFloat(String.valueOf(doc.getFeaturedSeries().getPosition()))); metadata.setSeriesNumber(Float.parseFloat(String.valueOf(doc.getFeaturedSeries().getPosition())));
} catch (NumberFormatException ignored) { } catch (NumberFormatException _) {
} }
} }
} }
@@ -449,7 +449,7 @@ public class CbxMetadataWriter implements MetadataWriter {
// Ensure 2-space indentation if possible // Ensure 2-space indentation if possible
try { try {
marshaller.setProperty("com.sun.xml.bind.indentString", " "); marshaller.setProperty("com.sun.xml.bind.indentString", " ");
} catch (Exception ignored) { } catch (Exception _) {
log.debug("Custom indentation property not supported via 'com.sun.xml.bind.indentString'"); log.debug("Custom indentation property not supported via 'com.sun.xml.bind.indentString'");
} }
@@ -37,7 +37,7 @@ public class ChapterCacheService {
* which can cause SIGSEGV / out-of-memory crashes in the native heap. * which can cause SIGSEGV / out-of-memory crashes in the native heap.
*/ */
public void prepareCbxCache(String cacheKey, Path cbxPath, List<String> entries) throws IOException { public void prepareCbxCache(String cacheKey, Path cbxPath, List<String> entries) throws IOException {
ReentrantLock lock = cacheLocks.computeIfAbsent(cacheKey, ignored -> new ReentrantLock()); ReentrantLock lock = cacheLocks.computeIfAbsent(cacheKey, _ -> new ReentrantLock());
lock.lock(); lock.lock();
try { try {
Path cacheDir = getCacheDir(cacheKey); Path cacheDir = getCacheDir(cacheKey);
@@ -33,7 +33,7 @@ public class BookloreSyncTokenGenerator {
.rawKoboSyncToken(base64Token) .rawKoboSyncToken(base64Token)
.build(); .build();
} }
} catch (Exception ignored) { } catch (Exception _) {
} }
return new BookloreSyncToken(); return new BookloreSyncToken();
@@ -412,7 +412,7 @@ class BookCoverServiceTest {
try { try {
when(file.getInputStream()).thenReturn(new ByteArrayInputStream(new byte[]{(byte) 0xFF, (byte) 0xD8, (byte) 0xFF, (byte) 0xE0})); // JPEG when(file.getInputStream()).thenReturn(new ByteArrayInputStream(new byte[]{(byte) 0xFF, (byte) 0xD8, (byte) 0xFF, (byte) 0xE0})); // JPEG
when(file.getBytes()).thenReturn(new byte[]{1, 2, 3}); when(file.getBytes()).thenReturn(new byte[]{1, 2, 3});
} catch (Exception ignored) {} } catch (Exception _) {}
service.updateCoverFromFileForBooks(Set.of(1L, 2L), file); service.updateCoverFromFileForBooks(Set.of(1L, 2L), file);
@@ -473,7 +473,7 @@ class BookCoverServiceTest {
try { try {
when(file.getInputStream()).thenReturn(new java.io.ByteArrayInputStream(new byte[]{(byte) 0xFF, (byte) 0xD8, (byte) 0xFF, (byte) 0xE0})); when(file.getInputStream()).thenReturn(new java.io.ByteArrayInputStream(new byte[]{(byte) 0xFF, (byte) 0xD8, (byte) 0xFF, (byte) 0xE0}));
when(file.getBytes()).thenReturn(new byte[]{1, 2, 3}); when(file.getBytes()).thenReturn(new byte[]{1, 2, 3});
} catch (Exception ignored) {} } catch (Exception _) {}
when(bookQueryService.findAllWithMetadataByIds(any())).thenReturn(List.of()); when(bookQueryService.findAllWithMetadataByIds(any())).thenReturn(List.of());
@@ -491,7 +491,7 @@ class BookCoverServiceTest {
try { try {
when(file.getInputStream()).thenReturn(new java.io.ByteArrayInputStream(new byte[]{(byte) 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A})); when(file.getInputStream()).thenReturn(new java.io.ByteArrayInputStream(new byte[]{(byte) 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A}));
when(file.getBytes()).thenReturn(new byte[]{1, 2, 3}); when(file.getBytes()).thenReturn(new byte[]{1, 2, 3});
} catch (Exception ignored) {} } catch (Exception _) {}
when(bookQueryService.findAllWithMetadataByIds(any())).thenReturn(List.of()); when(bookQueryService.findAllWithMetadataByIds(any())).thenReturn(List.of());
@@ -101,7 +101,7 @@ class PdfMetadataExtractorTest {
@Test @Test
void extractMetadata_minimalPdf_usesFilenameAsTitle() throws Exception { void extractMetadata_minimalPdf_usesFilenameAsTitle() throws Exception {
File pdf = createPdf(ignored -> {}); File pdf = createPdf(_ -> {});
BookMetadata meta = extractor.extractMetadata(pdf); BookMetadata meta = extractor.extractMetadata(pdf);
assertThat(meta.getTitle()).isEqualTo("test"); assertThat(meta.getTitle()).isEqualTo("test");
assertThat(meta.getPageCount()).isEqualTo(1); assertThat(meta.getPageCount()).isEqualTo(1);
@@ -62,7 +62,7 @@ class CbxComicInfoComplianceTest {
.forEach(p -> { .forEach(p -> {
try { try {
Files.deleteIfExists(p); Files.deleteIfExists(p);
} catch (Exception ignore) { } catch (Exception _) {
} }
}); });
} }
@@ -68,7 +68,7 @@ class CbxMetadataWriterTest {
.forEach(p -> { .forEach(p -> {
try { try {
Files.deleteIfExists(p); Files.deleteIfExists(p);
} catch (Exception ignore) { } catch (Exception _) {
} }
}); });
} }
@@ -66,7 +66,7 @@ class PdfMetadataWriterTest {
.forEach(p -> { .forEach(p -> {
try { try {
Files.deleteIfExists(p); Files.deleteIfExists(p);
} catch (Exception ignore) { } catch (Exception _) {
} }
}); });
} }
@@ -37,7 +37,7 @@ class LibraryWatchServiceTest {
void teardown() { void teardown() {
try { try {
service.stop(); service.stop();
} catch (Exception ignored) {} } catch (Exception _) {}
} }
@Test @Test
@@ -281,7 +281,7 @@ class TaskHistoryServiceTest {
java.lang.reflect.Field field = TaskType.class.getDeclaredField("hiddenFromUI"); java.lang.reflect.Field field = TaskType.class.getDeclaredField("hiddenFromUI");
field.setAccessible(true); field.setAccessible(true);
field.set(type, true); field.set(type, true);
} catch (Exception ignored) { } catch (Exception _) {
} }
}); });
@@ -250,7 +250,7 @@ class LibraryFileEventProcessorTest {
} finally { } finally {
try (var stream = Files.walk(outsideFolder)) { try (var stream = Files.walk(outsideFolder)) {
stream.sorted(java.util.Comparator.reverseOrder()).forEach(p -> { stream.sorted(java.util.Comparator.reverseOrder()).forEach(p -> {
try { Files.deleteIfExists(p); } catch (IOException ignored) {} try { Files.deleteIfExists(p); } catch (IOException _) {}
}); });
} }
} }