This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 177236 - Final class: exporting non-public type through public API
Summary: Final class: exporting non-public type through public API
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: -S1S-
Hardware: PC Windows Vista
: P4 normal (vote)
Assignee: Svata Dedic
URL:
Keywords: USABILITY
Depends on:
Blocks:
 
Reported: 2009-11-19 12:25 UTC by pindatjuh
Modified: 2013-09-02 14:20 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


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.