Skip to content
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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void handleFix(Fix fix) {
}

@Override
public void applyDifferences(SourceFile sourceFile) throws DiffNotApplicableException {
public void applyDifferences(SourceFile sourceFile) {
if (!importsToAdd.isEmpty() || !importsToRemove.isEmpty()) {
ImportStatements importStatements = ImportStatements.create(compilationUnit, importOrganizer);
importStatements.addAll(importsToAdd);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ public interface Diff {
/** Gets the name of the file this difference applies to */
String getRelevantFileName();

/**
* Applies this difference to the supplied {@code sourceFile}.
*
* @throws DiffNotApplicableException if the diff could not be applied to the source file
*/
/** Applies this difference to the supplied {@code sourceFile}. */
void applyDifferences(SourceFile sourceFile);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Copy link
Contributor Author

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?

Suggested change
} catch (IOException e) {
} catch (IOException | RuntimeException e) {

(But if after all those years the current code sufficed... 🤷)

logger.log(Level.WARNING, "Failed to apply diff to file " + diff.getRelevantFileName(), e);
diffsFailedPaths.add(diff.getRelevantFileName());
} finally {
Expand Down

This file was deleted.

Loading