this.names = fac.names; this.source = fac.source; this.allowGenerics = source.allowGenerics(); this.allowVarargs = source.allowVarargs(); this.allowAsserts = source.allowAsserts(); this.allowEnums = source.allowEnums(); this.allowForeach = source.allowForeach(); this.allowStaticImport = source.allowStaticImport(); this.allowAnnotations = source.allowAnnotations(); this.allowTWR = source.allowTryWithResources(); this.allowDiamond = source.allowDiamond(); this.allowMulticatch = source.allowMulticatch(); this.allowStringFolding = fac.options.getBoolean("allowStringFolding", true); this.allowLambda = source.allowLambda(); this.allowMethodReferences = source.allowMethodReferences(); this.allowDefaultMethods = source.allowDefaultMethods(); this.allowStaticInterfaceMethods = source.allowStaticInterfaceMethods(); this.allowIntersectionTypesInCast = source.allowIntersectionTypesInCast(); this.allowTypeAnnotations = source.allowTypeAnnotations(); this.keepDocComments = keepDocComments; docComments = newDocCommentTable(keepDocComments, fac);
Source source = Source.instance(context); allowGenerics = source.allowGenerics(); allowVarargs = source.allowVarargs(); allowEnums = source.allowEnums(); allowBoxing = source.allowBoxing(); allowCovariantReturns = source.allowCovariantReturns(); allowAnonOuterThis = source.allowAnonOuterThis(); allowStringsInSwitch = source.allowStringsInSwitch(); allowPoly = source.allowPoly(); allowTypeAnnos = source.allowTypeAnnotations(); allowLambda = source.allowLambda(); allowDefaultMethods = source.allowDefaultMethods(); sourceName = source.name; relax = (options.isSet("-retrofit") || options.isSet("-relax")); findDiamonds = options.get("findDiamond") != null && source.allowDiamond(); useBeforeDeclarationWarning = options.isSet("useBeforeDeclarationWarning"); identifyLambdaCandidate = options.getBoolean("identifyLambdaCandidate", false);
fileManager = context.get(JavaFileManager.class); Source source = Source.instance(context); allowGenerics = source.allowGenerics(); allowVarargs = source.allowVarargs(); allowAnnotations = source.allowAnnotations(); allowCovariantReturns = source.allowCovariantReturns(); allowSimplifiedVarargs = source.allowSimplifiedVarargs(); allowDefaultMethods = source.allowDefaultMethods(); allowStrictMethodClashCheck = source.allowStrictMethodClashCheck(); complexInference = options.isSet("complexinference"); warnOnSyntheticConflicts = options.isSet("warnOnSyntheticConflicts"); boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED); boolean verboseSunApi = lint.isEnabled(LintCategory.SUNAPI); boolean enforceMandatoryWarnings = source.enforceMandatoryWarnings();
checkClassFile = options.isSet("-checkclassfile"); Source source = Source.instance(context); allowGenerics = source.allowGenerics(); allowVarargs = source.allowVarargs(); allowAnnotations = source.allowAnnotations(); allowSimplifiedVarargs = source.allowSimplifiedVarargs(); allowDefaultMethods = source.allowDefaultMethods();
protected Attr(Context context) { context.put(attrKey, this); names = Name.Table.instance(context); log = Log.instance(context); syms = Symtab.instance(context); rs = Resolve.instance(context); chk = Check.instance(context); memberEnter = MemberEnter.instance(context); make = TreeMaker.instance(context); enter = Enter.instance(context); cfolder = ConstFold.instance(context); target = Target.instance(context); types = Types.instance(context); annotate = Annotate.instance(context); Options options = Options.instance(context); Source source = Source.instance(context); allowGenerics = source.allowGenerics(); allowVarargs = source.allowVarargs(); allowEnums = source.allowEnums(); allowBoxing = source.allowBoxing(); allowCovariantReturns = source.allowCovariantReturns(); allowAnonOuterThis = source.allowAnonOuterThis(); relax = (options.get("-retrofit") != null || options.get("-relax") != null); useBeforeDeclarationWarning = options.get("useBeforeDeclarationWarning") != null; }
/** Construct a parser from a given scanner, tree factory and log. */ protected Parser(Factory fac, Lexer S, boolean keepDocComments) { this.S = S; S.nextToken(); // prime the pump this.F = fac.F; this.log = fac.log; this.names = fac.names; this.keywords = fac.keywords; this.source = fac.source; Options options = fac.options; this.allowGenerics = source.allowGenerics(); this.allowVarargs = source.allowVarargs(); this.allowAsserts = source.allowAsserts(); this.allowEnums = source.allowEnums(); this.allowForeach = source.allowForeach(); this.allowStaticImport = source.allowStaticImport(); this.allowAnnotations = source.allowAnnotations(); this.keepDocComments = keepDocComments; if (keepDocComments) docComments = new HashMap<JCTree,String>(); this.errorTree = F.Erroneous(); }
/** Allow encoding errors, giving only warnings. */ public boolean allowEncodingErrors() { return compareTo(JDK1_6) < 0; } public boolean allowAsserts() {
? Source.lookup(sourceString) : Source.DEFAULT; String targetString = options.get("-target"); if (target.compareTo(source.requiredTarget()) < 0) { if (targetString != null) { if (sourceString == null) { warning("warn.target.default.source.conflict", targetString, source.requiredTarget().name); } else { warning("warn.source.target.conflict", sourceString, source.requiredTarget().name); options.put("-target", source.requiredTarget().name); if (targetString == null && !source.allowGenerics()) { options.put("-target", Target.JDK1_4.name);
protected Types(Context context) { context.put(typesKey, this); syms = Symtab.instance(context); names = Names.instance(context); Source source = Source.instance(context); allowBoxing = source.allowBoxing(); allowCovariantReturns = source.allowCovariantReturns(); allowObjectToPrimitiveCast = source.allowObjectToPrimitiveCast(); allowDefaultMethods = source.allowDefaultMethods(); reader = ClassReader.instance(context); chk = Check.instance(context); enter = Enter.instance(context); capturedName = names.fromString("<captured wildcard>"); messages = JavacMessages.instance(context); diags = JCDiagnostic.Factory.instance(context); functionDescriptorLookupError = new FunctionDescriptorLookupError(); noWarnings = new Warner(null); } // </editor-fold>
protected TransTypes(Context context) { context.put(transTypesKey, this); compileStates = CompileStates.instance(context); names = Names.instance(context); log = Log.instance(context); syms = Symtab.instance(context); enter = Enter.instance(context); overridden = new HashMap<MethodSymbol,MethodSymbol>(); Source source = Source.instance(context); allowEnums = source.allowEnums(); addBridges = source.addBridges(); allowInterfaceBridges = source.allowDefaultMethods(); types = Types.instance(context); make = TreeMaker.instance(context); resolve = Resolve.instance(context); }
protected Check(Context context) { context.put(checkKey, this); names = Name.Table.instance(context); log = Log.instance(context); syms = Symtab.instance(context); infer = Infer.instance(context); this.types = Types.instance(context); Options options = Options.instance(context); target = Target.instance(context); source = Source.instance(context); lint = Lint.instance(context); treeinfo = TreeInfo.instance(context); Source source = Source.instance(context); allowGenerics = source.allowGenerics(); allowAnnotations = source.allowAnnotations(); complexInference = options.get("-complexinference") != null; skipAnnotations = options.get("skipAnnotations") != null; boolean verboseDeprecated = lint.isEnabled(LintCategory.DEPRECATION); boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED); boolean enforceMandatoryWarnings = source.enforceMandatoryWarnings(); deprecationHandler = new MandatoryWarningHandler(log,verboseDeprecated, enforceMandatoryWarnings, "deprecated"); uncheckedHandler = new MandatoryWarningHandler(log, verboseUnchecked, enforceMandatoryWarnings, "unchecked"); }
protected Source getSource() { String sourceName = options.get(OptionName.SOURCE); Source source = null; if (sourceName != null) source = Source.lookup(sourceName); return (source != null ? source : Source.DEFAULT); }
types = Types.instance(context); diags = JCDiagnostic.Factory.instance(context); Source source = Source.instance(context); boxingEnabled = source.allowBoxing(); varargsEnabled = source.allowVarargs(); Options options = Options.instance(context); debugResolve = options.isSet("debugresolve"); Target target = Target.instance(context); allowMethodHandles = target.hasMethodHandles(); allowDefaultMethods = source.allowDefaultMethods(); allowStructuralMostSpecific = source.allowStructuralMostSpecific(); polymorphicSignatureScope = new Scope(syms.noSymbol);
protected TransTypes(Context context) { context.put(transTypesKey, this); names = Name.Table.instance(context); log = Log.instance(context); syms = Symtab.instance(context); enter = Enter.instance(context); overridden = new HashMap<MethodSymbol,MethodSymbol>(); Source source = Source.instance(context); allowEnums = source.allowEnums(); addBridges = source.addBridges(); types = Types.instance(context); make = TreeMaker.instance(context); resolve = Resolve.instance(context); }
protected Resolve(Context context) { context.put(resolveKey, this); syms = Symtab.instance(context); varNotFound = new ResolveError(ABSENT_VAR, syms.errSymbol, "variable not found"); wrongMethod = new ResolveError(WRONG_MTH, syms.errSymbol, "method not found"); wrongMethods = new ResolveError(WRONG_MTHS, syms.errSymbol, "wrong methods"); methodNotFound = new ResolveError(ABSENT_MTH, syms.errSymbol, "method not found"); typeNotFound = new ResolveError(ABSENT_TYP, syms.errSymbol, "type not found"); names = Name.Table.instance(context); log = Log.instance(context); chk = Check.instance(context); infer = Infer.instance(context); reader = ClassReader.instance(context); treeinfo = TreeInfo.instance(context); types = Types.instance(context); Source source = Source.instance(context); boxingEnabled = source.allowBoxing(); varargsEnabled = source.allowVarargs(); Options options = Options.instance(context); debugResolve = options.get("debugresolve") != null; }
protected Flow(Context context) { context.put(flowKey, this); names = Names.instance(context); log = Log.instance(context); syms = Symtab.instance(context); types = Types.instance(context); chk = Check.instance(context); lint = Lint.instance(context); rs = Resolve.instance(context); diags = JCDiagnostic.Factory.instance(context); Source source = Source.instance(context); allowImprovedRethrowAnalysis = source.allowImprovedRethrowAnalysis(); allowImprovedCatchAnalysis = source.allowImprovedCatchAnalysis(); allowEffectivelyFinalInInnerClasses = source.allowEffectivelyFinalInInnerClasses(); enforceThisDotInit = source.enforceThisDotInit(); }
types = Types.instance(context); diags = JCDiagnostic.Factory.instance(context); Source source = Source.instance(context); boxingEnabled = source.allowBoxing(); varargsEnabled = source.allowVarargs(); Options options = Options.instance(context); debugResolve = options.isSet("debugresolve"); Target target = Target.instance(context); allowMethodHandles = target.hasMethodHandles(); allowFunctionalInterfaceMostSpecific = source.allowFunctionalInterfaceMostSpecific(); checkVarargsAccessAfterResolution = source.allowPostApplicabilityVarargsAccessCheck(); polymorphicSignatureScope = new Scope(syms.noSymbol);
/** Create a new scanner factory. */ protected Factory(Context context) { context.put(scannerFactoryKey, this); this.log = Log.instance(context); this.names = Name.Table.instance(context); this.source = Source.instance(context); this.keywords = Keywords.instance(context); }
ClassPath classPath = null; ClassPath srcClassPath = cpInfo.getClassPath(PathKind.SOURCE); com.sun.tools.javac.code.Source[] sources = com.sun.tools.javac.code.Source.values(); Level warnLevel; if (sourceLevel == null) { if (source == com.sun.tools.javac.code.Source.lookup(sourceLevel)) { if (DISABLE_SOURCE_LEVEL_DOWNGRADE) { return source; if (source.compareTo(com.sun.tools.javac.code.Source.JDK1_4) >= 0) { if (bootClassPath != null && bootClassPath.findResource("java/lang/AssertionError.class") == null) { //NOI18N if (bootClassPath.findResource("java/lang/Object.class") == null) { // NOI18N if (source.compareTo(com.sun.tools.javac.code.Source.JDK1_5) >= 0 && !hasResource("java/lang/StringBuilder", bootClassPath, classPath, srcClassPath)) { //NOI18N LOGGER.log(warnLevel, if (source.compareTo(com.sun.tools.javac.code.Source.JDK1_7) >= 0 && !hasResource("java/lang/AutoCloseable", bootClassPath, classPath, srcClassPath)) { //NOI18N LOGGER.log(warnLevel, if (source.compareTo(com.sun.tools.javac.code.Source.JDK1_8) >= 0 && !hasResource("java/util/stream/Streams", bootClassPath, classPath, srcClassPath)) { //NOI18N LOGGER.log(warnLevel, if (source.compareTo(com.sun.tools.javac.code.Source.JDK1_9) >= 0 && !hasResource("java/util/zip/CRC32C", bootClassPath, classPath, srcClassPath)) { //NOI18N LOGGER.log(warnLevel,