< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java

Print this page

        

*** 151,161 **** argumentAttr = ArgumentAttr.instance(context); Options options = Options.instance(context); Source source = Source.instance(context); - allowStringsInSwitch = Feature.STRINGS_IN_SWITCH.allowedInSource(source); allowPoly = Feature.POLY.allowedInSource(source); allowTypeAnnos = Feature.TYPE_ANNOTATIONS.allowedInSource(source); allowLambda = Feature.LAMBDA.allowedInSource(source); allowDefaultMethods = Feature.DEFAULT_METHODS.allowedInSource(source); allowStaticInterfaceMethods = Feature.STATIC_INTERFACE_METHODS.allowedInSource(source); --- 151,160 ----
*** 196,210 **** * RFE: 6425594 */ boolean useBeforeDeclarationWarning; /** - * Switch: allow strings in switch? - */ - boolean allowStringsInSwitch; - - /** * Switch: name of source level; used for error reporting. */ String sourceName; /** Check kind and type of given tree against protokind and prototype. --- 195,204 ----
*** 1401,1413 **** try { boolean enumSwitch = (seltype.tsym.flags() & Flags.ENUM) != 0; boolean stringSwitch = types.isSameType(seltype, syms.stringType); - if (stringSwitch && !allowStringsInSwitch) { - log.error(DiagnosticFlag.SOURCE_LEVEL, tree.selector.pos(), Feature.STRINGS_IN_SWITCH.error(sourceName)); - } if (!enumSwitch && !stringSwitch) seltype = chk.checkType(tree.selector.pos(), seltype, syms.intType); // Attribute all cases and // check that there are no duplicate case labels or default clauses. --- 1395,1404 ----
< prev index next >