6339649: URI.create should include a detail message when throwing IllegalArgumentException
Summary: create enclosing exception with message of enclosed
Reviewed-by: alanb, chegar
diff --git a/test/java/net/URI/Test.java b/test/java/net/URI/Test.java
index 449f7d1..39b5b94 100644
--- a/test/java/net/URI/Test.java
+++ b/test/java/net/URI/Test.java
@@ -1536,6 +1536,7 @@
         serial();
         urls();
         npes();
+        bugs();
     }
 
 
@@ -1572,6 +1573,19 @@
     }
 
 
+    // miscellaneous bugs/rfes that don't fit in with the test framework
+
+    static void bugs() {
+        // 6339649 - include detail message from nested exception
+        try {
+            URI uri = URI.create("http://nowhere.net/should not be permitted");
+        } catch (IllegalArgumentException e) {
+            if ("".equals(e.getMessage()) || e.getMessage() == null) {
+                throw new RuntimeException ("No detail message");
+            }
+        }
+    }
+
     public static void main(String[] args) throws Exception {
         switch (args.length) {