mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-16 17:14:41 +02:00
8006566: Remove transient lambda-related guards from JavacParser
Remove transitional internal flag for allowing intersection types in cast Reviewed-by: jjg
This commit is contained in:
parent
442154dcf9
commit
422c8bd914
7 changed files with 6 additions and 10 deletions
|
@ -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
|
||||||
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 {
|
||||||
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 @@
|
||||||
* @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 @@
|
||||||
|
|
||||||
// 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 @@
|
||||||
* @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 {
|
||||||
|
|
||||||
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) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue