--- a/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java Mon Jan 10 14:57:59 2011 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java Mon Jan 10 15:08:31 2011 -0800
@@ -81,8 +81,7 @@
* method to make sure that the class symbol is loaded.
*/
public List<Attribute.Compound> getAnnotationMirrors() {
- assert attributes_field != null;
- return attributes_field;
+ return Assert.checkNonNull(attributes_field);
}
/** Fetch a particular annotation from a symbol. */
@@ -596,7 +595,7 @@
}
public <R, P> R accept(ElementVisitor<R, P> v, P p) {
- assert type.tag == TYPEVAR; // else override will be invoked
+ Assert.check(type.tag == TYPEVAR); // else override will be invoked
return v.visitTypeParameter(this, p);
}
@@ -670,8 +669,7 @@
if (attributes_field.isEmpty())
attributes_field = package_info.attributes_field;
}
- assert attributes_field != null;
- return attributes_field;
+ return Assert.checkNonNull(attributes_field);
}
/** A package "exists" if a type or package that exists has
@@ -768,8 +766,7 @@
public List<Attribute.Compound> getAnnotationMirrors() {
if (completer != null) complete();
- assert attributes_field != null;
- return attributes_field;
+ return Assert.checkNonNull(attributes_field);
}
public Type erasure(Types types) {
@@ -1020,7 +1017,7 @@
}
public void setData(Object data) {
- assert !(data instanceof Env<?>) : this;
+ Assert.check(!(data instanceof Env<?>), this);
this.data = data;
}
@@ -1052,7 +1049,7 @@
*/
public MethodSymbol(long flags, Name name, Type type, Symbol owner) {
super(MTH, flags, name, type, owner);
- assert owner.type.tag != TYPEVAR : owner + "." + name;
+ if (owner.type.tag == TYPEVAR) Assert.error(owner + "." + name);
}
/** Clone this symbol with new owner.