eclipse-corrosion/corrosion

NumberFormatException at ErrorLineMatcher.matchFound(ErrorLineMatcher.java:75)

Paum01 opened this issue · 6 comments

RustEclipseConsole.txt
RustEclipseLog.txt

I receive an error when running Rust within Eclipse. The error message pops up in an Eclipse dialog box and states "'Match Job has encountered a problem. An internal error occurred during Match Job." My Rust code actually runs to completion with no evident problems in Rust. It appears that the error is coming from an internal Java function within Eclipse (my project does not use Java). Someone suggested the issue may be within the interaction between Corrosion and Eclipse.

My Eclipse Project Setup:

  • Two Rust projects: One binary, one library, separate folders.
  • Library is named "Checkbook". Within Checkbook I have lib.rs and data_types.rs. mod data_types is referred to by lib.rs.
  • Binary is named "rust_proj". Main.rs in rust_proj points to Checkbook with an external crate reference. The Cargo.toml for this project also references serde version 1.0.115.

The error occurs when I run the main.rs within Eclipse. It does not appear when I run main.rs from the command line. Here is the error in the error log:

  • Plug-in: org.eclipse.core.jobs
  • Severity: Error
  • Message: "An internal error occurred during : "Match Jobs"
    Exception Stack Trace:
    java.lang.NumberFormatException: For input string: "\coding\rust\checkbook\src\data_types.rs"
    at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:68)
    at java.base/java.lang.Integer.parseInt(Integer.java:652)
    at java.base/java.lang.Integer.parseInt(Integer.java:770)
    at org.eclipse.corrosion.ErrorLineMatcher.matchFound(ErrorLineMatcher.java:75)
    at org.eclipse.ui.internal.console.PatternMatchListener.matchFound(PatternMatchListener.java:44)
    at org.eclipse.ui.internal.console.ConsolePatternMatcher$MatchJob.run(ConsolePatternMatcher.java:137)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

I am using:

  • Eclipse v 2020-06 (4.16.0), BuildID 20200615-1200
  • Rust stable build

My code is attached to this issue (please excuse its jumbled messiness - I am experimenting with the language)
rustcheckbookpgm_javamatcherror.zip

There is most likely an error line in the console starting with --> when running your program. Can you please share such lines if you see them?

There is most likely an error line in the console starting with --> when running your program. Can you please share such lines if you see them?

Mickaelistria, I do not see anything other than normal compiler warnings in the console. I took another look at the .log file and noticed a lot of additional info that might help. I copied both the console and log to text files and attached them to my original comment. Please take a look and let me know if you need anything else. Thanks for your help!

Thanks. I see lines like --> C:\coding\rust\checkbook\src\data_types.rs:2:2 make the ErrorLineMatcher fail because of : in file name (seems like this was only tested in Linux). This should be an easy fix with good ability to unit test it.

Thanks! This is the first time I've been able to help with something like this, so I am glad to be able to contribute.

Please install corrosion snapshot from https://download.eclipse.org/corrosion/snapshots/ and let us know whether your issue is fixed with it.

@akurtakov , @mickaelistria , that patch fixed the issue. Thank you!