8322782: Clean up usages of unnecessary fully qualified class name "java.util.Arrays"

Reviewed-by: alanb, aivanov
This commit is contained in:
Matthias Baesken 2024-01-04 08:06:14 +00:00
parent 4db7a1c3bb
commit 1369c545ac
9 changed files with 29 additions and 29 deletions

View File

@ -1,6 +1,6 @@
/* /*
* *
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -1716,7 +1716,7 @@ public class Intro extends JPanel {
this.beginning = beg; this.beginning = beg;
this.ending = end; this.ending = end;
fm = surf.getMetrics(font); fm = surf.getMetrics(font);
java.util.Arrays.sort(members); Arrays.sort(members);
cast.add("CONTRIBUTORS"); cast.add("CONTRIBUTORS");
cast.add(" "); cast.add(" ");
cast.addAll(Arrays.asList(members)); cast.addAll(Arrays.asList(members));

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -85,7 +85,7 @@ final class DESKey implements SecretKey {
// Use the cleaner to zero the key when no longer referenced // Use the cleaner to zero the key when no longer referenced
final byte[] k = this.key; final byte[] k = this.key;
CleanerFactory.cleaner().register(this, CleanerFactory.cleaner().register(this,
() -> java.util.Arrays.fill(k, (byte)0x00)); () -> Arrays.fill(k, (byte)0x00));
} }
public byte[] getEncoded() { public byte[] getEncoded() {
@ -136,7 +136,7 @@ final class DESKey implements SecretKey {
byte[] thatKey = that.getEncoded(); byte[] thatKey = that.getEncoded();
boolean ret = MessageDigest.isEqual(this.key, thatKey); boolean ret = MessageDigest.isEqual(this.key, thatKey);
java.util.Arrays.fill(thatKey, (byte)0x00); Arrays.fill(thatKey, (byte)0x00);
return ret; return ret;
} finally { } finally {
// prevent this from being cleaned for the above block // prevent this from being cleaned for the above block
@ -168,7 +168,7 @@ final class DESKey implements SecretKey {
// Use the cleaner to zero the key when no longer referenced // Use the cleaner to zero the key when no longer referenced
final byte[] k = this.key; final byte[] k = this.key;
CleanerFactory.cleaner().register(this, CleanerFactory.cleaner().register(this,
() -> java.util.Arrays.fill(k, (byte)0x00)); () -> Arrays.fill(k, (byte)0x00));
} }
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -87,7 +87,7 @@ final class DESedeKey implements SecretKey {
// Use the cleaner to zero the key when no longer referenced // Use the cleaner to zero the key when no longer referenced
final byte[] k = this.key; final byte[] k = this.key;
CleanerFactory.cleaner().register(this, CleanerFactory.cleaner().register(this,
() -> java.util.Arrays.fill(k, (byte)0x00)); () -> Arrays.fill(k, (byte)0x00));
} }
public byte[] getEncoded() { public byte[] getEncoded() {
@ -137,7 +137,7 @@ final class DESedeKey implements SecretKey {
byte[] thatKey = that.getEncoded(); byte[] thatKey = that.getEncoded();
boolean ret = MessageDigest.isEqual(this.key, thatKey); boolean ret = MessageDigest.isEqual(this.key, thatKey);
java.util.Arrays.fill(thatKey, (byte)0x00); Arrays.fill(thatKey, (byte)0x00);
return ret; return ret;
} finally { } finally {
// prevent this from being cleaned for the above block // prevent this from being cleaned for the above block
@ -162,7 +162,7 @@ final class DESedeKey implements SecretKey {
} }
byte[] temp = key; byte[] temp = key;
this.key = temp.clone(); this.key = temp.clone();
java.util.Arrays.fill(temp, (byte)0x00); Arrays.fill(temp, (byte)0x00);
DESKeyGenerator.setParityBit(key, 0); DESKeyGenerator.setParityBit(key, 0);
DESKeyGenerator.setParityBit(key, 8); DESKeyGenerator.setParityBit(key, 8);
@ -171,7 +171,7 @@ final class DESedeKey implements SecretKey {
// Use the cleaner to zero the key when no longer referenced // Use the cleaner to zero the key when no longer referenced
final byte[] k = this.key; final byte[] k = this.key;
CleanerFactory.cleaner().register(this, CleanerFactory.cleaner().register(this,
() -> java.util.Arrays.fill(k, (byte)0x00)); () -> Arrays.fill(k, (byte)0x00));
} }
/** /**

View File

@ -84,7 +84,7 @@ final class PBEKey implements SecretKey {
// Use the cleaner to zero the key when no longer referenced // Use the cleaner to zero the key when no longer referenced
final byte[] k = this.key; final byte[] k = this.key;
cleanable = CleanerFactory.cleaner().register(this, cleanable = CleanerFactory.cleaner().register(this,
() -> java.util.Arrays.fill(k, (byte)0x00)); () -> Arrays.fill(k, (byte)0x00));
} }
public byte[] getEncoded() { public byte[] getEncoded() {
@ -196,7 +196,7 @@ final class PBEKey implements SecretKey {
// Use cleaner to zero the key when no longer referenced // Use cleaner to zero the key when no longer referenced
final byte[] k = this.key; final byte[] k = this.key;
cleanable = CleanerFactory.cleaner().register(this, cleanable = CleanerFactory.cleaner().register(this,
() -> java.util.Arrays.fill(k, (byte)0x00)); () -> Arrays.fill(k, (byte)0x00));
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -190,7 +190,7 @@ class Invokers {
private boolean checkInvoker(MethodHandle invoker) { private boolean checkInvoker(MethodHandle invoker) {
assert(targetType.invokerType().equals(invoker.type())) assert(targetType.invokerType().equals(invoker.type()))
: java.util.Arrays.asList(targetType, targetType.invokerType(), invoker); : Arrays.asList(targetType, targetType.invokerType(), invoker);
assert(invoker.internalMemberName() == null || assert(invoker.internalMemberName() == null ||
invoker.internalMemberName().getMethodType().equals(targetType)); invoker.internalMemberName().getMethodType().equals(targetType));
assert(!invoker.isVarargsCollector()); assert(!invoker.isVarargsCollector());
@ -200,7 +200,7 @@ class Invokers {
private boolean checkVarHandleInvoker(MethodHandle invoker) { private boolean checkVarHandleInvoker(MethodHandle invoker) {
MethodType invokerType = targetType.insertParameterTypes(0, VarHandle.class); MethodType invokerType = targetType.insertParameterTypes(0, VarHandle.class);
assert(invokerType.equals(invoker.type())) assert(invokerType.equals(invoker.type()))
: java.util.Arrays.asList(targetType, invokerType, invoker); : Arrays.asList(targetType, invokerType, invoker);
assert(invoker.internalMemberName() == null || assert(invoker.internalMemberName() == null ||
invoker.internalMemberName().getMethodType().equals(targetType)); invoker.internalMemberName().getMethodType().equals(targetType));
assert(!invoker.isVarargsCollector()); assert(!invoker.isVarargsCollector());

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -1774,7 +1774,7 @@ public class BigInteger extends Number implements Comparable<BigInteger> {
carry = product >>> 32; carry = product >>> 32;
} }
if (carry == 0L) { if (carry == 0L) {
rmag = java.util.Arrays.copyOfRange(rmag, 1, rmag.length); rmag = Arrays.copyOfRange(rmag, 1, rmag.length);
} else { } else {
rmag[rstart] = (int)carry; rmag[rstart] = (int)carry;
} }
@ -1819,7 +1819,7 @@ public class BigInteger extends Number implements Comparable<BigInteger> {
rmag[0] = (int)carry; rmag[0] = (int)carry;
} }
if (carry == 0L) if (carry == 0L)
rmag = java.util.Arrays.copyOfRange(rmag, 1, rmag.length); rmag = Arrays.copyOfRange(rmag, 1, rmag.length);
return new BigInteger(rmag, rsign); return new BigInteger(rmag, rsign);
} }
@ -4593,7 +4593,7 @@ public class BigInteger extends Number implements Comparable<BigInteger> {
// Find first nonzero byte // Find first nonzero byte
for (keep = 0; keep < vlen && val[keep] == 0; keep++) for (keep = 0; keep < vlen && val[keep] == 0; keep++)
; ;
return java.util.Arrays.copyOfRange(val, keep, vlen); return Arrays.copyOfRange(val, keep, vlen);
} }
/** /**
@ -4607,7 +4607,7 @@ public class BigInteger extends Number implements Comparable<BigInteger> {
// Find first nonzero byte // Find first nonzero byte
for (keep = 0; keep < vlen && val[keep] == 0; keep++) for (keep = 0; keep < vlen && val[keep] == 0; keep++)
; ;
return keep == 0 ? val : java.util.Arrays.copyOfRange(val, keep, vlen); return keep == 0 ? val : Arrays.copyOfRange(val, keep, vlen);
} }
private static int[] stripLeadingZeroBytes(byte[] a, int from, int len) { private static int[] stripLeadingZeroBytes(byte[] a, int from, int len) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2009, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -204,7 +204,7 @@ public class FtpClient extends sun.net.ftp.FtpClient {
47, 63, 58, 64, 38, 61, 43, 36, 44}; 47, 63, 58, 64, 38, 61, 43, 36, 44};
byte[] b = chkS.getBytes(encoding); byte[] b = chkS.getBytes(encoding);
return java.util.Arrays.equals(b, chkB); return Arrays.equals(b, chkB);
} }
private class DefaultParser implements FtpDirParser { private class DefaultParser implements FtpDirParser {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1995, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1995, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -592,7 +592,7 @@ public class IndexColorModel extends ColorModel {
private BigInteger getAllValid() { private BigInteger getAllValid() {
int numbytes = (map_size+7)/8; int numbytes = (map_size+7)/8;
byte[] valid = new byte[numbytes]; byte[] valid = new byte[numbytes];
java.util.Arrays.fill(valid, (byte)0xff); Arrays.fill(valid, (byte)0xff);
valid[0] = (byte)(0xff >>> (numbytes*8 - map_size)); valid[0] = (byte)(0xff >>> (numbytes*8 - map_size));
return new BigInteger(1, valid); return new BigInteger(1, valid);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -267,7 +267,7 @@ public class ThreadImpl implements ThreadMXBean {
int length = ids.length; int length = ids.length;
long[] times = new long[length]; long[] times = new long[length];
java.util.Arrays.fill(times, -1); Arrays.fill(times, -1);
if (verified) { if (verified) {
if (length == 1) { if (length == 1) {
@ -306,7 +306,7 @@ public class ThreadImpl implements ThreadMXBean {
int length = ids.length; int length = ids.length;
long[] times = new long[length]; long[] times = new long[length];
java.util.Arrays.fill(times, -1); Arrays.fill(times, -1);
if (verified) { if (verified) {
if (length == 1) { if (length == 1) {
@ -390,7 +390,7 @@ public class ThreadImpl implements ThreadMXBean {
boolean verified = verifyThreadAllocatedMemory(ids); boolean verified = verifyThreadAllocatedMemory(ids);
long[] sizes = new long[ids.length]; long[] sizes = new long[ids.length];
java.util.Arrays.fill(sizes, -1); Arrays.fill(sizes, -1);
if (verified) { if (verified) {
getThreadAllocatedMemory1(ids, sizes); getThreadAllocatedMemory1(ids, sizes);