-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[2020.3 compat] Add compatibility class for VMOptions
VMoptions [started to return Path](JetBrains/intellij-community@c11cdea#diff-297f3fbe14cedd57aa946f58e4b40010d9b4f4f40d5b84eec33f4ab99f0b9a91R61) instead of File. We mimic the old behavior for sdk versions < 203. PiperOrigin-RevId: 355359166
- Loading branch information
1 parent
4927cdb
commit 1798560
Showing
8 changed files
with
90 additions
and
0 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
22 changes: 22 additions & 0 deletions
22
sdkcompat/v193/com/google/idea/sdkcompat/diagnostic/VMOptionsCompat.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,22 @@ | ||
package com.google.idea.sdkcompat.diagnostic; | ||
|
||
import com.intellij.diagnostic.VMOptions; | ||
import java.io.File; | ||
import java.nio.file.Path; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
/** | ||
* Compat for {@code VMOptions}. {@link com.intellij.diagnostic.VMOptions#getWriteFile} changed its | ||
* return type from File to Path in 2020.3. #api202 | ||
*/ | ||
public class VMOptionsCompat { | ||
|
||
private VMOptionsCompat() {} | ||
|
||
// #api202: Method return type changed in 2020.3 from File to Path | ||
@Nullable | ||
public static Path getWriteFile() { | ||
File file = VMOptions.getWriteFile(); | ||
return file == null ? null : file.toPath(); | ||
} | ||
} |
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
22 changes: 22 additions & 0 deletions
22
sdkcompat/v201/com/google/idea/sdkcompat/diagnostic/VMOptionsCompat.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,22 @@ | ||
package com.google.idea.sdkcompat.diagnostic; | ||
|
||
import com.intellij.diagnostic.VMOptions; | ||
import java.io.File; | ||
import java.nio.file.Path; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
/** | ||
* Compat for {@code VMOptions}. {@link com.intellij.diagnostic.VMOptions#getWriteFile} changed its | ||
* return type from File to Path in 2020.3. #api202 | ||
*/ | ||
public class VMOptionsCompat { | ||
|
||
private VMOptionsCompat() {} | ||
|
||
// #api202: Method return type changed in 2020.3 from File to Path | ||
@Nullable | ||
public static Path getWriteFile() { | ||
File file = VMOptions.getWriteFile(); | ||
return file == null ? null : file.toPath(); | ||
} | ||
} |
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
22 changes: 22 additions & 0 deletions
22
sdkcompat/v202/com/google/idea/sdkcompat/diagnostic/VMOptionsCompat.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,22 @@ | ||
package com.google.idea.sdkcompat.diagnostic; | ||
|
||
import com.intellij.diagnostic.VMOptions; | ||
import java.io.File; | ||
import java.nio.file.Path; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
/** | ||
* Compat for {@code VMOptions}. {@link com.intellij.diagnostic.VMOptions#getWriteFile} changed its | ||
* return type from File to Path in 2020.3. #api202 | ||
*/ | ||
public class VMOptionsCompat { | ||
|
||
private VMOptionsCompat() {} | ||
|
||
// #api202: Method return type changed in 2020.3 from File to Path | ||
@Nullable | ||
public static Path getWriteFile() { | ||
File file = VMOptions.getWriteFile(); | ||
return file == null ? null : file.toPath(); | ||
} | ||
} |
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
sdkcompat/v203/com/google/idea/sdkcompat/diagnostic/VMOptionsCompat.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 com.google.idea.sdkcompat.diagnostic; | ||
|
||
import com.intellij.diagnostic.VMOptions; | ||
import java.nio.file.Path; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
/** | ||
* Compat for {@code VMOptions}. {@link VMOptions#getWriteFile} changed its return type from File to | ||
* Path in 2020.3. #api202 | ||
*/ | ||
public class VMOptionsCompat { | ||
|
||
private VMOptionsCompat() {} | ||
|
||
// #api202: Method return type changed in 2020.3 from File to Path | ||
@Nullable | ||
public static Path getWriteFile() { | ||
return VMOptions.getWriteFile(); | ||
} | ||
} |