Refactoring java constant pool resolution