You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Renaming a field of a @value class may refactor code using the field via a getter to incorrect code.
This happens if the field is accessed in a class, not via 'this' and it's using the getter, "o.getId()" for a field 'id' -- this may change to "this.getIdRenamed()" when id is renamed.
Version information
IDEA Version: 2018.1 and 2018.2
JDK Version: 1.8.0_162
OS Type & Version: MacOSX 10.13.6
Lombok Plugin Version: 0.19-LATEST
Lombok Dependency Version: 1.18.0
Steps to reproduce
Point at "Tile tile" and rename 'tile' to 'xyz'.
The line 'o.getTile()' will be replaced incorrectly with 'this.getXyz()'
package com.tomtom.speedtools.geometry;
import com.google.common.collect.ComparisonChain;
import lombok.NonNull;
import lombok.Value;
class Test {
class Tile {
int id;
int getId() {
return id;
}
}
@Value // <-- This needs to be Lombok supplied
private static class TileIdFormatAndBaseLevel implements Comparable<TileIdFormatAndBaseLevel> {
@NonNull
Tile tile; // <-- If you rename this 'tile' to 'xyz', the o.getTile() below becomes this.getXYZ()
@Override
public int compareTo(@NonNull final TileIdFormatAndBaseLevel o) {
return ComparisonChain.start()
.compare(o.getTile().getId(), tile.getId())
.result();
}
}
}
The text was updated successfully, but these errors were encountered:
* added example for issue #512
* fix removing of field annotations during delombok
* cleanup code
* added to changelog #530
* added support for ImplicitResourceCloser extension point for @cleanup#287
* master is now for: up from 2018.1 IntelliJ builds
Renaming a field of a @value class may break code
Renaming a field of a @value class may refactor code using the field via a getter to incorrect code.
This happens if the field is accessed in a class, not via 'this' and it's using the getter, "o.getId()" for a field 'id' -- this may change to "this.getIdRenamed()" when id is renamed.
Version information
Steps to reproduce
Point at "Tile tile" and rename 'tile' to 'xyz'.
The line 'o.getTile()' will be replaced incorrectly with 'this.getXyz()'
The text was updated successfully, but these errors were encountered: