You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by th...@apache.org on 2021/02/11 22:51:32 UTC

[tapestry-5] branch 5.6.x updated (7edee29 -> 963ede8)

This is an automated email from the ASF dual-hosted git repository.

thiagohp pushed a change to branch 5.6.x
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git.


    from 7edee29  TAP5-2659: fixing bad merge again
     new 6dcc25e  TAP5-2651: TypeCoercer favoring exact match coercions
     new 963ede8  TAP5-2636: Tapestry-IoC shouldn't accept advisers with the same id

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../tapestry5/ioc/internal/services/TypeCoercerImpl.java      | 11 +++++++++++
 .../java/org/apache/tapestry5/jcache/module/JCacheModule.java |  2 ++
 .../java/org/apache/tapestry5/ioc/internal/RegistryImpl.java  |  2 +-
 3 files changed, 14 insertions(+), 1 deletion(-)


[tapestry-5] 01/02: TAP5-2651: TypeCoercer favoring exact match coercions

Posted by th...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

thiagohp pushed a commit to branch 5.6.x
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git

commit 6dcc25e533cd79b9d0bfc91b8002de488d6baf89
Author: Thiago H. de Paula Figueiredo <th...@arsmachina.com.br>
AuthorDate: Sun Dec 6 10:50:59 2020 -0300

    TAP5-2651: TypeCoercer favoring exact match coercions
    
    over indirect/intermediate ones
    # Conflicts:
    #	commons/src/main/java/org/apache/tapestry5/ioc/internal/services/TypeCoercerImpl.java
---
 .../tapestry5/ioc/internal/services/TypeCoercerImpl.java      | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/commons/src/main/java/org/apache/tapestry5/ioc/internal/services/TypeCoercerImpl.java b/commons/src/main/java/org/apache/tapestry5/ioc/internal/services/TypeCoercerImpl.java
index c93655d..68927c4 100644
--- a/commons/src/main/java/org/apache/tapestry5/ioc/internal/services/TypeCoercerImpl.java
+++ b/commons/src/main/java/org/apache/tapestry5/ioc/internal/services/TypeCoercerImpl.java
@@ -280,6 +280,17 @@ public class TypeCoercerImpl extends LockSupport implements TypeCoercer
         {
             return searchForNullCoercion(targetType);
         }
+        
+        // Trying to find exact match.
+        Optional<CoercionTuple> maybeTuple = 
+                getTuples(sourceType, targetType).stream()
+                    .filter((t) -> sourceType.equals(t.getSourceType()) && 
+                            targetType.equals(t.getTargetType())).findFirst();
+        
+        if (maybeTuple.isPresent())
+        {
+            return maybeTuple.get().getCoercion();
+        }
 
         // These are instance variables because this method may be called concurrently.
         // On a true race, we may go to the work of seeking out and/or fabricating


[tapestry-5] 02/02: TAP5-2636: Tapestry-IoC shouldn't accept advisers with the same id

Posted by th...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

thiagohp pushed a commit to branch 5.6.x
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git

commit 963ede88c15c19af2b3221aad8653b1e64889faf
Author: Thiago H. de Paula Figueiredo <th...@arsmachina.com.br>
AuthorDate: Tue Dec 1 23:45:47 2020 -0300

    TAP5-2636: Tapestry-IoC shouldn't accept advisers with the same id
---
 .../src/main/java/org/apache/tapestry5/jcache/module/JCacheModule.java  | 2 ++
 .../src/main/java/org/apache/tapestry5/ioc/internal/RegistryImpl.java   | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/tapestry-ioc-jcache/src/main/java/org/apache/tapestry5/jcache/module/JCacheModule.java b/tapestry-ioc-jcache/src/main/java/org/apache/tapestry5/jcache/module/JCacheModule.java
index 00fa94b..66705b2 100644
--- a/tapestry-ioc-jcache/src/main/java/org/apache/tapestry5/jcache/module/JCacheModule.java
+++ b/tapestry-ioc-jcache/src/main/java/org/apache/tapestry5/jcache/module/JCacheModule.java
@@ -26,6 +26,7 @@ import javax.cache.annotation.CacheResult;
 import org.apache.tapestry5.ioc.MethodAdviceReceiver;
 import org.apache.tapestry5.ioc.ObjectLocator;
 import org.apache.tapestry5.ioc.ServiceBinder;
+import org.apache.tapestry5.ioc.annotations.Advise;
 import org.apache.tapestry5.ioc.annotations.Match;
 import org.apache.tapestry5.jcache.internal.CacheLookupUtil;
 import org.apache.tapestry5.jcache.internal.CacheMethodAdvice;
@@ -70,6 +71,7 @@ public final class JCacheModule
      *            an {@link ObjectLocator}.
      */
     @Match("*")
+    @Advise(id = "JCache")
     public static void adviseCache(MethodAdviceReceiver receiver, ObjectLocator objectLocator)
     {
         advise(CachePut.class, objectLocator, CachePutMethodAdvice.class, receiver);
diff --git a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/RegistryImpl.java b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/RegistryImpl.java
index 2ebf962..ff270bd 100644
--- a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/RegistryImpl.java
+++ b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/RegistryImpl.java
@@ -949,7 +949,7 @@ public class RegistryImpl implements Registry, InternalRegistry, ServiceProxyPro
 
         Logger logger = getServiceLogger(serviceDef.getServiceId());
 
-        Orderer<ServiceAdvisor> orderer = new Orderer<ServiceAdvisor>(logger);
+        Orderer<ServiceAdvisor> orderer = new Orderer<ServiceAdvisor>(logger, true);
 
         for (Module module : moduleToServiceDefs.keySet())
         {