-
Notifications
You must be signed in to change notification settings - Fork 3
Minor auto-refactor code cleanup on a massive scale #1376
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
Conversation
| // msg.append("There are no missing files"); | ||
|
|
||
| return new HtmlView(msg.toString()); | ||
| return new HtmlView(msg); |
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.
Is msg ever set to a value? It looks like the code that did set it has been commented out.
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.
Nope, nor has it been in a long time (if ever). I simplified the code a bit more.
| String sb = safeAppend(rs, "Remark", "remark") + | ||
| safeAppend(rs, "Entered by", "performedby"); | ||
| return sb; |
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.
Not an ask for a change, just a comment.
I guess IntelliJ could have said:
return safeAppend(rs, "Remark", "remark") +
safeAppend(rs, "Entered by", "performedby");
And pointed out the Container c & boolean redacted are unused.
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 simplified to the return. Those two arguments are part of the method on the interface so IntelliJ doesn't complain about them being unused here.
| for (Ext4FieldRef field : _ext4Helper.componentQuery("field[fieldName='exclude']", Ext4FieldRef.class)) | ||
| { | ||
| Assert.assertEquals(field.getValue(), true); | ||
| Assert.assertEquals(true, field.getValue()); |
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.
Maybe Assert.assertTrue?
Just another comment on IntelliJ choices.
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.
field.getValue() returns Object so IntelliJ doesn't try to simplify the assert
# Conflicts: # onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRController.java
Rationale
We can cleanup tens of thousands of warnings across our codebase with IntelliJ's autorefactors. In some cases, this adopts newer, leaner syntax. In others, it simply removes code that's not serving any purpose.
Related Pull Requests
Changes