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

Refactoring raised an exception trying to move a class from one package of a project to another package in the project. #6774

Closed
dreappdev opened this issue Dec 1, 2023 · 1 comment
Labels
duplicate kind:bug Bug report or fix nb-javac Run nb-javac integration tests

Comments

@dreappdev
Copy link

Apache NetBeans version

Apache NetBeans 19

What happened

Attempted to move (refactor) a class from a package (call it Apkj) in a project to another existing package (call it Bpkj) in the same project. The class had been moved already from Bpkj to Apkj, and I was trying to put it back into Bpkj (yeah, I messed up and was just trying to fix it). Another class had also been successfully removed from Bpkj to Apkj before this. Error message said exception java.lang.IllegalStateException.

How to reproduce

Just pick a class and try to move it (CMD-M on a Mac). Follow the prompts on the dialog that pops up and select an appropriate package to move it to.

Did this work correctly in an earlier version?

No / Don't know

Operating System

macOS Ventrua Version 13.5.1

JDK

Java: 17.0.2; Java HotSpot(TM) 64-Bit Server VM 17.0.2+8-LTS-86

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

The full error message: Module Java Refactoring threw java.lang.IllegalStateException: java.lang.NullPointerException: Cannot read field "kind" because "tree.sym" is null. Please report a bug against Java Refactoring module and attach your var/log/messages.log.
Where exactly is this log file? On a Mac, it appears to hidden somewhere. I can't find it using a terminal (not in /var/log).

Are you willing to submit a pull request?

No

@dreappdev dreappdev added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Dec 1, 2023
@mbien mbien added nb-javac Run nb-javac integration tests duplicate and removed needs:triage Requires attention from one of the committers labels Dec 2, 2023
@mbien
Copy link
Member

mbien commented Dec 2, 2023

Where exactly is this log file?

you can see the log by opening View -> IDE log, on top of that log file you also see the value for User Directory, thats where the log files are.

Regarding exceptions in javac, we would need minimal reproducers for that. We have to figure out what is causing it and then likely report or fix it upstream in OpenJDK.

closing this issue since we track duplicates already: #5508 or #3725

@mbien mbien closed this as completed Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate kind:bug Bug report or fix nb-javac Run nb-javac integration tests
Projects
None yet
Development

No branches or pull requests

2 participants