Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetBeans renames classes only in declaring files, but not in client files #7358

Open
PavelTurk opened this issue May 4, 2024 · 2 comments
Open
Labels
Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) kind:bug Bug report or fix needs:triage Requires attention from one of the committers

Comments

@PavelTurk
Copy link

PavelTurk commented May 4, 2024

Apache NetBeans version

Apache NetBeans 22 release candidate

What happened

NetBeans sometimes renames classes/enum/iterfaces etc only in files, that declare them, but not in files, that use them. I see this problem for projects that use JPMS (have explicit module-info). This bug is linked to #3725 and was previously describe there.

Product Version: Apache NetBeans IDE 22-rc1
Java: 21.0.2; OpenJDK 64-Bit Server VM 21.0.2+13-58
Runtime: OpenJDK Runtime Environment 21.0.2+13-58
System: Linux version 5.15.0-88-generic running on amd64; UTF-8; en_US (nb)

Language / Project Type / NetBeans Component

Java Maven Project using Java Modules (JPMS)

How to reproduce

I don't have a solution to reproduce this bug. Earlier I used the steps described in #3725 (comment) however they don't work any more.

Did this work correctly in an earlier version?

No / Don't know

Operating System

Ubuntu 20.04.3 LTS

JDK

Java: 21.0.2; OpenJDK 64-Bit Server VM 21.0.2+13-58

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

No response

Are you willing to submit a pull request?

No

@PavelTurk PavelTurk added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels May 4, 2024
@PavelTurk
Copy link
Author

PavelTurk commented May 5, 2024

Sometimes I get this message while renaming:

Screenshot from 2024-05-05 12-10-38

And this is IDE log:

SEVERE [org.openide.util.Exceptions]
java.lang.NullPointerException: Cannot invoke "org.netbeans.modules.maven.model.pom.Properties.getProperty(String)" because "pr" is null
	at org.netbeans.modules.maven.refactoring.MavenRefactoringPlugin.lambda$prepare$0(MavenRefactoringPlugin.java:105)
	at org.netbeans.modules.maven.model.Utilities.performPOMModelOperations(Utilities.java:326)
	at org.netbeans.modules.maven.model.Utilities.performPOMModelOperations(Utilities.java:277)
	at org.netbeans.modules.maven.refactoring.MavenRefactoringPlugin.lambda$prepare$1(MavenRefactoringPlugin.java:125)
	at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:102)
	at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:494)
	at org.netbeans.modules.maven.refactoring.MavenRefactoringPlugin.prepare(MavenRefactoringPlugin.java:124)
[catch] at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare2(AbstractRefactoring.java:417)
	at org.netbeans.modules.refactoring.api.AbstractRefactoring.pluginsPrepare(AbstractRefactoring.java:401)
	at org.netbeans.modules.refactoring.api.AbstractRefactoring.prepare(AbstractRefactoring.java:212)
	at org.netbeans.modules.refactoring.spi.impl.ParametersPanel$Prepare.run(ParametersPanel.java:1063)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1420)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2035)

At the same time I don't know if these problems are related or not.

@mbien
Copy link
Member

mbien commented May 6, 2024

Sometimes I get this message while renaming:

this got fixed and should be in NB 22 rc3 #7361

@mbien mbien added the Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) label May 6, 2024
@PavelTurk PavelTurk changed the title NetNeans renames classes only in declaring files, but not in client files NetBeans renames classes only in declaring files, but not in client files May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) kind:bug Bug report or fix needs:triage Requires attention from one of the committers
Projects
None yet
Development

No branches or pull requests

2 participants