-
Notifications
You must be signed in to change notification settings - Fork 3.3k
HBASE-29273 Remove deprecated boxed primitive constructors in some test classes #6949
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
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Pull Request Overview
This PR removes the use of deprecated boxed primitive constructors in various test classes as part of HBASE-29273, ensuring more modern and idiomatic Java usage in tests.
- Replaces deprecated constructors in TestLogRolling, TestScannerWithBulkload, TestDeadServer, TestHFileDataBlockEncoder, TestTimestampsFilter, and TestMultiParallel.
- Updates object boxing to use autoboxing or factory methods such as Integer.valueOf and Long.valueOf.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java | Removed deprecated new Integer(1) usage in favor of literal 1. |
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java | Replaced new Long(9999999) with Long.valueOf(9999999). |
hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDeadServer.java | Updated new Long values to Long.valueOf for assertions. |
hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileDataBlockEncoder.java | Removed deprecated new Boolean(...) usage by directly passing includesMemstoreTS. |
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTimestampsFilter.java | Changed new Long(3) to 3L in timestamp addition. |
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiParallel.java | Replaced new Integer(...) with Integer.valueOf(...). |
Comments suppressed due to low confidence (2)
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiParallel.java:146
- [nitpick] Consider simplifying the integer to byte conversion by using a direct cast, e.g., (byte)(i % 256), which improves readability.
cp[k.length] = Integer.valueOf(i % 256).byteValue();
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiParallel.java:159
- [nitpick] Consider simplifying the integer to byte conversion by using a direct cast, e.g., (byte)(i % 256), which improves readability.
cp[k.length] = Integer.valueOf(i % 256).byteValue();
@@ -143,7 +143,7 @@ private static byte[][] makeKeys() { | |||
byte[] k = starterKeys[kIdx]; | |||
byte[] cp = new byte[k.length + 1]; | |||
System.arraycopy(k, 0, cp, 0, k.length); | |||
cp[k.length] = new Integer(i % 256).byteValue(); | |||
cp[k.length] = Integer.valueOf(i % 256).byteValue(); |
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.
Thanks @Apache9 for triggering the GitHub Copilot review!
These nitpicks seem reasonable in here and i will apply the changes.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
60cb790
to
ff45659
Compare
Squashed the commits and trigger a rebuild. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
…st classes (#6949) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit d84824b)
…st classes (#6949) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit d84824b)
…st classes (#6949) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit d84824b)
…st classes (#6949) Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit d84824b)
Details see: HBASE-29273