Watch, Follow, &
Connect with Us
Public Report
Report From: JBuilder/Editor    [ Add a report in this area ]  
Report #:  27178   Status: Open
Code Audits do not properly handle static inner classes
Project:  JBuilder Build #:  12.0.203.0
Version:    12 Submitted By:   Gillmer Derge
Report Type:  Basic functionality failure Date Reported:  4/10/2006 9:56:53 AM
Severity:    Commonly encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   239714
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
A static inner class frequently has incorrect Code Audit warnings about name conflicts that do not really exist.  Some examples are shown in the sample classes in the Steps.
Steps to Reproduce:
1. Create the class shown below.

package junk;

public class Foo1 {

    private static final long serialVersionUID = 0L;

    public static class Bar {

        // Warning: Field 'serialVersionUID' shadows field in containing class 'Foo' at line 10 (10:9)
        private static final long serialVersionUID = 0L;

        // Warning: Multiple visible declarations with the same name at line 13 (13:9)
        public boolean equals(Object object) {
            return true;
        }

        // Warning: Multiple visible declarations with the same name at line 18 (18:9)
        public int hashCode() {
            return 0;
        }
    }

    public boolean equals(Object object) {
        return true;
    }

    public int hashCode() {
        return 0;
    }
}

2. Create the sample class shown below.

package junk;

public class Foo2 {

    // Warning: Incorrect order of member declarations at line 6 (6:5)
    public static class Bar {
    }

    public boolean foo() {
        return true;
    }
}

3. Create the sample class shown below.

package junk;

public class Foo3 {

    public boolean foo() {
        return true;
    }

    // Warning: Incorrect order of member declarations at line 10 (10:5)
    public static class Bar {
    }
}

// exp: at least one of Foo2 or Foo3 should work
// act: both have warnings.  There is no other way to order the declarations
Workarounds
None
Attachment
None
Comments

None

Server Response from: ETNACODE01