• Icon: Sub-task Sub-task
    • Resolution: Unresolved
    • Icon: Major Major
    • 3.x Future
    • 2.19.0.Final
    • Java EE
    • None

      At the moment we can add a field to a target class with the java-new-field command (which by the way should be renamed to java-add-field). It generates getters, setters, updates the toString method....

      It would be good to have a command to add a constant to a target class (no need to have getters, setter...). So something as simple as :

      java-add-constant --name MyConstant 

      By default it will be a String. The command will uppercase the name and set it public static final :

      public class MyClass {
         public static final String MY_CONSTANT ;

      We could set a value, change the access type :

      java-add-constant --name MyConstant --value "My Value" --accessType private

      Will generate :

      public class MyClass {
         private static final String MY_CONSTANT = "My Value";

            Unassigned Unassigned
            agoncal Antonio Goncalves (Inactive)
            0 Vote for this issue
            1 Start watching this issue