Skip to content

Commit

Permalink
Fix uninitialized target field in RenameElementProcessor2 #3132
Browse files Browse the repository at this point in the history
The target field in RenameElementProcessor2 is not initialized, since it
is shadowed by a local variable in initialize(IRenameElementContext).
As a result, the target passed to IRenameNameValidator.validate(...) in
validateNewName(String) is always null.

This commit removes the local variable, so that the field is properly
initialized instead.

Signed-off-by: Martin Jobst <[email protected]>
  • Loading branch information
mx990 committed Aug 9, 2024
1 parent 2bce8b6 commit e116332
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public boolean initialize(IRenameElementContext renameElementContext) {
}

resourceSet = resourceSetProvider.get(project);
EObject target = resourceSet.getEObject(renameElementContext.getTargetElementURI(), true);
target = resourceSet.getEObject(renameElementContext.getTargetElementURI(), true);
if (target == null) {
status.add(RefactoringIssueAcceptor.Severity.ERROR, "Rename target does not exist", renameElementContext.getTargetElementURI());
} else {
Expand Down

0 comments on commit e116332

Please sign in to comment.