JDK-4193599 : Interfaces need protected and package accessibility
  • Type: Enhancement
  • Component: specification
  • Sub-Component: language
  • Affected Version: 1.1.5
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_95
  • CPU: x86
  • Submitted: 1998-11-30
  • Updated: 1998-12-01
  • Resolved: 1998-12-01
Related Reports
Duplicate :  
Description

Name: gb36485			Date: 11/30/98


There are two user groups of a java interface.
(1) Clients who use the services of an interface
provider.
(2) Developers who implement the services.

Even with a "non-public" interface, I have a very
difficult time making an implementation method "public".
Especially if an operation is related to an object's
identity or internal state.
For example, what I'd like to do:

interface ThingsIdentifiedByLabels {

   /** Client interface */
   public String getLabel();

   /** Implementator interface */
   protected setLabel( String labelId );
}
(Review ID: 25779)
======================================================================

Comments
PUBLIC COMMENTS Interfaces only have public members. Non-public members should not be mandated by an interface - they relate only to a particular implementation. See also bug 4193604.
10-06-2004