src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java
changeset 58906 d58a21542c04
parent 57963 ed7eb20871c5
equal deleted inserted replaced
58905:75eedcd30a2a 58906:d58a21542c04
     1 /*
     1 /*
     2  * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   562                                     .Block(Flags.SYNTHETIC, List.of((JCStatement)rewriting.originalTree));
   562                                     .Block(Flags.SYNTHETIC, List.of((JCStatement)rewriting.originalTree));
   563             }
   563             }
   564 
   564 
   565             //TODO: to further refine the analysis, try all rewriting combinations
   565             //TODO: to further refine the analysis, try all rewriting combinations
   566             deferredAttr.attribSpeculative(treeToAnalyze, rewriting.env, attr.statInfo, new TreeRewriter(rewriting),
   566             deferredAttr.attribSpeculative(treeToAnalyze, rewriting.env, attr.statInfo, new TreeRewriter(rewriting),
   567                     t -> rewriting.diagHandler(), AttributionMode.ANALYZER, argumentAttr.withLocalCacheContext());
   567                     () -> rewriting.diagHandler(), AttributionMode.ANALYZER, argumentAttr.withLocalCacheContext());
   568             rewriting.analyzer.process(rewriting.oldTree, rewriting.replacement, rewriting.erroneous);
   568             rewriting.analyzer.process(rewriting.oldTree, rewriting.replacement, rewriting.erroneous);
   569         } catch (Throwable ex) {
   569         } catch (Throwable ex) {
   570             Assert.error("Analyzer error when processing: " +
   570             Assert.error("Analyzer error when processing: " +
   571                          rewriting.originalTree + ":" + ex.toString() + "\n" +
   571                          rewriting.originalTree + ":" + ex.toString() + "\n" +
   572                          Arrays.stream(ex.getStackTrace())
   572                          Arrays.stream(ex.getStackTrace())