Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320275 - [1.5][compiler] The hierarchy of the type AbstractSubClass is inconsistent
Summary: [1.5][compiler] The hierarchy of the type AbstractSubClass is inconsistent
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC All
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-19 10:52 EDT by Vishal Garg CLA
Modified: 2019-09-19 06:04 EDT (History)
6 users (show)

See Also:


Attachments
eclipse project showing the problem (4.00 KB, application/zip)
2010-07-19 10:52 EDT, Vishal Garg CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vishal Garg CLA 2010-07-19 10:52:04 EDT
Build Identifier: 20100617-1415

create a 
1) baseInterface extends genericInterface<ConcreteClass>
2) abstract abstractClass implements baseInterface
3) abstract abstractSubClass extends abstractClass
4) concreteClass extends abtractsubclass

abstract subclass gives -  The hierarchy of the type AbstractSubClass is inconsistent


Reproducible: Always
Comment 1 Vishal Garg CLA 2010-07-19 10:52:46 EDT
Created attachment 174625 [details]
eclipse project showing the problem
Comment 2 Srikanth Sankaran CLA 2010-07-19 23:29:23 EDT
Can you report the full version & build id by copying & pasting
from Help + About Eclipse SDK, including any prefixes (M/I etc).

I don't see any problems if I create a java project by importing
the files from the attached archive. I did clean & build several
times to no avail.

This is on 3.6 as well as HEAD.

This looks like a duplicate of bug# 294057 : Indeed if I back out
the fix for that bug, I get the problem you cite consistently.
Comment 3 Vishal Garg CLA 2010-07-20 12:26:42 EDT
here's the eclipse version
Eclipse Java EE IDE for Web Developers.

