Bug 36260 - Java compiler bug.
Summary: Java compiler bug.
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-08 19:27 EDT by P Duffy CLA
Modified: 2003-06-02 06:12 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description P Duffy CLA 2003-04-08 19:27:42 EDT
We are importing a large Java project into Eclipse. 

The following code example....

public final class bug
{
        private BaseClass m_var;
	
	private abstract class BaseClass
	{
		protected Object m_var;
	}
	
	private class SubClass extends BaseClass
	{
		private void setVar()
		{
			m_var = null;
		}			
	}
}

Generated error "Error The field m_var is defined in an inherited type and an 
enclosing scope".

Javac/Jikes do not generate this error.
Comment 1 Philipe Mulet CLA 2003-04-09 04:36:55 EDT
I presume you are comparing to 1.4 compilers ? If so, then you should toggle 
our compiler in 1.4 mode as well (by default it is 1.3). See 
Preferences>Java>Compiler>Compliance and Classfiles.
When doing so, no error is reported any longer.

Similarily, javac 1.3.1 would report the following:
X.java:14: m_var is inherited from X.BaseClass and hides variable in outer class
 X.  An explicit 'this' qualifier must be used to select the desired instance.
                        m_var = null;
                        ^
1 error

FYI - this results from a language adjustment from 1.3 to 1.4, where the spec 
got clarified.
Comment 2 Philipe Mulet CLA 2003-04-09 05:30:42 EDT
Closing