Sure but lets get 5.5 out the door first.

I have been going over the changes and i have some patches available.

First attached is the already mentioned issue with static interface methods



On Sat, Dec 1, 2018 at 1:26 AM Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Fri, Nov 30, 2018 at 7:36 PM Dimitris Zenios <dimitris.zen...@gmail.com
> >
> wrote:
>
> > I have some ideas on that subject but lest get 5.5 out first and continue
> > on that afterwards
> >
>
> Nice! Could you please start a new thread with your ideas? I'm curious
> about them. :)
>
>
> >
> > On Fri, Nov 30, 2018 at 11:33 PM Thiago H. de Paula Figueiredo <
> > thiag...@gmail.com> wrote:
> >
> > > Yeah, it would break webapps styled with Bootstrap 4 due to the
> different
> > > tagging. Maybe we (the Tapestry team or the community) could come up
> > with a
> > > separate library to do this.
> > >
> > > On Fri, Nov 30, 2018 at 7:30 PM Dimitris Zenios <
> > dimitris.zen...@gmail.com
> > > >
> > > wrote:
> > >
> > > > Its not so huge my main concern is the backwards compatibility
> > > >
> > > > On Fri, Nov 30, 2018 at 11:27 PM Thiago H. de Paula Figueiredo <
> > > > thiag...@gmail.com> wrote:
> > > >
> > > > > On Fri, Nov 30, 2018 at 6:45 PM Dimitris Zenios <
> > > > dimitris.zen...@gmail.com
> > > > > >
> > > > > wrote:
> > > > >
> > > > > > Even though it might be irrelevant i was also thinking of
> bootstrap
> > > 4.
> > > > > >
> > > > >
> > > > > Hmm, it would be nice, but I don't think it would be a trivial,
> quick
> > > > thing
> > > > > to do. Any takers? :)
> > > > >
> > > > >
> > > > > >
> > > > > > On Fri, Nov 30, 2018 at 10:31 PM Dimitris Zenios <
> > > > > > dimitris.zen...@gmail.com>
> > > > > > wrote:
> > > > > >
> > > > > > > +1
> > > > > > >
> > > > > > > On Fri, 30 Nov 2018, 22:28 Thiago H. de Paula Figueiredo <
> > > > > > > thi...@arsmachina.com.br wrote:
> > > > > > >
> > > > > > >> Hello!
> > > > > > >>
> > > > > > >> Since we now have a working build and ASM 7 supporting Java
> 11,
> > I
> > > > was
> > > > > > >> thinking of release a beta version so people could test it on
> > > their
> > > > > > >> own projects. What do you think?
> > > > > > >>
> > > > > > >> Cheers!
> > > > > > >> --
> > > > > > >> Thiago H. de Paula Figueiredo
> > > > > > >>
> > > > > > >>
> > > > ---------------------------------------------------------------------
> > > > > > >> To unsubscribe, e-mail: dev-unsubscr...@tapestry.apache.org
> > > > > > >> For additional commands, e-mail: dev-h...@tapestry.apache.org
> > > > > > >>
> > > > > > >>
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Thiago
> > > > >
> > > >
> > >
> > >
> > > --
> > > Thiago
> > >
> >
>
>
> --
> Thiago
>
From 8bc7c6de09ce56b5aa4066887d8f8d8f916347aa Mon Sep 17 00:00:00 2001
From: Dimitris Zenios <dimitris.zen...@gmail.com>
Date: Sat, 1 Dec 2018 01:48:06 +0200
Subject: [PATCH] Skip static interface methods when proxying

---
 .../internal/plastic/PlasticClassImpl.java    | 19 ++++++++-----
 .../tapestry5/plastic/MethodProxying.groovy   | 27 +++++++++++++++++++
 .../test/java/testinterfaces/WithStatic.java  |  7 +++++
 .../tapestry5/ioc/internal/ModuleImpl.java    |  4 ---
 4 files changed, 46 insertions(+), 11 deletions(-)
 create mode 100644 plastic/src/test/java/testinterfaces/WithStatic.java

diff --git a/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassImpl.java b/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassImpl.java
index 223109a55..b86b8d082 100644
--- a/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassImpl.java
+++ b/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassImpl.java
@@ -619,15 +619,15 @@ public class PlasticClassImpl extends Lockable implements PlasticClass, Internal
         introduceInterface(interfaceType);
 
         // TAP5-2582: avoiding adding/delegating the same method more than once
