Hi to all, some other small fixed today, grouped by type: Int division result cast to double or float Here there are 33 warnings, for example see these 2: TerraAccordionSkin.java:145 int division result cast to double or float TerraAccordionSkin.java:144 int division result cast to double or float
This code casts the result of an integer division operation to double or float. Doing division on integers truncates the result to the integer value closest to zero. The fact that the result was cast to double suggests that this precision should have been retained. What was probably meant was to cast one or both of the operands to double before performing the division. Here is an example: int x = 2; int y = 5; // Wrong: yields result 0.0 double value1 = x / y; // Right: yields result 0.4 double value2 = x / (double) y; Call to unsupported method Description: All targets of this method invocation throw an UnsupportedOperationException. Component.java:85 Call to unsupported method org.apache.pivot.beans.BeanDictionary.remove(String) Class doesn't override equals in the superclass ArrayList.java:365 org.apache.pivot.wtk.TreeView$BranchHandler doesn't override org.apache.pivot.collections.ArrayList.equals(Object) Comparator doesn't implement Serializable => sorry, maybe some of these have already be discussed, i don't remember well ... TreeNodeComparator.java:1 org.apache.pivot.tutorials.TreeNodeComparator implements Comparator but not Serializable TableView.java:484 org.apache.pivot.wtk.TableView$RowComparator implements Comparator but not Serializable TreeView.java:331 org.apache.pivot.wtk.TreeView$PathComparator implements Comparator but not Serializable Element.java:72 org.apache.pivot.wtk.text.Element$NodeOffsetComparator implements Comparator but not Serializable Method invokes inefficient Number constructor => 8 times ... ok, it's a test class, but i can patch ... ParentResourcesTest.java:66 Method org.apache.pivot.util.test.ParentResourcesTest.testInteger() invokes inefficient new Integer(int) constructor; use Integer.valueOf(int) instead Tell me something. Bye
