Details

    • Type: New Feature New Feature
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Refactoring
    • Labels:
      None
    • Number of attachments :
      0

      Description

      To ease with IDE support, it is generally recommended to use explicit type information for field and method declarations, especially for API classes. Groovy-Eclipse should provide a refactoring that helps with this conversion.

      It should be able to guess the return types of methods as well as the types of fields. Generics should be included where possible and appropriate. Types that are resolved to Object should remain as def.

      eg-

      class Explicit {
        def fieldEasyInt = 9
        def fieldAssignedSomewhere
        def fieldAssignedToObject
        def fieldDontKnow
      
        def methodWithArgs(String arg1, arg2, Object arg3) {
          fieldAssignedSomewhere = [ arg1 ]
          fieldAssignedToObject = arg3
          [ arg1 : fieldEasyInt ]
        }
      }
      

      Should become:

      
      class Explicit {
        int fieldEasyInt = 9
        List<String> fieldAssignedSomewhere
        def fieldAssignedToObject
        def fieldDontKnow
      
        Map<String,Integer> methodWithArgs(String arg1, arg2, Object arg3) {
          fieldAssignedSomewhere = [ arg1 ]
          fieldAssignedToObject = arg3
          [ arg1 : fieldEasyInt ]
        }
      }
      

        Activity

        No changes have yet been made on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Andrew Eisenberg
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: