src/share/classes/com/sun/tools/javac/code/Symbol.java

changeset 816
7c537f4298fb
parent 815
d17f37522154
child 841
df371fd16386
     1.1 --- a/src/share/classes/com/sun/tools/javac/code/Symbol.java	Mon Jan 10 14:57:59 2011 -0800
     1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Symbol.java	Mon Jan 10 15:08:31 2011 -0800
     1.3 @@ -81,8 +81,7 @@
     1.4       *  method to make sure that the class symbol is loaded.
     1.5       */
     1.6      public List<Attribute.Compound> getAnnotationMirrors() {
     1.7 -        assert attributes_field != null;
     1.8 -        return attributes_field;
     1.9 +        return Assert.checkNonNull(attributes_field);
    1.10      }
    1.11  
    1.12      /** Fetch a particular annotation from a symbol. */
    1.13 @@ -596,7 +595,7 @@
    1.14          }
    1.15  
    1.16          public <R, P> R accept(ElementVisitor<R, P> v, P p) {
    1.17 -            assert type.tag == TYPEVAR; // else override will be invoked
    1.18 +            Assert.check(type.tag == TYPEVAR); // else override will be invoked
    1.19              return v.visitTypeParameter(this, p);
    1.20          }
    1.21  
    1.22 @@ -670,8 +669,7 @@
    1.23                  if (attributes_field.isEmpty())
    1.24                      attributes_field = package_info.attributes_field;
    1.25              }
    1.26 -            assert attributes_field != null;
    1.27 -            return attributes_field;
    1.28 +            return Assert.checkNonNull(attributes_field);
    1.29          }
    1.30  
    1.31          /** A package "exists" if a type or package that exists has
    1.32 @@ -768,8 +766,7 @@
    1.33  
    1.34          public List<Attribute.Compound> getAnnotationMirrors() {
    1.35              if (completer != null) complete();
    1.36 -            assert attributes_field != null;
    1.37 -            return attributes_field;
    1.38 +            return Assert.checkNonNull(attributes_field);
    1.39          }
    1.40  
    1.41          public Type erasure(Types types) {
    1.42 @@ -1020,7 +1017,7 @@
    1.43          }
    1.44  
    1.45          public void setData(Object data) {
    1.46 -            assert !(data instanceof Env<?>) : this;
    1.47 +            Assert.check(!(data instanceof Env<?>), this);
    1.48              this.data = data;
    1.49          }
    1.50  
    1.51 @@ -1052,7 +1049,7 @@
    1.52           */
    1.53          public MethodSymbol(long flags, Name name, Type type, Symbol owner) {
    1.54              super(MTH, flags, name, type, owner);
    1.55 -            assert owner.type.tag != TYPEVAR : owner + "." + name;
    1.56 +            if (owner.type.tag == TYPEVAR) Assert.error(owner + "." + name);
    1.57          }
    1.58  
    1.59          /** Clone this symbol with new owner.

mercurial