walkmod / walkmod-core

walkmod: an open source tool to fix coding style issues
http://www.walkmod.com
GNU Lesser General Public License v3.0
154 stars 23 forks source link

CompilationUnit.removeChild() calls Node.updateReferences() with a boolean instead of the child object #88

Open vladislav-knoll opened 5 years ago

vladislav-knoll commented 5 years ago

When removing a child of a CompilationUnit (e.g. an ImportDeclaration), the CompilationUnit passes the result of List.remove() to Node.updateReferences(); see below.

boolean result = false;
...
if (result) {
  updateReferences(result);
}

Node.updateReferences() checks whether the argument is either a SymbolReference or a SymbolDefinition and updates the usages accordingly. For ImportDeclarations which implement SymbolDefinition this does not work as expected