Bug 177236 - Final class: exporting non-public type through public API
Final class: exporting non-public type through public API
Status: NEW
Product: java
Classification: Unclassified
Component: Hints
-S1S-
PC Windows Vista
: P4 (vote)
: TBD
Assigned To: Svata Dedic
issues@java
: USABILITY
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-11-19 12:25 UTC by pindatjuh
Modified: 2013-09-02 14:20 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pindatjuh 2009-11-19 12:25:14 UTC
I have a ("protected" and final) class X in some package and a (public and final) class Y in the same package. The problem is a faulty hint in class Y when defining a protected field using class X.

Though, it seems logical to me, a final class can't be extended: the protected field never gets accessed by any class outside the current package. Hence, I am >not exporting< a non-public type.

The problem is not severe, it just bothers me when programming.
Product Version: NetBeans IDE 6.7 (Build 200906241340)
Java: 1.6.0_13; Java HotSpot(TM) Client VM 11.3-b02
System: Windows Vista version 6.0 running on x86; Cp1252; nl_NL (nb)
Userdir: C:\Users\[my username]\.netbeans\6.7

// file X.java
...
final class X {
...

// file Y.java
...
public final class Y {
...
protected final X someVar;
// An error hint: "Exporting non-public type through public API." is displayed.
...



Thank you.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo