提交 7677294e 编写于 作者: M mcimadamore

8006566: Remove transient lambda-related guards from JavacParser

Summary: Remove transitional internal flag for allowing intersection types in cast
Reviewed-by: jjg
上级 924002c6
...@@ -124,9 +124,7 @@ public class JavacParser implements Parser { ...@@ -124,9 +124,7 @@ public class JavacParser implements Parser {
this.allowLambda = source.allowLambda(); this.allowLambda = source.allowLambda();
this.allowMethodReferences = source.allowMethodReferences(); this.allowMethodReferences = source.allowMethodReferences();
this.allowDefaultMethods = source.allowDefaultMethods(); this.allowDefaultMethods = source.allowDefaultMethods();
this.allowIntersectionTypesInCast = this.allowIntersectionTypesInCast = source.allowIntersectionTypesInCast();
source.allowIntersectionTypesInCast() &&
fac.options.isSet("allowIntersectionTypes");
this.keepDocComments = keepDocComments; this.keepDocComments = keepDocComments;
docComments = newDocCommentTable(keepDocComments, fac); docComments = newDocCommentTable(keepDocComments, fac);
this.keepLineMap = keepLineMap; this.keepLineMap = keepLineMap;
......
...@@ -287,8 +287,7 @@ public class IntersectionTypeCastTest ...@@ -287,8 +287,7 @@ public class IntersectionTypeCastTest
final JavaCompiler tool = ToolProvider.getSystemJavaCompiler(); final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
JavacTask ct = (JavacTask)tool.getTask(null, fm.get(), diagChecker, JavacTask ct = (JavacTask)tool.getTask(null, fm.get(), diagChecker,
Arrays.asList("-XDallowIntersectionTypes"), null, null, Arrays.asList(source));
null, Arrays.asList(source));
try { try {
ct.analyze(); ct.analyze();
} catch (Throwable ex) { } catch (Throwable ex) {
......
...@@ -170,7 +170,7 @@ public class IntersectionTypeParserTest { ...@@ -170,7 +170,7 @@ public class IntersectionTypeParserTest {
void run(JavaCompiler tool, StandardJavaFileManager fm) throws Exception { void run(JavaCompiler tool, StandardJavaFileManager fm) throws Exception {
checkCount++; checkCount++;
JavacTask ct = (JavacTask)tool.getTask(null, fm, diagChecker, JavacTask ct = (JavacTask)tool.getTask(null, fm, diagChecker,
Arrays.asList("-XDallowIntersectionTypes"), null, Arrays.asList(source)); null, null, Arrays.asList(source));
ct.parse(); ct.parse();
if (diagChecker.errorFound) { if (diagChecker.errorFound) {
throw new Error("Unexpected parser error for source:\n" + throw new Error("Unexpected parser error for source:\n" +
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
* @summary Add support for intersection types in cast expression * @summary Add support for intersection types in cast expression
* @library /tools/javac/lib * @library /tools/javac/lib
* @build JavacTestingAbstractProcessor ModelChecker * @build JavacTestingAbstractProcessor ModelChecker
* @compile -XDallowIntersectionTypes -processor ModelChecker Model01.java * @compile -processor ModelChecker Model01.java
*/ */
import javax.lang.model.element.ElementKind; import javax.lang.model.element.ElementKind;
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
// key: compiler.err.prob.found.req // key: compiler.err.prob.found.req
// key: compiler.misc.secondary.bound.must.be.marker.intf // key: compiler.misc.secondary.bound.must.be.marker.intf
// options: -XDallowIntersectionTypes
class SecondaryBoundMustBeMarkerInterface { class SecondaryBoundMustBeMarkerInterface {
Runnable r = (Runnable & Comparable<?>)()->{}; Runnable r = (Runnable & Comparable<?>)()->{};
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
* @test * @test
* @bug 8002099 * @bug 8002099
* @summary Add support for intersection types in cast expression * @summary Add support for intersection types in cast expression
* @compile/fail/ref=Intersection01.out -XDallowIntersectionTypes -XDrawDiagnostics Intersection01.java * @compile/fail/ref=Intersection01.out -XDrawDiagnostics Intersection01.java
*/ */
class Intersection01 { class Intersection01 {
......
...@@ -248,7 +248,7 @@ public class IntersectionTargetTypeTest { ...@@ -248,7 +248,7 @@ public class IntersectionTargetTypeTest {
void run(JavaCompiler tool, StandardJavaFileManager fm) throws Exception { void run(JavaCompiler tool, StandardJavaFileManager fm) throws Exception {
JavacTask ct = (JavacTask)tool.getTask(null, fm, diagChecker, JavacTask ct = (JavacTask)tool.getTask(null, fm, diagChecker,
Arrays.asList("-XDallowIntersectionTypes"), null, Arrays.asList(source)); null, null, Arrays.asList(source));
try { try {
ct.analyze(); ct.analyze();
} catch (Throwable ex) { } catch (Throwable ex) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册