8130022: Use Java-style array declarations consistently

Reviewed-by: coffeys
This commit is contained in:
Ivan Gerasimov 2015-07-09 10:37:07 +03:00
parent 74427b9101
commit 82f8a14808
74 changed files with 233 additions and 235 deletions

View File

@ -76,7 +76,7 @@ import sun.security.util.SecurityConstants;
public final class AccessControlContext {
private ProtectionDomain context[];
private ProtectionDomain[] context;
// isPrivileged and isAuthorized are referenced by the VM - do not remove
// or change their names
private boolean isPrivileged;
@ -89,13 +89,13 @@ public final class AccessControlContext {
private DomainCombiner combiner = null;
// limited privilege scope
private Permission permissions[];
private Permission[] permissions;
private AccessControlContext parent;
private boolean isWrapped;
// is constrained by limited privilege scope?
private boolean isLimited;
private ProtectionDomain limitedContext[];
private ProtectionDomain[] limitedContext;
private static boolean debugInit = false;
private static Debug debug = null;
@ -123,7 +123,7 @@ public final class AccessControlContext {
* changes to the array will not affect this AccessControlContext.
* @throws NullPointerException if {@code context} is {@code null}
*/
public AccessControlContext(ProtectionDomain context[])
public AccessControlContext(ProtectionDomain[] context)
{
if (context.length == 0) {
this.context = null;
@ -282,7 +282,7 @@ public final class AccessControlContext {
* package private constructor for AccessController.getContext()
*/
AccessControlContext(ProtectionDomain context[],
AccessControlContext(ProtectionDomain[] context,
boolean isPrivileged)
{
this.context = context;
@ -643,7 +643,7 @@ public final class AccessControlContext {
/*
* Combine the current (stack) and assigned domains.
*/
private static ProtectionDomain[] combine(ProtectionDomain[]current,
private static ProtectionDomain[] combine(ProtectionDomain[] current,
ProtectionDomain[] assigned) {
// current could be null if only system code is on the stack;
@ -666,7 +666,7 @@ public final class AccessControlContext {
int n = (skipAssigned) ? 0 : assigned.length;
// now we combine both of them, and create a new context
ProtectionDomain pd[] = new ProtectionDomain[slen + n];
ProtectionDomain[] pd = new ProtectionDomain[slen + n];
// first copy in the assigned context domains, no need to compress
if (!skipAssigned) {
@ -695,7 +695,7 @@ public final class AccessControlContext {
} else if (skipAssigned && n == slen) {
return current;
}
ProtectionDomain tmp[] = new ProtectionDomain[n];
ProtectionDomain[] tmp = new ProtectionDomain[n];
System.arraycopy(pd, 0, tmp, 0, n);
pd = tmp;
}

View File

@ -65,7 +65,7 @@ public class CodeSource implements java.io.Serializable {
/*
* The code signers. Certificate chains are concatenated.
*/
private transient java.security.cert.Certificate certs[] = null;
private transient java.security.cert.Certificate[] certs = null;
// cached SocketPermission used for matchLocation
private transient SocketPermission sp;
@ -91,7 +91,7 @@ public class CodeSource implements java.io.Serializable {
* @param certs the certificate(s). It may be null. The contents of the
* array are copied to protect against subsequent modification.
*/
public CodeSource(URL url, java.security.cert.Certificate certs[]) {
public CodeSource(URL url, java.security.cert.Certificate[] certs) {
this.location = url;
if (url != null) {
this.locationNoFragString = URLUtil.urlNoFragString(url);

View File

@ -289,9 +289,9 @@ implements Serializable
if (unresolvedPerms == null)
return null;
java.security.cert.Certificate certs[] = null;
java.security.cert.Certificate[] certs = null;
Object signers[] = p.getClass().getSigners();
Object[] signers = p.getClass().getSigners();
int n = 0;
if (signers != null) {

View File

@ -69,7 +69,7 @@ import sun.security.util.Debug;
*
* <pre>
* SecureRandom random = new SecureRandom();
* byte bytes[] = new byte[20];
* byte[] bytes = new byte[20];
* random.nextBytes(bytes);
* </pre>
*
@ -77,7 +77,7 @@ import sun.security.util.Debug;
* to generate a given number of seed bytes (to seed other random number
* generators, for example):
* <pre>
* byte seed[] = random.generateSeed(20);
* byte[] seed = random.generateSeed(20);
* </pre>
*
* Note: Depending on the implementation, the {@code generateSeed} and
@ -186,7 +186,7 @@ public class SecureRandom extends java.util.Random {
*
* @param seed the seed.
*/
public SecureRandom(byte seed[]) {
public SecureRandom(byte[] seed) {
super(0);
getDefaultPRNG(true, seed);
}
@ -486,7 +486,7 @@ public class SecureRandom extends java.util.Random {
@Override
final protected int next(int numBits) {
int numBytes = (numBits+7)/8;
byte b[] = new byte[numBytes];
byte[] b = new byte[numBytes];
int next = 0;
nextBytes(b);

View File

@ -130,7 +130,7 @@ implements java.io.Serializable
*/
private String actions;
private transient java.security.cert.Certificate certs[];
private transient java.security.cert.Certificate[] certs;
/**
* Creates a new UnresolvedPermission containing the permission
@ -152,7 +152,7 @@ implements java.io.Serializable
public UnresolvedPermission(String type,
String name,
String actions,
java.security.cert.Certificate certs[])
java.security.cert.Certificate[] certs)
{
super(type);
@ -224,7 +224,7 @@ implements java.io.Serializable
* try and resolve this permission using the class loader of the permission
* that was passed in.
*/
Permission resolve(Permission p, java.security.cert.Certificate certs[]) {
Permission resolve(Permission p, java.security.cert.Certificate[] certs) {
if (this.certs != null) {
// if p wasn't signed, we don't have a match
if (certs == null) {

View File

@ -54,7 +54,7 @@ public class RSAMultiPrimePrivateCrtKeySpec extends RSAPrivateKeySpec {
private final BigInteger primeExponentP;
private final BigInteger primeExponentQ;
private final BigInteger crtCoefficient;
private final RSAOtherPrimeInfo otherPrimeInfo[];
private final RSAOtherPrimeInfo[] otherPrimeInfo;
/**
* Creates a new {@code RSAMultiPrimePrivateCrtKeySpec}

View File

@ -507,7 +507,7 @@ public class PKCS7 {
// certificates (optional)
if (certificates != null && certificates.length != 0) {
// cast to X509CertImpl[] since X509CertImpl implements DerEncoder
X509CertImpl implCerts[] = new X509CertImpl[certificates.length];
X509CertImpl[] implCerts = new X509CertImpl[certificates.length];
for (int i = 0; i < certificates.length; i++) {
if (certificates[i] instanceof X509CertImpl)
implCerts[i] = (X509CertImpl) certificates[i];

View File

@ -78,7 +78,7 @@ public class PKCS8Key implements PrivateKey {
* data is stored and transmitted losslessly, but no knowledge
* about this particular algorithm is available.
*/
private PKCS8Key (AlgorithmId algid, byte key [])
private PKCS8Key (AlgorithmId algid, byte[] key)
throws InvalidKeyException {
this.algid = algid;
this.key = key;

View File

@ -154,28 +154,28 @@ public final class PKCS12KeyStore extends KeyStoreSpi {
private static final Debug debug = Debug.getInstance("pkcs12");
private static final int keyBag[] = {1, 2, 840, 113549, 1, 12, 10, 1, 2};
private static final int certBag[] = {1, 2, 840, 113549, 1, 12, 10, 1, 3};
private static final int secretBag[] = {1, 2, 840, 113549, 1, 12, 10, 1, 5};
private static final int[] keyBag = {1, 2, 840, 113549, 1, 12, 10, 1, 2};
private static final int[] certBag = {1, 2, 840, 113549, 1, 12, 10, 1, 3};
private static final int[] secretBag = {1, 2, 840, 113549, 1, 12, 10, 1, 5};
private static final int pkcs9Name[] = {1, 2, 840, 113549, 1, 9, 20};
private static final int pkcs9KeyId[] = {1, 2, 840, 113549, 1, 9, 21};
private static final int[] pkcs9Name = {1, 2, 840, 113549, 1, 9, 20};
private static final int[] pkcs9KeyId = {1, 2, 840, 113549, 1, 9, 21};
private static final int pkcs9certType[] = {1, 2, 840, 113549, 1, 9, 22, 1};
private static final int[] pkcs9certType = {1, 2, 840, 113549, 1, 9, 22, 1};
private static final int pbeWithSHAAnd40BitRC2CBC[] =
private static final int[] pbeWithSHAAnd40BitRC2CBC =
{1, 2, 840, 113549, 1, 12, 1, 6};
private static final int pbeWithSHAAnd3KeyTripleDESCBC[] =
private static final int[] pbeWithSHAAnd3KeyTripleDESCBC =
{1, 2, 840, 113549, 1, 12, 1, 3};
private static final int pbes2[] = {1, 2, 840, 113549, 1, 5, 13};
private static final int[] pbes2 = {1, 2, 840, 113549, 1, 5, 13};
// TODO: temporary Oracle OID
/*
* { joint-iso-itu-t(2) country(16) us(840) organization(1) oracle(113894)
* jdk(746875) crypto(1) id-at-trustedKeyUsage(1) }
*/
private static final int TrustedKeyUsage[] =
private static final int[] TrustedKeyUsage =
{2, 16, 840, 1, 113894, 746875, 1, 1};
private static final int AnyExtendedKeyUsage[] = {2, 5, 29, 37, 0};
private static final int[] AnyExtendedKeyUsage = {2, 5, 29, 37, 0};
private static ObjectIdentifier PKCS8ShroudedKeyBag_OID;
private static ObjectIdentifier CertBag_OID;
@ -243,7 +243,7 @@ public final class PKCS12KeyStore extends KeyStoreSpi {
// A private key entry and its supporting certificate chain
private static class PrivateKeyEntry extends KeyEntry {
byte[] protectedPrivKey;
Certificate chain[];
Certificate[] chain;
};
// A secret key

View File

@ -403,7 +403,7 @@ public class AuthPolicyFile extends javax.security.auth.Policy {
debug.println(" "+perm);
}
} catch (ClassNotFoundException cnfe) {
Certificate certs[];
Certificate[] certs;
if (pe.signedBy != null) {
certs = getCertificates(keyStore, pe.signedBy);
} else {
@ -623,7 +623,7 @@ public class AuthPolicyFile extends javax.security.auth.Policy {
init();
}
final CodeSource codesource[] = {null};
final CodeSource[] codesource = {null};
codesource[0] = canonicalizeCodebase(cs, true);
@ -666,7 +666,7 @@ public class AuthPolicyFile extends javax.security.auth.Policy {
// now see if any of the keys are trusted ids.
if (!ignoreIdentityScope) {
Certificate certs[] = codesource[0].getCertificates();
Certificate[] certs = codesource[0].getCertificates();
if (certs != null) {
for (int k=0; k < certs.length; k++) {
if (aliasMapping.get(certs[k]) == null &&

View File

@ -237,7 +237,7 @@ public class DSAParameterGenerator extends AlgorithmParameterGeneratorSpi {
BigInteger offset = ONE;
/* Step 11 */
for (counter = 0; counter < 4*valueL; counter++) {
BigInteger V[] = new BigInteger[n + 1];
BigInteger[] V = new BigInteger[n + 1];
/* Step 11.1 */
for (int j = 0; j <= n; j++) {
BigInteger J = BigInteger.valueOf(j);

View File

@ -82,7 +82,7 @@ public abstract class JavaKeyStore extends KeyStoreSpi {
private static class KeyEntry {
Date date; // the creation date of this entry
byte[] protectedPrivKey;
Certificate chain[];
Certificate[] chain;
};
// Trusted certificates
@ -604,7 +604,7 @@ public abstract class JavaKeyStore extends KeyStoreSpi {
* the keystore (such as deleting or modifying key or
* certificate entries).
*/
byte digest[] = md.digest();
byte[] digest = md.digest();
dos.write(digest);
dos.flush();
@ -770,9 +770,8 @@ public abstract class JavaKeyStore extends KeyStoreSpi {
* with
*/
if (password != null) {
byte computed[], actual[];
computed = md.digest();
actual = new byte[computed.length];
byte[] computed = md.digest();
byte[] actual = new byte[computed.length];
dis.readFully(actual);
for (int i = 0; i < computed.length; i++) {
if (computed[i] != actual[i]) {

View File

@ -795,7 +795,7 @@ public class PolicyFile extends java.security.Policy {
// an unresolved permission which will be resolved
// when implies is called
// Add it to entry
Certificate certs[];
Certificate[] certs;
if (pe.signedBy != null) {
certs = getCertificates(keyStore,
pe.signedBy,
@ -817,7 +817,7 @@ public class PolicyFile extends java.security.Policy {
debug.println(" "+perm);
}
} catch (ClassNotFoundException cnfe) {
Certificate certs[];
Certificate[] certs;
if (pe.signedBy != null) {
certs = getCertificates(keyStore,
pe.signedBy,
@ -2032,7 +2032,7 @@ public class PolicyFile extends java.security.Policy {
*
* @serial
*/
private Certificate certs[];
private Certificate[] certs;
/**
* Creates a new SelfPermission containing the permission
@ -2048,7 +2048,7 @@ public class PolicyFile extends java.security.Policy {
* certificate first and the (root) certificate authority last).
*/
public SelfPermission(String type, String name, String actions,
Certificate certs[])
Certificate[] certs)
{
super(type);
if (type == null) {

View File

@ -1353,7 +1353,7 @@ public class PolicyParser {
}
}
public static void main(String arg[]) throws Exception {
public static void main(String[] arg) throws Exception {
try (FileReader fr = new FileReader(arg[0]);
FileWriter fw = new FileWriter(arg[1])) {
PolicyParser pp = new PolicyParser(true);

View File

@ -85,7 +85,7 @@ implements java.io.Serializable {
*
* @param seed the seed.
*/
private SecureRandom(byte seed[]) {
private SecureRandom(byte[] seed) {
init(seed);
}

View File

@ -70,7 +70,7 @@ class ByteBufferInputStream extends InputStream {
* Increments position().
*/
@Override
public int read(byte b[]) throws IOException {
public int read(byte[] b) throws IOException {
if (bb == null) {
throw new IOException("read on a closed InputStream");
@ -85,7 +85,7 @@ class ByteBufferInputStream extends InputStream {
* Increments position().
*/
@Override
public int read(byte b[], int off, int len) throws IOException {
public int read(byte[] b, int off, int len) throws IOException {
if (bb == null) {
throw new IOException("read on a closed InputStream");

View File

@ -810,7 +810,7 @@ final class ClientHandshaker extends Handshaker {
String alias = null;
int keytypesTmpSize = keytypesTmp.size();
if (keytypesTmpSize != 0) {
String keytypes[] =
String[] keytypes =
keytypesTmp.toArray(new String[keytypesTmpSize]);
if (conn != null) {

View File

@ -48,7 +48,7 @@ final class DHClientKeyExchange extends HandshakeMessage {
* This value may be empty if it was included in the
* client's certificate ...
*/
private byte dh_Yc[]; // 1 to 2^16 -1 bytes
private byte[] dh_Yc; // 1 to 2^16 -1 bytes
BigInteger getClientPublicKey() {
return dh_Yc == null ? null : new BigInteger(1, dh_Yc);

View File

@ -146,7 +146,7 @@ public final class HandshakeInStream extends ByteArrayInputStream {
byte[] getBytes8() throws IOException {
int len = getInt8();
verifyLength(len);
byte b[] = new byte[len];
byte[] b = new byte[len];
read(b);
return b;
@ -155,7 +155,7 @@ public final class HandshakeInStream extends ByteArrayInputStream {
public byte[] getBytes16() throws IOException {
int len = getInt16();
verifyLength(len);
byte b[] = new byte[len];
byte[] b = new byte[len];
read(b);
return b;
@ -164,7 +164,7 @@ public final class HandshakeInStream extends ByteArrayInputStream {
byte[] getBytes24() throws IOException {
int len = getInt24();
verifyLength(len);
byte b[] = new byte[len];
byte[] b = new byte[len];
read(b);
return b;

View File

@ -689,8 +689,8 @@ static abstract class ServerKeyExchange extends HandshakeMessage
static final
class RSA_ServerKeyExchange extends ServerKeyExchange
{
private byte rsa_modulus[]; // 1 to 2^16 - 1 bytes
private byte rsa_exponent[]; // 1 to 2^16 - 1 bytes
private byte[] rsa_modulus; // 1 to 2^16 - 1 bytes
private byte[] rsa_exponent; // 1 to 2^16 - 1 bytes
private Signature signature;
private byte[] signatureBytes;
@ -698,7 +698,7 @@ class RSA_ServerKeyExchange extends ServerKeyExchange
/*
* Hash the nonces and the ephemeral RSA public key.
*/
private void updateSignature(byte clntNonce[], byte svrNonce[])
private void updateSignature(byte[] clntNonce, byte[] svrNonce)
throws SignatureException {
int tmp;
@ -827,11 +827,11 @@ class DH_ServerKeyExchange extends ServerKeyExchange
private final static boolean dhKeyExchangeFix =
Debug.getBooleanProperty("com.sun.net.ssl.dhKeyExchangeFix", true);
private byte dh_p []; // 1 to 2^16 - 1 bytes
private byte dh_g []; // 1 to 2^16 - 1 bytes
private byte dh_Ys []; // 1 to 2^16 - 1 bytes
private byte[] dh_p; // 1 to 2^16 - 1 bytes
private byte[] dh_g; // 1 to 2^16 - 1 bytes
private byte[] dh_Ys; // 1 to 2^16 - 1 bytes
private byte signature [];
private byte[] signature;
// protocol version being established using this ServerKeyExchange message
ProtocolVersion protocolVersion;
@ -857,8 +857,8 @@ class DH_ServerKeyExchange extends ServerKeyExchange
* with the cert chain which was sent ... for DHE_DSS and DHE_RSA
* key exchange. (Constructor called by server.)
*/
DH_ServerKeyExchange(DHCrypt obj, PrivateKey key, byte clntNonce[],
byte svrNonce[], SecureRandom sr,
DH_ServerKeyExchange(DHCrypt obj, PrivateKey key, byte[] clntNonce,
byte[] svrNonce, SecureRandom sr,
SignatureAndHashAlgorithm signAlgorithm,
ProtocolVersion protocolVersion) throws GeneralSecurityException {
@ -913,7 +913,7 @@ class DH_ServerKeyExchange extends ServerKeyExchange
* DHE_DSS or DHE_RSA key exchange. (Called by client.)
*/
DH_ServerKeyExchange(HandshakeInStream input, PublicKey publicKey,
byte clntNonce[], byte svrNonce[], int messageSize,
byte[] clntNonce, byte[] svrNonce, int messageSize,
Collection<SignatureAndHashAlgorithm> localSupportedSignAlgs,
ProtocolVersion protocolVersion)
throws IOException, GeneralSecurityException {
@ -948,7 +948,7 @@ class DH_ServerKeyExchange extends ServerKeyExchange
}
// read the signature
byte signature[];
byte[] signature;
if (dhKeyExchangeFix) {
signature = input.getBytes16();
} else {
@ -1004,8 +1004,8 @@ class DH_ServerKeyExchange extends ServerKeyExchange
/*
* Update sig with nonces and Diffie-Hellman public key.
*/
private void updateSignature(Signature sig, byte clntNonce[],
byte svrNonce[]) throws SignatureException {
private void updateSignature(Signature sig, byte[] clntNonce,
byte[] svrNonce) throws SignatureException {
int tmp;
sig.update(clntNonce);
@ -1268,8 +1268,8 @@ class ECDH_ServerKeyExchange extends ServerKeyExchange {
}
}
private void updateSignature(Signature sig, byte clntNonce[],
byte svrNonce[]) throws SignatureException {
private void updateSignature(Signature sig, byte[] clntNonce,
byte[] svrNonce) throws SignatureException {
sig.update(clntNonce);
sig.update(svrNonce);
@ -1334,7 +1334,7 @@ static final class DistinguishedName {
* DER encoded distinguished name.
* TLS requires that its not longer than 65535 bytes.
*/
byte name[];
byte[] name;
DistinguishedName(HandshakeInStream input) throws IOException {
name = input.getBytes16();
@ -1411,8 +1411,8 @@ class CertificateRequest extends HandshakeMessage
private final static byte[] TYPES_ECC =
{ cct_rsa_sign, cct_dss_sign, cct_ecdsa_sign };
byte types []; // 1 to 255 types
DistinguishedName authorities []; // 3 to 2^16 - 1
byte[] types; // 1 to 255 types
DistinguishedName[] authorities; // 3 to 2^16 - 1
// ... "3" because that's the smallest DER-encoded X500 DN
// protocol version being established using this CertificateRequest message
@ -1424,7 +1424,7 @@ class CertificateRequest extends HandshakeMessage
// length of supported_signature_algorithms
private int algorithmsLen;
CertificateRequest(X509Certificate ca[], KeyExchange keyExchange,
CertificateRequest(X509Certificate[] ca, KeyExchange keyExchange,
Collection<SignatureAndHashAlgorithm> signAlgs,
ProtocolVersion protocolVersion) throws IOException {
@ -2063,7 +2063,7 @@ static final class Finished extends HandshakeMessage {
if (protocolVersion.useTLS10PlusSpec()) {
// TLS 1.0+
try {
byte [] seed;
byte[] seed;
String prfAlg;
PRF prf;

View File

@ -119,7 +119,7 @@ public class HandshakeOutStream extends ByteArrayOutputStream {
}
}
public void putBytes16(byte b[]) throws IOException {
public void putBytes16(byte[] b) throws IOException {
if (b == null) {
putInt16(0);
} else {
@ -128,7 +128,7 @@ public class HandshakeOutStream extends ByteArrayOutputStream {
}
}
void putBytes24(byte b[]) throws IOException {
void putBytes24(byte[] b) throws IOException {
if (b == null) {
putInt24(0);
} else {

View File

@ -52,7 +52,7 @@ final class MAC extends Authenticator {
final static MAC TLS_NULL = new MAC(false);
// Value of the null MAC is fixed
private static final byte nullMAC[] = new byte[0];
private static final byte[] nullMAC = new byte[0];
// internal identifier for the MAC algorithm
private final MacAlg macAlg;

View File

@ -38,7 +38,7 @@ import java.security.SecureRandom;
*/
final class RandomCookie {
byte random_bytes[]; // exactly 32 bytes
byte[] random_bytes; // exactly 32 bytes
RandomCookie(SecureRandom generator) {
long temp = System.currentTimeMillis() / 1000;

View File

@ -986,7 +986,7 @@ final class ServerHandshaker extends Handshaker {
ClientKeyExchangeService.find(keyExchange.name) == null) {
CertificateRequest m4;
X509Certificate caCerts[];
X509Certificate[] caCerts;
Collection<SignatureAndHashAlgorithm> localSignAlgs = null;
if (protocolVersion.useTLS12PlusSpec()) {

View File

@ -43,7 +43,7 @@ final
class SessionId
{
static int MAX_LENGTH = 32;
private byte sessionId []; // max 32 bytes
private byte[] sessionId; // max 32 bytes
/** Constructs a new session ID ... perhaps for a rejoinable session */
SessionId (boolean isRejoinable, SecureRandom generator)
@ -56,7 +56,7 @@ class SessionId
}
/** Constructs a session ID from a byte array (max size 32 bytes) */
SessionId (byte sessionId [])
SessionId (byte[] sessionId)
{ this.sessionId = sessionId; }
/** Returns the length of the ID, in bytes */
@ -64,7 +64,7 @@ class SessionId
{ return sessionId.length; }
/** Returns the bytes in the ID. May be an empty array. */
byte [] getId ()
byte[] getId ()
{
return sessionId.clone ();
}
@ -106,7 +106,7 @@ class SessionId
return false;
SessionId s = (SessionId) obj;
byte b [] = s.getId ();
byte[] b = s.getId ();
if (b.length != sessionId.length)
return false;

View File

@ -94,13 +94,13 @@ final class X509TrustManagerImpl extends X509ExtendedTrustManager
}
@Override
public void checkClientTrusted(X509Certificate chain[], String authType)
public void checkClientTrusted(X509Certificate[] chain, String authType)
throws CertificateException {
checkTrusted(chain, authType, (Socket)null, true);
}
@Override
public void checkServerTrusted(X509Certificate chain[], String authType)
public void checkServerTrusted(X509Certificate[] chain, String authType)
throws CertificateException {
checkTrusted(chain, authType, (Socket)null, false);
}

View File

@ -37,7 +37,7 @@ public class ManifestDigester {
public static final String MF_MAIN_ATTRS = "Manifest-Main-Attributes";
/** the raw bytes of the manifest */
private byte rawBytes[];
private byte[] rawBytes;
/** the offset/length pair for a section */
private HashMap<String, Entry> entries; // key is a UTF-8 string
@ -107,7 +107,7 @@ public class ManifestDigester {
return false;
}
public ManifestDigester(byte bytes[])
public ManifestDigester(byte[] bytes)
{
rawBytes = bytes;
entries = new HashMap<>();
@ -181,7 +181,7 @@ public class ManifestDigester {
}
}
private boolean isNameAttr(byte bytes[], int start)
private boolean isNameAttr(byte[] bytes, int start)
{
return ((bytes[start] == 'N') || (bytes[start] == 'n')) &&
((bytes[start+1] == 'a') || (bytes[start+1] == 'A')) &&
@ -261,11 +261,10 @@ public class ManifestDigester {
return e;
}
public byte[] manifestDigest(MessageDigest md)
{
md.reset();
md.update(rawBytes, 0, rawBytes.length);
return md.digest();
}
public byte[] manifestDigest(MessageDigest md) {
md.reset();
md.update(rawBytes, 0, rawBytes.length);
return md.digest();
}
}

View File

@ -165,7 +165,7 @@ public class ManifestEntryVerifier {
/**
* update the digests for the digests we are interested in
*/
public void update(byte buffer[], int off, int len) {
public void update(byte[] buffer, int off, int len) {
if (skip) return;
for (int i=0; i < digests.size(); i++) {

View File

@ -212,7 +212,7 @@ class ObjectIdentifier implements Serializable
* Constructor, from an array of integers.
* Validity check included.
*/
public ObjectIdentifier (int values []) throws IOException
public ObjectIdentifier(int[] values) throws IOException
{
checkCount(values.length);
checkFirstComponent(values[0]);

View File

@ -55,7 +55,7 @@ public class SignatureFileVerifier {
private PKCS7 block;
/** the raw bytes of the .SF file */
private byte sfBytes[];
private byte[] sfBytes;
/** the name of the signature block file, uppercased and without
* the extension (.DSA/.RSA/.EC)
@ -84,7 +84,7 @@ public class SignatureFileVerifier {
public SignatureFileVerifier(ArrayList<CodeSigner[]> signerCache,
ManifestDigester md,
String name,
byte rawBytes[])
byte[] rawBytes)
throws IOException, CertificateException
{
// new PKCS7() calls CertificateFactory.getInstance()
@ -129,7 +129,7 @@ public class SignatureFileVerifier {
* used to set the raw bytes of the .SF file when it
* is external to the signature block file.
*/
public void setSignatureFile(byte sfBytes[])
public void setSignatureFile(byte[] sfBytes)
{
this.sfBytes = sfBytes;
}
@ -511,7 +511,7 @@ public class SignatureFileVerifier {
* CodeSigner objects. We do this only *once* for a given
* signature block file.
*/
private CodeSigner[] getSigners(SignerInfo infos[], PKCS7 block)
private CodeSigner[] getSigners(SignerInfo[] infos, PKCS7 block)
throws IOException, NoSuchAlgorithmException, SignatureException,
CertificateException {

View File

@ -967,7 +967,7 @@ public class AVA implements DerEncoder {
previousWhite = false;
byte valueBytes[] = null;
byte[] valueBytes = null;
try {
valueBytes = Character.toString(c).getBytes("UTF8");
} catch (IOException ie) {
@ -1051,7 +1051,7 @@ public class AVA implements DerEncoder {
// using the hex format below. This will be used only
// when the value is not a string type
byte data [] = value.toByteArray();
byte[] data = value.toByteArray();
retval.append('#');
for (int i = 0; i < data.length; i++) {

View File

@ -117,7 +117,7 @@ class AlgIdDSA extends AlgorithmId implements DSAParams
* @param q the DSS/DSA parameter "Q"
* @param g the DSS/DSA parameter "G"
*/
public AlgIdDSA (byte p [], byte q [], byte g [])
public AlgIdDSA (byte[] p, byte[] q, byte[] g)
throws IOException
{
this (new BigInteger (1, p),

View File

@ -648,12 +648,12 @@ public class AlgorithmId implements Serializable, DerEncoder {
/*
* COMMON PUBLIC KEY TYPES
*/
private static final int DH_data[] = { 1, 2, 840, 113549, 1, 3, 1 };
private static final int DH_PKIX_data[] = { 1, 2, 840, 10046, 2, 1 };
private static final int DSA_OIW_data[] = { 1, 3, 14, 3, 2, 12 };
private static final int DSA_PKIX_data[] = { 1, 2, 840, 10040, 4, 1 };
private static final int RSA_data[] = { 2, 5, 8, 1, 1 };
private static final int RSAEncryption_data[] =
private static final int[] DH_data = { 1, 2, 840, 113549, 1, 3, 1 };
private static final int[] DH_PKIX_data = { 1, 2, 840, 10046, 2, 1 };
private static final int[] DSA_OIW_data = { 1, 3, 14, 3, 2, 12 };
private static final int[] DSA_PKIX_data = { 1, 2, 840, 10040, 4, 1 };
private static final int[] RSA_data = { 2, 5, 8, 1, 1 };
private static final int[] RSAEncryption_data =
{ 1, 2, 840, 113549, 1, 1, 1 };
public static final ObjectIdentifier DH_oid;
@ -674,27 +674,27 @@ public class AlgorithmId implements Serializable, DerEncoder {
/*
* COMMON SIGNATURE ALGORITHMS
*/
private static final int md2WithRSAEncryption_data[] =
private static final int[] md2WithRSAEncryption_data =
{ 1, 2, 840, 113549, 1, 1, 2 };
private static final int md5WithRSAEncryption_data[] =
private static final int[] md5WithRSAEncryption_data =
{ 1, 2, 840, 113549, 1, 1, 4 };
private static final int sha1WithRSAEncryption_data[] =
private static final int[] sha1WithRSAEncryption_data =
{ 1, 2, 840, 113549, 1, 1, 5 };
private static final int sha1WithRSAEncryption_OIW_data[] =
private static final int[] sha1WithRSAEncryption_OIW_data =
{ 1, 3, 14, 3, 2, 29 };
private static final int sha224WithRSAEncryption_data[] =
private static final int[] sha224WithRSAEncryption_data =
{ 1, 2, 840, 113549, 1, 1, 14 };
private static final int sha256WithRSAEncryption_data[] =
private static final int[] sha256WithRSAEncryption_data =
{ 1, 2, 840, 113549, 1, 1, 11 };
private static final int sha384WithRSAEncryption_data[] =
private static final int[] sha384WithRSAEncryption_data =
{ 1, 2, 840, 113549, 1, 1, 12 };
private static final int sha512WithRSAEncryption_data[] =
private static final int[] sha512WithRSAEncryption_data =
{ 1, 2, 840, 113549, 1, 1, 13 };
private static final int shaWithDSA_OIW_data[] =
private static final int[] shaWithDSA_OIW_data =
{ 1, 3, 14, 3, 2, 13 };
private static final int sha1WithDSA_OIW_data[] =
private static final int[] sha1WithDSA_OIW_data =
{ 1, 3, 14, 3, 2, 27 };
private static final int dsaWithSHA1_PKIX_data[] =
private static final int[] dsaWithSHA1_PKIX_data =
{ 1, 2, 840, 10040, 4, 3 };
public static final ObjectIdentifier md2WithRSAEncryption_oid;

View File

@ -69,7 +69,7 @@ implements CertAttrSet<String> {
public static final String S_MIME_CA = "s_mime_ca";
public static final String OBJECT_SIGNING_CA = "object_signing_ca";
private static final int CertType_data[] = { 2, 16, 840, 1, 113730, 1, 1 };
private static final int[] CertType_data = { 2, 16, 840, 1, 113730, 1, 1 };
/**
* Object identifier for the Netscape-Cert-Type extension.

View File

@ -102,7 +102,7 @@ public class OIDMap {
private static final String OCSPNOCHECK = ROOT + "." +
OCSPNoCheckExtension.NAME;
private static final int NetscapeCertType_data[] =
private static final int[] NetscapeCertType_data =
{ 2, 16, 840, 1, 113730, 1, 1 };
/** Map ObjectIdentifier(oid) -> OIDInfo(info) */

View File

@ -49,32 +49,32 @@ import sun.security.util.*;
*/
public class PKIXExtensions {
// The object identifiers
private static final int AuthorityKey_data [] = { 2, 5, 29, 35 };
private static final int SubjectKey_data [] = { 2, 5, 29, 14 };
private static final int KeyUsage_data [] = { 2, 5, 29, 15 };
private static final int PrivateKeyUsage_data [] = { 2, 5, 29, 16 };
private static final int CertificatePolicies_data [] = { 2, 5, 29, 32 };
private static final int PolicyMappings_data [] = { 2, 5, 29, 33 };
private static final int SubjectAlternativeName_data [] = { 2, 5, 29, 17 };
private static final int IssuerAlternativeName_data [] = { 2, 5, 29, 18 };
private static final int SubjectDirectoryAttributes_data [] = { 2, 5, 29, 9 };
private static final int BasicConstraints_data [] = { 2, 5, 29, 19 };
private static final int NameConstraints_data [] = { 2, 5, 29, 30 };
private static final int PolicyConstraints_data [] = { 2, 5, 29, 36 };
private static final int CRLDistributionPoints_data [] = { 2, 5, 29, 31 };
private static final int CRLNumber_data [] = { 2, 5, 29, 20 };
private static final int IssuingDistributionPoint_data [] = { 2, 5, 29, 28 };
private static final int DeltaCRLIndicator_data [] = { 2, 5, 29, 27 };
private static final int ReasonCode_data [] = { 2, 5, 29, 21 };
private static final int HoldInstructionCode_data [] = { 2, 5, 29, 23 };
private static final int InvalidityDate_data [] = { 2, 5, 29, 24 };
private static final int ExtendedKeyUsage_data [] = { 2, 5, 29, 37 };
private static final int InhibitAnyPolicy_data [] = { 2, 5, 29, 54 };
private static final int CertificateIssuer_data [] = { 2, 5, 29, 29 };
private static final int AuthInfoAccess_data [] = { 1, 3, 6, 1, 5, 5, 7, 1, 1};
private static final int SubjectInfoAccess_data [] = { 1, 3, 6, 1, 5, 5, 7, 1, 11};
private static final int FreshestCRL_data [] = { 2, 5, 29, 46 };
private static final int OCSPNoCheck_data [] = { 1, 3, 6, 1, 5, 5, 7,
private static final int[] AuthorityKey_data = { 2, 5, 29, 35 };
private static final int[] SubjectKey_data = { 2, 5, 29, 14 };
private static final int[] KeyUsage_data = { 2, 5, 29, 15 };
private static final int[] PrivateKeyUsage_data = { 2, 5, 29, 16 };
private static final int[] CertificatePolicies_data = { 2, 5, 29, 32 };
private static final int[] PolicyMappings_data = { 2, 5, 29, 33 };
private static final int[] SubjectAlternativeName_data = { 2, 5, 29, 17 };
private static final int[] IssuerAlternativeName_data = { 2, 5, 29, 18 };
private static final int[] SubjectDirectoryAttributes_data = { 2, 5, 29, 9 };
private static final int[] BasicConstraints_data = { 2, 5, 29, 19 };
private static final int[] NameConstraints_data = { 2, 5, 29, 30 };
private static final int[] PolicyConstraints_data = { 2, 5, 29, 36 };
private static final int[] CRLDistributionPoints_data = { 2, 5, 29, 31 };
private static final int[] CRLNumber_data = { 2, 5, 29, 20 };
private static final int[] IssuingDistributionPoint_data = { 2, 5, 29, 28 };
private static final int[] DeltaCRLIndicator_data = { 2, 5, 29, 27 };
private static final int[] ReasonCode_data = { 2, 5, 29, 21 };
private static final int[] HoldInstructionCode_data = { 2, 5, 29, 23 };
private static final int[] InvalidityDate_data = { 2, 5, 29, 24 };
private static final int[] ExtendedKeyUsage_data = { 2, 5, 29, 37 };
private static final int[] InhibitAnyPolicy_data = { 2, 5, 29, 54 };
private static final int[] CertificateIssuer_data = { 2, 5, 29, 29 };
private static final int[] AuthInfoAccess_data = { 1, 3, 6, 1, 5, 5, 7, 1, 1};
private static final int[] SubjectInfoAccess_data = { 1, 3, 6, 1, 5, 5, 7, 1, 11};
private static final int[] FreshestCRL_data = { 2, 5, 29, 46 };
private static final int[] OCSPNoCheck_data = { 1, 3, 6, 1, 5, 5, 7,
48, 1, 5};
/**

View File

@ -1119,25 +1119,25 @@ public class X500Name implements GeneralNameInterface, Principal {
* Includes all those specified in RFC 5280 as MUST or SHOULD
* be recognized
*/
private static final int commonName_data[] = { 2, 5, 4, 3 };
private static final int SURNAME_DATA[] = { 2, 5, 4, 4 };
private static final int SERIALNUMBER_DATA[] = { 2, 5, 4, 5 };
private static final int countryName_data[] = { 2, 5, 4, 6 };
private static final int localityName_data[] = { 2, 5, 4, 7 };
private static final int stateName_data[] = { 2, 5, 4, 8 };
private static final int streetAddress_data[] = { 2, 5, 4, 9 };
private static final int orgName_data[] = { 2, 5, 4, 10 };
private static final int orgUnitName_data[] = { 2, 5, 4, 11 };
private static final int title_data[] = { 2, 5, 4, 12 };
private static final int GIVENNAME_DATA[] = { 2, 5, 4, 42 };
private static final int INITIALS_DATA[] = { 2, 5, 4, 43 };
private static final int GENERATIONQUALIFIER_DATA[] = { 2, 5, 4, 44 };
private static final int DNQUALIFIER_DATA[] = { 2, 5, 4, 46 };
private static final int[] commonName_data = { 2, 5, 4, 3 };
private static final int[] SURNAME_DATA = { 2, 5, 4, 4 };
private static final int[] SERIALNUMBER_DATA = { 2, 5, 4, 5 };
private static final int[] countryName_data = { 2, 5, 4, 6 };
private static final int[] localityName_data = { 2, 5, 4, 7 };
private static final int[] stateName_data = { 2, 5, 4, 8 };
private static final int[] streetAddress_data = { 2, 5, 4, 9 };
private static final int[] orgName_data = { 2, 5, 4, 10 };
private static final int[] orgUnitName_data = { 2, 5, 4, 11 };
private static final int[] title_data = { 2, 5, 4, 12 };
private static final int[] GIVENNAME_DATA = { 2, 5, 4, 42 };
private static final int[] INITIALS_DATA = { 2, 5, 4, 43 };
private static final int[] GENERATIONQUALIFIER_DATA = { 2, 5, 4, 44 };
private static final int[] DNQUALIFIER_DATA = { 2, 5, 4, 46 };
private static final int ipAddress_data[] = { 1, 3, 6, 1, 4, 1, 42, 2, 11, 2, 1 };
private static final int DOMAIN_COMPONENT_DATA[] =
private static final int[] ipAddress_data = { 1, 3, 6, 1, 4, 1, 42, 2, 11, 2, 1 };
private static final int[] DOMAIN_COMPONENT_DATA =
{ 0, 9, 2342, 19200300, 100, 1, 25 };
private static final int userid_data[] =
private static final int[] userid_data =
{ 0, 9, 2342, 19200300, 100, 1, 1 };

View File

@ -1086,7 +1086,7 @@ public class X509CRLImpl extends X509CRL implements DerEncoder {
throw new CRLException("Invalid DER-encoded CRL data");
signedCRL = val.toByteArray();
DerValue seq[] = new DerValue[3];
DerValue[] seq = new DerValue[3];
seq[0] = val.data.getDerValue();
seq[1] = val.data.getDerValue();

View File

@ -427,7 +427,7 @@ public final class ServicePermission extends Permission
/*
public static void main(String args[]) throws Exception {
public static void main(String[] args) throws Exception {
ServicePermission this_ =
new ServicePermission(args[0], "accept");
ServicePermission that_ =

View File

@ -75,7 +75,7 @@ public class GSSCredentialImpl implements GSSCredential {
}
GSSCredentialImpl(GSSManagerImpl gssManager, GSSName name,
int lifetime, Oid mechs[], int usage)
int lifetime, Oid[] mechs, int usage)
throws GSSException {
init(gssManager);
boolean defaultList = false;

View File

@ -128,7 +128,7 @@ public class GSSManagerImpl extends GSSManager {
return new GSSNameImpl(this, nameStr, nameType);
}
public GSSName createName(byte name[], Oid nameType)
public GSSName createName(byte[] name, Oid nameType)
throws GSSException {
return new GSSNameImpl(this, name, nameType);
}
@ -138,7 +138,7 @@ public class GSSManagerImpl extends GSSManager {
return new GSSNameImpl(this, nameStr, nameType, mech);
}
public GSSName createName(byte name[], Oid nameType, Oid mech)
public GSSName createName(byte[] name, Oid nameType, Oid mech)
throws GSSException {
return new GSSNameImpl(this, name, nameType, mech);
}
@ -155,7 +155,7 @@ public class GSSManagerImpl extends GSSManager {
}
public GSSCredential createCredential(GSSName aName,
int lifetime, Oid mechs[], int usage)
int lifetime, Oid[] mechs, int usage)
throws GSSException {
return wrap(new GSSCredentialImpl(this, aName, lifetime, mechs, usage));
}

View File

@ -159,7 +159,7 @@ class Krb5Context implements GSSContextSpi {
/**
* Constructor for Krb5Context to import a previously exported context.
*/
public Krb5Context(GSSCaller caller, byte [] interProcessToken)
public Krb5Context(GSSCaller caller, byte[] interProcessToken)
throws GSSException {
throw new GSSException(GSSException.UNAVAILABLE,
-1, "GSS Import Context not available");
@ -905,7 +905,7 @@ class Krb5Context implements GSSContextSpi {
* and verifyMIC care about the remote sequence number (peerSeqNumber).
*/
public final byte[] wrap(byte inBuf[], int offset, int len,
public final byte[] wrap(byte[] inBuf, int offset, int len,
MessageProp msgProp) throws GSSException {
if (DEBUG) {
System.out.println("Krb5Context.wrap: data=["
@ -943,7 +943,7 @@ class Krb5Context implements GSSContextSpi {
}
}
public final int wrap(byte inBuf[], int inOffset, int len,
public final int wrap(byte[] inBuf, int inOffset, int len,
byte[] outBuf, int outOffset,
MessageProp msgProp) throws GSSException {
@ -977,7 +977,7 @@ class Krb5Context implements GSSContextSpi {
}
}
public final void wrap(byte inBuf[], int offset, int len,
public final void wrap(byte[] inBuf, int offset, int len,
OutputStream os, MessageProp msgProp)
throws GSSException {
@ -1032,7 +1032,7 @@ class Krb5Context implements GSSContextSpi {
wrap(data, 0, data.length, os, msgProp);
}
public final byte[] unwrap(byte inBuf[], int offset, int len,
public final byte[] unwrap(byte[] inBuf, int offset, int len,
MessageProp msgProp)
throws GSSException {
@ -1069,7 +1069,7 @@ class Krb5Context implements GSSContextSpi {
return data;
}
public final int unwrap(byte inBuf[], int inOffset, int len,
public final int unwrap(byte[] inBuf, int inOffset, int len,
byte[] outBuf, int outOffset,
MessageProp msgProp) throws GSSException {
@ -1141,7 +1141,7 @@ class Krb5Context implements GSSContextSpi {
}
}
public final byte[] getMIC(byte []inMsg, int offset, int len,
public final byte[] getMIC(byte[] inMsg, int offset, int len,
MessageProp msgProp)
throws GSSException {
@ -1166,7 +1166,7 @@ class Krb5Context implements GSSContextSpi {
}
}
private int getMIC(byte []inMsg, int offset, int len,
private int getMIC(byte[] inMsg, int offset, int len,
byte[] outBuf, int outOffset,
MessageProp msgProp)
throws GSSException {
@ -1236,7 +1236,7 @@ class Krb5Context implements GSSContextSpi {
getMIC(data, 0, data.length, os, msgProp);
}
public final void verifyMIC(byte []inTok, int tokOffset, int tokLen,
public final void verifyMIC(byte[] inTok, int tokOffset, int tokLen,
byte[] inMsg, int msgOffset, int msgLen,
MessageProp msgProp)
throws GSSException {
@ -1293,7 +1293,7 @@ class Krb5Context implements GSSContextSpi {
* @param os the output token will be written to this stream
* @exception GSSException
*/
public final byte [] export() throws GSSException {
public final byte[] export() throws GSSException {
throw new GSSException(GSSException.UNAVAILABLE, -1,
"GSS Export Context not available");
}

View File

@ -265,7 +265,7 @@ public interface GSSContextSpi {
/**
* For apps that want simplicity and don't care about buffer copies.
*/
public byte[] wrap(byte inBuf[], int offset, int len,
public byte[] wrap(byte[] inBuf, int offset, int len,
MessageProp msgProp) throws GSSException;
/**
@ -275,7 +275,7 @@ public interface GSSContextSpi {
*
* NOTE: This method is not defined in public class org.ietf.jgss.GSSContext
*
public int wrap(byte inBuf[], int inOffset, int len,
public int wrap(byte[] inBuf, int inOffset, int len,
byte[] outBuf, int outOffset,
MessageProp msgProp) throws GSSException;
@ -292,7 +292,7 @@ public interface GSSContextSpi {
*
* NOTE: This method is not defined in public class org.ietf.jgss.GSSContext
*
public void wrap(byte inBuf[], int offset, int len,
public void wrap(byte[] inBuf, int offset, int len,
OutputStream os, MessageProp msgProp)
throws GSSException;
*/
@ -314,7 +314,7 @@ public interface GSSContextSpi {
/**
* For apps that want simplicity and don't care about buffer copies.
*/
public byte[] unwrap(byte inBuf[], int offset, int len,
public byte[] unwrap(byte[] inBuf, int offset, int len,
MessageProp msgProp) throws GSSException;
/**
@ -324,7 +324,7 @@ public interface GSSContextSpi {
*
* NOTE: This method is not defined in public class org.ietf.jgss.GSSContext
*
public int unwrap(byte inBuf[], int inOffset, int len,
public int unwrap(byte[] inBuf, int inOffset, int len,
byte[] outBuf, int outOffset,
MessageProp msgProp) throws GSSException;
@ -356,7 +356,7 @@ public interface GSSContextSpi {
MessageProp msgProp)
throws GSSException;
public byte[] getMIC(byte []inMsg, int offset, int len,
public byte[] getMIC(byte[] inMsg, int offset, int len,
MessageProp msgProp) throws GSSException;
/**
@ -372,7 +372,7 @@ public interface GSSContextSpi {
public void verifyMIC(InputStream is, InputStream msgStr,
MessageProp mProp) throws GSSException;
public void verifyMIC(byte []inTok, int tokOffset, int tokLen,
public void verifyMIC(byte[] inTok, int tokOffset, int tokLen,
byte[] inMsg, int msgOffset, int msgLen,
MessageProp msgProp) throws GSSException;

View File

@ -372,7 +372,7 @@ class NativeGSSContext implements GSSContextSpi {
}
return cStub.wrap(pContext, data, msgProp);
}
public void wrap(byte inBuf[], int offset, int len,
public void wrap(byte[] inBuf, int offset, int len,
OutputStream os, MessageProp msgProp)
throws GSSException {
try {

View File

@ -78,7 +78,7 @@ public final class SunNativeProvider extends Provider {
if (DEBUG) err.printStackTrace();
return null;
}
String gssLibs[] = new String[0];
String[] gssLibs = new String[0];
String defaultLib = System.getProperty(LIB_PROP);
if (defaultLib == null || defaultLib.trim().equals("")) {
String osname = System.getProperty("os.name");

View File

@ -568,7 +568,7 @@ public class PrincipalName implements Cloneable {
temp.putInteger(bint);
bytes.write(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x00), temp);
temp = new DerOutputStream();
DerValue der[] = new DerValue[nameStrings.length];
DerValue[] der = new DerValue[nameStrings.length];
for (int i = 0; i < nameStrings.length; i++) {
der[i] = new KerberosString(nameStrings[i]).toDerValue();
}

View File

@ -198,7 +198,7 @@ public class Authenticator {
if (authorizationData != null) {
v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x08), authorizationData.asn1Encode()));
}
DerValue der[] = new DerValue[v.size()];
DerValue[] der = new DerValue[v.size()];
v.copyInto(der);
temp = new DerOutputStream();
temp.putSequence(der);

View File

@ -120,7 +120,7 @@ public class AuthorizationData implements Cloneable {
*/
public byte[] asn1Encode() throws Asn1Exception, IOException {
DerOutputStream bytes = new DerOutputStream();
DerValue der[] = new DerValue[entry.length];
DerValue[] der = new DerValue[entry.length];
for (int i = 0; i < entry.length; i++) {
der[i] = new DerValue(entry[i].asn1Encode());
}

View File

@ -151,7 +151,7 @@ public class EncAPRepPart {
v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT,
true, (byte) 0x03), temp.toByteArray()));
}
DerValue der[] = new DerValue[v.size()];
DerValue[] der = new DerValue[v.size()];
v.copyInto(der);
temp = new DerOutputStream();
temp.putSequence(der);

View File

@ -129,7 +129,7 @@ public class EncKrbCredPart {
subDer = der.getData().getDerValue();
if ((subDer.getTag() & (byte) 0x1F) == (byte) 0x00) {
DerValue derValues[] = subDer.getData().getSequence(1);
DerValue[] derValues = subDer.getData().getSequence(1);
ticketInfo = new KrbCredInfo[derValues.length];
for (int i = 0; i < derValues.length; i++) {
ticketInfo[i] = new KrbCredInfo(derValues[i]);

View File

@ -98,8 +98,8 @@ public class HostAddresses implements Cloneable {
throw new KrbException(Krb5.KRB_ERR_GENERIC, "Bad name");
String host = components[1];
InetAddress addr[] = InetAddress.getAllByName(host);
HostAddress hAddrs[] = new HostAddress[addr.length];
InetAddress[] addr = InetAddress.getAllByName(host);
HostAddress[] hAddrs = new HostAddress[addr.length];
for (int i = 0; i < addr.length; i++) {
hAddrs[i] = new HostAddress(addr[i]);

View File

@ -269,7 +269,7 @@ public class KDCReqBody {
ticketsTemp.write(DerValue.tag_SequenceOf, temp);
v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x0B), ticketsTemp.toByteArray()));
}
DerValue der[] = new DerValue[v.size()];
DerValue[] der = new DerValue[v.size()];
v.copyInto(der);
temp = new DerOutputStream();
temp.putSequence(der);

View File

@ -172,7 +172,7 @@ public class KrbCredInfo {
}
if (caddr != null)
v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x0A), caddr.asn1Encode()));
DerValue der[] = new DerValue[v.size()];
DerValue[] der = new DerValue[v.size()];
v.copyInto(der);
DerOutputStream out = new DerOutputStream();
out.putSequence(der);

View File

@ -200,7 +200,7 @@ class UDPClient extends NetClient {
@Override
public byte[] receive() throws IOException {
byte ibuf[] = new byte[bufSize];
byte[] ibuf = new byte[bufSize];
dgPacketIn = new DatagramPacket(ibuf, ibuf.length);
try {
dgSocket.receive(dgPacketIn);

View File

@ -135,7 +135,7 @@ public class Ticket implements Cloneable {
public byte[] asn1Encode() throws Asn1Exception, IOException {
DerOutputStream bytes = new DerOutputStream();
DerOutputStream temp = new DerOutputStream();
DerValue der[] = new DerValue[4];
DerValue[] der = new DerValue[4];
temp.putInteger(BigInteger.valueOf(tkt_vno));
bytes.write(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x00), temp);
bytes.write(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x01), sname.getRealm().asn1Encode());

View File

@ -357,7 +357,7 @@ public class CCacheInputStream extends KrbDataInputStream implements FileCCacheC
if (DEBUG) {
System.out.println(">>>DEBUG <CCacheInputStream> key type: " + key.getEType());
}
long times[] = readTimes();
long[] times = readTimes();
KerberosTime authtime = new KerberosTime(times[0]);
KerberosTime starttime =
(times[1]==0) ? null : new KerberosTime(times[1]);
@ -374,9 +374,9 @@ public class CCacheInputStream extends KrbDataInputStream implements FileCCacheC
((renewTill==null)?"null":renewTill.toDate().toString()));
}
boolean skey = readskey();
boolean flags[] = readFlags();
boolean[] flags = readFlags();
TicketFlags tFlags = new TicketFlags(flags);
HostAddress addr[] = readAddr();
HostAddress[] addr = readAddr();
HostAddresses addrs = null;
if (addr != null) {
addrs = new HostAddresses(addr);

View File

@ -112,7 +112,7 @@ public final class crc32 extends MessageDigestSpi implements Cloneable {
* This version is more efficient than the byte-at-a-time version;
* it avoids data copies and reduces per-byte call overhead.
*/
protected synchronized void engineUpdate(byte input[], int offset,
protected synchronized void engineUpdate(byte[] input, int offset,
int len) {
processData(input, offset, len);
}

View File

@ -53,8 +53,8 @@ import sun.security.ssl.ProtocolVersion;
final class KerberosPreMasterSecret {
private ProtocolVersion protocolVersion; // preMaster [0,1]
private byte preMaster[]; // 48 bytes
private byte encrypted[];
private byte[] preMaster; // 48 bytes
private byte[] encrypted;
/**
* Constructor used by client to generate premaster secret.

View File

@ -47,13 +47,13 @@ import javax.security.auth.callback.UnsupportedCallbackException;
* @author Rosanna Lee
*/
final public class ClientFactoryImpl implements SaslClientFactory {
private static final String myMechs[] = {
private static final String[] myMechs = {
"EXTERNAL",
"CRAM-MD5",
"PLAIN",
};
private static final int mechPolicies[] = {
private static final int[] mechPolicies = {
// %%% RL: Policies should actually depend on the external channel
PolicyUtils.NOPLAINTEXT|PolicyUtils.NOACTIVE|PolicyUtils.NODICTIONARY,
PolicyUtils.NOPLAINTEXT|PolicyUtils.NOANONYMOUS, // CRAM-MD5

View File

@ -165,7 +165,7 @@ final class CramMD5Server extends CramMD5Base implements SaslServer {
PasswordCallback pcb =
new PasswordCallback("CRAM-MD5 password: ", false);
cbh.handle(new Callback[]{ncb,pcb});
char pwChars[] = pcb.getPassword();
char[] pwChars = pcb.getPassword();
if (pwChars == null || pwChars.length == 0) {
// user has no password; OK to disclose to server
aborted = true;
@ -190,7 +190,7 @@ final class CramMD5Server extends CramMD5Base implements SaslServer {
clearPassword();
// Check whether digest is as expected
byte [] expectedDigest = digest.getBytes("UTF8");
byte[] expectedDigest = digest.getBytes("UTF8");
int digestLen = responseData.length - ulen - 1;
if (expectedDigest.length != digestLen) {
aborted = true;

View File

@ -41,11 +41,11 @@ import javax.security.auth.callback.CallbackHandler;
* @author Rosanna Lee
*/
final public class ServerFactoryImpl implements SaslServerFactory {
private static final String myMechs[] = {
private static final String[] myMechs = {
"CRAM-MD5", //
};
private static final int mechPolicies[] = {
private static final int[] mechPolicies = {
PolicyUtils.NOPLAINTEXT|PolicyUtils.NOANONYMOUS, // CRAM-MD5
};

View File

@ -272,7 +272,7 @@ abstract class DigestMD5Base extends AbstractSaslImpl {
*/
/** This array maps the characters to their 6 bit values */
private final static char pem_array[] = {
private final static char[] pem_array = {
// 0 1 2 3 4 5 6 7
'A','B','C','D','E','F','G','H', // 0
'I','J','K','L','M','N','O','P', // 1
@ -1068,7 +1068,7 @@ abstract class DigestMD5Base extends AbstractSaslImpl {
byte[] hMAC_MD5 = m.doFinal();
/* First 10 bytes of HMAC_MD5 digest */
byte macBuffer[] = new byte[10];
byte[] macBuffer = new byte[10];
System.arraycopy(hMAC_MD5, 0, macBuffer, 0, 10);
return macBuffer;

View File

@ -44,9 +44,9 @@ import com.sun.security.sasl.util.PolicyUtils;
public final class FactoryImpl implements SaslClientFactory,
SaslServerFactory{
private static final String myMechs[] = { "DIGEST-MD5" };
private static final String[] myMechs = { "DIGEST-MD5" };
private static final int DIGEST_MD5 = 0;
private static final int mechPolicies[] = {
private static final int[] mechPolicies = {
PolicyUtils.NOPLAINTEXT|PolicyUtils.NOANONYMOUS};
/**

View File

@ -43,8 +43,8 @@ import com.sun.security.sasl.util.PolicyUtils;
public final class FactoryImpl implements SaslClientFactory,
SaslServerFactory{
private static final String myMechs[] = { "NTLM" };
private static final int mechPolicies[] = {
private static final String[] myMechs = { "NTLM" };
private static final int[] mechPolicies = {
PolicyUtils.NOPLAINTEXT|PolicyUtils.NOANONYMOUS
};

View File

@ -66,7 +66,7 @@ abstract class KeyStore extends KeyStoreSpi {
class KeyEntry
{
private Key privateKey;
private X509Certificate certChain[];
private X509Certificate[] certChain;
private String alias;
KeyEntry(Key key, X509Certificate[] chain) {

View File

@ -175,7 +175,7 @@ final class P11Cipher extends CipherSpi {
this.algorithm = algorithm;
this.mechanism = mechanism;
String algoParts[] = algorithm.split("/");
String[] algoParts = algorithm.split("/");
if (algoParts[0].startsWith("AES")) {
blockSize = 16;

View File

@ -164,7 +164,7 @@ final class P11KeyStore extends KeyStoreSpi {
private X509Certificate cert = null;
// chain
private X509Certificate chain[] = null;
private X509Certificate[] chain = null;
// true if CKA_ID for private key and cert match up
private boolean matched = false;

View File

@ -42,7 +42,7 @@ package sun.security.pkcs11.wrapper;
public class CK_AES_CTR_PARAMS {
private final long ulCounterBits;
private final byte cb[];
private final byte[] cb;
public CK_AES_CTR_PARAMS(byte[] cb) {
ulCounterBits = 128;

View File

@ -40,7 +40,7 @@ public final class UcryptoException extends ProviderException {
private static final long serialVersionUID = -933864511110035746L;
// NOTE: check /usr/include/sys/crypto/common.h for updates
private static final String ERROR_MSG[] = {
private static final String[] ERROR_MSG = {
"CRYPTO_SUCCESS",
"CRYPTO_CANCEL",
"CRYPTO_HOST_MEMORY",

View File

@ -377,7 +377,7 @@ class Crypt {
*
*/
public static void main(String arg[]) {
public static void main(String[] arg) {
if (arg.length!=2) {
System.err.println("usage: Crypt password salt");
@ -386,7 +386,7 @@ class Crypt {
Crypt c = new Crypt();
try {
byte result[] = c.crypt
byte[] result = c.crypt
(arg[0].getBytes("ISO-8859-1"), arg[1].getBytes("ISO-8859-1"));
for (int i=0; i<result.length; i++) {
System.out.println(" "+i+" "+(char)result[i]);

View File

@ -729,8 +729,8 @@ public class JndiLoginModule implements LoginModule {
Crypt c = new Crypt();
try {
byte oldCrypt[] = encryptedPassword.getBytes("UTF8");
byte newCrypt[] = c.crypt(password.getBytes("UTF8"),
byte[] oldCrypt = encryptedPassword.getBytes("UTF8");
byte[] newCrypt = c.crypt(password.getBytes("UTF8"),
oldCrypt);
if (newCrypt.length != oldCrypt.length)
return false;

View File

@ -81,7 +81,7 @@ public class NTLoginModule implements LoginModule {
private NTDomainPrincipal userDomain; // user domain
private NTSidDomainPrincipal domainSID; // domain SID
private NTSidPrimaryGroupPrincipal primaryGroup; // primary group
private NTSidGroupPrincipal groups[]; // supplementary groups
private NTSidGroupPrincipal[] groups; // supplementary groups
private NTNumericCredential iToken; // impersonation token
/**
@ -194,7 +194,7 @@ public class NTLoginModule implements LoginModule {
if (ntSystem.getGroupIDs() != null &&
ntSystem.getGroupIDs().length > 0) {
String groupSIDs[] = ntSystem.getGroupIDs();
String[] groupSIDs = ntSystem.getGroupIDs();
groups = new NTSidGroupPrincipal[groupSIDs.length];
for (int i = 0; i < groupSIDs.length; i++) {
groups[i] = new NTSidGroupPrincipal(groupSIDs[i]);

View File

@ -40,7 +40,7 @@ public class NTSystem {
private String domain;
private String domainSID;
private String userSID;
private String groupIDs[];
private String[] groupIDs;
private String primaryGroupID;
private long impersonationToken;

View File

@ -38,10 +38,10 @@ import javax.security.auth.callback.CallbackHandler;
* @author Rosanna Lee
*/
public final class FactoryImpl implements SaslClientFactory, SaslServerFactory {
private static final String myMechs[] = {
private static final String[] myMechs = {
"GSSAPI"};
private static final int mechPolicies[] = {
private static final int[] mechPolicies = {
PolicyUtils.NOPLAINTEXT|PolicyUtils.NOANONYMOUS|PolicyUtils.NOACTIVE
};