tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anat...@apache.org
Subject [01/10] incubator-tamaya git commit: Fixed key evaluation.
Date Sun, 30 Oct 2016 17:22:10 GMT
Repository: incubator-tamaya
Updated Branches:
  refs/heads/master aac361a30 -> eafcadea6


Fixed key evaluation.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/8a8a5352
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/8a8a5352
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/8a8a5352

Branch: refs/heads/master
Commit: 8a8a5352253f5ba81abad3f2298bfda612717d8b
Parents: a41d143
Author: anatole <anatole@apache.org>
Authored: Fri Sep 23 08:13:14 2016 +0200
Committer: anatole <anatole@apache.org>
Committed: Fri Sep 23 08:13:14 2016 +0200

----------------------------------------------------------------------
 .../apache/tamaya/inject/api/InjectionUtils.java | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/8a8a5352/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/InjectionUtils.java
----------------------------------------------------------------------
diff --git a/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/InjectionUtils.java
b/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/InjectionUtils.java
index a010e96..7920f89 100644
--- a/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/InjectionUtils.java
+++ b/modules/injection-api/src/main/java/org/apache/tamaya/inject/api/InjectionUtils.java
@@ -104,14 +104,17 @@ public final class InjectionUtils {
         if (keys.isEmpty()) {
             keys.add(member.getName());
         }
-        ListIterator<String> iterator = keys.listIterator();
-        while (iterator.hasNext()) {
-            String next = iterator.next();
-            if (next.startsWith("[") && next.endsWith("]")) {
-                // absolute key, strip away brackets, take key as is
-                iterator.set(next.substring(1, next.length() - 1));
-            } else {
-                if (areasAnnot != null && areasAnnot.value().length>0) {
+        if (areasAnnot == null || areasAnnot.value().length==0) {
+            keys.add(member.getDeclaringClass().getName() + '.' + member.getName());
+            keys.add(member.getDeclaringClass().getSimpleName() + '.' + member.getName());
+        }else{
+            ListIterator<String> iterator = keys.listIterator();
+            while (iterator.hasNext()) {
+                String next = iterator.next();
+                if (next.startsWith("[") && next.endsWith("]")) {
+                    // absolute key, strip away brackets, take key as is
+                    iterator.set(next.substring(1, next.length() - 1));
+                } else {
                     // Remove original entry, since it will be replaced with prefixed entries
                     iterator.remove();
                     // Add prefixed entries, including absolute (root) entry for "" area
keys.


Mime
View raw message