ANY23-365 resolved additional warnings
authorHans <firedrake93@gmail.com>
Wed, 11 Jul 2018 20:53:05 +0000 (15:53 -0500)
committerHans <firedrake93@gmail.com>
Wed, 11 Jul 2018 20:53:05 +0000 (15:53 -0500)
api/src/main/java/org/apache/any23/plugin/Author.java
cli/src/main/java/org/apache/any23/cli/PluginVerifier.java
service/src/main/java/org/apache/any23/servlet/WebResponder.java

index 86ae20a..a113a15 100644 (file)
 
 package org.apache.any23.plugin;
 
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
 /**
  * Describes the author of the plugin.
  *
  * @author Michele Mostarda (mostarda@fbk.eu)
  */
+@Retention(RetentionPolicy.RUNTIME)
 public @interface Author {
 
     /**
index f3f3234..a43065d 100644 (file)
@@ -76,11 +76,11 @@ public class PluginVerifier implements Tool {
         return sb.toString();
     }
 
-    private void printPluginData(ExtractorFactory extractorFactory, PrintStream ps) {
+    private void printPluginData(ExtractorFactory<?> extractorFactory, PrintStream ps) {
         final Author authorAnnotation = extractorFactory.getClass().getAnnotation(Author.class);
         ps.printf("Plugin author    : %s%n", authorAnnotation == null ? "<unknown>" : authorAnnotation.name());
         ps.printf("Plugin factory   : %s%n", extractorFactory.getClass());
-        ps.printf("Plugin mime-types: %s%n", getMimeTypesStr( extractorFactory.getSupportedMIMETypes() ));
+        ps.printf("Plugin mime-types: %s%n", getMimeTypesStr(extractorFactory.getSupportedMIMETypes()));
     }
 
 }
index b9641d2..024bf70 100644 (file)
@@ -21,6 +21,7 @@ import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.PrintStream;
 import java.nio.charset.Charset;
+import java.security.cert.CertificateException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
@@ -45,7 +46,6 @@ import org.apache.any23.writer.TripleHandler;
 import org.apache.any23.writer.TripleHandlerException;
 import org.apache.any23.writer.WriterFactory;
 import org.apache.any23.writer.WriterFactoryRegistry;
-import sun.security.validator.ValidatorException;
 
 /**
  * This class is responsible for building the {@link Servlet}
@@ -127,7 +127,7 @@ class WebResponder {
             }
         } catch (IOException ioe) {
             // IO Error.
-            if (ioe.getCause() != null && ValidatorException.class.equals(ioe.getCause().getClass())) {
+            if (ioe.getCause() instanceof CertificateException) {
                 final String errMsg = "Could not fetch input, IO Error.";
                 any23servlet.log(errMsg, ioe.getCause());
                 sendError(502, errMsg, ioe, null, report);