Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5032583

extraneous object construction (String, Boolean, etc)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 6
    • 5.0
    • security-libs
    • beta
    • generic
    • solaris_9

      investigate whether the following constructions are necessary
      (also investigate whether it is better to use valueOf
      instead of constructing a new object):

      --------------------------------------------------------------

      javax.security.auth.Subject

          String toString(boolean includePrivateCredentials) {
      String s = new String(ResourcesMgr.getString("Subject:\n"));
              String suffix = new String();
              ...
          }

      javax.security.auth.SubjectDomainCombiner

          private static boolean cachePolicy() {
      ...
              if (s != null) {
                  Boolean b = new Boolean(s);
                  return b.booleanValue();
              }

      javax.security.auth.kerberos.KeyImpl

          public String toString() {
      ...
      return new String("EncryptionKey: keyType=" + keyType
                                + " keyBytes (hex dump)="
                                + (keyBytes == null || keyBytes.length == 0 ?
                                   " Empty Key" :
                                   '\n' + hd.encode(keyBytes)
                                + '\n'));
          }

      sun.security.action.GetBooleanAction

          public Object run() {
              return new Boolean(Boolean.getBoolean(theProp));
          }

      sun.security.pkcs.SignerInfo.verify (line 351)

                      try {
                          // We don't care whether or not this extension was marked
                          // critical in the certificate.
                          // We're interested only in its value (i.e., the bits set)
                          // and treat the extension as critical.
                          keyUsage = new KeyUsageExtension(new Boolean(true),
                                                           keyUsageBytes);

      sun.security.x509.BasicConstraints

          public BasicConstraintsExtension(boolean ca, int len) throws IOException {
              this(new Boolean(ca), ca, len);
          }

          public Object get(String name) throws IOException {
              if (name.equalsIgnoreCase(IS_CA)) {
                  return (new Boolean(ca));
              }
          }

      sun.security.x509.KeyUsageExtension

          public Object get(String name) throws IOException {
              if (name.equalsIgnoreCase(DIGITAL_SIGNATURE)) {
                  return new Boolean(isSet(0));
               ...

            claisunw Charlie Lai (Inactive)
            claisunw Charlie Lai (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: