From 4a1a4700c343b6e1eeed659ff56f867794c765e1 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Fri, 25 Jan 2013 12:28:54 +1100 Subject: [PATCH 1/2] 382237 support non java JSON classes --- .../org/eclipse/jetty/util/ajax/JSON.java | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSON.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSON.java index 2f14f0ce22d..d40567752eb 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSON.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSON.java @@ -86,8 +86,12 @@ import org.eclipse.jetty.util.log.Logger; * . These convertors are looked up by class, interface and super class by * {@link #getConvertor(Class)}. *

- * - * + *

If a JSON object has a "class" field, then a java class for that name is + * looked up and the method {@link convertTo(Class,Map)} is used to find a + * Convertor for that class. If a JSON object has a "x-class" field then a + * direct lookup for a Convertor for that named x-class is done, so that none + * java classes may be converted. + *

*/ public class JSON { @@ -945,6 +949,15 @@ public class JSON next = seekTo("\"}",source); } + String xclassname = (String)map.get("x-class"); + if (xclassname != null) + { + Convertor c = getConvertorFor(xclassname); + if (c != null) + return c.fromJSON(map); + LOG.warn("no Convertor for xclassname '%s'", xclassname); + } + String classname = (String)map.get("class"); if (classname != null) { @@ -955,9 +968,10 @@ public class JSON } catch (ClassNotFoundException e) { - LOG.warn(e); + LOG.warn("no Class for classname '%s'", classname); } } + return map; } From c00e8d02830c50464818746e76584913223b087b Mon Sep 17 00:00:00 2001 From: Jesse McConnell Date: Fri, 25 Jan 2013 11:26:25 -0600 Subject: [PATCH 2/2] Add analystics to aggregate javadoc profile (so it only targeted on actual release deployment.) --- pom.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pom.xml b/pom.xml index a9df1ef1234..6c9680195da 100644 --- a/pom.xml +++ b/pom.xml @@ -757,6 +757,20 @@ +
+ + var _gaq = _gaq || []; + _gaq.push(['_setAccount', 'UA-1149868-7']); + _gaq.push(['_trackPageview']); + (function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); + })(); + + ]]> +