3 Replies Latest reply: Nov 12, 2008 5:28 AM by thomas.behr RSS

    @inheritDoc producing errors and warnings.

    843810
      Hi,

      I am trying to get @inheritDoc working against the JSE, to get the standard comments included in my own documentation. I've unpacked the src.zip (from the latest jdk1.6.0_10), and included it in my -sourcepath. However, I am now getting 1 error and 662 warnings about use of proprietary methods within the JSE classes.

      Like:
      E:\Program Files\Java\jdk1.6.0_10\src\java\util\concurrent\atomic\AtomicReference.java:9: warning: sun.misc.Unsafe is Sun proprietary API and may be removed in a future release
      import sun.misc.Unsafe;
      Does anyone know how to stop this from occuring?

      Thanks in advance,

      Bob.

      Edited by: BobDavies on Nov 6, 2008 9:57 AM, Added example.
        • 1. Re: @inheritDoc producing errors and warnings.
          thomas.behr
          The proprietary API warnings is a new feature in Javadoc 6u10 and cannot be turned off. The only way to get rid of these (aside from downgrading to 6u7) is to adjust the relevant source files - which is not a practical thing to do in your case. However, these wanrings (especially in your case) are safe to ignore.

          You only need to fix the error. Unfortunately, you did not provide information on that one at all, so it is impossible to give any advice.
          • 2. Re: @inheritDoc producing errors and warnings.
            843810
            Thanks for the reply Tom, I'm pretty sure this happened with u7 as well though.

            It does seem daft that the JDK source hands out hundreds of proprietary warnings, it's not like I'm using the proprietary APIs myself or that if the proprietary APIs were to change that they'd release a JDK build which still used them!

            Roll on "-ignore proprietary"

            I couldn't find the error originally as there are so many warnings, one of the reasons for wanting to turn it off. The error btw:

            E:\Program Files\Java\jdk1.6.0_10\src\java\util\JapaneseImperialCalendar.java:20: cannot find symbol
            symbol : class LocaleData
            location: package sun.util.resources
            import sun.util.resources.LocaleData;

            Thanks for your help so far.
            • 3. Re: @inheritDoc producing errors and warnings.
              thomas.behr
              BobDavies wrote:
              Thanks for the reply Tom, I'm pretty sure this happened with u7 as well though.
              Sorry, you are right. This feature was introduced in JDK 6. You'd have to downgrade to JDK 5 to get rid of it.


              BobDavies wrote:
              I couldn't find the error originally as there are so many warnings, one of the reasons for wanting to turn it off. The error btw:

              E:\Program Files\Java\jdk1.6.0_10\src\java\util\JapaneseImperialCalendar.java:20: cannot find symbol
              symbol : class LocaleData
              location: package sun.util.resources
              import sun.util.resources.LocaleData;
              That shouldn't be an error, at least for me that is only a warning, too. You can check by running Javadoc on the following code:
              import com.sun.image.codec.jpeg.JPEGCodec;
              import sun.util.resources.LocaleData;
              
              public class Warnings {
                public static void main( String[] args ) {
                  JPEGCodec.createJPEGEncoder(null);
                  LocaleData.getDateFormatData(null);
                }
              
                private Warnings() {}
              }
              Anyways, you can get rid of the sun.util.resources.LocaleData related warning by explicitly including jre/lib/rt.jar from your JDK installation directory in Javadoc's -classpath option. I don't really understand why this is necessary, though, as I would have thought that rt.jar is included by default. After all, Javadoc always succeeds to resolve java.\*, javax.\*, etc. stuff from the JDK.