7132879: address Findbugs issue in WebRowSetXmlWriter
authorlancea
Tue, 24 Jan 2012 15:13:27 -0500
changeset 11680 8be4a665d07e
parent 11679 84da476c4537
child 11681 9a1076231db7
7132879: address Findbugs issue in WebRowSetXmlWriter Reviewed-by: forax
jdk/src/share/classes/com/sun/rowset/internal/WebRowSetXmlWriter.java
--- a/jdk/src/share/classes/com/sun/rowset/internal/WebRowSetXmlWriter.java	Tue Jan 24 09:58:44 2012 -0800
+++ b/jdk/src/share/classes/com/sun/rowset/internal/WebRowSetXmlWriter.java	Tue Jan 24 15:13:27 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,16 +205,11 @@
 
             //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");