changeset 47359 | e1a6c0168741 |
parent 47216 | 71c04702a3d5 |
child 48409 | 5ab69533994b |
--- a/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java Tue Sep 05 13:40:14 2017 +0200 +++ b/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java Wed Oct 18 13:25:49 2017 -0700 @@ -1,5 +1,6 @@ /* * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. + * @LastModified: Oct 2017 */ /* * Licensed to the Apache Software Foundation (ASF) under one or more @@ -39,7 +40,6 @@ import com.sun.org.apache.xerces.internal.xs.PSVIProvider; import java.io.IOException; import java.util.HashMap; -import java.util.Iterator; import java.util.Locale; import java.util.Map; import javax.xml.XMLConstants; @@ -387,8 +387,8 @@ */ public static class JAXPSAXParser extends com.sun.org.apache.xerces.internal.parsers.SAXParser { - private final HashMap fInitFeatures = new HashMap(); - private final HashMap fInitProperties = new HashMap(); + private final Map<String, Boolean> fInitFeatures = new HashMap<>(); + private final Map<String, Object> fInitProperties = new HashMap<>(); private final SAXParserImpl fSAXParser; private XMLSecurityManager fSecurityManager; private XMLSecurityPropertyManager fSecurityPropertyMgr; @@ -605,22 +605,17 @@ synchronized void restoreInitState() throws SAXNotRecognizedException, SAXNotSupportedException { - Iterator iter; if (!fInitFeatures.isEmpty()) { - iter = fInitFeatures.entrySet().iterator(); - while (iter.hasNext()) { - Map.Entry entry = (Map.Entry) iter.next(); - String name = (String) entry.getKey(); - boolean value = ((Boolean) entry.getValue()).booleanValue(); + for (Map.Entry<String, Boolean> entry : fInitFeatures.entrySet()) { + String name = entry.getKey(); + boolean value = (entry.getValue()); super.setFeature(name, value); } fInitFeatures.clear(); } if (!fInitProperties.isEmpty()) { - iter = fInitProperties.entrySet().iterator(); - while (iter.hasNext()) { - Map.Entry entry = (Map.Entry) iter.next(); - String name = (String) entry.getKey(); + for (Map.Entry<String, Object> entry : fInitProperties.entrySet()) { + String name = entry.getKey(); Object value = entry.getValue(); super.setProperty(name, value); }