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

Conversation

Projects
None yet
7 participants
@JamieMagee
Member

JamieMagee commented Sep 22, 2017

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

This comment has been minimized.

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

This comment has been minimized.

Contributor

nsidhaye commented Sep 25, 2017

@JamieMagee : Good. It will make code more readable.

@cheenamalhotra cheenamalhotra added this to the 6.3.4 milestone Sep 26, 2017

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

This comment has been minimized.

@cheenamalhotra

cheenamalhotra Oct 5, 2017

Member

@JamieMagee You could avoid using 'ParameterMetaData' interface reference explicitly here since SQLServerParameterMetadata already implements it. The constants are available directly.

This comment has been minimized.

@JamieMagee

@AfsanehR AfsanehR merged commit e51ea73 into Microsoft:dev Oct 17, 2017

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla All CLA requirements met.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment