#154 MiscUtilities.openInDesktop() in jEdit 5.0

for 5.0.x
Alan Ezust

Originally, I was just going to move the code out of the browser.actions.xml file and into MiscUtilities
but during testing, I found and fixed a couple of bugs in related to files with spaces in the names.

So revision # 21791 moves the code into MiscUtilities (which is a new API) and also fixes some of the code
that was there before. I would like to put this into jEdit 5.0 so that plugins can use it sooner (esp. projectviewer which has duplicate bad code right now).


  • Alan Ezust
    Alan Ezust

    I removed some unnecessary code in rev# 21792 so you can apply that as part of this merge request too.

  • Alan, so you suggest that 5.0pre1 (already released) have different api than 5.0 or 5.0pre2? I remember someone said recently that it shouldn't be done, but I don't see any written rule about that.

  • Alan Ezust
    Alan Ezust

    I hope an exception can be made in this case.
    I was just a day late :-)

  • Alan Ezust
    Alan Ezust

    Rev#21801 improves the API docs for the function.

  • Kazutoshi was not sure whether to agree on this merge. I am going to commit it, but will wait a few days for possible objections.

    • assigned_to: nobody --> jarekczek
  • There is a problem with method's signature, maybe with javadoc.

    @throws IOException if the path is not valid or something else is not working

    Usually the exception will not be thrown because the string is simply passed to a native command. Only in

    // I don't know what platform it is...

    there may really be IOException raised. But that's the border case, as all known operating systems don't reach this line.

    I think it would be better to remove this misleading exception from signature. Capture it and report immediately, maybe returning true on success, false on failure.

    Copying the code from action to api seems to be not enough in this case. Api needs additional care.

  • Alan Ezust
    Alan Ezust

    That is incorrect.
    An IOException can also be thrown from Runtime.exec(). if for example, command is not found or filename is bad.

    • assigned_to: jarekczek --> nobody
  • Alan, with such hasty comment and this level of your verbosity I see no way to work on this ticket. And my opinion about this new api in 5.1 remains negative.

  • Alan Ezust
    Alan Ezust

    Rev# 21880 should address all your issues.

    • assigned_to: nobody --> jarekczek
    • status: open --> closed-accepted
  • Applied to 5.0 as r21894. It would be easier if there were no other changes to the method applied inbetween and no whitespace changes in different places.