Commits

gigadot committed 3aa8aea

fixed logger checking

Comments (0)

Files changed (2)

         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <version>4.10</version>
+            <version>4.11</version>
             <scope>test</scope>
         </dependency>
         <dependency>

src/main/java/gigadot/rebound/Rebound.java

     public <T> Set<Class<? extends T>> getSubClassesOf(final Class<T> clazz) {
         long start = System.currentTimeMillis();
         if (packagePrefix.isEmpty()) {
-            logger.warn("Package prefix is empty. Rebound will look for subclasses inside "
-                    + "every jar file under your classpath in this case. This is a lengthy "
-                    + "and time consuming process. Please consider using Rebound with prefix.");
+            if (logging) {
+                logger.warn("Package prefix is empty. Rebound will look for subclasses inside "
+                        + "every jar file under your classpath in this case. This is a lengthy "
+                        + "and time consuming process. Please consider using Rebound with prefix.");
+            }
         }
         final Set<Class<? extends T>> subClazzes = new HashSet<Class<? extends T>>();
         try {
             }
         }
         long elapsed = System.currentTimeMillis() - start;
-        logger.info("Rebound uses " + elapsed + " milliseconds to look up subclasses of " + clazz.getName() + " in package " + packagePrefix + ".*");
-
+        if (logging) {
+            logger.info("Rebound uses " + elapsed + " milliseconds to look up subclasses of " + clazz.getName() + " in package " + packagePrefix + ".*");
+        }
         return subClazzes;
     }
     private Set<Class> temp_classes_set;
                 logger.error("Unable to decode jar file location using UTF-8.", ex);
             }
         }
-        logger.warn("URL is not decoded : " + url.toString());
+        if (logging) {
+            logger.warn("URL is not decoded : " + url.toString());
+        }
         return new File(url.toString());
     }
 
         try {
             String rawJarPath = URLDecoder.decode(url.getFile(), "UTF-8");
             String jarPath = rawJarPath.replaceFirst("!.*$", "").replaceFirst("^file:", "");
-            if (logging) {
-                System.out.println("jarPath : " + jarPath);
-            }
             try {
                 JarFile jarFile = new JarFile(jarPath);
                 return jarFile;