You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by pl...@apache.org on 2016/09/16 22:03:33 UTC

[23/50] [abbrv] incubator-tamaya-extensions git commit: TAMAYA-160: Fixed bug setting fields to null, if no config is present.

TAMAYA-160: Fixed bug setting fields to null, if no config is present.


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

Branch: refs/heads/master
Commit: 96811d76ff9313d70193c2860ed63ef345eb2c28
Parents: 2d51d67
Author: anatole <an...@apache.org>
Authored: Wed May 11 04:19:28 2016 +0200
Committer: anatole <an...@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-extensions/blob/96811d76/injection-api/src/main/java/org/apache/tamaya/inject/api/InjectionUtils.java
----------------------------------------------------------------------
diff --git a/injection-api/src/main/java/org/apache/tamaya/inject/api/InjectionUtils.java b/injection-api/src/main/java/org/apache/tamaya/inject/api/InjectionUtils.java
index 1e2cd6e..a010e96 100644
--- a/injection-api/src/main/java/org/apache/tamaya/inject/api/InjectionUtils.java
+++ b/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-extensions/blob/96811d76/injection/src/test/java/annottext/NonAnnotatedConfigBean.java
----------------------------------------------------------------------
diff --git a/injection/src/test/java/annottext/NonAnnotatedConfigBean.java b/injection/src/test/java/annottext/NonAnnotatedConfigBean.java
new file mode 100644
index 0000000..87f8be7
--- /dev/null
+++ b/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.";
+
+}