private SourceCodeChange extractDecreasingAccessibilityChange(Delete delete) {
delete.setChangeType(ChangeType.DECREASING_ACCESSIBILITY_CHANGE);
SourceCodeChange result;
Insert insProtected =
findInsertOperation(
delete.getRootEntity().getType(),
delete.getRootEntity().getUniqueName(),
JavaEntityType.MODIFIERS,
"",
JavaEntityType.MODIFIER,
PROTECTED);
Insert insPrivate =
findInsertOperation(
delete.getRootEntity().getType(),
delete.getRootEntity().getUniqueName(),
JavaEntityType.MODIFIERS,
"",
JavaEntityType.MODIFIER,
PRIVATE);
if (insProtected != null) {
result =
new Update(
delete.getRootEntity(),
delete.getChangedEntity(),
insProtected.getChangedEntity(),
insProtected.getParentEntity());
fInserts.remove(insProtected);
} else if (insPrivate != null) {
result =
new Update(
delete.getRootEntity(),
delete.getChangedEntity(),
insPrivate.getChangedEntity(),
insPrivate.getParentEntity());
fInserts.remove(insPrivate);
} else {
result = delete;
}
result.setChangeType(ChangeType.DECREASING_ACCESSIBILITY_CHANGE);