mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-04 07:28:22 +00:00
8035364: An extra space in the comments of constant pool entries
Reviewed-by: ksrini
This commit is contained in:
parent
49b3f8639b
commit
31ca5c712a
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2007, 2014, 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
|
||||
@ -64,7 +64,7 @@ public class ConstantWriter extends BasicWriter {
|
||||
public Integer visitClass(CONSTANT_Class_info info, Void p) {
|
||||
print("#" + info.name_index);
|
||||
tab();
|
||||
println("// " + stringValue(info));
|
||||
println("// " + stringValue(info));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ public class ConstantWriter extends BasicWriter {
|
||||
public Integer visitFieldref(CONSTANT_Fieldref_info info, Void p) {
|
||||
print("#" + info.class_index + ".#" + info.name_and_type_index);
|
||||
tab();
|
||||
println("// " + stringValue(info));
|
||||
println("// " + stringValue(info));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -93,14 +93,14 @@ public class ConstantWriter extends BasicWriter {
|
||||
public Integer visitInterfaceMethodref(CONSTANT_InterfaceMethodref_info info, Void p) {
|
||||
print("#" + info.class_index + ".#" + info.name_and_type_index);
|
||||
tab();
|
||||
println("// " + stringValue(info));
|
||||
println("// " + stringValue(info));
|
||||
return 1;
|
||||
}
|
||||
|
||||
public Integer visitInvokeDynamic(CONSTANT_InvokeDynamic_info info, Void p) {
|
||||
print("#" + info.bootstrap_method_attr_index + ":#" + info.name_and_type_index);
|
||||
tab();
|
||||
println("// " + stringValue(info));
|
||||
println("// " + stringValue(info));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -112,21 +112,21 @@ public class ConstantWriter extends BasicWriter {
|
||||
public Integer visitNameAndType(CONSTANT_NameAndType_info info, Void p) {
|
||||
print("#" + info.name_index + ":#" + info.type_index);
|
||||
tab();
|
||||
println("// " + stringValue(info));
|
||||
println("// " + stringValue(info));
|
||||
return 1;
|
||||
}
|
||||
|
||||
public Integer visitMethodref(CONSTANT_Methodref_info info, Void p) {
|
||||
print("#" + info.class_index + ".#" + info.name_and_type_index);
|
||||
tab();
|
||||
println("// " + stringValue(info));
|
||||
println("// " + stringValue(info));
|
||||
return 1;
|
||||
}
|
||||
|
||||
public Integer visitMethodHandle(CONSTANT_MethodHandle_info info, Void p) {
|
||||
print("#" + info.reference_kind.tag + ":#" + info.reference_index);
|
||||
tab();
|
||||
println("// " + stringValue(info));
|
||||
println("// " + stringValue(info));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -140,7 +140,7 @@ public class ConstantWriter extends BasicWriter {
|
||||
public Integer visitString(CONSTANT_String_info info, Void p) {
|
||||
print("#" + info.string_index);
|
||||
tab();
|
||||
println("// " + stringValue(info));
|
||||
println("// " + stringValue(info));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2009, 2014, 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
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6868539 6868548
|
||||
* @bug 6868539 6868548 8035364
|
||||
* @summary javap should use current names for constant pool entries,
|
||||
* remove spurious ';' from constant pool entries
|
||||
*/
|
||||
@ -41,17 +41,17 @@ public class T6868539
|
||||
void run() {
|
||||
String output = javap("T6868539");
|
||||
verify(output, "Utf8 +java/lang/String"); // 1: Utf8
|
||||
// 2: currently unused
|
||||
// 2: currently unused
|
||||
verify(output, "Integer +123456"); // 3: Integer
|
||||
verify(output, "Float +123456.0f"); // 4: Float
|
||||
verify(output, "Long +123456l"); // 5: Long
|
||||
verify(output, "Double +123456.0d"); // 6: Double
|
||||
verify(output, "Class +#[0-9]+ +// + T6868539"); // 7: Class
|
||||
verify(output, "String +#[0-9]+ +// + not found"); // 8: String
|
||||
verify(output, "Class +#[0-9]+ +// +T6868539"); // 7: Class
|
||||
verify(output, "String +#[0-9]+ +// +not found"); // 8: String
|
||||
verify(output, "Fieldref +#[0-9]+\\.#[0-9]+ +// +T6868539.errors:I"); // 9: Fieldref
|
||||
verify(output, "Methodref +#[0-9]+\\.#[0-9]+ +// +T6868539.run:\\(\\)V"); // 10: Methodref
|
||||
verify(output, "InterfaceMethodref +#[0-9]+\\.#[0-9]+ +// +java/lang/Runnable\\.run:\\(\\)V");
|
||||
// 11: InterfaceMethodref
|
||||
// 11: InterfaceMethodref
|
||||
verify(output, "NameAndType +#[0-9]+:#[0-9]+ +// +run:\\(\\)V"); // 12: NameAndType
|
||||
if (errors > 0)
|
||||
throw new Error(errors + " found.");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user