-
Notifications
You must be signed in to change notification settings - Fork 745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop unused DiffNotApplicableException
#4086
Drop unused DiffNotApplicableException
#4086
Conversation
This exception type was introduced along with Refaster in 01f7136, but no instance is ever instantiated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -123,7 +123,7 @@ public void run() { | |||
if (completed % 100 == 0) { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.