-//        for (Method m : interfaceType.getMethods())
-//        {
-//            introduceMethod(m).delegateTo(field);
-//        }
-
         Map<MethodSignature, MethodDescription> map = createMethodSignatureMap(interfaceType);
         for (MethodSignature methodSignature : map.keySet())
         {
-            introduceMethod(map.get(methodSignature)).delegateTo(field);
+            final MethodDescription description = map.get(methodSignature);
+            if(Modifier.isStatic(description.modifiers))
+            {
+                continue;
+            }
+            introduceMethod(description).delegateTo(field);
         }
 
         return this;
@@ -646,6 +646,11 @@ public class PlasticClassImpl extends Lockable implements PlasticClass, Internal
         Map<MethodSignature, MethodDescription> map = createMethodSignatureMap(interfaceType);
         for (MethodSignature methodSignature : map.keySet())
         {
+            final MethodDescription description = map.get(methodSignature);
+            if(Modifier.isStatic(description.modifiers))
+            {
+                continue;
+            }
             introduceMethod(map.get(methodSignature)).delegateTo(method);
         }
 
@@ -1456,7 +1461,7 @@ public class PlasticClassImpl extends Lockable implements PlasticClass, Internal
             // MethodDescription description = new MethodDescription(m);
             final MethodDescription description = map.get(methodSignature);
 
-            if (!isMethodImplemented(description) && !isDefaultMethod(methodSignature.method))
+            if (!isMethodImplemented(description) && !isDefaultMethod(methodSignature.method) && !Modifier.isStatic(description.modifiers))
             {
                 // introducedMethods.add(introduceMethod(m));
                 introducedMethods.add(introduceMethod(description));
diff --git a/plastic/src/test/groovy/org/apache/tapestry5/plastic/MethodProxying.groovy b/plastic/src/test/groovy/org/apache/tapestry5/plastic/MethodProxying.groovy
index 512508d87..22e41b6ff 100644
--- a/plastic/src/test/groovy/org/apache/tapestry5/plastic/MethodProxying.groovy
+++ b/plastic/src/test/groovy/org/apache/tapestry5/plastic/MethodProxying.groovy
@@ -1,6 +1,7 @@
 package org.apache.tapestry5.plastic
 
 import testsubjects.Memory
+import testinterfaces.WithStatic
 
 class MethodProxying extends AbstractPlasticSpecification {
 
@@ -29,6 +30,32 @@ class MethodProxying extends AbstractPlasticSpecification {
         1 * mockRunnable.run()
     }
 
+    def "Proxying with static methods"() {
+        setup:
+
+        def mockRunnable = Mock(Runnable.class)
+
+        def o = mgr.createClass(Object, { PlasticClass pc ->
+
+            def field = pc.introduceField(Runnable, "delegate").inject(mockRunnable)
+
+            pc.proxyInterface(WithStatic, field)
+        } as PlasticClassTransformer).newInstance()
+
+        expect:
+
+        WithStatic.isInstance o
+        o.version() == 1
+
+        when:
+
+        o.run()
+
+        then:
+
+        1 * mockRunnable.run()
+    }
+
     def "proxy method with arguments and return value"() {
         setup:
 
diff --git a/plastic/src/test/java/testinterfaces/WithStatic.java b/plastic/src/test/java/testinterfaces/WithStatic.java
new file mode 100644
index 000000000..e3150f34c
--- /dev/null
+++ b/plastic/src/test/java/testinterfaces/WithStatic.java
@@ -0,0 +1,7 @@
+package testinterfaces;
+
+public interface WithStatic extends Runnable {
+    static int version() {
+        return 1;
+    }
+}
diff --git a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/ModuleImpl.java b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/ModuleImpl.java
index 51f864cbf..37ce2bf71 100644
--- a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/ModuleImpl.java
+++ b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/ModuleImpl.java
@@ -510,10 +510,6 @@ public class ModuleImpl implements Module
                 });
 
                 plasticClass.proxyInterface(serviceInterface, delegateMethod);
-//                for (Method m : serviceInterface.getMethods())
-//                {
-//                    plasticClass.introduceMethod(m).delegateTo(delegateMethod);
-//                }
 
                 plasticClass.introduceMethod(WRITE_REPLACE).changeImplementation(new InstructionBuilderCallback()
                 {
-- 
2.19.2

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tapestry.apache.org
For additional commands, e-mail: dev-h...@tapestry.apache.org

Reply via email to