Index: src/org/jboss/tools/ws/jaxrs/core/jdt/JdtUtils.java =================================================================== --- src/org/jboss/tools/ws/jaxrs/core/jdt/JdtUtils.java (revision 41507) +++ src/org/jboss/tools/ws/jaxrs/core/jdt/JdtUtils.java (working copy) @@ -582,7 +582,16 @@ return methodsVisitor.getMethodSignatures(); } + /** + * Returns the method signature for the given method with the given AST. + * @param method the java method + * @param ast the associated Compilation Unit AST + * @return the JavaMethodSignature or null if the given AST is null. + */ public static JavaMethodSignature resolveMethodSignature(IMethod method, CompilationUnit ast) { + if(ast == null) { + return null; + } JavaMethodSignaturesVisitor methodsVisitor = new JavaMethodSignaturesVisitor(method); ast.accept(methodsVisitor); return methodsVisitor.getMethodSignature(); Index: src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/ResourceChangedProcessor.java =================================================================== --- src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/ResourceChangedProcessor.java (revision 41507) +++ src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/ResourceChangedProcessor.java (working copy) @@ -694,12 +694,14 @@ int flags = existingMethod.mergeAnnotations(matchingMethod.getAnnotations()); final CompilationUnit matchingResourceAST = CompilationUnitsRepository.getInstance().getAST(matchingResource.getResource()); final JavaMethodSignature matchingResourceMethodSignature = JdtUtils.resolveMethodSignature(matchingMethod.getJavaElement(), matchingResourceAST); - flags += existingMethod.update(matchingResourceMethodSignature); - if ((flags & F_ELEMENT_KIND) > 0 && existingMethod.getKind() == EnumKind.UNDEFINED) { - metamodel.remove(existingMethod); - changes.add(new JaxrsElementDelta(existingMethod, REMOVED)); - } else if (flags > 0) { - changes.add(new JaxrsElementDelta(existingMethod, CHANGED, flags)); + if(matchingResourceMethodSignature != null) { + flags += existingMethod.update(matchingResourceMethodSignature); + if ((flags & F_ELEMENT_KIND) > 0 && existingMethod.getKind() == EnumKind.UNDEFINED) { + metamodel.remove(existingMethod); + changes.add(new JaxrsElementDelta(existingMethod, REMOVED)); + } else if (flags > 0) { + changes.add(new JaxrsElementDelta(existingMethod, CHANGED, flags)); + } } } for (Entry entry : removedMethods.entrySet()) {