Config file not found exception disables PiranhaJava refactoring silently
See original GitHub issueI am trying the sample java gradle project and after running clean build piranha only removes the SAMPLE_STALE_FLAG enum but not the code checks. This is the output -
public class MyClass {
enum TestExperimentName {
//REMOVED FROM HERE BUT NOT BELOW
}
private XPTest expt;
public void foo() {
if (expt.flagEnabled(TestExperimentName.SAMPLE_STALE_FLAG)) {
System.out.println("Hello World");
}
}
public void bar() {
if (expt.flagDisabled(TestExperimentName.SAMPLE_STALE_FLAG)) {
System.out.println("Hi World");
}
}
static class XPTest {
public boolean flagEnabled(TestExperimentName x) {
return true;
}
public boolean enableFlag(TestExperimentName x) {
return true;
}
public boolean disableFlag(TestExperimentName x) {
return true;
}
public boolean flagDisabled(TestExperimentName x) {
return true;
}
}
}
Here is my gradle file - https://github.com/vihanparmar/testRepo/blob/master/test/build.gradle
Please let me know what i am doing wrong or if this is an issue.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to Fix the FileNotFoundException in Java.io - Rollbar
The FileNotFoundException is a checked exception in Java that occurs when an attempt to open a file denoted by a specified pathname fails....
Read more >Java Spring Boot config file is processed correctly despite a ...
FileNotFoundException for owners.json file despite it being read & populating database, during mvn clean install and / or mvn ...
Read more >error - Oracle Support
Encountering Error After Opted in "DISABLE MESSAGE CREDENTIALS" ... config/jps-config.xml (No such file or directory)" (Doc ID 2814602.1).
Read more >529522 – git config FileNotFoundException (used by ... - Bugs
Over the last week of normal egit 4.10 usage I have experienced 3 occurrences of FileNotFoundException on the config file in the error...
Read more >log4j config file giving FileNotFoundException - CodeRanch
I'm new to log4j and trying to configure it from an init method in a servlet, by passing a properties file to PropertyConfigurator....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Never mind, i updated piranha to 0.1.0 and it worked, thanks for the help.
I tried abosolute path too -
options.errorprone.errorproneArgs.add("-XepOpt:Piranha:Config=Users/vparmar/Documents/GitHub/testRepo/test/config/properties.json")
andoptions.errorprone.errorproneArgs.add("-XepOpt:Piranha:Config=/Users/vparmar/Documents/GitHub/testRepo/test/config/properties.json")
still no luck