openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1843022 - in /openwebbeans/trunk: ./ distribution/ distribution/src/assembly/ webbeans-impl/ webbeans-impl/src/main/java/org/apache/webbeans/proxy/ webbeans-impl/src/test/java/org/apache/webbeans/test/injection/generics/ webbeans-se/src/te...
Date Sat, 06 Oct 2018 16:11:35 GMT
Author: rmannibucau
Date: Sat Oct  6 16:11:35 2018
New Revision: 1843022

URL: http://svn.apache.org/viewvc?rev=1843022&view=rev
Log:
OWB-1261 asm7 upgrade

Added:
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/injection/generics/FastMatchingGenericsTest.java
Modified:
    openwebbeans/trunk/distribution/pom.xml
    openwebbeans/trunk/distribution/src/assembly/dist-binary.xml
    openwebbeans/trunk/pom.xml
    openwebbeans/trunk/webbeans-impl/pom.xml
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/SubclassProxyFactory.java
    openwebbeans/trunk/webbeans-se/src/test/java/org/apache/openwebbeans/se/CDISETest.java

Modified: openwebbeans/trunk/distribution/pom.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/distribution/pom.xml?rev=1843022&r1=1843021&r2=1843022&view=diff
==============================================================================
--- openwebbeans/trunk/distribution/pom.xml (original)
+++ openwebbeans/trunk/distribution/pom.xml Sat Oct  6 16:11:35 2018
@@ -145,7 +145,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.xbean</groupId>
-            <artifactId>xbean-asm6-shaded</artifactId>
+            <artifactId>xbean-asm7-shaded</artifactId>
         </dependency>
 
 

Modified: openwebbeans/trunk/distribution/src/assembly/dist-binary.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/distribution/src/assembly/dist-binary.xml?rev=1843022&r1=1843021&r2=1843022&view=diff
==============================================================================
--- openwebbeans/trunk/distribution/src/assembly/dist-binary.xml (original)
+++ openwebbeans/trunk/distribution/src/assembly/dist-binary.xml Sat Oct  6 16:11:35 2018
@@ -73,7 +73,7 @@ under the License.
             <includes>
                 <include>org.apache.openwebbeans:openwebbeans-impl:jar</include>
                 <include>org.apache.xbean:xbean-finder-shaded:jar</include>
-                <include>org.apache.xbean:xbean-asm6-shaded:jar</include>
+                <include>org.apache.xbean:xbean-asm7-shaded:jar</include>
             </includes>
         </dependencySet>
 

Modified: openwebbeans/trunk/pom.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/pom.xml?rev=1843022&r1=1843021&r2=1843022&view=diff
==============================================================================
--- openwebbeans/trunk/pom.xml (original)
+++ openwebbeans/trunk/pom.xml Sat Oct  6 16:11:35 2018
@@ -71,7 +71,7 @@
         <geronimo_validation.version>1.1</geronimo_validation.version>
         <tomcat7.version>7.0.73</tomcat7.version>
         <myfaces.version>2.3.0</myfaces.version>
-        <xbean.version>4.9</xbean.version>
+        <xbean.version>4.11</xbean.version>
         <arquillian.version>1.1.13.Final</arquillian.version>
         <cdi.tck.version>2.0.3.Final</cdi.tck.version>
         <httpclient.version>4.5.2</httpclient.version>
@@ -611,7 +611,7 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.xbean</groupId>
-                <artifactId>xbean-asm6-shaded</artifactId>
+                <artifactId>xbean-asm7-shaded</artifactId>
                 <version>${xbean.version}</version>
             </dependency>
 

Modified: openwebbeans/trunk/webbeans-impl/pom.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/pom.xml?rev=1843022&r1=1843021&r2=1843022&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/pom.xml (original)
+++ openwebbeans/trunk/webbeans-impl/pom.xml Sat Oct  6 16:11:35 2018
@@ -49,7 +49,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.xbean</groupId>
-            <artifactId>xbean-asm6-shaded</artifactId>
+            <artifactId>xbean-asm7-shaded</artifactId>
         </dependency>
 
         <dependency>

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java?rev=1843022&r1=1843021&r2=1843022&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java
Sat Oct  6 16:11:35 2018
@@ -18,9 +18,9 @@
  */
 package org.apache.webbeans.proxy;
 
