< prev index next >

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

Print this page

75     }
76 
77     /**
78      * Add free variable to fvs list unless it is already there.
79      */
80     protected void addFreeVar(Symbol.VarSymbol v) {
81         fvs.add(v);
82     }
83 
84     @Override
85     public void visitVarDef(JCTree.JCVariableDecl tree) {
86         if (tree.sym.owner.kind == MTH) {
87             seenVars.add(tree.sym);
88         }
89         super.visitVarDef(tree);
90     }
91 
92     /**
93      * Obtains the list of captured local variables in the tree under analysis.
94      */
95     List<Symbol.VarSymbol> analyzeCaptures() {
96         scan(tree);
97         return List.from(fvs);
98     }
99 }

75     }
76 
77     /**
78      * Add free variable to fvs list unless it is already there.
79      */
80     protected void addFreeVar(Symbol.VarSymbol v) {
81         fvs.add(v);
82     }
83 
84     @Override
85     public void visitVarDef(JCTree.JCVariableDecl tree) {
86         if (tree.sym.owner.kind == MTH) {
87             seenVars.add(tree.sym);
88         }
89         super.visitVarDef(tree);
90     }
91 
92     /**
93      * Obtains the list of captured local variables in the tree under analysis.
94      */
95     public List<Symbol.VarSymbol> analyzeCaptures() {
96         scan(tree);
97         return List.from(fvs);
98     }
99 }
< prev index next >