Bug 35437 - can't call protected methods from derived classes in other pkg
Summary: can't call protected methods from derived classes in other pkg
Status: RESOLVED INVALID
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: 2.1 RC4   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-20 21:08 EST by Eric DeFazio CLA
Modified: 2003-03-21 12:44 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric DeFazio CLA 2003-03-20 21:08:03 EST
(RC2) Eclipse will throw a compilation error when you try to invoke a protected 
method from a derived class in another pkg.

i.e. Base Class = 
package javaoverview.methods;

public class MethodAccessibilityBase
{   
    protected void protectedMethod ()
    {
        System.out.println ("Can be invoked by subclasses");        
    }
}

Derived = 
package javaoverview.methods.anotherpackage;

import javaoverview.methods.MethodAccessibilityBase;

public class MethodAccessibilityDerivedAnotherPackage extends 
MethodAccessibilityBase
{
    public void invokeMethods()
    {
     MethodAccessibilityBase lClassToCallMethodOn = new MethodAccessibilityBase
();
     lClassToCallMethodOn.protectedMethod();
    }
}
Comment 1 Eric DeFazio CLA 2003-03-21 00:08:33 EST
Whoops, guess I should doublecheck my work, and not submit bug reports when I 
am up for 20 hours straight... Sorry
Comment 2 Olivier Thomann CLA 2003-03-21 12:44:08 EST
Set milestone.