Index: src/main/java/java/util/logging/FileHandler.java =================================================================== --- src/main/java/java/util/logging/FileHandler.java (revision 483102) +++ src/main/java/java/util/logging/FileHandler.java (working copy) @@ -420,6 +420,7 @@ // logging.19=Pattern cannot be empty throw new NullPointerException(Messages.getString("logging.19")); //$NON-NLS-1$ } + if("".equals(pattern)){ //$NON-NLS-1$ throw new IllegalArgumentException(); } @@ -451,10 +452,15 @@ * */ public FileHandler(String pattern, boolean append) throws IOException { - if(null == pattern || "".equals(pattern)){ //$NON-NLS-1$ + if(null == pattern){ // logging.19=Pattern cannot be empty throw new NullPointerException(Messages.getString("logging.19")); //$NON-NLS-1$ - } + } + + if ("".equals(pattern)){ //$NON-NLS-1$ + throw new IllegalArgumentException(Messages.getString("logging.19")); //$NON-NLS-1$ + } + init(pattern, Boolean.valueOf(append), Integer.valueOf(DEFAULT_LIMIT), Integer.valueOf(DEFAULT_COUNT)); } @@ -488,10 +494,15 @@ * if count<1, or limit<0 */ public FileHandler(String pattern, int limit, int count) throws IOException { - if(null == pattern || "".equals(pattern)){ //$NON-NLS-1$ + if(null == pattern){ // logging.19=Pattern cannot be empty throw new NullPointerException(Messages.getString("logging.19")); //$NON-NLS-1$ - } + } + + if ("".equals(pattern)){ //$NON-NLS-1$ + throw new IllegalArgumentException(Messages.getString("logging.19")); //$NON-NLS-1$ + } + if (limit < 0 || count < 1) { // logging.1B=The limit and count property must be larger than 0 and 1, respectively throw new IllegalArgumentException(Messages.getString("logging.1B")); //$NON-NLS-1$ @@ -533,10 +544,15 @@ */ public FileHandler(String pattern, int limit, int count, boolean append) throws IOException { - if(null == pattern || "".equals(pattern)){ //$NON-NLS-1$ + if(null == pattern){ // logging.19=Pattern cannot be empty throw new NullPointerException(Messages.getString("logging.19")); //$NON-NLS-1$ - } + } + + if ("".equals(pattern)){ //$NON-NLS-1$ + throw new IllegalArgumentException(Messages.getString("logging.19")); //$NON-NLS-1$ + } + if (limit < 0 || count < 1) { // logging.1B=The limit and count property must be larger than 0 and 1, respectively throw new IllegalArgumentException(Messages.getString("logging.1B")); //$NON-NLS-1$