You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "PavelTurk (via GitHub)" <gi...@apache.org> on 2024/05/04 10:32:46 UTC
[I] NetNeans renames classes only in declaring files, but not in client files [netbeans]
PavelTurk opened a new issue, #7358:
URL: https://github.com/apache/netbeans/issues/7358
### Apache NetBeans version
Apache NetBeans 22 release candidate
### What happened
NetBeans sometimes renames classes/enum/iterfaces etc only in files, that declares 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 https://github.com/apache/netbeans/issues/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 https://github.com/apache/netbeans/issues/3725#issuecomment-1997195547 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] NetBeans renames classes only in declaring files, but not in client files [netbeans]
Posted by "PavelTurk (via GitHub)" <gi...@apache.org>.
PavelTurk commented on issue #7358:
URL: https://github.com/apache/netbeans/issues/7358#issuecomment-2256151367
Besides when I rename I get this exception:
```
Caused: com.sun.tools.javac.code.Symbol$CompletionFailure: class file for kotlin.Pair not found
Caused: java.io.IOException
at org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:458)
at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:425)
at org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:680)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:323)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:264)
at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.processFiles(JavaRefactoringPlugin.java:246)
[catch] at org.netbeans.modules.refactoring.java.spi.JavaRefactoringPlugin.createAndAddElements(JavaRefactoringPlugin.java:338)
at org.netbeans.modules.refactoring.java.plugins.RenameRefactoringPlugin.prepare(RenameRefactoringPlugin.java:627)
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)
```
I just wonder, nobody has problems with renaming in JPMS projects? I have about 25% of tasks related to renaming failing during refactoring, even with not very serious changes. As a result, I have to change everything manually.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] NetNeans renames classes only in declaring files, but not in client files [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on issue #7358:
URL: https://github.com/apache/netbeans/issues/7358#issuecomment-2096677328
> Sometimes I get this message while renaming:
this got fixed and should be in NB 22 rc3 https://github.com/apache/netbeans/pull/7361
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] NetBeans renames classes only in declaring files, but not in client files [netbeans]
Posted by "PavelTurk (via GitHub)" <gi...@apache.org>.
PavelTurk commented on issue #7358:
URL: https://github.com/apache/netbeans/issues/7358#issuecomment-2236377336
I had something like this:
```
public interface DialogManager { ... }
public abstract class AbstractService<T extends Bar<?> & DialogManager> {
private final T owner;
...
protected T getOwner() {..}
...
}
```
After that I renamed `DialogManager` interface. Interface was renamed, but not everywhere. For example, it wasn't renamed in `AbstractService` class. In IDE log I got:
```
SEVERE [global]: IsOverriddenAnnotationHandler: originalMethod == null!
INFO [org.netbeans.api.java.source.ElementHandle]: Cannot resolve: ElementHandle[kind=METHOD; sigs=foo.AbstractService getOwner ()LDialogManager; ]
INFO [org.netbeans.api.java.source.ElementHandle]: Cannot resolve: ElementHandle[kind=METHOD; sigs=foo.AbstractService getOwner ()LDialogManager; ]
SEVERE [global]: IsOverriddenAnnotationHandler: originalMethod == null!
INFO [org.netbeans.api.java.source.ElementHandle]: Cannot resolve: ElementHandle[kind=METHOD; sigs=foo.AbstractService getOwner ()LDialogManager; ]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] NetNeans renames classes only in declaring files, but not in client files [netbeans]
Posted by "PavelTurk (via GitHub)" <gi...@apache.org>.
PavelTurk commented on issue #7358:
URL: https://github.com/apache/netbeans/issues/7358#issuecomment-2094700106
Sometimes I get this message while renaming:

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)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists