1.1 --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java Mon Jan 10 14:57:59 2011 -0800 1.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java Mon Jan 10 15:08:31 2011 -0800 1.3 @@ -563,7 +563,7 @@ 1.4 if (bound != null && bound.tsym instanceof ClassSymbol) { 1.5 ClassSymbol c = (ClassSymbol)bound.tsym; 1.6 if ((c.flags_field & COMPOUND) != 0) { 1.7 - assert (c.flags_field & UNATTRIBUTED) != 0 : c; 1.8 + Assert.check((c.flags_field & UNATTRIBUTED) != 0, c); 1.9 attribClass(typaram.pos(), c); 1.10 } 1.11 } 1.12 @@ -1434,7 +1434,7 @@ 1.13 localEnv.info.varArgs = false; 1.14 Type mtype = attribExpr(tree.meth, localEnv, mpt); 1.15 if (localEnv.info.varArgs) 1.16 - assert mtype.isErroneous() || tree.varargsElement != null; 1.17 + Assert.check(mtype.isErroneous() || tree.varargsElement != null); 1.18 1.19 // Compute the result type. 1.20 Type restype = mtype.getReturnType(); 1.21 @@ -1667,7 +1667,7 @@ 1.22 typeargtypes, 1.23 localEnv.info.varArgs); 1.24 if (localEnv.info.varArgs) 1.25 - assert tree.constructorType.isErroneous() || tree.varargsElement != null; 1.26 + Assert.check(tree.constructorType.isErroneous() || tree.varargsElement != null); 1.27 } 1.28 1.29 if (cdef != null) { 1.30 @@ -1727,7 +1727,7 @@ 1.31 Symbol sym = rs.resolveConstructor( 1.32 tree.pos(), localEnv, clazztype, argtypes, 1.33 typeargtypes, true, tree.varargsElement != null); 1.34 - assert sym.kind < AMBIGUOUS || tree.constructor.type.isErroneous(); 1.35 + Assert.check(sym.kind < AMBIGUOUS || tree.constructor.type.isErroneous()); 1.36 tree.constructor = sym; 1.37 if (tree.constructor.kind > ERRONEOUS) { 1.38 tree.constructorType = syms.errType; 1.39 @@ -2961,7 +2961,7 @@ 1.40 extending, implementing, List.<JCTree>nil()); 1.41 1.42 ClassSymbol c = (ClassSymbol)a.getUpperBound().tsym; 1.43 - assert (c.flags() & COMPOUND) != 0; 1.44 + Assert.check((c.flags() & COMPOUND) != 0); 1.45 cd.sym = c; 1.46 c.sourcefile = env.toplevel.sourcefile; 1.47 1.48 @@ -3093,7 +3093,7 @@ 1.49 /** Finish the attribution of a class. */ 1.50 private void attribClassBody(Env<AttrContext> env, ClassSymbol c) { 1.51 JCClassDecl tree = (JCClassDecl)env.tree; 1.52 - assert c == tree.sym; 1.53 + Assert.check(c == tree.sym); 1.54 1.55 // Validate annotations 1.56 chk.validateAnnotations(tree.mods.annotations, c); 1.57 @@ -3134,12 +3134,9 @@ 1.58 1.59 tree.type = c.type; 1.60 1.61 - boolean assertsEnabled = false; 1.62 - assert assertsEnabled = true; 1.63 - if (assertsEnabled) { 1.64 - for (List<JCTypeParameter> l = tree.typarams; 1.65 - l.nonEmpty(); l = l.tail) 1.66 - assert env.info.scope.lookup(l.head.name).scope != null; 1.67 + for (List<JCTypeParameter> l = tree.typarams; 1.68 + l.nonEmpty(); l = l.tail) { 1.69 + Assert.checkNonNull(env.info.scope.lookup(l.head.name).scope); 1.70 } 1.71 1.72 // Check that a generic class doesn't extend Throwable