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.
In a Java project properly configured to use annotation processors, in NetBeans 6.9, using SomeClass.class.getPackage() returns a package instance. In 7.0, something has been changed since the call now returns null, causing a NPE to be thrown. This is a common technique employed by processor writers, such as the Hibernate Validator Annotation Processor. The first two attachments to bug # 193379 contain a project that demonstrates the problem. The stack trace can be seen in the IDE log when the project is opened. The NPE is caused by a call to Size.class.getPackage().getName(). Size is contained in validation-api-1.0.0.GA.jar, which is part of the library. The processor works on 6.9. Product Version = NetBeans IDE Dev (Build 101214-090a73ea0cba) Operating System = Windows 7 version 6.1 running on x86 Java; VM; Vendor = 1.6.0_19 Runtime = Java HotSpot(TM) Client VM 16.2-b04
Integrated into 'main-golden', will be available in build *201012150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/07a40b1a784e User: Jan Lahoda <jlahoda@netbeans.org> Log: #193381: when a class is defined, the corresponding package needs to be defined as well unless it is already defined.
Fixed by the above commit.