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

stubgen: Extra method created for Boolean property

    XMLWordPrintableJSON

Details

    Description

      Consider the following:

      class Pogo {
        Boolean x
        boolean isX() { x }
      }
      

      Stub for joint compilation includes two isX() methods:

      import java.lang.*;
      import java.util.*;
      import java.io.*;
      import java.net.*;
      import groovy.lang.*;
      import groovy.util.*;
      
      public class Pogo extends java.lang.Object  implements groovy.lang.GroovyObject {
        @groovy.transform.Generated() @groovy.transform.Internal() @java.beans.Transient() 
        public  groovy.lang.MetaClass getMetaClass() { return (groovy.lang.MetaClass)null;}
        @groovy.transform.Generated() @groovy.transform.Internal() public  void 
        setMetaClass(groovy.lang.MetaClass mc) { }
        public  java.lang.Boolean getX() { return (java.lang.Boolean)null;}
        public  java.lang.Boolean isX() { return (java.lang.Boolean)null;}
        public  void setX(java.lang.Boolean value) { }
        public  boolean isX() { return false;}
      }
      

      javac says: "error: method isX() is already defined in class Pogo"

      Attachments

        Activity

          People

            emilles Eric Milles
            emilles Eric Milles
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: