-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
refactor: introduce ModificationStatus for better readability #3396
Conversation
@@ -133,29 +133,29 @@ protected void printSpaces(int fragmentIndex) { | |||
* false if whole `fragment` is not modified. | |||
* null if it is not possible to detect it here. Then it will be detected later. |
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.
update comment, null value is not returned anymore?
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.
done, thanks.
public boolean toBoolean() { | ||
if (this == MODIFIED) { | ||
return true; | ||
} | ||
if (this == NOT_MODIFIED) { | ||
return false; | ||
} | ||
throw new IllegalStateException(); |
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.
shouldn't this be abstract and all Enum constants implement this? Otherwise every new enum item would need a change in this method.
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.
that's not necessary to over-engineer, this enum is very unlikely to change
@@ -69,10 +69,10 @@ public boolean knowsHowToPrint(PrinterEvent event) { | |||
} | |||
|
|||
@Override | |||
protected Boolean isFragmentModified(SourceFragment fragment) { | |||
protected ModificationStatus isFragmentModified(SourceFragment fragment) { | |||
//we cannot fast detect if it is modified using our changeResolver. | |||
//So return null. The code later will detect it including modified roles. |
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.
update comment, null value is not returned anymore?
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.
done, thanks.
|
@nharrand ready for merge. |
No description provided.