File tree 3 files changed +3
-10
lines changed
src/jdk.compiler/share/classes/com/sun/tools/javac
3 files changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -167,9 +167,7 @@ protected Attr(Context context) {
167
167
allowLambda = Feature .LAMBDA .allowedInSource (source );
168
168
allowDefaultMethods = Feature .DEFAULT_METHODS .allowedInSource (source );
169
169
allowStaticInterfaceMethods = Feature .STATIC_INTERFACE_METHODS .allowedInSource (source );
170
- allowReifiableTypesInInstanceof =
171
- Feature .REIFIABLE_TYPES_INSTANCEOF .allowedInSource (source ) &&
172
- (!preview .isPreview (Feature .REIFIABLE_TYPES_INSTANCEOF ) || preview .isEnabled ());
170
+ allowReifiableTypesInInstanceof = Feature .REIFIABLE_TYPES_INSTANCEOF .allowedInSource (source );
173
171
allowRecords = Feature .RECORDS .allowedInSource (source );
174
172
sourceName = source .name ;
175
173
useBeforeDeclarationWarning = options .isSet ("useBeforeDeclarationWarning" );
@@ -3996,9 +3994,6 @@ public void visitTypeTest(JCInstanceOf tree) {
3996
3994
if (!clazztype .isErroneous () && !types .isReifiable (clazztype )) {
3997
3995
boolean valid = false ;
3998
3996
if (allowReifiableTypesInInstanceof ) {
3999
- if (preview .isPreview (Feature .REIFIABLE_TYPES_INSTANCEOF )) {
4000
- preview .warnPreview (tree .expr .pos (), Feature .REIFIABLE_TYPES_INSTANCEOF );
4001
- }
4002
3997
Warner warner = new Warner ();
4003
3998
if (!types .isCastable (exprtype , clazztype , warner )) {
4004
3999
chk .basicHandler .report (tree .expr .pos (),
Original file line number Diff line number Diff line change @@ -146,8 +146,7 @@ protected Resolve(Context context) {
146
146
Target target = Target .instance (context );
147
147
allowFunctionalInterfaceMostSpecific = Feature .FUNCTIONAL_INTERFACE_MOST_SPECIFIC .allowedInSource (source );
148
148
allowLocalVariableTypeInference = Feature .LOCAL_VARIABLE_TYPE_INFERENCE .allowedInSource (source );
149
- allowYieldStatement = (!preview .isPreview (Feature .SWITCH_EXPRESSION ) || preview .isEnabled ()) &&
150
- Feature .SWITCH_EXPRESSION .allowedInSource (source );
149
+ allowYieldStatement = Feature .SWITCH_EXPRESSION .allowedInSource (source );
151
150
checkVarargsAccessAfterResolution =
152
151
Feature .POST_APPLICABILITY_VARARGS_ACCESS_CHECK .allowedInSource (source );
153
152
polymorphicSignatureScope = WriteableScope .create (syms .noSymbol );
Original file line number Diff line number Diff line change @@ -183,8 +183,7 @@ protected JavacParser(ParserFactory fac,
183
183
this .keepLineMap = keepLineMap ;
184
184
this .errorTree = F .Erroneous ();
185
185
endPosTable = newEndPosTable (keepEndPositions );
186
- this .allowYieldStatement = (!preview .isPreview (Feature .SWITCH_EXPRESSION ) || preview .isEnabled ()) &&
187
- Feature .SWITCH_EXPRESSION .allowedInSource (source );
186
+ this .allowYieldStatement = Feature .SWITCH_EXPRESSION .allowedInSource (source );
188
187
this .allowRecords = Feature .RECORDS .allowedInSource (source );
189
188
this .allowSealedTypes = Feature .SEALED_CLASSES .allowedInSource (source );
190
189
}
You can’t perform that action at this time.
0 commit comments