Source:
<code>private void processLinks(Object entity, Object resource, Object instance, Set<Object> processed, UriInfo uriInfo, ResourceMappingContext rmc) { try { if (instance == null || processed.contains(instance)) return; processed.add(instance); } catch (RuntimeException e) { log.log(Level.INFO, LinkMessages.WARNING_LINKFILTER_PROCESSING(instance.getClass().getName()), e); } for (FieldDescriptor field : instanceDescriptor.getLinkFields()) { if (field instanceof InjectLinkFieldDescriptor) { InjectLinkFieldDescriptor linkField = (InjectLinkFieldDescriptor) field; if (ELLinkBuilder.evaluateCondition(linkField.getCondition(), entity, resource, instance)) { URI uri = ELLinkBuilder.buildURI(linkField, entity, resource, instance, uriInfo, rmc); linkField.setPropertyValue(instance, uri); } } else if (field instanceof InjectLinksFieldDescriptor) { InjectLinksFieldDescriptor linksField = (InjectLinksFieldDescriptor) field; List<Link> list = new ArrayList<Link>(); for (InjectLinkFieldDescriptor linkField : linksField.getLinksToInject()) { if (ELLinkBuilder.evaluateCondition(linkField.getCondition(), entity, resource, instance)) { URI uri = ELLinkBuilder.buildURI(linkField, entity, resource, instance, uriInfo, rmc); Link link = linkField.getLink(uri); list.add(link); } } linksField.setPropertyValue(instance, list); } } Class<?> instanceClass = instance.getClass(); if (instanceClass.isArray() && Object[].class.isAssignableFrom(instanceClass)) { Object array[] = (Object[]) instance; for (Object member : array) { processMember(entity, resource, member, processed, uriInfo,rmc); } } else if (instance instanceof Collection) { Collection collection = (Collection) instance; for (Object member : collection) { processMember(entity, resource, member, processed, uriInfo,rmc); } } for (FieldDescriptor member : instanceDescriptor.getNonLinkFields()) { <START> if (!member.field.isAnnotationPresent(NoLinkIntrospect.class)) { <END> processMember(entity, resource, member.getFieldValue(instance), processed, uriInfo,rmc); } } }</code><technical_language>a null pointer check field here? a property in JAX-B defined methods this null. (The code modified slightly this account)</technical_language>

Target:
private void processLinks(Object entity, Object resource, Object instance, Set<Object> processed, UriInfo uriInfo, ResourceMappingContext rmc) { try { if (instance == null || processed.contains(instance)) return; processed.add(instance); } catch (RuntimeException e) { log.log(Level.INFO, LinkMessages.WARNING_LINKFILTER_PROCESSING(instance.getClass().getName()), e); } for (FieldDescriptor field : instanceDescriptor.getLinkFields()) { if (field instanceof InjectLinkFieldDescriptor) { InjectLinkFieldDescriptor linkField = (InjectLinkFieldDescriptor) field; if (ELLinkBuilder.evaluateCondition(linkField.getCondition(), entity, resource, instance)) { URI uri = ELLinkBuilder.buildURI(linkField, entity, resource, instance, uriInfo, rmc); linkField.setPropertyValue(instance, uri); } } else if (field instanceof InjectLinksFieldDescriptor) { InjectLinksFieldDescriptor linksField = (InjectLinksFieldDescriptor) field; List<Link> list = new ArrayList<Link>(); for (InjectLinkFieldDescriptor linkField : linksField.getLinksToInject()) { if (ELLinkBuilder.evaluateCondition(linkField.getCondition(), entity, resource, instance)) { URI uri = ELLinkBuilder.buildURI(linkField, entity, resource, instance, uriInfo, rmc); Link link = linkField.getLink(uri); list.add(link); } } linksField.setPropertyValue(instance, list); } } Class<?> instanceClass = instance.getClass(); if (instanceClass.isArray() && Object[].class.isAssignableFrom(instanceClass)) { Object array[] = (Object[]) instance; for (Object member : array) { processMember(entity, resource, member, processed, uriInfo,rmc); } } else if (instance instanceof Collection) { Collection collection = (Collection) instance; for (Object member : collection) { processMember(entity, resource, member, processed, uriInfo,rmc); } } for (FieldDescriptor member : instanceDescriptor.getNonLinkFields()) { if (fieldSuitableForIntrospection(member)) { processMember(entity, resource, member.getFieldValue(instance), processed, uriInfo,rmc); } } }