8005782: get rid of javadoc errors, warnings in nashorn build

Reviewed-by: lagergren
diff --git a/nashorn/make/build.xml b/nashorn/make/build.xml
index bfff718..b893635 100644
--- a/nashorn/make/build.xml
+++ b/nashorn/make/build.xml
@@ -63,7 +63,7 @@
 
   <!-- do it only if ASM is not available -->
   <target name="compile-asm" depends="prepare" unless="asm.available">
-    <javac srcdir="${asm.src.dir}"
+    <javac srcdir="${jdk.asm.src.dir}"
            destdir="${build.classes.dir}"
            excludes="**/optimizer/* **/xml/* **/attrs/*"
            source="${javac.source}"
@@ -142,15 +142,20 @@
     </jar>
   </target>
 
-  <target name="javadoc" depends="compile-asm">
-    <javadoc destdir="${dist.javadoc.dir}" use="yes" overview="src/overview.html" windowtitle="${nashorn.product.name} ${nashorn.version}">
+  <target name="javadoc" depends="prepare">
+    <javadoc destdir="${dist.javadoc.dir}" use="yes" overview="src/overview.html" windowtitle="${nashorn.product.name} ${nashorn.version}" additionalparam="-quiet" failonerror="true">
       <classpath>
         <pathelement location="${build.classes.dir}"/>
         <pathelement location="${dynalink.jar}"/>
       </classpath>
       <fileset dir="${src.dir}" includes="**/*.java"/>
-      <link href="http://docs.oracle.com/javase/7/docs/api"/>
-      <link href="http://szegedi.github.com/dynalink/0.4/javadoc"/>
+      <fileset dir="${jdk.asm.src.dir}" includes="**/*.java"/>
+      <link href="http://docs.oracle.com/javase/7/docs/api/"/>
+      <link href="http://szegedi.github.com/dynalink/0.4/javadoc/"/>
+      <!-- The following tags are used only in ASM sources - just ignore these -->
+      <tag name="label" description="label tag in ASM sources" enabled="false"/>
+      <tag name="linked" description="linked tag in ASM sources" enabled="false"/>
+      <tag name="associates" description="associates tag in ASM sources" enabled="false"/>
     </javadoc>
   </target>
 
diff --git a/nashorn/make/project.properties b/nashorn/make/project.properties
index b6c8570..3868ead 100644
--- a/nashorn/make/project.properties
+++ b/nashorn/make/project.properties
@@ -23,6 +23,9 @@
 
 application.title=nashorn
 
+# location of JDK embedded ASM sources
+jdk.asm.src.dir=../jdk/src/share/classes/jdk/internal
+
 # source and target levels
 build.compiler=modern
 javac.source=1.7
@@ -58,10 +61,6 @@
 dist.jar=${dist.dir}/nashorn.jar
 dist.javadoc.dir=${dist.dir}/javadoc
 
-# directory where asm project lives
-asm.dir=../asm
-asm.src.dir=${asm.dir}/src
-
 # jars refererred
 file.reference.testng.jar=test/lib/testng.jar
 
diff --git a/nashorn/src/jdk/nashorn/internal/codegen/MethodEmitter.java b/nashorn/src/jdk/nashorn/internal/codegen/MethodEmitter.java
index 78d5ab7..6a8b2fe 100644
--- a/nashorn/src/jdk/nashorn/internal/codegen/MethodEmitter.java
+++ b/nashorn/src/jdk/nashorn/internal/codegen/MethodEmitter.java
@@ -155,7 +155,7 @@
 
     /**
      * Constructor - internal use from ClassEmitter only
-     * @see ClassEmitter.method
+     * @see ClassEmitter#method
      *
      * @param classEmitter the class emitter weaving the class this method is in
      * @param method       a method visitor
@@ -166,7 +166,7 @@
 
     /**
      * Constructor - internal use from ClassEmitter only
-     * @see ClassEmitter.method
+     * @see ClassEmitter#method
      *
      * @param classEmitter the class emitter weaving the class this method is in
      * @param method       a method visitor
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/ECMAErrors.java b/nashorn/src/jdk/nashorn/internal/runtime/ECMAErrors.java
index ceabcd2..c0ab054 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/ECMAErrors.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ECMAErrors.java
@@ -38,13 +38,16 @@
     private static final String MESSAGES_RESOURCE = "jdk.nashorn.internal.runtime.resources.Messages";
 
     // Without do privileged, under security manager messages can not be loaded.
-    private static final ResourceBundle MESSAGES_BUNDLE = AccessController.doPrivileged(
+    private static final ResourceBundle MESSAGES_BUNDLE;
+    static {
+        MESSAGES_BUNDLE = AccessController.doPrivileged(
         new PrivilegedAction<ResourceBundle>() {
             @Override
             public ResourceBundle run() {
                 return ResourceBundle.getBundle(MESSAGES_RESOURCE, Locale.getDefault());
             }
         });
+    }
 
     private ECMAErrors() {
     }
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java b/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java
index f2d34c2..f642638 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/PropertyMap.java
@@ -417,8 +417,8 @@
     /**
      * Prevents properties in map from being modified.
      *
-     * @return New map with {@link NOT_EXTENSIBLE} flag set and properties with
-     * {@link Property.NOT_CONFIGURABLE} set.
+     * @return New map with {@link #NOT_EXTENSIBLE} flag set and properties with
+     * {@link Property#NOT_CONFIGURABLE} set.
      */
     PropertyMap seal() {
         PropertyHashMap newProperties = EMPTY_MAP;
@@ -437,7 +437,7 @@
      * Prevents properties in map from being modified or written to.
      *
      * @return New map with {@link #NOT_EXTENSIBLE} flag set and properties with
-     * {@link Property.NOT_CONFIGURABLE} and {@link Property.NOT_WRITABLE} set.
+     * {@link Property#NOT_CONFIGURABLE} and {@link Property#NOT_WRITABLE} set.
      */
     PropertyMap freeze() {
         PropertyHashMap newProperties = EMPTY_MAP;