src/share/classes/com/sun/tools/javac/comp/Check.java

changeset 80
5c9cdeb740f2
parent 79
36df13bde238
child 89
b6d5f53b3b29
     1.1 --- a/src/share/classes/com/sun/tools/javac/comp/Check.java	Thu Jul 24 11:12:41 2008 +0100
     1.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Check.java	Thu Jul 24 19:06:57 2008 +0100
     1.3 @@ -576,8 +576,8 @@
     1.4          if ((flags & set1) != 0 && (flags & set2) != 0) {
     1.5              log.error(pos,
     1.6                        "illegal.combination.of.modifiers",
     1.7 -                      TreeInfo.flagNames(TreeInfo.firstFlag(flags & set1)),
     1.8 -                      TreeInfo.flagNames(TreeInfo.firstFlag(flags & set2)));
     1.9 +                      asFlagSet(TreeInfo.firstFlag(flags & set1)),
    1.10 +                      asFlagSet(TreeInfo.firstFlag(flags & set2)));
    1.11              return false;
    1.12          } else
    1.13              return true;
    1.14 @@ -670,7 +670,7 @@
    1.15              }
    1.16              else {
    1.17                  log.error(pos,
    1.18 -                          "mod.not.allowed.here", TreeInfo.flagNames(illegal));
    1.19 +                          "mod.not.allowed.here", asFlagSet(illegal));
    1.20              }
    1.21          }
    1.22          else if ((sym.kind == TYP ||
    1.23 @@ -1023,14 +1023,6 @@
    1.24          }
    1.25      }
    1.26  
    1.27 -    /** A string describing the access permission given by a flag set.
    1.28 -     *  This always returns a space-separated list of Java Keywords.
    1.29 -     */
    1.30 -    private static String protectionString(long flags) {
    1.31 -        long flags1 = flags & AccessFlags;
    1.32 -        return (flags1 == 0) ? "package" : TreeInfo.flagNames(flags1);
    1.33 -    }
    1.34 -
    1.35      /** A customized "cannot override" error message.
    1.36       *  @param m      The overriding method.
    1.37       *  @param other  The overridden method.
    1.38 @@ -1124,7 +1116,7 @@
    1.39                   (other.flags() & STATIC) != 0) {
    1.40              log.error(TreeInfo.diagnosticPositionFor(m, tree), "override.meth",
    1.41                        cannotOverride(m, other),
    1.42 -                      TreeInfo.flagNames(other.flags() & (FINAL | STATIC)));
    1.43 +                      asFlagSet(other.flags() & (FINAL | STATIC)));
    1.44              return;
    1.45          }
    1.46  
    1.47 @@ -1138,9 +1130,10 @@
    1.48                   protection(m.flags()) > protection(other.flags())) {
    1.49              log.error(TreeInfo.diagnosticPositionFor(m, tree), "override.weaker.access",
    1.50                        cannotOverride(m, other),
    1.51 -                      protectionString(other.flags()));
    1.52 +                      other.flags() == 0 ?
    1.53 +                          Flag.PACKAGE :
    1.54 +                          asFlagSet(other.flags() & AccessFlags));
    1.55              return;
    1.56 -
    1.57          }
    1.58  
    1.59          Type mt = types.memberType(origin.type, m);
    1.60 @@ -2035,7 +2028,7 @@
    1.61              log.error(pos,
    1.62                        "operator.cant.be.applied",
    1.63                        treeinfo.operatorName(tag),
    1.64 -                      left + "," + right);
    1.65 +                      List.of(left, right));
    1.66          }
    1.67          return operator.opcode;
    1.68      }

mercurial