Here is the change removing the java.util.Map

thanks for the feedback.


new-host-4:internal lanceandersen$ hg diff
diff -r b14e13237498 
src/share/classes/com/sun/rowset/internal/WebRowSetXmlWriter.java
--- a/src/share/classes/com/sun/rowset/internal/WebRowSetXmlWriter.java Wed Jan 
18 11:00:20 2012 -0800
+++ b/src/share/classes/com/sun/rowset/internal/WebRowSetXmlWriter.java Tue Jan 
24 14:01:20 2012 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,7 @@
      * for this field is set with the <code>java.io.Writer</code> object given
      * as the second argument to the <code>writeXML</code> method.
      */
-    private java.io.Writer writer;
+    private transient java.io.Writer writer;
 
     /**
      * The <code>java.util.Stack</code> object that this 
<code>WebRowSetXmlWriter</code>
@@ -205,17 +205,12 @@
 
             //Changed to beginSection and endSection for maps for proper 
indentation
             beginSection("map");
-            java.util.Map<?,?> typeMap = caller.getTypeMap();
-            if (typeMap != null) {
-                Iterator<?> i = typeMap.keySet().iterator();
-                Class<?> c;
-                String type;
-                while (i.hasNext()) {
-                    type = (String)i.next();
-                    c = (Class)typeMap.get(type);
-                    propString("type", type);
-                    propString("class", c.getName());
-                }
+            Map<String, Class<?>> typeMap = caller.getTypeMap();
+            if(typeMap != null) {
+                for(Map.Entry<String, Class<?>> mm : typeMap.entrySet()) {
+                    propString("type", mm.getKey());
+                    propString("class", mm.getValue().getName());
+                }   
             }
             endSection("map");

On Jan 24, 2012, at 1:58 PM, Rémi Forax wrote:

> On 01/24/2012 07:50 PM, Lance Andersen - Oracle wrote:
>> You are suggesting changing
>> 
>> java.util.Map<?,?> typeMap = caller.getTypeMap();
>> 
>> to
>> 
>> Map<?,?> typeMap = caller.getTypeMap();
>> 
>> 
>> Which I can do.  I probably did not think about it much as it was their 
>> previously but I agree that would be the way to go.
>> 
>> Please let me know if I am on point with your suggestion
> 
> Yes.
> 
> Map<String, Class<?>>  typeMap = ...
> 
> 
>> 
>> Best
>> Lance
> 
> rgds,
> Rémi
> 
>> On Jan 24, 2012, at 1:29 PM, Remi Forax wrote:
>> 
>>> Looks good.
>>> The only weird thing is the use of java.util.Map instead of Map. Because 
>>> Map is used in when referencing Map.Entry just after.
>>> 
>>> Rémi
>>> 
>>> 
>>> ----- Reply message -----
>>> From: "Lance Andersen - Oracle" <[email protected] 
>>> <mailto:[email protected]>>
>>> To: "core-libs-dev Libs" <[email protected] 
>>> <mailto:[email protected]>>
>>> Subject: Review needed for 7132879 to address the findbug errors in 
>>> WebRowSetXmlWriter
>>> Date: Tue, Jan 24, 2012 19:18
>>> 
>>> 
>>> Hi,
>>> 
>>> Looking for a reviewer for 
>>> http://cr.openjdk.java.net/~lancea/7132879/webrev.00/ 
>>> <http://cr.openjdk.java.net/%7Elancea/7132879/webrev.00/>
>>> 
>>> this is a small change to address 2 findbug errors for this class.  The 
>>> findbug issues being addressed:
>>> 
>>> Inefficient use of keySet iterator instead of entrySet iterator
>>> 
>>> and
>>> 
>>> non-serializable instance field in serializable class
>>> 
>>> 
>>> Best,
>>> Lance
>>> 
>>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
>>> Oracle Java Engineering
>>> 1 Network Drive
>>> Burlington, MA 01803
>>> [email protected] <mailto:[email protected]>
>>> 
>> 
>> <http://oracle.com/us/design/oracle-email-sig-198324.gif>
>> <http://oracle.com/us/design/oracle-email-sig-198324.gif>Lance Andersen| 
>> Principal Member of Technical Staff | +1.781.442.2037
>> Oracle Java Engineering
>> 1 Network Drive
>> Burlington, MA 01803
>> [email protected] <mailto:[email protected]>
>> 
> 


Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive 
Burlington, MA 01803
[email protected]

Reply via email to