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

Replace bare literals #502

Merged
merged 2 commits into from
Oct 17, 2017
Merged

Conversation

JamieMagee
Copy link
Member

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);

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-io
Copy link

codecov-io commented Sep 22, 2017

Codecov Report

Merging #502 into dev will decrease coverage by 0.01%.
The diff coverage is 25%.

Impacted file tree graph

@@             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
Flag Coverage Δ Complexity Δ
#JDBC41 46.32% <25%> (-0.08%) 2202 <0> (-3)
#JDBC42 46.44% <25%> (-0.02%) 2214 <0> (+1)
Impacted Files Coverage Δ Complexity Δ
...soft/sqlserver/jdbc/SQLServerBulkCopy42Helper.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...oft/sqlserver/jdbc/SQLServerParameterMetaData.java 24.46% <0%> (ø) 31 <0> (ø) ⬇️
...in/java/com/microsoft/sqlserver/jdbc/IOBuffer.java 54.34% <100%> (+0.06%) 0 <0> (ø) ⬇️
...c/main/java/com/microsoft/sqlserver/jdbc/Util.java 59.43% <0%> (-1.09%) 88% <0%> (-2%)
...m/microsoft/sqlserver/jdbc/SQLServerResultSet.java 32.76% <0%> (-0.21%) 241% <0%> (-1%)
...om/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java 52.64% <0%> (-0.07%) 240% <0%> (+1%)
...rc/main/java/com/microsoft/sqlserver/jdbc/dtv.java 63.11% <0%> (+0.18%) 0% <0%> (ø) ⬇️
...om/microsoft/sqlserver/jdbc/SimpleInputStream.java 52.59% <0%> (+1.48%) 12% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 24dfd49...d94cccc. Read the comment docs.

@nsidhaye
Copy link
Contributor

@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;
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@AfsanehR-zz AfsanehR-zz merged commit e51ea73 into microsoft:dev Oct 17, 2017
@lilgreenbird lilgreenbird added this to Closed/Merged PRs in MSSQL JDBC Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
MSSQL JDBC
  
Closed/Merged PRs
Development

Successfully merging this pull request may close these issues.

None yet

7 participants