You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2019/10/10 04:08:01 UTC

[isis] branch v2 updated: ISIS-2158: fixes ServiceInjector not honoring @Primary

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

ahuber pushed a commit to branch v2
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/v2 by this push:
     new ac57daa  ISIS-2158: fixes ServiceInjector not honoring @Primary
ac57daa is described below

commit ac57daaa41f353cfd9cef737d071f72acb6a2c23
Author: Andi Huber <ah...@apache.org>
AuthorDate: Thu Oct 10 06:07:47 2019 +0200

    ISIS-2158: fixes ServiceInjector not honoring @Primary
    
    - instance equality checks seem to require the @Primary constant in
    _Constants to be picked up via reflection instead of providing a newed
    up one
---
 .../org/apache/isis/commons/internal/_Constants.java     | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/core/commons/src/main/java/org/apache/isis/commons/internal/_Constants.java b/core/commons/src/main/java/org/apache/isis/commons/internal/_Constants.java
index 8a88fca..5cb48ed 100644
--- a/core/commons/src/main/java/org/apache/isis/commons/internal/_Constants.java
+++ b/core/commons/src/main/java/org/apache/isis/commons/internal/_Constants.java
@@ -75,12 +75,16 @@ public final class _Constants {
         @Override public void close() throws IOException { }
     };
     
-    public static final Primary ANNOTATION_PRIMARY = new Primary() {
-        @Override
-        public Class<? extends Annotation> annotationType(){
-            return Primary.class;
-        }
-    };
+    @Primary private static final class PrimaryAnnotated {}
+    public static final Primary ANNOTATION_PRIMARY = PrimaryAnnotated.class.getAnnotation(Primary.class);
+    
+//    public static final Primary ANNOTATION_PRIMARY = new Primary() {
+//        @Override
+//        public Class<? extends Annotation> annotationType(){
+//            return Primary.class;
+//        }
+//    };
+    
     
 
 }