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.
Run the following under internal execution inside NetBeans. You will get a NullPointerException like the one that follows. The problem is that AEIndexSetWrapper.clear() is calling IndexSetWrapper.wrap() with a null argument. This causes IndexSetWrapper.wrap() to return null. Then, this null result is given to AEIndexSetWrapper.remove() and then also given to AssocEndIndexSet.checkType(). checkType throws the NullPointerException explicitly when it finds its argument is null. Note that this seems to only happen when the whole extent is deleted. If you change the pkgA.refDelete() to p.refDelete() then there is no NullPointerException. This affects the <mof> Ant task I wrote but I was able to work around it by simply doing the .clear() before the .refDelete() of the extent. import org.netbeans.api.mdr.*; import javax.jmi.model.*; public class EmptyReferenceTest { public static void main(String [] s) throws CreationFailedException { MDRepository repository = MDRManager.getDefault().getDefaultRepository(); ModelPackage pkgA = (ModelPackage) repository.createExtent("A"); ModelPackage pkgB = (ModelPackage) repository.createExtent("B"); MofPackage p = pkgA.getMofPackage().createMofPackage(); Constraint c = pkgB.getConstraint().createConstraint(); c.getConstrainedElements().add(p); //p.refDelete(); pkgA.refDelete(); c.getConstrainedElements().clear(); } } => java.lang.NullPointerException at org.netbeans.mdr.storagemodel.AssocEndIndexSet.checkType(AssocEndIndexSet.java:73) at org.netbeans.mdr.handlers.AEIndexSetWrapper.remove(AEIndexSetWrapper.java:111) at org.netbeans.mdr.handlers.AEIndexSetWrapper.clear(AEIndexSetWrapper.java:51) at EmptyReferenceTest.main(EmptyReferenceTest.java:13) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.openide.execution.ThreadExecutor.executeClass(ThreadExecutor.java:117) at org.openide.execution.ThreadExecutor$TERunnable.run(ThreadExecutor.java:184) at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:118)
This is caused by a bug in refDelete for whole extent. RefPackage.refDelete should delete links from all external extents as RefObject.refDelete does it.
This only applies to inter-extent links. Lowering priority.
I am closing all reports in category Java/Unsupported as wontfix. These should be dead issues --- if the reported cases are against some live part of the NetBeans IDE please reopen and we can discuss to which category they belong.