You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by st...@apache.org on 2012/07/16 10:13:45 UTC

git commit: DELTASPIKE-115 producers are fine to return Null for non-primitives.

Updated Branches:
  refs/heads/master 5083e8e5b -> 855dcd423


DELTASPIKE-115 producers are fine to return Null for non-primitives.

That's what all the defaultValue is about.


Project: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/commit/855dcd42
Tree: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/tree/855dcd42
Diff: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/diff/855dcd42

Branch: refs/heads/master
Commit: 855dcd423dd05df2542d11ac62c0dea5d611bbd1
Parents: 5083e8e
Author: Mark Struberg <st...@apache.org>
Authored: Mon Jul 16 10:12:30 2012 +0200
Committer: Mark Struberg <st...@apache.org>
Committed: Mon Jul 16 10:12:30 2012 +0200

----------------------------------------------------------------------
 .../core/api/config/annotation/ConfigProperty.java |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/855dcd42/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/annotation/ConfigProperty.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/annotation/ConfigProperty.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/annotation/ConfigProperty.java
index 435b7cc..83b15f2 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/annotation/ConfigProperty.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/config/annotation/ConfigProperty.java
@@ -48,8 +48,8 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
  *   &#064;Target({ FIELD, METHOD })
  *   &#064;Retention(RUNTIME)
  *   &#064;ConfigProperty(name = "locationId")
- *   //alternative to null check in the producer:
- *   //&#064;ConfigProperty(name = "locationId", defaultValue = "LOCATION_X")
+ *   // alternative to null check in the producer:
+ *   // &#064;ConfigProperty(name = "locationId", defaultValue = "LOCATION_X")
  *   &#064;Qualifier
  *   public &#064;interface Location
  *   {
@@ -85,11 +85,9 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
  *     public String produceLocationId(InjectionPoint injectionPoint)
  *     {
  *       String configuredValue = getStringPropertyValue(injectionPoint);
- *
- *       //null check isn't needed, if {@link #defaultValue} is used
  *       if (configuredValue == null)
  *       {
- *         return "LOCATION_X";
+ *         return null;
  *       }
  *       return configuredValue;
  *     }
@@ -107,10 +105,9 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
  *     public LocationId produceLocationId(InjectionPoint injectionPoint)
  *     {
  *       String configuredValue = getStringPropertyValue(injectionPoint);
- *
  *       if (configuredValue == null)
  *       {
- *         return LocationId.LOCATION_X;
+ *         return null;
  *       }
  *       return LocationId.valueOf(configuredValue.trim().toUpperCase());
  *     }