Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 282197

Summary: stack overflow in GUI when using a lot of "final static" constants
Product: [Eclipse Project] JDT Reporter: Peter Elzner <peter.elzner>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: major    
Priority: P3 CC: Olivier_Thomann
Version: 3.5   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
URL: http://www.diamond-download.de/eclipse/crash.zip
Whiteboard: stalebug

Description Peter Elzner CLA 2009-07-01 14:45:54 EDT
I am currently migrating a C# project to Java and came across the following problem:

The project makes use of a lot of constant values, declared as "final static" and depending on each other like in
  public final static int someValue4712 = someValue4711 + 42;
  
I am now creating a second class with a subclass in it.
When I try to reference one of these constant values from within the subclass,
I get a "Requesting Java AST from selection has ecountered a problem: java.lang.StackOverflowError"

I have uploaded some sample code here: http://www.diamond-download.de/eclipse/crash.zip
the code might look a bit stupid but it can reproduce the error.
There are two source files:
1. a class declaring the constants like this:

public class testClassConst
{
    public static final int someValue0 = 0;
    public static final int someValue1 = someValue0+1;
...
    public static final int someValue3999 = someValue3998+1;
}

2. and the main class:

public class testClass
{
    public class SubTestClass
    {
        public int GetSomeValue()
        {
            return testClassConst.someValue3999;
        }
    }
}

that's all you need to reproduce the error message. it comes up when you try to edit the main class.

side effects:
- error message pops up every now and then
- copy/paste does not work any more within the main class source-file
- syntax-highlighting does not work propperly in the affected file

Visual Studio 2008 has no problems displaying these files :-)

-- Configuration Details --
Product: Eclipse 1.2.0.20090619-0620 (org.eclipse.epp.package.java.product)
Installed Features:
 org.eclipse.jdt 3.5.0.v20090527-2000-7r88FEeFJePyvYeA33DjZ_c1
Comment 1 Olivier Thomann CLA 2009-07-14 16:05:41 EDT
The problem occurs when trying to compute the constant value. A workaround is to increase the stack size using the -Xss option.
Comment 2 Eclipse Genie CLA 2020-01-01 14:41:24 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.