-
Notifications
You must be signed in to change notification settings - Fork 426
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
Replace bare literals #502
Conversation
Replace bare literals with magic constants. For example: `cal.set(1, 1, 577738, 0, 0, 0);` becomes `cal.set(1, Calendar.FEBRUARY, 577738, 0, 0, 0);`
Codecov Report
@@ Coverage Diff @@
## dev #502 +/- ##
============================================
- Coverage 46.64% 46.62% -0.02%
+ Complexity 2218 2217 -1
============================================
Files 108 108
Lines 25279 25279
Branches 4167 4167
============================================
- Hits 11791 11787 -4
- Misses 11463 11464 +1
- Partials 2025 2028 +3
Continue to review full report at Codecov.
|
@JamieMagee : Good. It will make code more readable. |
@@ -788,7 +788,7 @@ public boolean isWrapperFor(Class<?> iface) throws SQLException { | |||
} | |||
catch (SQLException e) { | |||
SQLServerException.makeFromDriverError(con, stmtParent, e.toString(), null, false); | |||
return 0; | |||
return ParameterMetaData.parameterModeUnknown; |
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.
@JamieMagee You could avoid using 'ParameterMetaData' interface reference explicitly here since SQLServerParameterMetadata already implements it. The constants are available directly.
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
Replace bare literals with magic constants. For example:
cal.set(1, 1, 577738, 0, 0, 0);
becomes
cal.set(1, Calendar.FEBRUARY, 577738, 0, 0, 0);