Merge
authorjwilhelm
Mon, 16 Jan 2017 16:18:04 +0100
changeset 43531 c31f3ca41bd8
parent 43530 f444d3f438dd (current diff)
parent 43529 d6c3cdeedf6d (diff)
child 43532 5028c6b02af5
Merge
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Layer.java	Fri Jan 13 18:26:33 2017 +0100
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Layer.java	Mon Jan 16 16:18:04 2017 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -458,7 +458,7 @@
             loader.initRemotePackageMap(cf, parents);
             Layer layer =  new Layer(cf, parents, mn -> loader);
             return new Controller(layer);
-        } catch (IllegalArgumentException e) {
+        } catch (IllegalArgumentException | IllegalStateException e) {
             throw new LayerInstantiationException(e.getMessage());
         }
     }
@@ -526,7 +526,7 @@
         try {
             Layer layer = new Layer(cf, parents, pool::loaderFor);
             return new Controller(layer);
-        } catch (IllegalArgumentException e) {
+        } catch (IllegalArgumentException | IllegalStateException e) {
             throw new LayerInstantiationException(e.getMessage());
         }
     }
@@ -610,9 +610,8 @@
         try {
             Layer layer = new Layer(cf, parents, clf);
             return new Controller(layer);
-        } catch (IllegalArgumentException iae) {
-            // IAE is thrown by VM when defining the module fails
-            throw new LayerInstantiationException(iae.getMessage());
+        } catch (IllegalArgumentException | IllegalStateException e) {
+            throw new LayerInstantiationException(e.getMessage());
         }
     }