Author: j16sdiz
Date: 2009-04-06 05:49:34 +0000 (Mon, 06 Apr 2009)
New Revision: 26549
Modified:
trunk/freenet/src/freenet/clients/http/PageMaker.java
Log:
Check for null early - getInfobox(String,HTMLNode) would throw NPE anyway
Modified: trunk/freenet/src/freenet/clients/http/PageMaker.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/PageMaker.java 2009-04-06
05:49:11 UTC (rev 26548)
+++ trunk/freenet/src/freenet/clients/http/PageMaker.java 2009-04-06
05:49:34 UTC (rev 26549)
@@ -213,15 +213,18 @@
}
public HTMLNode getInfobox(String header) {
- return getInfobox((header != null) ? new HTMLNode("#", header)
: (HTMLNode) null);
+ if (header == null) throw new NullPointerException();
+ return getInfobox(new HTMLNode("#", header));
}
public HTMLNode getInfobox(HTMLNode header) {
+ if (header == null) throw new NullPointerException();
return getInfobox(null, header);
}
public HTMLNode getInfobox(String category, String header) {
- return getInfobox(category, (header != null) ? new
HTMLNode("#", header) : (HTMLNode) null);
+ if (header == null) throw new NullPointerException();
+ return getInfobox(category, new HTMLNode("#", header));
}
/**
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs