aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net/sourceforge/jnlp/Node.java
diff options
context:
space:
mode:
authorJiri Vanek <[email protected]>2013-12-13 10:47:07 +0100
committerJiri Vanek <[email protected]>2013-12-13 10:47:07 +0100
commit25f307d98cb0ba4698318c6a1a4e738ee81f6e55 (patch)
treee869f4d7ea537ba2d4508f71edbafdccecd0f375 /netx/net/sourceforge/jnlp/Node.java
parent6256aac59275df0edd0feb4950272aa33573be9f (diff)
itw itself warning cleanup: fixed rawtypes and unchecks, added braces and Override
After this clean up only "internal proprietary API and may be removed in a future release" warnings remain fro make check. Please keep itw in this way :) remaining issues: icedtea-web/netx/net/sourceforge/jnlp/cache/ResourceTracker.java:357: warning: [deprecation] toURL() in File has been deprecated icedtea-web/netx/net/sourceforge/jnlp/cache/CacheUtil.java:128: warning: [deprecation] toURL() in File has been deprecated icedtea-web/netx/net/sourceforge/jnlp/runtime/Boot.java:261: warning: [deprecation] toURL() in File has been deprecated There have been a lot of work around cach x file x url escaping, and as main difference between file.tourl and file.touri.tourl is escapin, I rather left it. icedtea-web/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java:804: warning: [deprecation] Ref in sun.misc has been deprecated icedtea-web/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java:121: warning: [deprecation] Ref in sun.misc has been deprecated What can be done? icedtea-web/netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java:205: warning: [fallthrough] possible fall-through into case icedtea-web/netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java:211: warning: [fallthrough] possible fall-through into case This have to be fixed
Diffstat (limited to 'netx/net/sourceforge/jnlp/Node.java')
-rw-r--r--netx/net/sourceforge/jnlp/Node.java29
1 files changed, 19 insertions, 10 deletions
diff --git a/netx/net/sourceforge/jnlp/Node.java b/netx/net/sourceforge/jnlp/Node.java
index f3c95bd..e208852 100644
--- a/netx/net/sourceforge/jnlp/Node.java
+++ b/netx/net/sourceforge/jnlp/Node.java
@@ -63,13 +63,16 @@ class Node {
}
Node getFirstChild() {
- if (children == null)
+ if (children == null) {
getChildNodes();
+ }
- if (children.length == 0)
+ if (children.length == 0) {
return null;
- else
+ }
+ else {
return children[0];
+ }
}
Node getNextSibling() {
@@ -87,13 +90,15 @@ class Node {
if (children == null) {
List<Node> list = new ArrayList<Node>();
- for (Enumeration e = xml.enumerateChildren(); e.hasMoreElements();)
- list.add(new Node((XMLElement) e.nextElement()));
+ for (Enumeration<XMLElement> e = xml.enumerateChildren(); e.hasMoreElements();) {
+ list.add(new Node(e.nextElement()));
+ }
children = list.toArray(new Node[list.size()]);
- for (int i = 0; i < children.length - 1; i++)
+ for (int i = 0; i < children.length - 1; i++) {
children[i].next = children[i + 1];
+ }
}
return children;
@@ -107,8 +112,9 @@ class Node {
if (attributeNames == null) {
attributeNames= new ArrayList<String>();
- for (Enumeration e = xml.enumerateAttributeNames(); e.hasMoreElements();)
- attributeNames.add(new String((String) e.nextElement()));
+ for (Enumeration<String> e = xml.enumerateAttributeNames(); e.hasMoreElements();) {
+ attributeNames.add(new String(e.nextElement()));
+ }
}
return attributeNames;
@@ -119,12 +125,15 @@ class Node {
}
String getNodeName() {
- if (xml.getName() == null)
+ if (xml.getName() == null) {
return "";
- else
+ }
+ else {
return xml.getName();
+ }
}
+ @Override
public String toString() {
return getNodeName();
}