Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Critical Exception thrown with Java code on Intellij Idea 2021 #215

Closed
ashaychangwani opened this issue Aug 2, 2021 · 2 comments
Closed

Comments

@ashaychangwani
Copy link

Critical error(epi.test_framework.minimal_json.ParseException): Unexpected end of input at 1:1
epi.test_framework.minimal_json.ParseException: Unexpected end of input at 1:1
	at epi.test_framework.minimal_json.JsonParser.error(JsonParser.java:478)
	at epi.test_framework.minimal_json.JsonParser.expected(JsonParser.java:472)
	at epi.test_framework.minimal_json.JsonParser.readValue(JsonParser.java:181)
	at epi.test_framework.minimal_json.JsonParser.parse(JsonParser.java:140)
	at epi.test_framework.minimal_json.JsonParser.parse(JsonParser.java:73)
	at epi.test_framework.minimal_json.Json.parse(Json.java:286)
	at epi.test_framework.GenericTest.updateTestPassed(GenericTest.java:181)
	at epi.test_framework.GenericTest.runTests(GenericTest.java:152)
	at epi.test_framework.GenericTest.genericTestMain(GenericTest.java:67)
	at epi.test_framework.GenericTest.runFromAnnotations(GenericTest.java:233)
	at epi.ValidIpAddresses.main(ValidIpAddresses.java:47)

The above error is thrown when I run the following code:

@EpiTest(testDataFile = "valid_ip_addresses.tsv")

  public static List<String> getValidIpAddress(String s) {
    return helper(new StringBuilder(s), 0, 0);
  }
  static List<String> helper(StringBuilder s, int done, int index){
    List<String> list = new ArrayList<>();
    if(index>=s.length())
      return list;
    if(done==3) {
      if (s.substring(index).length()<=3 && Integer.parseInt(s.substring(index)) < 256 && !(s.charAt(index)=='0' && s.substring(index).length()>1))
        list = List.of(s.toString());
      return list;
    }
    for(int i=1;i<=3;i++){
      if(index+i<s.length() && Integer.parseInt(s.substring(index, index+i))<256){
        list.addAll(helper(new StringBuilder(s).insert(index+i,"."), done+1, index+i+1));
      }
      if(s.charAt(index)=='0')
        break;
    }
    return list;
  }

All test cases pass, but during the calculation of the result, the error gets thrown. Please let me know if anymore details are required.

@ashaychangwani
Copy link
Author

My apologies, seemed to happen because problem_mapping.js got replaced with a blank file. No clue how that happened. Not an issue with the repo.

@zorro786
Copy link

@ashaychangwani This looks like an actual issue, happened with me too several times. Even after replacing the file, over time this error appears again - I verified today after replacing the mapping file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants