Package com.sun.tools.javac.tree.JCTree

Examples of com.sun.tools.javac.tree.JCTree.JCModifiers


  @Override
  public Description matchVariable(VariableTree tree, VisitorState state) {
    if (ANNOTATED_WITH_GUICE_INJECT_MATCHER.matches(tree, state)
            && FINAL_FIELD_MATCHER.matches(tree, state)) {
      JCModifiers modifiers = ((JCVariableDecl) tree).getModifiers();
      long replacementFlags = modifiers.flags ^ Flags.FINAL;
      JCModifiers replacementModifiers = TreeMaker.instance(state.context)
          .Modifiers(replacementFlags, modifiers.annotations);
      /*
       * replace new lines with strings, trim whitespace and remove empty parens to make the
       * suggested fixes look sane
       */
      String replacementModifiersString =
          replacementModifiers.toString().replace('\n', ' ').replace("()", "").trim();
      return describeMatch(modifiers,
          SuggestedFix.replace(modifiers, replacementModifiersString));
    }
    return Description.NO_MATCH;
  }
View Full Code Here


            }
            if (quotedName.equals("ceylon$language")) {
                continue;
            }
            List<JCAnnotation> importAnnotations = expressionGen().transform(imported.getAnnotationList());
            JCModifiers mods = make().Modifiers(Flags.PUBLIC | Flags.STATIC | Flags.FINAL, importAnnotations);
            Name fieldName = names().fromString(quotedName);
            builder.defs(List.<JCTree>of(make().VarDef(mods, fieldName, make().Type(syms().stringType), makeNull())));
        }
        return builder.build();
    }
View Full Code Here

TOP

Related Classes of com.sun.tools.javac.tree.JCTree.JCModifiers

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.