This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 245742 - Erroneous hint "Make initializer static" on anonymous class
Summary: Erroneous hint "Make initializer static" on anonymous class
Status: RESOLVED DUPLICATE of bug 241344
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-16 19:14 UTC by matthies
Modified: 2014-07-18 11:02 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description matthies 2014-07-16 19:14:56 UTC
Example 1:

        new HashSet<String>()
        {{
            if (foo) add("foo");
            if (bar) add("bar");
        }};

Example 2"

    {
        class Inner
        {
            {
                System.out.println("Initializing!");
            }
        };
    }

These show the hint "Make initializer static", although static initializers are not allowed inside inner classes.
Comment 1 Svata Dedic 2014-07-18 11:02:17 UTC
Cannot reproduce in current dev build, possibly fixed along with issue #241344. Please check in the dev version and reopen, if the defect is still visible; thanks.

*** This bug has been marked as a duplicate of bug 241344 ***