-import static org.apache.xbean.asm6.ClassReader.SKIP_CODE;
-import static org.apache.xbean.asm6.ClassReader.SKIP_DEBUG;
-import static org.apache.xbean.asm6.ClassReader.SKIP_FRAMES;
+import static org.apache.xbean.asm7.ClassReader.SKIP_CODE;
+import static org.apache.xbean.asm7.ClassReader.SKIP_DEBUG;
+import static org.apache.xbean.asm7.ClassReader.SKIP_FRAMES;
 
 import java.io.InputStream;
 import java.lang.reflect.Constructor;
@@ -40,12 +40,12 @@ import org.apache.webbeans.config.WebBea
 import org.apache.webbeans.exception.ProxyGenerationException;
 import org.apache.webbeans.exception.WebBeansException;
 import org.apache.webbeans.logger.WebBeansLoggerFacade;
-import org.apache.xbean.asm6.ClassReader;
-import org.apache.xbean.asm6.ClassWriter;
-import org.apache.xbean.asm6.MethodVisitor;
-import org.apache.xbean.asm6.Opcodes;
-import org.apache.xbean.asm6.Type;
-import org.apache.xbean.asm6.shade.commons.EmptyVisitor;
+import org.apache.xbean.asm7.ClassReader;
+import org.apache.xbean.asm7.ClassWriter;
+import org.apache.xbean.asm7.MethodVisitor;
+import org.apache.xbean.asm7.Opcodes;
+import org.apache.xbean.asm7.Type;
+import org.apache.xbean.asm7.shade.commons.EmptyVisitor;
 
 /**
  * Base class for all OWB Proxy factories
@@ -110,10 +110,18 @@ public abstract class AbstractProxyFacto
             {
                 return Opcodes.V9;
             }
+            else if (javaVersionProp.startsWith("10"))
+            {
+                return Opcodes.V10;
+            }
+            else if (javaVersionProp.startsWith("11"))
+            {
+                return Opcodes.V11;
+            }
         }
 
         // the fallback is the lowest one to ensure it supports all possible classes of current
environments
-        return Opcodes.V1_6;
+        return Opcodes.V1_8;
     }
 
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java?rev=1843022&r1=1843021&r2=1843022&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java
Sat Oct  6 16:11:35 2018
@@ -26,11 +26,11 @@ import org.apache.webbeans.intercept.Int
 import org.apache.webbeans.logger.WebBeansLoggerFacade;
 import org.apache.webbeans.util.Asserts;
 import org.apache.webbeans.util.ExceptionUtil;
-import org.apache.xbean.asm6.ClassWriter;
-import org.apache.xbean.asm6.Label;
-import org.apache.xbean.asm6.MethodVisitor;
-import org.apache.xbean.asm6.Opcodes;
-import org.apache.xbean.asm6.Type;
+import org.apache.xbean.asm7.ClassWriter;
+import org.apache.xbean.asm7.Label;
+import org.apache.xbean.asm7.MethodVisitor;
+import org.apache.xbean.asm7.Opcodes;
+import org.apache.xbean.asm7.Type;
 
 import javax.enterprise.inject.spi.AnnotatedType;
 import javax.enterprise.inject.spi.Bean;

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java?rev=1843022&r1=1843021&r2=1843022&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java
Sat Oct  6 16:11:35 2018
@@ -41,10 +41,10 @@ import org.apache.webbeans.intercept.Nor
 import org.apache.webbeans.util.ClassUtil;
 import org.apache.webbeans.util.ExceptionUtil;
 import org.apache.webbeans.util.WebBeansUtil;
-import org.apache.xbean.asm6.ClassWriter;
-import org.apache.xbean.asm6.MethodVisitor;
-import org.apache.xbean.asm6.Opcodes;
-import org.apache.xbean.asm6.Type;
+import org.apache.xbean.asm7.ClassWriter;
+import org.apache.xbean.asm7.MethodVisitor;
+import org.apache.xbean.asm7.Opcodes;
+import org.apache.xbean.asm7.Type;
 
 /**
  * This factory creates proxies which delegate the
@@ -508,7 +508,7 @@ public class NormalScopeProxyFactory ext
      * if targetMethod is protected. Please see Java LangSpec 6.6.2 about the complex
      * rules for calling 'protected' methods.
      *
-     * @see #generateDelegationMethod(org.apache.xbean.asm6.ClassWriter, java.lang.reflect.Method,
int, Class, String)
+     * @see #generateDelegationMethod(org.apache.xbean.asm7.ClassWriter, java.lang.reflect.Method,
int, Class, String)
      */
     @SuppressWarnings("unused")
     public static Object delegateProtectedMethod(Method method, Object instance, Object[]
params)

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/SubclassProxyFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/SubclassProxyFactory.java?rev=1843022&r1=1843021&r2=1843022&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/SubclassProxyFactory.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/SubclassProxyFactory.java
Sat Oct  6 16:11:35 2018
@@ -27,10 +27,10 @@ import org.apache.webbeans.config.WebBea
 import org.apache.webbeans.exception.ProxyGenerationException;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
 import org.apache.webbeans.util.ClassUtil;
