# HG changeset patch # User jjh # Date 1319146372 25200 # Node ID d37897312d318c18b0a855ce80f70c410865d105 # Parent 0dbfce4dcd6436ada3f062d8546cf947c4a4ff61 7102515: javac running very very long and not returning Reviewed-by: jjg, mcimadamore diff -r 0dbfce4dcd64 -r d37897312d31 src/share/classes/com/sun/tools/javac/comp/Resolve.java --- a/src/share/classes/com/sun/tools/javac/comp/Resolve.java Tue Oct 18 14:45:09 2011 -0700 +++ b/src/share/classes/com/sun/tools/javac/comp/Resolve.java Thu Oct 20 14:32:52 2011 -0700 @@ -691,6 +691,7 @@ case ABSENT_MTH: return wrongMethod.setWrongSym(sym, ex.getDiagnostic()); case WRONG_MTH: + if (operator) return bestSoFar; wrongMethods.addCandidate(currentStep, wrongMethod.sym, wrongMethod.explanation); case WRONG_MTHS: return wrongMethods.addCandidate(currentStep, sym, ex.getDiagnostic()); @@ -1685,6 +1686,7 @@ */ Symbol resolveOperator(DiagnosticPosition pos, int optag, Env env, List argtypes) { + startResolution(); Name name = treeinfo.operatorName(optag); Symbol sym = findMethod(env, syms.predefClass.type, name, argtypes, null, false, false, true); diff -r 0dbfce4dcd64 -r d37897312d31 test/tools/javac/7102515/T7102515.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/7102515/T7102515.java Thu Oct 20 14:32:52 2011 -0700 @@ -0,0 +1,11 @@ +/* + * @test /nodynamiccopyright/ + * @bug 7102515 + * @summary javac running very very long and not returning + * @compile/fail/ref=T7102515.out -XDrawDiagnostics T7102515.java + */ + +class T7102515 { + T7102515 badBinary = new T7102515() + new T7102515(); + Object badUnary = badBinary++; +} diff -r 0dbfce4dcd64 -r d37897312d31 test/tools/javac/7102515/T7102515.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/7102515/T7102515.out Thu Oct 20 14:32:52 2011 -0700 @@ -0,0 +1,3 @@ +T7102515.java:9:41: compiler.err.operator.cant.be.applied.1: +, T7102515, T7102515 +T7102515.java:10:32: compiler.err.operator.cant.be.applied: ++, T7102515, null +2 errors