Package com.sun.source.tree

Examples of com.sun.source.tree.ModifiersTree


    // figure out where to insert the static modifier
    // if there is other modifier, prepend 'static ' in front of class
    // else insert 'static ' AFTER public/private/protected and BEFORE final
    Fix fix;

    ModifiersTree mods = tree.getModifiers();
    if (mods.getFlags().isEmpty()) {
      fix = SuggestedFix.prefixWith(tree, "static ");
    } else {
      // Note that the use of .toString() here effectively destroys any special
      // formatting, eg if the modifiers previously had multiple spaces or a
      // comment between them, after this fix they will all have exactly one
      // space between each modifier.
      String newmods = mods.toString();
      int ind = newmods.indexOf("final");
      if (ind < 0) {
        // append if 'final' not found
        newmods += "static";
        fix = SuggestedFix.replace(mods, newmods);
View Full Code Here

TOP

Related Classes of com.sun.source.tree.ModifiersTree

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.