Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflict resolution failed on renaming field together with its access…
…ors #70 added equal/hashcode implementations
- Loading branch information
Michail Plushnikov
committed
Dec 28, 2014
1 parent
d7ce9e3
commit d2c2245
Showing
8 changed files
with
172 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...ugin/src/main/java/de/plushnikov/intellij/plugin/psi/LombokLightParameterListBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package de.plushnikov.intellij.plugin.psi; | ||
|
||
import com.intellij.lang.Language; | ||
import com.intellij.psi.PsiManager; | ||
import com.intellij.psi.impl.light.LightParameterListBuilder; | ||
|
||
import java.util.Arrays; | ||
|
||
public class LombokLightParameterListBuilder extends LightParameterListBuilder { | ||
public LombokLightParameterListBuilder(PsiManager manager, Language language) { | ||
super(manager, language); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
|
||
LombokLightParameterListBuilder that = (LombokLightParameterListBuilder) o; | ||
|
||
return Arrays.equals(getParameters(), that.getParameters()); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Arrays.hashCode(getParameters()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
test-manual/lombok/src/main/java/de/plushnikov/refactor/RenameBuilderClass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package de.plushnikov.refactor; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
import lombok.experimental.Builder; | ||
|
||
@Builder | ||
@Getter | ||
@Setter | ||
public class RenameBuilderClass { | ||
private int intFielda; | ||
|
||
public static void main(String[] args) { | ||
RenameBuilderClass builderClass1 = new RenameBuilderClass(2); | ||
builderClass1.getIntFielda(); | ||
|
||
RenameBuilderClass builderClass = RenameBuilderClass.builder().intFielda(123).build(); | ||
System.out.println(builderClass); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
test-manual/lombok/src/main/java/de/plushnikov/refactor/RenameDataTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package de.plushnikov.refactor; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class RenameDataTest { | ||
String data; | ||
|
||
public static RenameDataTest factoryMethod() { | ||
RenameDataTest foo = new RenameDataTest(); | ||
foo.setData("data"); | ||
System.out.println(foo.getData()); | ||
return foo; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
test-manual/lombok/src/main/java/de/plushnikov/refactor/RenameGetterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package de.plushnikov.refactor; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public class RenameGetterTest { | ||
private String someString; | ||
|
||
public static RenameGetterTest factoryMethod() { | ||
RenameGetterTest foo = new RenameGetterTest(); | ||
foo.getSomeString(); | ||
return foo; | ||
} | ||
} |