Time for action: handling deletion

The incremental builder does not handle deletion in its current implementation. To handle deletion, the IResourceDelta instance needs to be inspected to find out what kind of delta took place and handle deleted resources accordingly.

  1. Run the target Eclipse instance, and delete a .minimark file. An exception is thrown and reported to the user:
    Time for action: handling deletion
  2. To fix this issue, modify the check in the MinimarkVisitor method processResource to see whether the resource exists or not:
    private void processResource(IResource resource) throws
     CoreException {
      if (resource instanceof IFile && resource.exists()) {
  3. This solves the NullPointerException ...

Get Eclipse Plug-in Development Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.