Skip to content

Commit 8bf4698

Browse files
guluo2016Apache9
authored andcommitted
HBASE-29273 Remove deprecated boxed primitive constructors in some test classes (#6949)
Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit d84824b)
1 parent 21f546a commit 8bf4698

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiParallel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ private static byte[][] makeKeys() {
143143
byte[] k = starterKeys[kIdx];
144144
byte[] cp = new byte[k.length + 1];
145145
System.arraycopy(k, 0, cp, 0, k.length);
146-
cp[k.length] = new Integer(i % 256).byteValue();
146+
cp[k.length] = (byte) (i % 256);
147147
keys.add(cp);
148148
}
149149

@@ -156,7 +156,7 @@ private static byte[][] makeKeys() {
156156
byte[] k = starterKeys[kIdx];
157157
byte[] cp = new byte[k.length + 1];
158158
System.arraycopy(k, 0, cp, 0, k.length);
159-
cp[k.length] = new Integer(i % 256).byteValue();
159+
cp[k.length] = (byte) (i % 256);
160160
keys.add(cp);
161161
}
162162
return keys.toArray(new byte[][] { new byte[] {} });

hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestTimestampsFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public void testMultiColumns() throws Exception {
192192
ht.put(p);
193193

194194
ArrayList<Long> timestamps = new ArrayList<>();
195-
timestamps.add(new Long(3));
195+
timestamps.add(3L);
196196
TimestampsFilter filter = new TimestampsFilter(timestamps);
197197

198198
Get g = new Get(Bytes.toBytes("row"));

hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileDataBlockEncoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public static Collection<Object[]> getAllConfigurations() {
238238
HFileDataBlockEncoder dbe = (diskAlgo == DataBlockEncoding.NONE)
239239
? NoOpDataBlockEncoder.INSTANCE
240240
: new HFileDataBlockEncoderImpl(diskAlgo);
241-
configurations.add(new Object[] { dbe, new Boolean(includesMemstoreTS) });
241+
configurations.add(new Object[] { dbe, includesMemstoreTS });
242242
}
243243
}
244244

hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestDeadServer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ public void testSortExtract() {
125125
Assert.assertEquals(2, copy.size());
126126

127127
Assert.assertEquals(hostname1234, copy.get(0).getFirst());
128-
Assert.assertEquals(new Long(2L), copy.get(0).getSecond());
128+
Assert.assertEquals(Long.valueOf(2L), copy.get(0).getSecond());
129129

130130
Assert.assertEquals(hostname12345, copy.get(1).getFirst());
131-
Assert.assertEquals(new Long(3L), copy.get(1).getSecond());
131+
Assert.assertEquals(Long.valueOf(3L), copy.get(1).getSecond());
132132

133133
EnvironmentEdgeManager.reset();
134134
}

hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScannerWithBulkload.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ private Path writeToHFile(long l, String hFilePath, String pathStr, boolean nati
177177
// Set a big MAX_SEQ_ID_KEY. Scan should not look at this seq id in a bulk loaded file.
178178
// Scan should only look at the seq id appended at the bulk load time, and not skip its
179179
// kv.
180-
writer.appendFileInfo(MAX_SEQ_ID_KEY, Bytes.toBytes(new Long(9999999)));
180+
writer.appendFileInfo(MAX_SEQ_ID_KEY, Bytes.toBytes(Long.valueOf(9999999)));
181181
} else {
182182
writer.appendFileInfo(BULKLOAD_TIME_KEY, Bytes.toBytes(EnvironmentEdgeManager.currentTime()));
183183
}

hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ public void testLogRollOnPipelineRestart() throws Exception {
345345
@Override
346346
public void preLogRoll(Path oldFile, Path newFile) {
347347
LOG.debug("preLogRoll: oldFile=" + oldFile + " newFile=" + newFile);
348-
preLogRolledCalled.add(new Integer(1));
348+
preLogRolledCalled.add(1);
349349
}
350350

351351
@Override

0 commit comments

Comments
 (0)