Version: Helios Release
Build id: 20100617-1415
Comment 4 Vishal Garg CLA 2010-07-20 12:28:35 EDT
AbstractubClass should show the error
Comment 5 Srikanth Sankaran CLA 2010-07-21 02:44:20 EDT
(In reply to comment #3)
> here's the eclipse version
> Eclipse Java EE IDE for Web Developers.
> 
> Version: Helios Release
> Build id: 20100617-1415

I have downloaded these exact bits and tested it with the
test case you have supplied by importing the project. I
don't see the problem.

I assume you were trying to isolate & put together a small
test case from your project that was showing the problem: If so,
could you verify if the problem does show up on this small case
you have ? I would suggest you start with a clean workspace,
import project from the zip in comment#1 and see.

Anything else that could be peculiar to your set up that would
explain why I am not seeing the problem ? 

Jay, can you try your hand at reproducing it with 3.6 as well
as the EE IDE ? TIA.
Comment 6 Vishal Garg CLA 2010-07-21 17:26:13 EDT
(In reply to comment #5)
> (In reply to comment #3)
> > here's the eclipse version
> > Eclipse Java EE IDE for Web Developers.
> > 
> > Version: Helios Release
> > Build id: 20100617-1415
> 
> I have downloaded these exact bits and tested it with the
> test case you have supplied by importing the project. I
> don't see the problem.
> 
> I assume you were trying to isolate & put together a small
> test case from your project that was showing the problem: If so,
> could you verify if the problem does show up on this small case
> you have ? I would suggest you start with a clean workspace,
> import project from the zip in comment#1 and see.
> 
> Anything else that could be peculiar to your set up that would
> explain why I am not seeing the problem ? 
> 
> Jay, can you try your hand at reproducing it with 3.6 as well
> as the EE IDE ? TIA.

I am able to reproduce every time on the Helios build I mentioned. on windows Vista, and Ubuntu 10.04 with JDK1.6_18 and 1.6_20
Comment 7 Srikanth Sankaran CLA 2010-07-22 01:56:27 EDT
Would it be possible for you to test against the eclipse
classic (eclipse-SDK-3.6-win32.zip) version, using out of
the box settings in a new, clean workspace with just the
offending case ? 

I wonder if it is some settings on your side that somehow
triggers it.  Can you attach the file org.eclipse.jdt.core.prefs
from the .settings folder of the test case project ?
Comment 8 Srikanth Sankaran CLA 2010-07-22 02:16:06 EDT
(In reply to comment #7)
> Would it be possible for you to test against the eclipse
> classic (eclipse-SDK-3.6-win32.zip) version, 

Actually, Jay (Thanks!) showed me how to see the problem.
I was looking at the problems view and since there was
nothing there, I concluded it is not reproducible. The
problem does show up in the editor.

I'll investigate and see what is going on here.
Comment 9 Olivier Thomann CLA 2010-07-22 12:58:15 EDT
(In reply to comment #8)
> Actually, Jay (Thanks!) showed me how to see the problem.
> I was looking at the problems view and since there was
> nothing there, I concluded it is not reproducible. The
> problem does show up in the editor.
> I'll investigate and see what is going on here.
Then this means it is a reconciling issue only.
Comment 10 Olivier Thomann CLA 2010-07-22 13:17:53 EDT
You can actually reproduce it using the plain compiler by doing the following steps:

1) Put all 5 files into a folder called d:\tests\src.
2) Compile all files at once and put the output into a folder bin.
Compiler arguments are:
d:\tests\src
-classpath d:\tests\src;d:\tests\bin
-d d:\tests\bin
-1.6

3) All .class files will be created.
4) Now run the following compilation.

d:\tests\src\AbstractSubClass.java
-classpath d:\tests\src;d:\tests\bin
-d d:\tests\bin
-1.6

You should get the following error:
[compiled 20 lines in 469 ms: 42.6 lines/s]
[3 .class files generated]
----------
1. ERROR in D:\tests\src\AbstractSubClass.java (at line 2)
	public abstract class AbstractSubClass extends AbstractClass {
	                      ^^^^^^^^^^^^^^^^
The hierarchy of the type AbstractSubClass is inconsistent
----------
----------
2. ERROR in D:\tests\src\ConcreteClass.java (at line 2)
	extends AbstractSubClass {
	        ^^^^^^^^^^^^^^^^
Cycle detected: a cycle exists in the type hierarchy between ConcreteClass and AbstractSubClass
----------
2 problems (2 errors)

If the second compilation is only retrieving dependent types from binary, then it works fine.
The reconciler is getting dependent types from source. And the step (4) would "reproduce" the way the reconciler works.

This might make it easier to debug. I'll provide a regression test inside the GenericTypeTest suite.
Comment 11 Olivier Thomann CLA 2010-07-22 14:50:21 EDT
Released disabled regression test for this bug.
See org.eclipse.jdt.core.tests.compiler.regression.GenericTypeTest#_test1465.
The test should compile, but it reports an error right now.
Comment 12 Olivier Thomann CLA 2010-07-22 14:53:22 EDT
(In reply to comment #10)
> You can actually reproduce it using the plain compiler by doing the following
> steps:
> 1) Put all 5 files into a folder called d:\tests\src.
> 2) Compile all files at once and put the output into a folder bin.
> Compiler arguments are:
> d:\tests\src
> -classpath d:\tests\src;d:\tests\bin
> -d d:\tests\bin
> -1.6
In fact these steps are not needed. As soon as you compile the d:\tests\src\AbstractSubClass.java file alone with the dependant files on the classpath, the problem occurs.
This is what the regression test is doing.
Hope this help.
Comment 13 Srikanth Sankaran CLA 2010-07-25 22:43:31 EDT
(In reply to comment #12)
> (In reply to comment #10)
[...]

> This is what the regression test is doing.
> Hope this help.

Yes, Thanks, will follow up.
Comment 14 Anttix Mising name CLA 2011-11-12 08:31:46 EST
The same problem is also easily reproducible with serializable JPA Entities and Spring Roo.

1. Install STS 2.8.0 and Spring Roo (1.1.5.RELEASE)
2. Create a Roo project (File->New->Other->Spring Roo Project)
3. Set up persistence with Roo command (type into Roo console): persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
4. Create an abstract base entity: entity --class ~.entities.Base --abstract --mappedSuperclass
5. Create a concrete entity: entity --class ~.entities.Concrete --extends ~.entities.Base
6. Open Base.java in editor and change "public abstract class Base" to "public abstract class Base implements java.io.Serializable"
7. Open Concrete.java in Editor
8. "The hierarchy of the type Concrete is inconsistent error" will appear on type definition line. No error markers will be visible neither in Markers tab or in the project explorer.
Comment 15 Eclipse Genie CLA 2019-09-19 06:04:49 EDT
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.