JDK-8029031 : "ant clean jar" on nashorn repo results in number of ASM deprecated warnings
  • Type: Bug
  • Component: core-libs
  • Sub-Component: jdk.nashorn
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2013-11-22
  • Updated: 2014-07-29
  • Resolved: 2014-01-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u20Fixed 9 b02Fixed
Related Reports
Relates :  
Description
"ant clean jar" on nashorn repo results in these warnings:

compile-asm:

compile:
    [javac] Compiling 434 source files to /home/sundar/src/nashorn-jdk8/nashorn/build/classes
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/src/jdk/nashorn/internal/codegen/MethodEmitter.java:1133: warning: [deprecation] visitMethodInsn(int,String,String,String) in MethodVisitor has been deprecated
    [javac]         method.visitMethodInsn(opcode, className, methodName, methodDescriptor);
    [javac]               ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/src/jdk/nashorn/internal/codegen/types/Type.java:264: warning: [deprecation] visitMethodInsn(int,String,String,String) in MethodVisitor has been deprecated
    [javac]         method.visitMethodInsn(INVOKESTATIC, call.className(), call.name(), call.descriptor());
    [javac]               ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java:320: warning: [deprecation] invokestatic(String,String,String) in InstructionAdapter has been deprecated
    [javac]         mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getClassOverrides", GET_CLASS_INITIALIZER_DESCRIPTOR);
    [javac]           ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java:336: warning: [deprecation] invokestatic(String,String,String) in InstructionAdapter has been deprecated
    [javac]                     mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getHandle", GET_HANDLE_FUNCTION_DESCRIPTOR);
    [javac]                       ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java:353: warning: [deprecation] invokestatic(String,String,String) in InstructionAdapter has been deprecated
    [javac]             mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getHandle", GET_HANDLE_OBJECT_DESCRIPTOR);
    [javac]               ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java:370: warning: [deprecation] invokevirtual(String,String,String) in InstructionAdapter has been deprecated
    [javac]         mv.invokevirtual(OBJECT_TYPE_NAME, "getClass", GET_CLASS_METHOD_DESCRIPTOR); // check against null Context
    [javac]           ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java:427: warning: [deprecation] invokespecial(String,String,String) in InstructionAdapter has been deprecated
    [javac]         mv.invokespecial(superClassName, INIT, originalCtorType.getDescriptor());
    [javac]           ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java:480: warning: [deprecation] invokespecial(String,String,String) in InstructionAdapter has been deprecated
    [javac]         mv.invokespecial(superClassName, INIT, originalCtorType.getDescriptor());
    [javac]           ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java:499: warning: [deprecation] invokestatic(String,String,String) in InstructionAdapter has been deprecated
    [javac]                 mv.invokestatic(SERVICES_CLASS_TYPE_NAME, "getHandle", getHandleDescriptor);
    [javac]                   ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java:523: warning: [deprecation] invokestatic(String,String,String) in InstructionAdapter has been deprecated
    [javac]         mv.invokestatic(CONTEXT_TYPE_NAME, "getGlobal", GET_GLOBAL_METHOD_DESCRIPTOR);
    [javac]           ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java:527: warning: [deprecation] invokestatic(String,String,String) in InstructionAdapter has been deprecated
    [javac]         mv.invokestatic(CONTEXT_TYPE_NAME, "setGlobal", SET_GLOBAL_METHOD_DESCRIPTOR);
    [javac]           ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java:650: warning: [deprecation] invokespecial(String,String,String) in InstructionAdapter has been deprecated
    [javac]             mv.invokespecial(UNSUPPORTED_OPERATION_TYPE_NAME, INIT, VOID_NOARG_METHOD_DESCRIPTOR);
    [javac]               ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java:731: warning: [deprecation] invokevirtual(String,String,String) in InstructionAdapter has been deprecated
    [javac]         mv.invokevirtual(METHOD_HANDLE_TYPE.getInternalName(), "invokeExact", type.toMethodDescriptorString());
    [javac]           ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java:747: warning: [deprecation] invokespecial(String,String,String) in InstructionAdapter has been deprecated
    [javac]             mv.invokespecial(RUNTIME_EXCEPTION_TYPE_NAME, INIT, Type.getMethodDescriptor(Type.VOID_TYPE, THROWABLE_TYPE));
    [javac]               ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java:846: warning: [deprecation] invokespecial(String,String,String) in InstructionAdapter has been deprecated
    [javac]         mv.invokespecial(superClassName, name, methodDesc);
    [javac]           ^
    [javac] 16 warnings
    [javac] Creating empty /home/sundar/src/nashorn-jdk8/nashorn/build/classes/jdk/nashorn/internal/objects/package-info.class
    [javac] Creating empty /home/sundar/src/nashorn-jdk8/nashorn/build/classes/jdk/nashorn/api/scripting/package-info.class
     [copy] Copying 1 file to /home/sundar/src/nashorn-jdk8/nashorn/build/classes/META-INF/services
     [copy] Copying 2 files to /home/sundar/src/nashorn-jdk8/nashorn/build/classes/jdk/nashorn/api/scripting/resources
     [copy] Copying 14 files to /home/sundar/src/nashorn-jdk8/nashorn/build/classes/jdk/nashorn/internal/runtime/resources
     [copy] Copying 2 files to /home/sundar/src/nashorn-jdk8/nashorn/build/classes/jdk/nashorn/tools/resources
     [copy] Copying 1 file to /home/sundar/src/nashorn-jdk8/nashorn/build/classes/jdk/internal/dynalink/support

