From be100210eb6e53acfa01aafe05da2ae94f480415 Mon Sep 17 00:00:00 2001 From: Tim Strazzere Date: Tue, 13 Jan 2015 00:01:41 -0800 Subject: [PATCH] Fix lint issues --- .../org/xmlpull/v1/XmlPullParserFactory.java | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/main/java/org/xmlpull/v1/XmlPullParserFactory.java b/src/main/java/org/xmlpull/v1/XmlPullParserFactory.java index 6b12f3b..76234c7 100644 --- a/src/main/java/org/xmlpull/v1/XmlPullParserFactory.java +++ b/src/main/java/org/xmlpull/v1/XmlPullParserFactory.java @@ -33,7 +33,7 @@ public class XmlPullParserFactory { /** used as default class to server as context class in newInstance() */ - final static Class referenceContextClass; + final static Class referenceContextClass; static { XmlPullParserFactory f = new XmlPullParserFactory(); @@ -53,13 +53,13 @@ public class XmlPullParserFactory { // public static final String DEFAULT_PROPERTY = // "org.xmlpull.xpp3.XmlPullParser,org.kxml2.io.KXmlParser"; - protected Vector parserClasses; + protected Vector parserClasses; protected String classNamesLocation; - protected Vector serializerClasses; + protected Vector serializerClasses; // features are kept there - protected Hashtable features = new Hashtable(); + protected Hashtable features = new Hashtable(); /** * Protected constructor to be called by factory implementations. @@ -92,7 +92,7 @@ public void setFeature(String name, boolean state) throws XmlPullParserException */ public boolean getFeature(String name) { - Boolean value = (Boolean) features.get(name); + Boolean value = features.get(name); return value != null ? value.booleanValue() : false; } @@ -167,16 +167,16 @@ public XmlPullParser newPullParser() throws XmlPullParserException { final StringBuffer issues = new StringBuffer(); for (int i = 0; i < parserClasses.size(); i++) { - final Class ppClass = (Class) parserClasses.elementAt(i); + final Class ppClass = parserClasses.elementAt(i); try { final XmlPullParser pp = (XmlPullParser) ppClass.newInstance(); // if( ! features.isEmpty() ) { // Enumeration keys = features.keys(); // while(keys.hasMoreElements()) { - for (Enumeration e = features.keys(); e.hasMoreElements();) { - final String key = (String) e.nextElement(); - final Boolean value = (Boolean) features.get(key); + for (Enumeration e = features.keys(); e.hasMoreElements();) { + final String key = e.nextElement(); + final Boolean value = features.get(key); if ((value != null) && value.booleanValue()) { pp.setFeature(key, true); } @@ -215,7 +215,7 @@ public XmlSerializer newSerializer() throws XmlPullParserException { final StringBuffer issues = new StringBuffer(); for (int i = 0; i < serializerClasses.size(); i++) { - final Class ppClass = (Class) serializerClasses.elementAt(i); + final Class ppClass = serializerClasses.elementAt(i); try { final XmlSerializer ser = (XmlSerializer) ppClass.newInstance(); @@ -246,7 +246,7 @@ public static XmlPullParserFactory newInstance() throws XmlPullParserException { return newInstance(null, null); } - public static XmlPullParserFactory newInstance(String classNames, Class context) + public static XmlPullParserFactory newInstance(String classNames, Class context) throws XmlPullParserException { if (context == null) { @@ -289,8 +289,8 @@ public static XmlPullParserFactory newInstance(String classNames, Class context) } XmlPullParserFactory factory = null; - final Vector parserClasses = new Vector(); - final Vector serializerClasses = new Vector(); + final Vector parserClasses = new Vector(); + final Vector serializerClasses = new Vector(); int pos = 0; while (pos < classNames.length()) { @@ -309,6 +309,7 @@ public static XmlPullParserFactory newInstance(String classNames, Class context) // necessary because of J2ME .class issue instance = candidate.newInstance(); } catch (Exception e) { + e.printStackTrace(); } if (candidate != null) {