src/java.logging/share/classes/java/util/logging/FileHandler.java

Print this page

        

@@ -421,10 +421,15 @@
            throw new IllegalArgumentException("file count = " + count);
         }
         if (limit < 0) {
             limit = 0;
         }
+        if (pattern == null || pattern.isEmpty()) {
+            // can only happen if the default constructor was called: all
+            // other constructors will have thrown IAE.
+            throw new NullPointerException();
+        }
 
         // We register our own ErrorManager during initialization
         // so we can record exceptions.
         InitializationErrorManager em = new InitializationErrorManager();
         setErrorManager(em);