-import org.apache.xbean.asm6.ClassWriter;
-import org.apache.xbean.asm6.MethodVisitor;
-import org.apache.xbean.asm6.Opcodes;
-import org.apache.xbean.asm6.Type;
+import org.apache.xbean.asm7.ClassWriter;
+import org.apache.xbean.asm7.MethodVisitor;
+import org.apache.xbean.asm7.Opcodes;
+import org.apache.xbean.asm7.Type;
 
 import javax.enterprise.inject.spi.AnnotatedConstructor;
 import javax.enterprise.inject.spi.AnnotatedType;

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/injection/generics/FastMatchingGenericsTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/injection/generics/FastMatchingGenericsTest.java?rev=1843022&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/injection/generics/FastMatchingGenericsTest.java
(added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/injection/generics/FastMatchingGenericsTest.java
Sat Oct  6 16:11:35 2018
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.webbeans.test.injection.generics;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+
+import org.apache.webbeans.config.OwbParametrizedTypeImpl;
+import org.apache.webbeans.test.AbstractUnitTest;
+import org.junit.Test;
+
+public class FastMatchingGenericsTest extends AbstractUnitTest
+{
+    @Test
+    public void concreteGenericsAreNotAmbiguous()
+    {
+        startContainer(StringRepo.class, IntRepo.class);
+        final Object stringRepo = getInstance(new OwbParametrizedTypeImpl(null, Repo.class,
String.class));
+        assertNotNull(stringRepo);
+        assertEquals("string", Repo.class.cast(stringRepo).get());
+        validateIntRepoIsOk();
+    }
+
+    @Test
+    public void genericGenericsAreNotAmbiguous()
+    {
+        startContainer(IntRepo.class, StringRepo.class, ConcreteRepo.class);
+        final ConcreteRepo stringRepo = getInstance(ConcreteRepo.class);
+        assertNotNull(stringRepo);
+        assertEquals("string", stringRepo.get());
+        validateIntRepoIsOk();
+    }
+
+    // just to ensure String is not a particular case or there is a iterator().next() breaking
other cases
+    private void validateIntRepoIsOk()
+    {
+        final Object intRepo = getInstance(new OwbParametrizedTypeImpl(null, Repo.class,
Integer.class));
+        assertNotNull(intRepo);
+        assertEquals(1, Repo.class.cast(intRepo).get());
+    }
+
+    public interface Repo<A> {
+        A get();
+    }
+
+    public static abstract class BaseRepoAware<A>
+    {
+        @Inject
+        protected Repo<A> repo;
+    }
+
+    @ApplicationScoped
+    public static class ConcreteRepo extends BaseRepoAware<String>
+    {
+        public String get()
+        {
+            return repo.get();
+        }
+    }
+
+    @ApplicationScoped
+    public static class StringRepo implements Repo<String>
+    {
+        @Override
+        public String get()
+        {
+            return "string";
+        }
+    }
+
+    @ApplicationScoped
+    public static class IntRepo implements Repo<Integer>
+    {
+        @Override
+        public Integer get()
+        {
+            return 1;
+        }
+    }
+}

Modified: openwebbeans/trunk/webbeans-se/src/test/java/org/apache/openwebbeans/se/CDISETest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-se/src/test/java/org/apache/openwebbeans/se/CDISETest.java?rev=1843022&r1=1843021&r2=1843022&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-se/src/test/java/org/apache/openwebbeans/se/CDISETest.java
(original)
+++ openwebbeans/trunk/webbeans-se/src/test/java/org/apache/openwebbeans/se/CDISETest.java
Sat Oct  6 16:11:35 2018
@@ -74,6 +74,15 @@ public class CDISETest
         }
     }
 
+    @Test // main for OWB-1260 and enable java 11 testing
+    public void fire() {
+        try (final SeContainer container = SeContainerInitializer.newInstance()
+                .disableDiscovery()
+                .initialize()) {
+            container.getBeanManager().fireEvent(new Object());
+        }
+    }
+
     public static class ImNotScanned {
     }
 



Mime
View raw message