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 262675

Summary: Order Members should treat static and non-static interfaces the same
Product: editor Reporter: _ gtzabari <gtzabari>
Component: Formatting & IndentationAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Windows 10 x64   
Issue Type: DEFECT Exception Reporter:

Description _ gtzabari 2016-07-05 03:32:10 UTC
Product Version: NetBeans IDE Dev (Build 201606200002)
Java: 1.8.0_92; Java HotSpot(TM) 64-Bit Server VM 25.92-b14
Runtime: Java(TM) SE Runtime Environment 1.8.0_92-b14
System: Windows 10 version 10.0 running on amd64; Cp1252; en_CA (nb)
User directory: C:\Users\Gili\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\dev

Repro steps:

1. Assuming that "static classes" are ordered before "classes" in Project -> properties -> formatting -> Java -> ordering -> Member sort order
2. Create the following Java file:

public class Outer
{
  public static interface First
  {}

  public void someMethod()
  {}

  public interface Second
  {}
}

3. Notice that Netbeans is happy with the member ordering found above.
4. Now, add the "static" modified to "Second"
5. Notice that Netbeans prompts you to "Order Members"

Expected behavior: interfaces, whether they contain the "static" modifier or not, should be treated consistently (be it non-static or static). Technically speaking, I believe that they should be treated as static as they do not (nor can they) reference the outer class.