An exception is thrown when no results are generated due to a division by zero in JavaParserMain.scala at line 60
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 50/100
Research direction
Start in javaparser/src/main/scala/com/virtuslab/semanticgraphs/javaparser/JavaParserMain.scala at line 60, where the failure percentage is calculated, and trace how generateSemanticGraphFiles is called from ScgCli.scala. Handle the zero-results case with a clear message instead of an ArithmeticException, and verify that normal result generation still reports its percentage.
Written by the indexing model from the issue text.
Description
In this file, there is an instruction that shows the percentage of failed results compared to the total number of results generated. However, the total can be zero. It would be really helpful to have a message that says that no results have been generated, as it can be quite confusing to encounter a "dividing by zero" exception (see below) when using the tool for the first time.
java.lang.ArithmeticException: / by zero
at com.virtuslab.semanticgraphs.javaparser.JavaParserMain$.generateSemanticGraphFiles(JavaParserMain.scala:60)
at org.virtuslab.semanticgraphs.analytics.cli.ScgCli.generate(ScgCli.scala:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at picocli.CommandLine.executeUserObject(CommandLine.java:2066)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at picocli.CommandLine.execute(CommandLine.java:2170)
at org.virtuslab.semanticgraphs.analytics.cli.ScgCli$.main(ScgCli.scala:335)
at org.virtuslab.semanticgraphs.analytics.cli.ScgCli.main(ScgCli.scala)
- Dominant language
- Scala
- Stars
- 26
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ergoplatform/ergodocs#614 ·
-
area:ci enhancement requires-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/datafusion-comet#6078 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
[VL] madvise(WILLNEED) call fails in MmapFileStream because of wrong calculation of fetching length Openbug triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
chipsalliance/rocket-chip#3831 ·