tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anat...@apache.org
Subject [5/6] incubator-tamaya git commit: TAMAYA-160: Fixed bug setting fields to null, if no config is present.
Date Wed, 11 May 2016 02:41:43 GMT
TAMAYA-160: Fixed bug setting fields to null, if no config is present.


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

Branch: refs/heads/master
Commit: 0429bb7cc816d93ddad73b9229496eb739a1f242
Parents: e7779d0
Author: anatole <anatole@apache.org>
Authored: Wed May 11 04:19:28 2016 +0200
Committer: anatole <anatole@apache.org>
Committed: Wed May 11 04:19:28 2016 +0200

----------------------------------------------------------------------
 .../tamaya/inject/api/InjectionUtils.java       |  1 +
 .../java/annottext/NonAnnotatedConfigBean.java  | 45 ++++++++++++++++++++
 2 files changed, 46 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0429bb7c/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 1e2cd6e..a010e96 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
@@ -82,6 +82,7 @@ public final class InjectionUtils {
             }
         } else { // add package name
             keys.add(member.getDeclaringClass().getName() + '.' + mainKey);
+            keys.add(member.getDeclaringClass().getSimpleName() + '.' + mainKey);
         }
         return keys;
     }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/0429bb7c/modules/injection/src/test/java/annottext/NonAnnotatedConfigBean.java
----------------------------------------------------------------------
diff --git a/modules/injection/src/test/java/annottext/NonAnnotatedConfigBean.java b/modules/injection/src/test/java/annottext/NonAnnotatedConfigBean.java
new file mode 100644
index 0000000..87f8be7
--- /dev/null
+++ b/modules/injection/src/test/java/annottext/NonAnnotatedConfigBean.java
@@ -0,0 +1,45 @@
+/*
+ * 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 annottext;
+
+import org.apache.tamaya.inject.api.Config;
+import org.apache.tamaya.inject.api.DynamicValue;
+import org.apache.tamaya.inject.api.NoConfig;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * An example showing some basic annotations, using an interface to be proxied by the
+ * configuration system, nevertheless extending the overall Configuration interface.
+ * Created by Anatole on 15.02.14.
+ */
+public class NonAnnotatedConfigBean {
+
+    public String simple_value = "Should be overridden!";
+
+    public String fieldKey;
+
+    public String classFieldKey = "Foo";
+
+    public String fullKey;
+
+    public String test2 = "This is not set.";
+
+}


Mime
View raw message