This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
1.Create new EJB module on glassfish server 2.Create new Entity class and the Persistence unit 3.Delete line 25 "@id" wait for a hint 4.Use the hint to create new EntityID 5.Type @PersistenceContext() private Integer age; below id definition 6.use hint to import javax.persistence.PersistenceContext; 7.Right Click to age and use popup menu to Refactor/Encapsulate Fields 8.move the focus(cursor) to the line 30: @PersistenceContext() A java.lang.RuntimeException exception and a java.lang.IllegalArgumentException exception occures It's hard to reproduce try to repeat steps 3-8 few times I've reached these exceptions at least five times an hour, but now allways by the same process.
Created attachment 31033 [details] messages.log
Created attachment 31034 [details] stack trace of both exceptions
since the message appears it's impossible to stop her showing again
*** Issue 75245 has been marked as a duplicate of this issue. ***
I've seen this stack trace many times but I can't find the previously reported bug. This issue is a P2, it leads to exception loop, the user has choice but to restart the IDE. Reassigning to javacore (both exceptions come from ResourceImpl.getElementByOffset()).
*** Issue 78040 has been marked as a duplicate of this issue. ***
*** This issue has been marked as a duplicate of 70319 ***
I would be better to leave this issue open and mark the others as duplicates since this one includes reproduction steps...
*** Issue 81294 has been marked as a duplicate of this issue. ***
*** Issue 79645 has been marked as a duplicate of this issue. ***
*** Issue 81949 has been marked as a duplicate of this issue. ***
*** Issue 82005 has been marked as a duplicate of this issue. ***
I have added an additional info into the exception message. I have tried to reproduce it following the given steps (repeatedly), but I was not successful. Reporter, do these steps still work for you? If so, can you attach some stack trace with the extended message, please?
Created attachment 33059 [details] adding todays(NetBeans 5.5Dev 200608180000) messages.log with stacktrace
The attached stacktrace helped, thanks. I am able to reproduce it quite reliably now using the following steps: 1. Create a source file with annotation that needs an import to be resolved (include the import). 2. Delete the line containing annotation import, preferably by Ctrl+E. 3. Move cursor quickly to the line where the annotation is used and quickly invoke Fix Imports. It must be called before the source file is parsed and error line appears. The exception is thrown after that. Note that sometimes NPE can be thrown instead on IAE, it depends on the position of the annotation in the source. Here are my findings why IAE is thrown: MultipartId corresponding to the name of annotation stores firstToken and lastToken values to retrieve ASTree. There are old values, pointing to the tree related to the source without the import, but the whole resourse has been already assigned by a new tree (containing the import). It implies that incorrect pair 'tokens and tree' are passed into parser.findTree() method and the method fails. I have tried to reproduce the problem also on field type, but without any success. It seems, the scenario above causes problems in the case of annotations. Tomasi, do you have any idea how the situation with new tree and old firstToken, lastToken values can occure?
Fixed in trunk. /cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/MethodImpl.java new revision: 1.45; previous revision: 1.44 /cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/AnnotationImpl.java new revision: 1.36; previous revision: 1.35
Is this issue fully fixed? Are you planning merge fix into 5.5 branch? (see status whiteboard)
Fixed merged into release55 branch. /cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/MethodImpl.java new revision: 1.37.2.3.2.2; previous revision: 1.37.2.3.2.1 /cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/AnnotationImpl.java new revision: 1.19.4.5.2.7; previous revision: 1.19.4.5.2.6
Verified NetBeans 5.5Dev 200608240000
*** Issue 82362 has been marked as a duplicate of this issue. ***
Reorganization of java component