apache / apache/netbeans

'Organize Members' has random error result

Open
#7,773 0 comments 0 reactions 0 assignees View on GitHub
Java kind:bug needs:triage
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 22

### What happened

When sorting members using 'organize member' function, most of the time it OK, but someting give error results also fail to compile.

### Language / Project Type / NetBeans Component

_No response_

### How to reproduce

I made a minimum test case
```java
class A {

}
public class TestOrder1 {

public static long inst,
aaa,
zzz;

public final static A s = new A();

}
```
sorting this result in
```java
class A {

}
public class TestOrder1 {

public static long aaa,
inst,
zzz;

public final static A s = new A();
public static long inst,
aaa,
zzz;

}

```
which has duplicated items make compile fail

### Did this work correctly in an earlier version?

No / Don't know

### Operating System

Linux

### JDK

JDK21

### Apache NetBeans packaging

Apache NetBeans binary zip

### Anything else

_No response_

### Are you willing to submit a pull request?

No

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the minimal Java example in the report and the NetBeans “Organize Members” function. Trace that function's implementation and any related tests; done means organizing the members no longer duplicates declarations and the resulting source compiles.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.