Skip to content

An exception is thrown when no results are generated due to a division by zero in JavaParserMain.scala at line 60 #1

Description

@balfroim

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions