Hi,
with the 2.0 release approaching, I'm looking at some little things for it:
- build dependencies for Pivot 2.0 :
as reported in our BUILD file, be ask for JUnit 4.3 or higher, and
optional Maven Ant Tasks 2.0.10 or greater , and this is good for
both.
But latest (stable) releases for both are junit-4.8.2 and
maven-ant-tasks-2.1.1 , I used both in my environments and works good,
so what do you think to update these requirements ? For example junit
in the 4.5 has changed some things, and as a general rule I don't like
to depend on too old releases ... what do you think ?
- findbugs analysis, only some small things:
CharSequenceCharacterIterator.java:127
org.apache.pivot.text.CharSequenceCharacterIterator.clone() does not
call super.clone()
Explain (from FindBugs):
This non-final class defines a clone() method that does not call
super.clone(). If this class ("A") is extended by a subclass ("B"),
and the subclass B calls super.clone(), then it is likely that B's
clone() method will return an object of type A, which violates the
standard contract for clone().
If all clone() methods call super.clone(), then they are guaranteed to
use Object.clone(), which always returns an object of the correct
type.
BXMLSerializer.java:1003 Load of known null value
-- but this probably is good (or I could pass null instead of the
variable with known null value, propertyClass) ...
BXMLSerializer.java:319 Method
org.apache.pivot.beans.BXMLSerializer$1.putAll(Map) makes inefficient
use of keySet iterator instead of entrySet iterator
-- a little thing, but less CPU used is always good :-)
ListViewColorItemRenderer.java:83 Redundant nullcheck of item, which
is known to be non-null
TreeView.java:395 org.apache.pivot.wtk.TreeView$PathComparator
implements Comparator but not Serializable
Tell me what to do, or if you want to fix them instead of me (you know
that I have slow timings).
- substrings without check before (detail follows):
in some classes I've found some calls to substring(1) because for
example it's implicit that the input string has to start with a slash
or other "control" char, but in many cases the existence of that char
is not tested before the substring ... so, to avoid little "strange
and confusing" small behaviors, what do you think if I'd fix them ?
For example, a good behavior is in TerraTheme, while a "not-so-good"
sample is in ScriptApplication. This is a sample line:
if (location.startsWith("/")) {
locationURL = classLoader.getResource(location.substring(1));
...
Note: I'm not saying that all substring(1) here are not-so-good, some
of them are good the same, like all occurrences inside BXMLSerializer
:-)
Bye,
Sandro