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.
Have a Java library with sources and open a source file from this library. Usages of classes outside the Java platform and the library are marked as errors. This is expected if one understands the internals of the Java infrastructure, but it is unexpected by the users.
It's not possible to find out the required classpath for a library. Also the java lang infrastructure cannot find that the file is "somehow" special and don't mark errors for it.