Bug 23788 - Java compiler doesn't properly flag invalid protected access (for javac 1.4 compatibility)
Summary: Java compiler doesn't properly flag invalid protected access (for javac 1.4 c...
Status: RESOLVED DUPLICATE of bug 22428
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 2.1 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-18 16:26 EDT by Seth Nickell CLA
Modified: 2002-09-19 07:14 EDT (History)
1 user (show)

See Also:


Attachments
Tiny eclipse project demonstrating the problem (2.93 KB, application/x-zip)
2002-09-18 16:27 EDT, Seth Nickell CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Seth Nickell CLA 2002-09-18 16:26:20 EDT
According to:
http://developer.java.sun.com/developer/bugParade/bugs/4637755.html for a Java
1.4 compatible javac the compiler should not allow access to protected members
from classes defined outside their package, even if members are overrider the
method from a base class that *is* in the accessor's package. This "bug" existed
in the javac included with JDK 1.3, but is "fixed" in the JDK 1.4 javac.

Included is a piece of sample code that demonstrates the problem. With Sun's
javac from JDK1.4 the following error is reported on compilation:

PackageA/MainClass.java:12: overriddenMethod() has protected access in
PackageB.DerivedClass
		derivedObject.overriddenMethod();

Eclipse's java compiler compiles the code happily, even when JDK1.4
compatibility is enabled.
Comment 1 Seth Nickell CLA 2002-09-18 16:27:20 EDT
Created attachment 2009 [details]
Tiny eclipse project demonstrating the problem
Comment 2 Seth Nickell CLA 2002-09-18 16:27:57 EDT
I should mention that the attachment *does* compile with Eclipse, but it should
not. I've commented the line that should not compile.
Comment 3 Philipe Mulet CLA 2002-09-19 07:13:37 EDT
Works for me in latest. This is a duplicate of bug 22428.
Fix is part of 2.1-M1 build.

*** This bug has been marked as a duplicate of 22428 ***
Comment 4 Philipe Mulet CLA 2002-09-19 07:13:53 EDT
Forgot to assign.
Comment 5 Philipe Mulet CLA 2002-09-19 07:14:21 EDT

*** This bug has been marked as a duplicate of 22428 ***