Repository: incubator-juneau
Updated Branches:
  refs/heads/master e4b601d71 -> 25a3d3719


Move logic for handling _value parameters entirely into
UrlEncodingParser (since that's the only class that uses it).

Project: http://git-wip-us.apache.org/repos/asf/incubator-juneau/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-juneau/commit/25a3d371
Tree: http://git-wip-us.apache.org/repos/asf/incubator-juneau/tree/25a3d371
Diff: http://git-wip-us.apache.org/repos/asf/incubator-juneau/diff/25a3d371

Branch: refs/heads/master
Commit: 25a3d371952c5c92adc3437bf4d423c33f984a49
Parents: e4b601d
Author: jamesbognar <[email protected]>
Authored: Thu Sep 8 15:23:11 2016 -0400
Committer: jamesbognar <[email protected]>
Committed: Thu Sep 8 15:23:11 2016 -0400

----------------------------------------------------------------------
 juneau-core/src/main/java/org/apache/juneau/ObjectMap.java      | 2 --
 .../src/main/java/org/apache/juneau/parser/ParserSession.java   | 2 +-
 .../src/main/java/org/apache/juneau/urlencoding/UonParser.java  | 4 ++--
 .../java/org/apache/juneau/urlencoding/UrlEncodingParser.java   | 5 ++++-
 .../src/main/java/org/apache/juneau/xml/annotation/Xml.java     | 1 -
 5 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/25a3d371/juneau-core/src/main/java/org/apache/juneau/ObjectMap.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/ObjectMap.java 
b/juneau-core/src/main/java/org/apache/juneau/ObjectMap.java
index ce047c7..18b2609 100644
--- a/juneau-core/src/main/java/org/apache/juneau/ObjectMap.java
+++ b/juneau-core/src/main/java/org/apache/juneau/ObjectMap.java
@@ -1164,8 +1164,6 @@ public class ObjectMap extends 
LinkedHashMap<String,Object> {
        public Object cast(TypeDictionary typeDictionary) {
                String c = (String)get(beanContext.getTypePropertyName());
                if (c == null) {
-                       if (containsKey("_value"))
-                               return get("_value");
                        return this;
                }
                if (typeDictionary != null) {

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/25a3d371/juneau-core/src/main/java/org/apache/juneau/parser/ParserSession.java
----------------------------------------------------------------------
diff --git 
a/juneau-core/src/main/java/org/apache/juneau/parser/ParserSession.java 
b/juneau-core/src/main/java/org/apache/juneau/parser/ParserSession.java
index 0e44374..7f126eb 100644
--- a/juneau-core/src/main/java/org/apache/juneau/parser/ParserSession.java
+++ b/juneau-core/src/main/java/org/apache/juneau/parser/ParserSession.java
@@ -2,7 +2,7 @@
 // * 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                
                                              * 
+// * with the License.  You may obtain a copy of the License at                
                                              *
 // *                                                                           
                                              *
 // *  http://www.apache.org/licenses/LICENSE-2.0                               
                                              *
 // *                                                                           
                                              *

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/25a3d371/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonParser.java
----------------------------------------------------------------------
diff --git 
a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonParser.java 
b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonParser.java
index 4e85745..9552688 100644
--- a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonParser.java
+++ b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UonParser.java
@@ -146,7 +146,7 @@ public class UonParser extends ReaderParser {
                                ObjectMap m = new ObjectMap(bc);
                                parseIntoMap(session, r, m, string(), object());
                                // Handle case where it's a collection, but 
serialized as a map with a _type or _value key.
-                               if (m.containsKey(bc.getTypePropertyName()) || 
m.containsKey("_value"))
+                               if (m.containsKey(bc.getTypePropertyName()))
                                        o = m.cast();
                                // Handle case where it's a collection, but 
only a single value was specified.
                                else {
@@ -177,7 +177,7 @@ public class UonParser extends ReaderParser {
                                ObjectMap m = new ObjectMap(bc);
                                parseIntoMap(session, r, m, string(), object());
                                // Handle case where it's an array, but 
serialized as a map with a _type or _value key.
-                               if (m.containsKey(bc.getTypePropertyName()) || 
m.containsKey("_value"))
+                               if (m.containsKey(bc.getTypePropertyName()))
                                        o = m.cast();
                                // Handle case where it's an array, but only a 
single value was specified.
                                else {

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/25a3d371/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
----------------------------------------------------------------------
diff --git 
a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
 
b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
index c873567..dde9e5b 100644
--- 
a/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
+++ 
b/juneau-core/src/main/java/org/apache/juneau/urlencoding/UrlEncodingParser.java
@@ -86,7 +86,10 @@ public class UrlEncodingParser extends UonParser {
                if (sType.isObject()) {
                        ObjectMap m = new ObjectMap(bc);
                        parseIntoMap(session, r, m, bc.string(), bc.object());
-                       o = m.cast();
+                       if (m.containsKey("_value"))
+                               o = m.get("_value");
+                       else
+                               o = m.cast();
                } else if (sType.isMap()) {
                        Map m = (sType.canCreateNewInstance() ? 
(Map)sType.newInstance() : new ObjectMap(bc));
                        o = parseIntoMap(session, r, m, sType.getKeyType(), 
sType.getValueType());

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/25a3d371/juneau-core/src/main/java/org/apache/juneau/xml/annotation/Xml.java
----------------------------------------------------------------------
diff --git 
a/juneau-core/src/main/java/org/apache/juneau/xml/annotation/Xml.java 
b/juneau-core/src/main/java/org/apache/juneau/xml/annotation/Xml.java
index 1589758..a2e2008 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/annotation/Xml.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/annotation/Xml.java
@@ -26,7 +26,6 @@ import org.apache.juneau.xml.*;
  * <p>
  *     Can be used for the following:
  * <ul class='spaced-list'>
- *     <li>Override the element name on the XML representation of a bean or 
object.
  *     <li>Override the child element name on the XML representation of 
collection or array properties.
  *     <li>Specify the XML namespace on a package, class, or method.
  *     <li>Override the XML format on a POJO.

Reply via email to