Project: JDT
Bug 88020 NPE while moving empty CU [5.0] [refactoring] [move]
Reported: 2005-03-15 02:55:54 | Status: resolved fixed

Using build I20050308-1510. I've created empty compilation unit package-info.java in default package. Now I create a new package (let say 'test') in my project and want to move my empty CU in this package => I get following NPE: Root exception: java.lang.NullPointerException at org.eclipse.jdt.internal.core.search.matching.MatchLocator.findIndexMatches(MatchLocator.java:308) Thinking it was a Search Engine issue, I looked at it and see that MatchLocator pattern was null...! After tracing what happened, it seems that MoveCuUpdateCreator.getReferences method is not protected from the fact that pattern creation may fail in certain circumstances (empty cu for example) and always perform a search...

Files changed in fix:
org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/MoveCuUpdateCreator.java