Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
strazzere committed Jan 13, 2015
1 parent 8cff9ba commit be10021
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/main/java/org/xmlpull/v1/XmlPullParserFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<? extends XmlPullParserFactory> referenceContextClass;

static {
XmlPullParserFactory f = new XmlPullParserFactory();
Expand All @@ -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<Class> parserClasses;
protected String classNamesLocation;

protected Vector serializerClasses;
protected Vector<Class> serializerClasses;

// features are kept there
protected Hashtable features = new Hashtable();
protected Hashtable<String, Boolean> features = new Hashtable<String, Boolean>();

/**
* Protected constructor to be called by factory implementations.
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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<String> 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);
}
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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<? extends XmlPullParserFactory> context)
throws XmlPullParserException {

if (context == null) {
Expand Down Expand Up @@ -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<Class> parserClasses = new Vector<Class>();
final Vector<Class> serializerClasses = new Vector<Class>();
int pos = 0;

while (pos < classNames.length()) {
Expand All @@ -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) {
Expand Down

0 comments on commit be10021

Please sign in to comment.