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 158116 - Misleading compiler error for non-public classes
Summary: Misleading compiler error for non-public classes
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Svata Dedic
Depends on:
Reported: 2009-02-07 04:18 UTC by _ gtzabari
Modified: 2013-09-02 14:21 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2009-02-07 04:18:34 UTC
When a user references a non-public class from the editor Netbeans gives misleading messages about being unable to
resolve class name. The only way I discovered that the problem was the class accessibility was to manually type "import
<ClassName>" by hand (because Fix Imports refused to work silently) and only then did Netbeans give me a clean error

This is a usability problem because from a compiler point of view the symbol is unresolved, yet from a user's point of
view "Fix Imports" refuses to work no matter what you do. Hitting SHIFT+ALT+I doesn't help either. It comes up with "No
classes found". Again, this is misleading. Netbeans should do a better job at communicating to the user that the class
name could be resolved but it could not be imported because it's non-public. Perhaps hitting SHIFT+ALT+I a second time
should show non-public matches crossed out (much like hitting CTRL+SPACE twice shows all matches).
Comment 1 Jiri Prox 2009-02-11 13:06:15 UTC

when CoS is disabled the error message is ok.
Comment 2 Rastislav Komara 2009-02-16 09:50:28 UTC
Comment 3 Jan Lahoda 2009-08-20 09:58:24 UTC
Reassigning all moonko's java/source bugs to myself.
Comment 4 David Strupl 2012-10-25 13:41:41 UTC
Bug prior to 7.0, not touched for the last 2 years --> P4.
Comment 5 _ gtzabari 2012-10-26 21:13:26 UTC
Target Milestone is wrong (6.8 has already been released).