Drop unused DiffNotApplicableException#4086
Conversation
This exception type was introduced along with Refaster in 01f7136, but no instance is ever instantiated.
Stephan202
left a comment
There was a problem hiding this comment.
I noticed this while working on #4085. It could of course be that some Google-internal code does reference this type, in which case this PR may not make sense or require significant modification.
| logger.log(Level.INFO, String.format("Completed %d files in %s", completed, stopwatch)); | ||
| } | ||
| } catch (IOException | DiffNotApplicableException e) { | ||
| } catch (IOException e) { |
There was a problem hiding this comment.
Which raises the question: was the following perhaps intended?
| } catch (IOException e) { | |
| } catch (IOException | RuntimeException e) { |
(But if after all those years the current code sufficed... 🤷)
That is unfortunately the case, but I will take a closer look at whether the single place that's instantiating this exception type still makes sense |
We have a another I don't have strong opinions about this :) I think we could either
|
|
Interesting! I don't immediately have a strong opinion either. Some initial thoughts:
So all-in-all I'm tending to "let's keep it simple" and go for option (2), but that does assume of course that the Google-internal diff is no longer relied upon. †: Distantly related here is #4088, but as far as I can tell the general case of chaining dependent bug checkers will always require an intermediate compilation phase, in which case there's no reason to assume that the replacements emitted by each round can't be accurate, relative to the source code produced by the previous round. |
|
Thanks for thinking this through! I am leaning towards (2).
I think that is an extremely valid argument :) I think the motivation might have been for iterating on new checks, where it's useful to apply the fixes we can even if some of them are bogus. We'd also want to fix the bad findings, but it takes some time to run the check across the depot, and being able to apply a subset of the fixes in that case cuts down on the number of iterations. But (2) is still fine for that. |
Let any IndexOutOfBoundsExceptions propagate, and handle RuntimeException in DiffApplier. See discussion in #4086. PiperOrigin-RevId: 566971731
Let any IndexOutOfBoundsExceptions propagate, and handle RuntimeException in DiffApplier. See discussion in #4086. PiperOrigin-RevId: 566971731
Let any IndexOutOfBoundsExceptions propagate, and handle RuntimeException in DiffApplier. See discussion in #4086. PiperOrigin-RevId: 567323714
|
DiffNotApplicableException has been removed in 737dec0. Thanks for pointing this out! |
Thanks for the input @Stephan202! |
This exception type was introduced along with Refaster in
01f7136, but no instance is ever
instantiated.