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.
Build: NetBeans IDE Dev (Build 200911291400) VM: Java HotSpot(TM) Client VM, 14.3-b01, Java(TM) SE Runtime Environment, 1.6.0_17-b04 OS: Windows XP, 5.1, x86 User Comments: esmithbss: Editing a Java Bean File. Stacktrace: java.lang.IllegalStateException: Please attach dump file file:/C:/Documents%20and%20Settings/ersmith/.netbeans/dev/var/log/EDFApprovalTypeBean.jddump to bug. at org.netbeans.modules.java.editor.javadoc.JavadocCompletionUtils.dumpOutOfSyncError(JavadocCompletionUtils.java:511) at org.netbeans.modules.java.editor.javadoc.JavadocCompletionUtils.dumpOutOfSyncError(JavadocCompletionUtils.java:593) at org.netbeans.modules.java.editor.javadoc.DocPositions$DocPositionsManager.get(DocPositions.java:520) at org.netbeans.modules.java.editor.javadoc.DocPositions.get(DocPositions.java:86) at org.netbeans.modules.java.editor.javadoc.JavadocImports.computeReferencedElements(JavadocImports.java:116) at org.netbeans.modules.java.editor.semantic.SemanticHighlighter$DetectorVisitor.handleJavadoc(SemanticHighlighter.java:736)
Created attachment 92060 [details] stacktrace
Created attachment 92061 [details] stacktrace
Created attachment 92062 [details] stacktrace
Created attachment 92063 [details] jddump file
Created attachment 92065 [details] jddump
Created attachment 92066 [details] jddump
Created attachment 92067 [details] jddump
This appears to be generated when you cut and paste an entire class from one file into another file without overwriting the existing class definition. i.e.: 1) I generated a new java class (to get the formatting, etc...). 2) Copied the contents of an existing file into the new class file as an insert operation below the package line, but above the class definition. 3) I started editing the pasted class by changing the classes name to the file's class name.
reproducible java.lang.ArrayIndexOutOfBoundsException: 0 at org.netbeans.modules.java.editor.javadoc.DocPositions.addBlockTag(DocPositions.java:278) at org.netbeans.modules.java.editor.javadoc.DocPositions.resolve(DocPositions.java:166) Caused: java.lang.IllegalStateException: '' org.netbeans.modules.java.editor.javadoc.DocPositions@fefcce token sequence dump: TokenSequence for text/x-java/text/x-javadoc at tokenIndex=1. TokenList contains 5 tokens: T[0]: "\n *\n * " <160,167> OTHER_TEXT[5] DefT, IHC=30713183 *[1]: "@author" <167,174> TAG[1] DefT, IHC=28646030 T[2]: " " <174,175> OTHER_TEXT[5] DefT, IHC=14846077 T[3]: "jp159440" <175,183> IDENT[0] DefT, IHC=7265680 T[4]: "\n " <183,185> OTHER_TEXT[5] DefT, IHC=9715748 at org.netbeans.modules.java.editor.javadoc.DocPositions.resolve(DocPositions.java:194) at org.netbeans.modules.java.editor.javadoc.DocPositions.getTags(DocPositions.java:127) at org.netbeans.modules.java.editor.javadoc.JavadocImports.computeReferencedElements(JavadocImports.java:118) at org.netbeans.modules.java.editor.semantic.SemanticHighlighter$DetectorVisitor.handleJavadoc(SemanticHighlighter.java:736) at org.netbeans.modules.java.editor.semantic.SemanticHighlighter$DetectorVisitor.visitClass(SemanticHighlighter.java:1348) at org.netbeans.modules.java.editor.semantic.SemanticHighlighter$DetectorVisitor.visitClass(SemanticHighlighter.java:449) at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:604) at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67) at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:91) at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:80) at com.sun.source.util.TreeScanner.scan(TreeScanner.java:90) at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:100) at org.netbeans.modules.java.editor.semantic.SemanticHighlighter$DetectorVisitor.visitCompilationUnit(SemanticHighlighter.java:801) at org.netbeans.modules.java.editor.semantic.SemanticHighlighter$DetectorVisitor.visitCompilationUnit(SemanticHighlighter.java:449) at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:482) at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67) at org.netbeans.api.java.source.support.CancellableTreePathScanner.scan(CancellableTreePathScanner.java:91) at org.netbeans.modules.java.editor.semantic.SemanticHighlighter.process(SemanticHighlighter.java:288) at org.netbeans.modules.java.editor.semantic.SemanticHighlighter.process(SemanticHighlighter.java:265) at org.netbeans.modules.java.editor.semantic.SemanticHighlighter.run(SemanticHighlighter.java:203) at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:654) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [catch] at java.lang.Thread.run(Thread.java:619)
Honzo, please have a look. Thanks.
This bug already has 5 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=163297
Created attachment 92694 [details] stacktrace Just opening any .java file for editing.. here the .jddump file : Out of sync error: source file file:/D:/VSS/33I080002_WebHMI_P2/dis/jhmi/test/module/junit/fasttools/jhmi/set/actionui/NameSpaceManagerTest.java ----- Element: ------------------------------------------------------- kind: METHOD, createItems(fasttools.jhmi.set.actionui.IActionResource,java.lang.String[]) ----- Tree: ------------------------------------------------------- kind: METHOD private StructureItem[] createItems(IActionResource resource, String[] strings) { StructureItem[] mItems = new StructureItem[strings.length]; for (int t = 0; t < strings.length; t++) { try { mItems[t] = new StructureItem(resource, strings[t]); } catch (URISyntaxException ex) { Assert.fail("Failed, but not part of this test"); } } return mItems; } ----- Offset: ------------------------------------------------------- offset: 4092 ----- Token sequence: --------------------------
(In reply to comment #8) > This appears to be generated when you cut and paste an entire class from one > file into another file without overwriting the existing class definition. > > i.e.: > > 1) I generated a new java class (to get the formatting, etc...). > > 2) Copied the contents of an existing file into the new class file as an insert > operation below the package line, but above the class definition. > > 3) I started editing the pasted class by changing the classes name to the > file's class name. Thank you very much for .jddump file. Yes in your case the exception arises when the file contains 2 top level classes with the same name.
Using the debugger I have found out that com.sun.tools.javadoc.JavadocEnter does not make a ClassDoc instance in case of erroneous duplicate of top level class (tree.sym.kind != Kinds.TYP). It is opposite what JavacElements.getDocComment returns. IMO both method should be consistent to return null or real javadoc. Me as a java source api client cannot access tree.sym.kind to detect something is wrong as Element.getKind returns CLASS for both top level classes. Reassigning.
Fixed in jet-main. http://hg.netbeans.org/jet-main/rev/aa35bd368f17 changeset 3d7ebb1cfb55 in main/nb-javac details: http://hg.netbeans.org/main/nb-javac?cmd=changeset;node=3d7ebb1cfb55
Integrated into 'main-golden', will be available in build *201001060200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/aa35bd368f17 User: Dusan Balek <dbalek@netbeans.org> Log: Issue #178095 fixed.