When linking inside an annex library, a NullPointerException is thrown because
line 224: aadl Classifier ns = AadlUtil.getContainingClassifier(context);
returns null, because there is no containing classifier for an annex library.
Please check for (ns != null) before use and return an empty list instead (line 249)
The implementation of Aadl2LinkingService.getLinkedObjects() assumes in many places that it is only called in the context of core AADL. The name resolution for references inside any annex must happen in an annex specific linking service.
The real bug is that the Aadl2LinkingService tries to resolve references inside an annex if
no annex linking service is registered or
an annex linking service is registered bit encounters an unresolvable reference
instead of just returning an empty list in these cases.