openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1793634 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
Date Wed, 03 May 2017 10:46:23 GMT
Author: rmannibucau
Date: Wed May  3 10:46:23 2017
New Revision: 1793634

URL: http://svn.apache.org/viewvc?rev=1793634&view=rev
Log:
OWB-1180 use getDefinedPackage in favor of getPackage on java 9

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java?rev=1793634&r1=1793633&r2=1793634&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
Wed May  3 10:46:23 2017
@@ -142,17 +142,28 @@ public class BeansDeployer
     private static final Method GET_PACKAGE;
     static
     {
+        Method getPackage;
         try
         {
-            GET_PACKAGE = ClassLoader.class.getDeclaredMethod("getPackage", String.class);
-            GET_PACKAGE.setAccessible(true);
+            getPackage = ClassLoader.class.getDeclaredMethod("getDefinedPackage", String.class);
+            getPackage.setAccessible(true);
         }
         catch (final NoSuchMethodException e)
         {
-            throw new IllegalStateException(e);
+            try
+            {
+                getPackage = ClassLoader.class.getDeclaredMethod("getPackage", String.class);
+                getPackage.setAccessible(true);
+            }
+            catch (final NoSuchMethodException ex)
+            {
+                throw new IllegalStateException(ex);
+            }
         }
+        GET_PACKAGE = getPackage;
     }
 
+
     /**Deployment is started or not*/
     protected boolean deployed = false;
 



Mime
View raw message