question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Config file not found exception disables PiranhaJava refactoring silently

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vihanparmarcommented, Jul 8, 2020

Never mind, i updated piranha to 0.1.0 and it worked, thanks for the help.

0reactions
vihanparmarcommented, Jul 8, 2020

I tried abosolute path too - options.errorprone.errorproneArgs.add("-XepOpt:Piranha:Config=Users/vparmar/Documents/GitHub/testRepo/test/config/properties.json") and

options.errorprone.errorproneArgs.add("-XepOpt:Piranha:Config=/Users/vparmar/Documents/GitHub/testRepo/test/config/properties.json") still no luck

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found