-
Notifications
You must be signed in to change notification settings - Fork 17
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
Simplify setting workspace metadata & add tests #694
Conversation
... in preparation for setting object admin metadata which will hopefully reuse the code
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #694 +/- ##
=============================================
+ Coverage 87.42% 87.44% +0.01%
- Complexity 5193 5195 +2
=============================================
Files 223 223
Lines 17319 17309 -10
Branches 2546 2545 -1
=============================================
- Hits 15141 15135 -6
+ Misses 1711 1708 -3
+ Partials 467 466 -1 |
|
||
throws WorkspaceCommunicationException, CorruptWorkspaceDBException { | ||
// TODO NOW CODE integrate keys to remove (below) into this method and do it all in | ||
// one shot |
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.
mysterious space?
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 tabbed it in to make it clear it's a continuation of the TODO
if (ur.getModifiedCount() == 1) { //ok, it worked | ||
return time; | ||
} else if (attempts >= maxattempts) { | ||
throw new WorkspaceCommunicationException( | ||
String.format("Failed to update metadata %s times", attempts)); | ||
} else { | ||
return null; | ||
} |
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.
if you were having an anti-indentation day, you could do:
if (ur.getModifiedCount() == 1) { //ok, it worked
return time;
}
if (attempts >= maxattempts) {
throw new WorkspaceCommunicationException(
String.format("Failed to update metadata %s times", attempts));
}
return null;
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 actually prefer the else
s here, makes things a bit easier to read for me. Not a big deal though
... in preparation for setting object admin metadata which will hopefully reuse the code