IType currentType = types[i];
if (currentType.getElementName().equals(oldTypeName)) {
AbstractTypeDeclaration typeNode = (AbstractTypeDeclaration) ((JavaElement) currentType).findNode(astCU);
if (typeNode != null) {
// rename type
rewriter.replace(typeNode.getName(), ast.newSimpleName(newTypeName), null);
// rename constructors
Iterator bodyDeclarations = typeNode.bodyDeclarations().iterator();
while (bodyDeclarations.hasNext()) {
Object bodyDeclaration = bodyDeclarations.next();
if (bodyDeclaration instanceof MethodDeclaration) {