changeset 4971:303b67074666

7132879: address Findbugs issue in WebRowSetXmlWriter Reviewed-by: forax
author lancea
date Tue, 24 Jan 2012 15:13:27 -0500
parents f64ea40293db
children ceab7e149581
files src/share/classes/com/sun/rowset/internal/WebRowSetXmlWriter.java
diffstat 1 files changed, 7 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/rowset/internal/WebRowSetXmlWriter.java	Tue Jan 24 09:58:44 2012 -0800
+++ b/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");