Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6709709

javadoc does not get compilation errors after type erasure

XMLWordPrintable

    • b08
    • x86
    • windows_xp
    • Verified

        FULL PRODUCT VERSION :
        java 1.5.0.12

        A DESCRIPTION OF THE PROBLEM :
        run javadoc against the following class:
        package bug;

        import java.util.List;

        public class JavaDocGenerics {
         public void a(List<String> s){}
         public void a(List<StringBuffer> s){}
        }

        No warning or error will be reported. The html will be generated, although anchors for both methods will be the same.

        However,

        Run the javadoc against the following class

        package bug;



        public class JavaDocNoneGenerics {
           public void b(int a){}
           public void b(int a){}
        }

        The javadoc will report:
        " b(int) is already defined in bug.JavaDocGenerics
           public void b(int a){}
                       ^
        "
        and the html file will be generated will one method in it.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        run javadoc against the following class:
        package bug;

        import java.util.List;

        public class JavaDocGenerics {
         public void a(List<String> s){}
         public void a(List<StringBuffer> s){}
        }

        No warning or error will be reported. The html will be generated, although anchors for both methods will be the same.

        However,

        Run the javadoc against the following class

        package bug;



        public class JavaDocNoneGenerics {
           public void b(int a){}
           public void b(int a){}
        }

        The javadoc will report:
        " b(int) is already defined in bug.JavaDocGenerics
           public void b(int a){}
                       ^
        "
        and the html file will be generated will one method in it.


        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------

        package bug;
        import java.util.List;

        public class JavaDocGenerics {
         public void a(List<String> s){}
         public void a(List<StringBuffer> s){}
        }





        package bug;

        public class JavaDocNoneGenerics {
           public void b(int a){}
           public void b(int a){}
        }

        ---------- END SOURCE ----------

              coffeys Sean Coffey
              mbykov Misha Bykov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: