Refactor variable name gives NullPointerException - Cannot invoke "javax.lang.model.element.VariableElement.getEnclosingElement()" because "var" is null #5008
Unanswered
JohnAtPheasantVille
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
on variable name 'extractPartOfSpeech' in line
Pattern extractPartOfSpeech = Pattern.compile("\[([\-a-zA-Z'\(\),; ]*?)\]$");
Refactor > Rename
amended name to 'extractFinalBracket'
produced NullException in dialog box (see screenshot)
Repeated activity and came up with the same exception. Tried a third time and appeared to work this time. Variable was local to the method.
Undid changes, saved files and restarted Netbeans and then Refactor worked ok (hence a discussion item rather than a bug fix)
Vanilla Netbeans 15 (installed from https://netbeans.apache.org/download/index.html yesterday), Java 19.0.1, running on Windows 10.
Netbeans About details below
Product Version: Apache NetBeans IDE 15
Java: 19.0.1; OpenJDK 64-Bit Server VM 19.0.1+10-21
Runtime: OpenJDK Runtime Environment 19.0.1+10-21
System: Windows 10 version 10.0 running on amd64; UTF-8; en_GB (nb)
User directory: C:\Development\Netbeans\John
Cache directory: C:\Development\Netbeans\Cache
Attachments:
StackTrace.txt
Beta Was this translation helpful? Give feedback.
All reactions