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.

Bug 54232 - NPE at ASTProvider.getToken
Summary: NPE at ASTProvider.getToken
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-31 16:37 UTC by Lukas Hasik
Modified: 2007-09-26 09:14 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NPE at org.netbeans.modules.javacore.parser.ASTProvider.getToken(ASTProvider.java:334) (1.63 KB, text/plain)
2005-01-31 16:38 UTC, Lukas Hasik
Details
ide.log (31.15 KB, text/plain)
2005-03-15 15:17 UTC, Lukas Hasik
Details
Proposed patch (577 bytes, patch)
2005-03-16 18:24 UTC, Jan Becicka
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Hasik 2005-01-31 16:37:37 UTC
200501301900, jdk1.5.0_01

when created new java class
Comment 1 Lukas Hasik 2005-01-31 16:38:11 UTC
Created attachment 20096 [details]
NPE 	at org.netbeans.modules.javacore.parser.ASTProvider.getToken(ASTProvider.java:334)
Comment 2 Tomas Hurka 2005-02-01 17:03:48 UTC
Steps?
Comment 3 Lukas Hasik 2005-02-02 15:02:29 UTC
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
Comment 4 Jan Becicka 2005-02-11 14:46:59 UTC
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
Comment 5 Lukas Hasik 2005-03-15 15:17:14 UTC
Created attachment 20850 [details]
ide.log
Comment 6 Lukas Hasik 2005-03-15 15:22:23 UTC
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
Comment 7 Jan Becicka 2005-03-16 18:23:12 UTC
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.
Comment 8 Jan Becicka 2005-03-16 18:24:12 UTC
Created attachment 20907 [details]
Proposed patch
Comment 9 Adam Sotona 2005-03-17 12:31:26 UTC
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.
 
Comment 10 Jan Becicka 2005-03-17 13:16:13 UTC
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
Comment 11 Lukas Hasik 2006-09-14 10:32:36 UTC
v
Comment 12 Quality Engineering 2007-09-20 12:05:19 UTC
Reorganization of java component