From 13b1456b535eda22c50fb3c98fcb5b71aba469a8 Mon Sep 17 00:00:00 2001 From: Frederic Leitenberger Date: Mon, 17 Aug 2020 10:26:08 +0200 Subject: [PATCH 01/11] Enabled java9+ compatibility - SignatureChecker: upgraded from ASM5 to ASM7 - ClassFileVisitor: added ability to process Paths (nedded for "jrt:/modules") - SignatureBuilder: added java version switch (<=8 / >=9) and implemented signature creation for java 9+ --- .../mojo/animal_sniffer/ClassFileVisitor.java | 40 +++++++++++++++++++ .../mojo/animal_sniffer/SignatureBuilder.java | 28 ++++++++++++- .../mojo/animal_sniffer/SignatureChecker.java | 6 +-- 3 files changed, 69 insertions(+), 5 deletions(-) diff --git a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java index 6d8f8cf4..b9ac37a3 100644 --- a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java +++ b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java @@ -29,7 +29,14 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import java.nio.file.FileVisitOption; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.attribute.BasicFileAttributes; import java.util.Arrays; +import java.util.Collections; import java.util.Comparator; import java.util.Enumeration; import java.util.Iterator; @@ -123,6 +130,39 @@ else if ( ( file.getName().endsWith( ".jar" ) || file.getName().endsWith( ".jmod // ignore other files } + /** + * Recursively finds class files and invokes {@link #process(String, InputStream)} + * + * @param path Directory (or other Path like {@code Paths.get(URI.create("jrt:/modules"))}) full of class files, + * or a class file (in which case that single class is processed). + */ + public void process( Path path ) + throws IOException { + Files.walkFileTree(path, Collections.emptySet(), 10000, new SimpleFileVisitor() { + + @Override + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { + if (file.getFileName().toString().endsWith(".class")) { + process(file.toString(), Files.newInputStream(file)); + } + // XXX we could add processing of jars here as well + // but it's not necessary for processing: Paths.get(URI.create("jrt:/modules")) + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException { + return FileVisitResult.CONTINUE; + } + + }); + } + protected void processDirectory( File dir ) throws IOException { diff --git a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/SignatureBuilder.java b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/SignatureBuilder.java index 5e8db25e..689b25a5 100644 --- a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/SignatureBuilder.java +++ b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/SignatureBuilder.java @@ -32,6 +32,8 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.OutputStream; +import java.net.URI; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.HashSet; import java.util.List; @@ -71,8 +73,12 @@ public static void main( String[] args ) throws IOException { SignatureBuilder builder = - new SignatureBuilder( new FileOutputStream( "signature" ), new PrintWriterLogger( System.out ) ); - builder.process( new File( System.getProperty( "java.home" ), "lib/rt.jar" ) ); + new SignatureBuilder( new FileOutputStream( "signature" ), new PrintWriterLogger( System.out ) ); + if ( getJavaVersion() > 8 ) { + builder.process( Paths.get(URI.create("jrt:/modules")) ); + } else { + builder.process( new File( System.getProperty( "java.home" ), "lib/rt.jar" ) ); + } builder.close(); } @@ -236,4 +242,22 @@ public FieldVisitor visitField( int access, String name, String desc, String sig return null; } } + + public static int getJavaVersion() + { + String version = System.getProperty("java.version"); + if ( version.startsWith("1.") ) + { + version = version.substring(2); + } + // Allow these formats: + // 1.8.0_72-ea + // 9-ea + // 9 + // 9.0.1 + int dotPos = version.indexOf( '.' ); + int dashPos = version.indexOf( '-' ); + return Integer.parseInt( version.substring( 0, dotPos > -1 ? dotPos : dashPos > -1 ? dashPos : 1 ) ); + } + } diff --git a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/SignatureChecker.java b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/SignatureChecker.java index e7308de3..8c48c9cd 100644 --- a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/SignatureChecker.java +++ b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/SignatureChecker.java @@ -295,7 +295,7 @@ private class CheckingVisitor public CheckingVisitor( String name ) { - super(Opcodes.ASM5); + super(Opcodes.ASM7); this.ignoredPackageCache = new HashSet( 50 * ignoredPackageRules.size() ); this.name = name; } @@ -355,7 +355,7 @@ public AnnotationVisitor visitAnnotation(String desc, boolean visible) @Override public FieldVisitor visitField(int access, String name, final String descriptor, String signature, Object value) { - return new FieldVisitor(Opcodes.ASM5) { + return new FieldVisitor(Opcodes.ASM7) { @Override public void visitEnd() { @@ -369,7 +369,7 @@ public void visitEnd() { public MethodVisitor visitMethod( int access, final String name, final String desc, String signature, String[] exceptions ) { line = 0; - return new MethodVisitor(Opcodes.ASM5) + return new MethodVisitor(Opcodes.ASM7) { /** * True if @IgnoreJRERequirement is set. From 6262d3891e842c60128bfab08b3a464ca8af9a03 Mon Sep 17 00:00:00 2001 From: Frederic Leitenberger Date: Tue, 19 Jan 2021 20:29:29 +0100 Subject: [PATCH 02/11] added support for java7+ and URIs like "jrt:/modules" --- .../codehaus/mojo/animal_sniffer/Main.java | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/Main.java b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/Main.java index e7ebb201..1299c96a 100644 --- a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/Main.java +++ b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/Main.java @@ -26,9 +26,12 @@ */ import java.io.DataInputStream; -import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -58,7 +61,7 @@ public static void main( String[] args ) Main m = new Main(); String threshold = null; - List files = new ArrayList(); + List files = new ArrayList(); for ( int i = 0; i < args.length; i++ ) { if (args[i].equals("-h")) @@ -80,16 +83,21 @@ public static void main( String[] args ) continue; } - files.add(new File(args[i])); + try { + files.add(Paths.get(new URI(args[i]))); // attempt to treat it as an URI + } catch (URISyntaxException e) { + files.add(Paths.get(args[i])); // if that fails: treat is as a normal file/path + } } - for (int i = 0; i < files.size(); i++) - { - m.process((File) files.get(i)); + for (Path file : files) { + m.process(file); } - if (threshold!=null && m.maximumVersion.compareTo(threshold)>0) + if ( threshold != null && m.maximumVersion.compareTo(threshold) > 0 ) + { System.exit(1); + } } protected void process( String name, InputStream image ) @@ -129,5 +137,14 @@ private static int u2( byte u, byte d ) HUMAN_READABLE_NAME.put("48.0","Java4"); HUMAN_READABLE_NAME.put("49.0","Java5"); HUMAN_READABLE_NAME.put("50.0","Java6"); + HUMAN_READABLE_NAME.put("51.0","Java7"); + HUMAN_READABLE_NAME.put("52.0","Java8"); + HUMAN_READABLE_NAME.put("53.0","Java9"); + HUMAN_READABLE_NAME.put("54.0","Java10"); + HUMAN_READABLE_NAME.put("55.0","Java11"); + HUMAN_READABLE_NAME.put("56.0","Java12"); + HUMAN_READABLE_NAME.put("57.0","Java13"); + HUMAN_READABLE_NAME.put("58.0","Java14"); + HUMAN_READABLE_NAME.put("59.0","Java15"); } } From 8bdb7581fb6be171c3cdd337f953d52782a59db5 Mon Sep 17 00:00:00 2001 From: Frederic Leitenberger Date: Tue, 19 Jan 2021 20:31:32 +0100 Subject: [PATCH 03/11] fixed bug: processing failed sometimes when inner classes existed Inner classes need to be processed first. By using a TreeSet, the files are automatically sorted with inner classes first. eg. like "Outer$Inner.class" before "Outer.class" --- .../mojo/animal_sniffer/ClassFileVisitor.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java index b9ac37a3..6f9056fe 100644 --- a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java +++ b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java @@ -29,14 +29,12 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; -import java.nio.file.FileVisitOption; import java.nio.file.FileVisitResult; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; import java.util.Arrays; -import java.util.Collections; import java.util.Comparator; import java.util.Enumeration; import java.util.Iterator; @@ -137,18 +135,20 @@ else if ( ( file.getName().endsWith( ".jar" ) || file.getName().endsWith( ".jmod * or a class file (in which case that single class is processed). */ public void process( Path path ) - throws IOException { - Files.walkFileTree(path, Collections.emptySet(), 10000, new SimpleFileVisitor() { + throws IOException + { + final SortedSet files = new TreeSet<>(); + Files.walkFileTree(path, new SimpleFileVisitor() { @Override - public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) { return FileVisitResult.CONTINUE; } @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { if (file.getFileName().toString().endsWith(".class")) { - process(file.toString(), Files.newInputStream(file)); + files.add(file); } // XXX we could add processing of jars here as well // but it's not necessary for processing: Paths.get(URI.create("jrt:/modules")) @@ -161,6 +161,9 @@ public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOExce } }); + for (final Path file : files) { + process(file.toString(), Files.newInputStream(file)); + } } protected void processDirectory( File dir ) From be4f1d6277a3738c69c69d9be3215459bab77fe7 Mon Sep 17 00:00:00 2001 From: Frederic Leitenberger Date: Mon, 8 Feb 2021 09:09:14 +0100 Subject: [PATCH 04/11] fixed issue: InputStream was not closed --- .../org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java index 6f9056fe..6fe215da 100644 --- a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java +++ b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java @@ -162,7 +162,9 @@ public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOExce }); for (final Path file : files) { - process(file.toString(), Files.newInputStream(file)); + try (final InputStream inputStream = Files.newInputStream(file)) { + process(file.toString(), inputStream); + } } } From 03bba52612a74c42640c0d732ee44446b70739a8 Mon Sep 17 00:00:00 2001 From: Frederic Leitenberger Date: Mon, 8 Feb 2021 09:12:28 +0100 Subject: [PATCH 05/11] fixed issue: FileSystemNotFoundException was thrown for paths like "C:/..." (with forward slash) --- .../src/main/java/org/codehaus/mojo/animal_sniffer/Main.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/Main.java b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/Main.java index 1299c96a..5fb9a840 100644 --- a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/Main.java +++ b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/Main.java @@ -30,6 +30,7 @@ import java.io.InputStream; import java.net.URI; import java.net.URISyntaxException; +import java.nio.file.FileSystemNotFoundException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; @@ -85,7 +86,7 @@ public static void main( String[] args ) try { files.add(Paths.get(new URI(args[i]))); // attempt to treat it as an URI - } catch (URISyntaxException e) { + } catch (URISyntaxException | FileSystemNotFoundException e) { files.add(Paths.get(args[i])); // if that fails: treat is as a normal file/path } } From 09fbc1e22ca822ac24d11c2bbe422843e75d0446 Mon Sep 17 00:00:00 2001 From: Frederic Leitenberger Date: Mon, 8 Feb 2021 09:13:53 +0100 Subject: [PATCH 06/11] removed obsolete method - the inherited method did the same --- .../org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java index 6fe215da..ad510dda 100644 --- a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java +++ b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java @@ -140,11 +140,6 @@ public void process( Path path ) final SortedSet files = new TreeSet<>(); Files.walkFileTree(path, new SimpleFileVisitor() { - @Override - public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) { - return FileVisitResult.CONTINUE; - } - @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { if (file.getFileName().toString().endsWith(".class")) { From 9c8a50bc3ab7c87698e6e740df5499e6ee320c0c Mon Sep 17 00:00:00 2001 From: Frederic Leitenberger Date: Mon, 8 Feb 2021 09:18:26 +0100 Subject: [PATCH 07/11] changed process(Path path) to process each directory separately --- .../mojo/animal_sniffer/ClassFileVisitor.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java index ad510dda..c21c158e 100644 --- a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java +++ b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java @@ -137,9 +137,10 @@ else if ( ( file.getName().endsWith( ".jar" ) || file.getName().endsWith( ".jmod public void process( Path path ) throws IOException { - final SortedSet files = new TreeSet<>(); Files.walkFileTree(path, new SimpleFileVisitor() { + final SortedSet files = new TreeSet<>(); + @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { if (file.getFileName().toString().endsWith(".class")) { @@ -150,17 +151,23 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { return FileVisitResult.CONTINUE; } + @Override + public FileVisitResult postVisitDirectory(final Path dir, final IOException exc) throws IOException { + for (final Path file : files) { + try (final InputStream inputStream = Files.newInputStream(file)) { + process(file.toString(), inputStream); + } + } + files.clear(); + return super.postVisitDirectory(dir, exc); + } + @Override public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException { return FileVisitResult.CONTINUE; } }); - for (final Path file : files) { - try (final InputStream inputStream = Files.newInputStream(file)) { - process(file.toString(), inputStream); - } - } } protected void processDirectory( File dir ) From f66f7acb8cc6d198f3608026aa568bd7c81f0653 Mon Sep 17 00:00:00 2001 From: Frederic Leitenberger Date: Mon, 8 Feb 2021 09:19:04 +0100 Subject: [PATCH 08/11] fixed bug with paths like: "C:\..." (backslash) and others --- .../src/main/java/org/codehaus/mojo/animal_sniffer/Main.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/Main.java b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/Main.java index 5fb9a840..7d4b0fd3 100644 --- a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/Main.java +++ b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/Main.java @@ -29,8 +29,6 @@ import java.io.IOException; import java.io.InputStream; import java.net.URI; -import java.net.URISyntaxException; -import java.nio.file.FileSystemNotFoundException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; @@ -86,7 +84,7 @@ public static void main( String[] args ) try { files.add(Paths.get(new URI(args[i]))); // attempt to treat it as an URI - } catch (URISyntaxException | FileSystemNotFoundException e) { + } catch (Exception e) { files.add(Paths.get(args[i])); // if that fails: treat is as a normal file/path } } From dbcfc2a9e575869076d92cf84065a68b27481a1c Mon Sep 17 00:00:00 2001 From: Frederic Leitenberger Date: Tue, 9 Mar 2021 21:55:45 +0100 Subject: [PATCH 09/11] implemented suggested changes https://github.com/mojohaus/animal-sniffer/pull/139#discussion_r590576127 --- .../codehaus/mojo/animal_sniffer/Main.java | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/Main.java b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/Main.java index 7d4b0fd3..45386abf 100644 --- a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/Main.java +++ b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/Main.java @@ -29,6 +29,7 @@ import java.io.IOException; import java.io.InputStream; import java.net.URI; +import java.net.URISyntaxException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; @@ -82,11 +83,7 @@ public static void main( String[] args ) continue; } - try { - files.add(Paths.get(new URI(args[i]))); // attempt to treat it as an URI - } catch (Exception e) { - files.add(Paths.get(args[i])); // if that fails: treat is as a normal file/path - } + files.add(getPath(args[i])); } for (Path file : files) { @@ -99,6 +96,21 @@ public static void main( String[] args ) } } + private static Path getPath(String s) { + try { + URI uri = new URI(s); + String scheme = uri.getScheme(); + // Only allow certain schemes to prevent treating (mistyped) file path unintentionally as URI + if (scheme.equalsIgnoreCase("file") || scheme.equalsIgnoreCase("jrt")) { + return Paths.get(uri); + } + // Fall through + } catch (URISyntaxException e) { + // Fall through; probably not a URI but a file path + } + return Paths.get(s); + } + protected void process( String name, InputStream image ) throws IOException { From 8909994e40d786f74acb0e4b35a1061e251da963 Mon Sep 17 00:00:00 2001 From: Frederic Leitenberger Date: Tue, 9 Mar 2021 22:15:06 +0100 Subject: [PATCH 10/11] improved exception handling https://github.com/mojohaus/animal-sniffer/pull/139/files --- .../org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java index 1ecbcb8a..1db6a3f6 100644 --- a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java +++ b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java @@ -35,7 +35,6 @@ import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; import java.util.Arrays; -import java.util.Comparator; import java.util.Enumeration; import java.util.SortedSet; import java.util.TreeSet; @@ -147,13 +146,16 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { @Override public FileVisitResult postVisitDirectory(final Path dir, final IOException exc) throws IOException { + if (exc != null) { + throw exc; + } for (final Path file : files) { try (final InputStream inputStream = Files.newInputStream(file)) { process(file.toString(), inputStream); } } files.clear(); - return super.postVisitDirectory(dir, exc); + return FileVisitResult.CONTINUE; } @Override From abb1fee0fb6bd60510fedaac7cae03cb0b7371f4 Mon Sep 17 00:00:00 2001 From: Frederic Leitenberger Date: Thu, 28 Apr 2022 11:24:25 +0200 Subject: [PATCH 11/11] removed obsolete "throws IOException" --- .../java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java index 1db6a3f6..ba83856c 100644 --- a/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java +++ b/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/ClassFileVisitor.java @@ -159,7 +159,7 @@ public FileVisitResult postVisitDirectory(final Path dir, final IOException exc) } @Override - public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException { + public FileVisitResult visitFileFailed(Path file, IOException exc) { return FileVisitResult.CONTINUE; }