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.
200501301900, jdk1.5.0_01 when created new java class
Created attachment 20096 [details] NPE at org.netbeans.modules.javacore.parser.ASTProvider.getToken(ASTProvider.java:334)
Steps?
hmm, it happend after these steps today: -created new project - Mobile > Mobile Class Application -create a new Java class in this new project and fill in package field too -when the new generated file opens in editor the exception appers
Fixed, please verify. Checking in RepositoryUpdater.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/RepositoryUpdater.java,v <-- RepositoryUpdater.java new revision: 1.34; previous revision: 1.33 done
Created attachment 20850 [details] ide.log
happend again with build 200503150955+me050315_19q-builds) What I did: 1, installed NB, and run with fresh userdir - u1, exit 2, installed mobility pack and run again with userdir u1 3, created j2me project 4, created j2me library project 5, NPE when creating java class in unexisting package in class project I hope that it helps
Something strange is happening during instantiating of Java Class. It looks like JavaDataObject is created, but it is immediately invalidated and replaced by J2MEDataObject. RepositoryUpdater gets valid JavaDataObject and passes it to ASTProvider. In the meantime JavaDataObject became invalid and is replaced by J2MEDataObject. Insofar that ASTProvider.getASTree receives invalid DataObject and returns null. I have a patch, which is rather workaround than fix. Real fix should be IMHO done in j2me module, which is responsible for this hanky-panky.
Created attachment 20907 [details] Proposed patch
There is currently no way how to change it in j2me module. All java files inside J2ME project must be recognized as J2MEDataObject instead of JavaDataObject. This is one case when it fails. Create from template on JavaDataObject creates directly a new instance of JavaDataObject without asking data loaders. It means that any new java file created inside J2ME project must be invalidated and recognized back as J2MEDataObject.
Checking in ASTProvider.java; /cvs/java/javacore/src/org/netbeans/modules/javacore/parser/ASTProvider.java,v <-- ASTProvider.java new revision: 1.40; previous revision: 1.39 done
v
Reorganization of java component