Ejemplo n.º 1
0
 @Override
 public void visitVariable(VariableTree tree) {
   Symbol symbol = tree.symbol();
   if (symbol != null && !symbol.isStatic()) {
     super.visitVariable(tree);
   }
 }
Ejemplo n.º 2
0
 private static boolean isFirstParentStatic(Deque<Symbol> outerClasses) {
   if (outerClasses.size() == 1) {
     return true;
   }
   for (Symbol outerClass : outerClasses) {
     if (outerClass.isStatic()) {
       return true;
     }
   }
   return false;
 }
Ejemplo n.º 3
0
 private int referenceInstance(Symbol symbol) {
   Symbol owner = symbol.owner();
   if (owner != null && owner.isMethodSymbol()) {
     // local variable, use owner of the method
     owner = owner.owner();
   }
   int result = -1;
   if (owner != null && !outerClasses.peek().equals(owner)) {
     if (symbol.isUnknown()) {
       result = atLeastOneReference.size() - 1;
     } else if (!symbol.isStatic()) {
       result = fromInstance(symbol, owner);
     }
   }
   return result;
 }