netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Fix import imports class from same package

Open wolfgangreder opened this issue 2 years ago • 2 comments

Apache NetBeans version

Apache NetBeans 20

What happened

When i create a class with static factory methods. Auto fix imports create a import for this class. See https://github.com/wolfgangreder/UART2EMB/blob/bd41ce492df4ed8407c9ceab251c03645b5b237c/bootloader-java/libJBoot/src/main/java/at/or/reder/jboot/impl/jboot/Record.java as as example.

Language / Project Type / NetBeans Component

Java Gradle Project

How to reproduce

Import project https://github.com/wolfgangreder/UART2EMB.git and open bootloader-java

Did this work correctly in an earlier version?

No / Don't know

Operating System

Linux

JDK

JDK 21

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

No response

Are you willing to submit a pull request?

No

wolfgangreder avatar Jan 02 '24 09:01 wolfgangreder

If i rename the class from Record to e.g. CommandRecord the problem does not occur! Maybe the problem is related to the java keyword record.

wolfgangreder avatar Feb 25 '24 16:02 wolfgangreder

potential fix would be here https://github.com/apache/netbeans/pull/7363

@wolfgangreder could you check if this is fixing it? dev-build zip: https://github.com/apache/netbeans/actions/runs/8979314348/artifacts/1478735216

mbien avatar May 08 '24 19:05 mbien