diff -r d17f37522154 -r 7c537f4298fb src/share/classes/com/sun/tools/javac/comp/Attr.java --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java Mon Jan 10 14:57:59 2011 -0800 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java Mon Jan 10 15:08:31 2011 -0800 @@ -563,7 +563,7 @@ if (bound != null && bound.tsym instanceof ClassSymbol) { ClassSymbol c = (ClassSymbol)bound.tsym; if ((c.flags_field & COMPOUND) != 0) { - assert (c.flags_field & UNATTRIBUTED) != 0 : c; + Assert.check((c.flags_field & UNATTRIBUTED) != 0, c); attribClass(typaram.pos(), c); } } @@ -1434,7 +1434,7 @@ localEnv.info.varArgs = false; Type mtype = attribExpr(tree.meth, localEnv, mpt); if (localEnv.info.varArgs) - assert mtype.isErroneous() || tree.varargsElement != null; + Assert.check(mtype.isErroneous() || tree.varargsElement != null); // Compute the result type. Type restype = mtype.getReturnType(); @@ -1667,7 +1667,7 @@ typeargtypes, localEnv.info.varArgs); if (localEnv.info.varArgs) - assert tree.constructorType.isErroneous() || tree.varargsElement != null; + Assert.check(tree.constructorType.isErroneous() || tree.varargsElement != null); } if (cdef != null) { @@ -1727,7 +1727,7 @@ Symbol sym = rs.resolveConstructor( tree.pos(), localEnv, clazztype, argtypes, typeargtypes, true, tree.varargsElement != null); - assert sym.kind < AMBIGUOUS || tree.constructor.type.isErroneous(); + Assert.check(sym.kind < AMBIGUOUS || tree.constructor.type.isErroneous()); tree.constructor = sym; if (tree.constructor.kind > ERRONEOUS) { tree.constructorType = syms.errType; @@ -2961,7 +2961,7 @@ extending, implementing, List.nil()); ClassSymbol c = (ClassSymbol)a.getUpperBound().tsym; - assert (c.flags() & COMPOUND) != 0; + Assert.check((c.flags() & COMPOUND) != 0); cd.sym = c; c.sourcefile = env.toplevel.sourcefile; @@ -3093,7 +3093,7 @@ /** Finish the attribution of a class. */ private void attribClassBody(Env env, ClassSymbol c) { JCClassDecl tree = (JCClassDecl)env.tree; - assert c == tree.sym; + Assert.check(c == tree.sym); // Validate annotations chk.validateAnnotations(tree.mods.annotations, c); @@ -3134,12 +3134,9 @@ tree.type = c.type; - boolean assertsEnabled = false; - assert assertsEnabled = true; - if (assertsEnabled) { - for (List l = tree.typarams; - l.nonEmpty(); l = l.tail) - assert env.info.scope.lookup(l.head.name).scope != null; + for (List l = tree.typarams; + l.nonEmpty(); l = l.tail) { + Assert.checkNonNull(env.info.scope.lookup(l.head.name).scope); } // Check that a generic class doesn't extend Throwable