Fix Java refactoring bug

Issue is probably incompatibility between Java 6 and 7.