}
return result;
}
private SourceCodeChange handleFieldDeclarationChange(Insert insert) {
SourceCodeChange result = null;
// may lead to incorrect result (never happened so far); better: check for each
// possible kind of type
if (insert.getChangedEntity().getType().isType()) {
Delete del =
findSpDeleteOperation(
insert.getRootEntity().getType(),
insert.getRootEntity().getUniqueName(),
insert.getParentEntity().getType(),
insert.getParentEntity().getUniqueName());
if (del != null) {
result =
new Update(
insert.getRootEntity(),
del.getChangedEntity(),
insert.getChangedEntity(),
insert.getParentEntity());
fDeletes.remove(del);
result.setChangeType(ChangeType.ATTRIBUTE_TYPE_CHANGE);
}
} else if (insert.getChangedEntity().getType() == JavaEntityType.JAVADOC) {
Delete del =
findDeleteOperation(
insert.getRootEntity().getType(),
insert.getRootEntity().getUniqueName(),
insert.getParentEntity().getType(),
insert.getParentEntity().getUniqueName(),
insert.getChangedEntity().getType(),
null);
if (del != null) {
result =
new Update(
insert.getRootEntity(),
del.getChangedEntity(),
insert.getChangedEntity(),
insert.getParentEntity());
result.setChangeType(ChangeType.DOC_UPDATE);
fDeletes.remove(del);
} else {
insert.setChangeType(ChangeType.DOC_INSERT);
result = insert;
}