build-nasgen:

init:

prepare:
    [mkdir] Created dir: /home/sundar/src/nashorn-jdk8/nashorn/buildtools/nasgen/build/classes
    [mkdir] Created dir: /home/sundar/src/nashorn-jdk8/nashorn/buildtools/nasgen/dist
    [mkdir] Created dir: /home/sundar/src/nashorn-jdk8/nashorn/buildtools/nasgen/dist/lib

compile:
    [javac] Compiling 11 source files to /home/sundar/src/nashorn-jdk8/nashorn/buildtools/nasgen/build/classes
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MethodGenerator.java:352: warning: [deprecation] visitMethodInsn(int,String,String,String) in MethodVisitor has been deprecated
    [javac]         super.visitMethodInsn(INVOKEINTERFACE, owner, method, desc);
    [javac]              ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MethodGenerator.java:356: warning: [deprecation] visitMethodInsn(int,String,String,String) in MethodVisitor has been deprecated
    [javac]         super.visitMethodInsn(INVOKEVIRTUAL, owner, method, desc);
    [javac]              ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MethodGenerator.java:360: warning: [deprecation] visitMethodInsn(int,String,String,String) in MethodVisitor has been deprecated
    [javac]         super.visitMethodInsn(INVOKESPECIAL, owner, method, desc);
    [javac]              ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MethodGenerator.java:364: warning: [deprecation] visitMethodInsn(int,String,String,String) in MethodVisitor has been deprecated
    [javac]         super.visitMethodInsn(INVOKESTATIC, owner, method, desc);
    [javac]              ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MethodGenerator.java:413: warning: [deprecation] visitMethodInsn(int,String,String,String) in MethodVisitor has been deprecated
    [javac]         super.visitMethodInsn(INVOKEVIRTUAL,
    [javac]              ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MethodGenerator.java:426: warning: [deprecation] visitMethodInsn(int,String,String,String) in MethodVisitor has been deprecated
    [javac]         super.visitMethodInsn(INVOKEVIRTUAL,
    [javac]              ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java:148: warning: [deprecation] visitMethodInsn(int,String,String,String) in MethodVisitor has been deprecated
    [javac]                     super.visitMethodInsn(INVOKESTATIC, scriptClassInfo.getJavaName(),
    [javac]                          ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java:155: warning: [deprecation] visitMethodInsn(int,String,String,String) in MethodVisitor has been deprecated
    [javac]             public void visitMethodInsn(final int opcode, final String owner, final String name, final String desc) {
    [javac]                         ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java:158: warning: [deprecation] visitMethodInsn(int,String,String,String) in MethodVisitor has been deprecated
    [javac]                     super.visitMethodInsn(opcode, owner, name, desc);
    [javac]                          ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java:168: warning: [deprecation] visitMethodInsn(int,String,String,String) in MethodVisitor has been deprecated
    [javac]                                 super.visitMethodInsn(INVOKESPECIAL, clazz,
    [javac]                                      ^
    [javac] /home/sundar/src/nashorn-jdk8/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java:183: warning: [deprecation] visitMethodInsn(int,String,String,String) in MethodVisitor has been deprecated
    [javac]                     super.visitMethodInsn(opcode, owner, name, desc);
    [javac]                          ^
    [javac] 11 warnings

jar:
      [jar] Building jar: /home/sundar/src/nashorn-jdk8/nashorn/buildtools/nasgen/dist/nasgen.jar

run-nasgen:

prepare-to-be-instrumented:
     [copy] Copying 846 files to /home/sundar/src/nashorn-jdk8/nashorn/build/to_be_instrumented

generate-cc-template:

jar:
      [jar] Building jar: /home/sundar/src/nashorn-jdk8/nashorn/dist/nashorn.jar

BUILD SUCCESSFUL
Total time: 19 seconds

Comments
Fix pushed to nashorn-jdk9 forest: changeset: 679:fce0ef0c9858 tag: tip user: sundar date: Tue Nov 26 18:36:39 2013 +0530 summary: 8029031: "ant clean jar" on nashorn repo results in number of ASM deprecated warnings
27-11-2013

ASM's MethodVisitor.java has this: @Deprecated public void visitMethodInsn(int opcode, String owner, String name, String desc) { Nashorn code should be adjusted to avoid using this deprecated API.
22-11-2013