Project: JDT
Bug 85299 Cannot copy or move enum constants (IFields)
Reported: 2005-02-15 13:04:04 | Status: resolved fixed

I20050215-0800 Copying and moving enum constants (IFields, e.g. in the Outline) does not work. The problem is that clients of ASTNodeSearchUtil.getFieldDeclarationNode(IField, CompilationUnit) and ASTNodeSearchUtil.getFieldDeclarationFragmentNode(IField, CompilationUnit) assume they get a field that is not an enum constant. Enum constants map to EnumConstantDeclaration AST nodes, and clients need to either handle them separately or else ensure they only work with non-enum fields. The clients in ReorgPolicyFactory and TypedSource need to be updated.

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