2

I'm using a simple method that reads a location and does some stuff;

public void readMyFile(loc file) {
 M3 model = createM3FromEclipseFile(file); 
 println(model);
 // do some stuff;
}

The method fails to read a specific location file;

|plugin://rascal_eclipse/src/org/rascalmpl/eclipse/library/lang/java/jdt/m3/Core.rsc|(1019,261,<33,0>,<38,77>): IO("Could not find|project://hsqldb/doc/verbatim/src/org/hsqldb/server/WebServer.java|")

However, this file is present on my disk. All other locations from the hsqldb project or other projects I've used it with, work without any issue. Only this specific file throws an exception.

I can also use createM3FromEclipseProject to read all files in a project. This works without any issues for the hsqldb project. However, in my workflow I prefer to read an individual file via createM3FromEclipseFile. Is there a difference between createM3FromEclipseFile and createM3FromEclipseProject concerning the info it reads of an individual file?

enter image description here

Richard
  • 294
  • 1
  • 7
  • First a question; does the file exist? If you use `exists(|project://hsqldb/doc/verbatim/src/org/hsqldb/server/WebServer.java|)` does it return true and if you find the file on disk using the OS file browser, is the file there at that exact position? – Jurgen Vinju Jan 12 '21 at 13:12
  • There should not be a difference between the two functions concerning file resolution. So if this issue persists, also after a "Refresh" in the Eclipse IDE and a restart, then could you submit a bug report at https://github.com/usethesource/rascal/issues ? Thanks! – Jurgen Vinju Jan 12 '21 at 13:14
  • Thank you for your help. Yes, it returns true and is present on my disk at the exact position in the folder tree structure. I've tried 2 workstations and both had the same issue. I've also deleted and imported the hsqldb project again. In Bash, I can verify the file exists;
    hsqldb % test -f doc/verbatim/src/org/hsqldb/server/WebServer.java; echo $?
    0
    As a small note; the output of 0, means true in bash.

    rascal>import IO;
    ok
    rascal>exists(|project://hsqldb/doc/verbatim/src/org/hsqldb/server/WebServer.java|)
    bool: true
    rascal>
    – Richard Jan 12 '21 at 18:55
  • Sorry for the confusing comment. it appears no line breaks are possible in comments. – Richard Jan 12 '21 at 18:59
  • I'll try to reproduce the behavior at home. perhaps it's good if you me a link to a zip of the exact hsqldb project. – Jurgen Vinju Jan 12 '21 at 20:22

1 Answers1

3

I can confirm the behavior of createM3FromEclipseFile of the original question; however createM3FromFile works as expected.