Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-4935

stub generator loses package qualification for generic type argument

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.1
    • 1.8.1, 1.7.11
    • None
    • Windows XP (as it happens)
      jdk1.6.0_17

    Description

      In my groovy class, I have a method that returns a List<Year>, where <Year> is a java class in another package. (Not sure whether the "java" part is relevant; it's what my code happened to do. I also haven't checked whether this problem happens only with method return types, though I think all the examples I saw had that property.)

      import other_package.Year
      
      class YearRange {
         List<Year> getYears() {
            return null
         }
      }
      

      When groovy creates the stub, however, it includes the full package name for List, but not for Year:

        [groovyc] C:\DOCUME~1\cyrus\LOCALS~1\Temp\groovy-generated-1209606927705701441-java-source\one_package\YearRange.java:18: cannot find symbol
        [groovyc] symbol  : class Year
        [groovyc] location: class one_package.YearRange
        [groovyc] public  java.util.List<Year> getYears() { return (java.util.List<Year>)null;}
        [groovyc]                        ^
        [groovyc] C:\DOCUME~1\cyrus\LOCALS~1\Temp\groovy-generated-1209606927705701441-java-source\one_package\YearRange.java:18: cannot find symbol
        [groovyc] symbol  : class Year
        [groovyc] location: class one_package.YearRange
        [groovyc] public  java.util.List<Year> getYears() { return (java.util.List<Year>)null;}
      

      I have this problem with the following snapshot build:
      groovy-all-1.8.1-SNAPSHOT.jar 20-Jul-2011 06:11 5.8M

      I do not have this problem with groovy 1.8.0.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            paulk Paul King
            lgdean Laura Dean
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment