Community
Participate
Working Groups
When MalformedTreeException happens during the formatting, the returned TextEdit is null, hence nothing is changed. Open an error dialog to display this kind of problems sounds a little bit too worrying for the user as there's neither loss of data nor breakage of other functionalities. An good example of such kind of situation is highlighted by the bug 237592. Because the save action activates the formatter, the user gets an error dialog while saving its file which unnecessarily and wrongly makes him believe that his changes were not saved... I think that logging the exception instead opening an error dialog would be enough for this kind of problems.
Sounds good. Benno, any objection? Considering for 3.4.2.
(In reply to comment #1) > Sounds good. Benno, any objection? Well, it's better then nothing, but not the nice thing to do. But I would do it only for 3.4.2 and not for 3.5. > wrongly makes him believe that his changes were not saved... If the shown error dialog leaves the impression that the file might not be saved then we should improve the dialogs message because the file is always saved, even with a failed save action.
(In reply to comment #2) > (In reply to comment #1) > > Sounds good. Benno, any objection? > > Well, it's better then nothing, but not the nice thing to do. But I would do it > only for 3.4.2 and not for 3.5. > That's the goal of this bug. The exception will no longer occur for 3.5 as original bug 234583 has been fixed... > > wrongly makes him believe that his changes were not saved... > > If the shown error dialog leaves the impression that the file might not be > saved then we should improve the dialogs message because the file is always > saved, even with a failed save action. > That's the problem of the opened error dialog just after having pressed on the save button... This kind of dialog is usually used in a panic mode: something bad happened while doing this and the only thing we was able to do was to signal the error to the user... Whatever you can say in this dialog will not make me (as a user) comfortable with the fact that my file was well saved...
> Whatever you can say in this dialog will not >make me (as a user) comfortable with the fact that my file was well saved... Are you saying you don't read dialog texts? Come on ;-)
>When MalformedTreeException happens during the formatting, the returned >TextEdit is null, There is no returned edit as we get an exception. We would have to add special code for MalformedTreeException during format on save. That's not something I want to do because: - later you get bug reports with .log entries but the user cannot tell us when/why it happened - the user might be interested that his file (or changed lines) weren't formatted correctly I agree that the error dialog is irritating and in 3.5 its layout is broken. Fixed in HEAD. Available in builds > N20080901-2000.
Created attachment 111413 [details] Fix
Fixed in 3.4.2.
Verified in M20081023-1830 that the dialog looks good.
Verified using I20081029-1823 with older version of JDT Core in order to trigger bug 237592.