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 69576 - StackOverflowError at org.netbeans.modules.javacore.parser.Scope.createMethodScopeImpl
Summary: StackOverflowError at org.netbeans.modules.javacore.parser.Scope.createMethod...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-30 05:55 UTC by _ gtzabari
Modified: 2007-09-26 09:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
stack-trace (84.09 KB, text/plain)
2005-11-30 05:56 UTC, _ gtzabari
Details
Offending file (2.96 KB, text/plain)
2005-12-03 20:05 UTC, _ gtzabari
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2005-11-30 05:55:59 UTC
dev build 200511271900

See the attached stack-trace
Comment 1 _ gtzabari 2005-11-30 05:56:47 UTC
Created attachment 27421 [details]
stack-trace
Comment 2 Tomas Hurka 2005-11-30 10:43:10 UTC
This seems to be caused by special combination of source files. Can you provide steps and source files to 
reproduce it? Thanks.
Comment 3 _ gtzabari 2005-11-30 15:06:14 UTC
Dang, I knew this one would bite me in the ass :) I got this stack-trace while
compiling but I don't remember the exact source files. When you compile the
entire project, how do you find one which one of the files is the one triggering
the error?
Comment 4 _ gtzabari 2005-12-02 21:18:52 UTC
Closing as INVALID. I haven't seen this since trying a fresh userdir.
Comment 5 _ gtzabari 2005-12-03 20:01:51 UTC
I can reproduce this again. I get this exception and I try cut/pasting a class
in explorer from one package to another. I've attached the offending Java file.
Comment 6 _ gtzabari 2005-12-03 20:05:42 UTC
Created attachment 27530 [details]
Offending file
Comment 7 _ gtzabari 2005-12-03 20:29:00 UTC
I was trying to move ContentTypeDAOImpl from package
desktopbeautifier.server.dao.impl to package desktopbeautifier.dao.impl but it
turns out that ContentTypeDAOImpl already existed in that package, from another
project. I am expecting Netbeans to give me a clearer error message explaining
why the move operation is illegal.

I renamed the file to avoid a namespace collision. Next, I had to rename some
import statements which pointed to nonexistant classes (if I didn't I would get
yet another sort of exception). Next, I noticed that the interface that
ContentTypeDAOImpl.java "implemented" happened to have a namespace collision of
its own. That is, I had two interfaces with identical names in two different
packages (one dependant on the other). So I renamed the interface. I also
noticed a cyclical depencency in that interface (since both interfaces had the
same name) so I fixed it.

Now... once this was all done I could move ContentTypeDAOImpl.java without
getting an exception. So in a nutshell here is what I think the code needs to do:

1) Check for preexisting cyclical dependencies not only in the class being moved
but also in its dependencies

2) Check for namespace collisions when scanning the classpath. This is only
relevant if project A depends on project B and both declare a class/interface in
the exact same namespace.

3) If a move operation would cause namespace collision or cyclical dependencies
warn the user and abort the operation.
Comment 8 Tomas Hurka 2005-12-05 09:24:29 UTC
Yes, StackOverflowError can be caused by cyclic dependencies in your interfaces. 
Comment 9 _ gtzabari 2005-12-05 16:18:13 UTC
Ok, so can you try adding some of the checks I mentioned? I am especially
interested in the check for namespace collision across projects since that is
harder to notice manually.
Comment 10 Jan Becicka 2006-10-26 16:26:48 UTC
Javacore module was replaced by Retouche infrastructure. This bug is not valid
in trunk any more.
Comment 11 Quality Engineering 2007-09-20 09:46:42 UTC
Reorganization of java component