Java News from Thursday, June 16, 2005

jutils.com has released lint4j 0.8.2, a free-beer "static Java source code analyzer that detects locking and threading issues, performance and scalability problems, and checks complex contracts such as Java serialization by performing type, data flow, and lock graph analysis." Version 0.8.2 fixes bugs and detects unnecessary declarations of interfaces and methods already implemented by superclasses/interfaces.

I tested lint4j on the XOM code base, but it didn't find anything new. At this point, that's down to the same batch of false positives I get every time I run this. I then ran it on Jaxen. These results were a little more interesting, including some isseus found by the new detectors such as "The method getText [in the LocationPath class] is already required by the extended interface Expr and can be removed." It also reported a lot of places where "This switch statement should be refactored to an if statement or inlined." For instance it flagged this method:

    public BinaryExpr createAdditiveExpr( Expr lhs,
                                          Expr rhs,
                                          int additiveOperator ) throws JaxenException
    {
        switch( additiveOperator )
        {
            case Operator.ADD:
                {
                    return new DefaultPlusExpr( lhs,
                                                rhs );
                }
            case Operator.SUBTRACT:
                {
                    return new DefaultMinusExpr( lhs,
                                                 rhs );
                }
        }
        throw new JaxenException( "Unhandled operator in createAdditiveExpr(): " + additiveOperator );
    }

lint4j classifies this as a pathological switch statement. According to the documentation, "A switch statement with less than three branches is better expressed as an if statement, and may be a result of incomplete coding, or a branch that has been commented out." I'm not sure I believe that. Is there any strong reason to prefer an if statement in methods like this? And what does it mean to inline a switch statement anyway?


David Hovemeyer and Bill Pugh have posted FindBugs 0.9.1, an automated open source tool for finding potential bugs in Java code. This release cures an accidental dependence on Java 1.5 in 0.9.0.


The Blackdown Project has released their version of the Java 2 Standard Edition for Linux 1.4.2-02. This includes a software devlopment kit, runtime environment, and Java plug-in for Linux on x86 and Sparc. It's based on Sun's source code for JDK 1.4.2_08. It is not open source. This release plugs a major security hole. All users should upgrade.


Andrei Kouznetsov has released Unified I/O 2.4, an open source (BSD license) class library that "allows random access to any data or stream (even over HTTP), and gives a clear difference between read only and read/write access." This release adds support for memory management.


Websina has released BugZero 4.1.1, a $1299 payware (+$300 for maintenance) Web-based bug tracking system that supports multiple projects, group-based access, automatic bug assignment, file attachment, email notification, and metric reports. Bug Zero is written in Java and can run on top of various backend databases including MySQL. 4.1.1 is a bug fix release.