8059631: Use of '#' to represent MethodHandle kind is confusing
Reviewed-by: jrose, mcimadamore
This commit is contained in:
parent
6f1a819053
commit
6f7a85797e
langtools/src/jdk.jdeps/share/classes/com/sun/tools
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -119,22 +119,20 @@ public class ConstantPool {
|
||||
public static final int CONSTANT_InvokeDynamic = 18;
|
||||
|
||||
public static enum RefKind {
|
||||
REF_getField(1, "getfield"),
|
||||
REF_getStatic(2, "getstatic"),
|
||||
REF_putField(3, "putfield"),
|
||||
REF_putStatic(4, "putstatic"),
|
||||
REF_invokeVirtual(5, "invokevirtual"),
|
||||
REF_invokeStatic(6, "invokestatic"),
|
||||
REF_invokeSpecial(7, "invokespecial"),
|
||||
REF_newInvokeSpecial(8, "newinvokespecial"),
|
||||
REF_invokeInterface(9, "invokeinterface");
|
||||
REF_getField(1),
|
||||
REF_getStatic(2),
|
||||
REF_putField(3),
|
||||
REF_putStatic(4),
|
||||
REF_invokeVirtual(5),
|
||||
REF_invokeStatic(6),
|
||||
REF_invokeSpecial(7),
|
||||
REF_newInvokeSpecial(8),
|
||||
REF_invokeInterface(9);
|
||||
|
||||
public final int tag;
|
||||
public final String name;
|
||||
|
||||
RefKind(int tag, String name) {
|
||||
RefKind(int tag) {
|
||||
this.tag = tag;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
static RefKind getRefkind(int tag) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -124,7 +124,7 @@ public class ConstantWriter extends BasicWriter {
|
||||
}
|
||||
|
||||
public Integer visitMethodHandle(CONSTANT_MethodHandle_info info, Void p) {
|
||||
print("#" + info.reference_kind.tag + ":#" + info.reference_index);
|
||||
print(info.reference_kind.tag + ":#" + info.reference_index);
|
||||
tab();
|
||||
println("// " + stringValue(info));
|
||||
return 1;
|
||||
@ -326,7 +326,7 @@ public class ConstantWriter extends BasicWriter {
|
||||
|
||||
public String visitMethodHandle(CONSTANT_MethodHandle_info info, Void p) {
|
||||
try {
|
||||
return info.reference_kind.name + " " + stringValue(info.getCPRefInfo());
|
||||
return info.reference_kind + " " + stringValue(info.getCPRefInfo());
|
||||
} catch (ConstantPoolException e) {
|
||||
return report(e);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user