forked from JetBrains/intellij-community
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Java Type Migration: avoid NPE when migrating enum type to something …
…else (IDEA-225806) GitOrigin-RevId: d71d68d9395c93d6346a247c7f207ae840e2fbad
- Loading branch information
1 parent
b856d0e
commit 14390e6
Showing
5 changed files
with
26 additions
and
2 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
8 changes: 8 additions & 0 deletions
8
java/typeMigration/testData/refactoring/typeMigration/migrateEnumType/after/Test.items
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,8 @@ | ||
Types: | ||
PsiField:someEnum : int | ||
|
||
Conversions: | ||
|
||
New expression type changes: | ||
Fails: | ||
SomeEnum.ENUM_VALUE_1->int |
6 changes: 6 additions & 0 deletions
6
java/typeMigration/testData/refactoring/typeMigration/migrateEnumType/after/Test.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,6 @@ | ||
class Test { | ||
private int someEnum = SomeEnum.ENUM_VALUE_1; | ||
public enum SomeEnum { | ||
ENUM_VALUE_1, ENUM_VALUE_2 | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
java/typeMigration/testData/refactoring/typeMigration/migrateEnumType/before/Test.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,6 @@ | ||
class Test { | ||
private SomeEnum someEnum = SomeEnum.ENUM_VALUE_1; | ||
public enum SomeEnum { | ||
ENUM_VALUE_1, ENUM_VALUE_2 | ||
} | ||
} |