Commit 9881fee3 authored by Eric Bruneton's avatar Eric Bruneton

Merge branch '317848-add-names-to-declaration-comments' into 'master'

Resolve "Type names no longer included in declaration comments produced by Textifier"

Closes #317848

See merge request !199
parents 3f7d6ba2 a677c3b0
Pipeline #2670 passed with stage
in 7 minutes and 19 seconds
......@@ -175,7 +175,7 @@ public class Textifier extends Printer {
appendDescriptor(CLASS_SIGNATURE, signature);
if (signature != null) {
appendJavaDeclaration(signature);
appendJavaDeclaration(name, signature);
}
appendAccess(access & ~(Opcodes.ACC_SUPER | Opcodes.ACC_MODULE));
......@@ -323,7 +323,7 @@ public class Textifier extends Printer {
stringBuilder.append(tab);
appendDescriptor(FIELD_SIGNATURE, signature);
stringBuilder.append(tab);
appendJavaDeclaration(signature);
appendJavaDeclaration(name, signature);
}
stringBuilder.append(tab);
......@@ -364,7 +364,7 @@ public class Textifier extends Printer {
stringBuilder.append(tab);
appendDescriptor(METHOD_SIGNATURE, signature);
stringBuilder.append(tab);
appendJavaDeclaration(signature);
appendJavaDeclaration(name, signature);
}
stringBuilder.append(tab);
......@@ -1097,7 +1097,7 @@ public class Textifier extends Printer {
stringBuilder.append(tab2);
appendDescriptor(FIELD_SIGNATURE, signature);
stringBuilder.append(tab2);
appendJavaDeclaration(signature);
appendJavaDeclaration(name, signature);
}
text.add(stringBuilder.toString());
}
......@@ -1310,9 +1310,10 @@ public class Textifier extends Printer {
/**
* Appends the Java generic type declaration corresponding to the given signature.
*
* @param name a class, field or method name.
* @param signature a class, field or method signature.
*/
private void appendJavaDeclaration(final String signature) {
private void appendJavaDeclaration(final String name, final String signature) {
TraceSignatureVisitor traceSignatureVisitor = new TraceSignatureVisitor(access);
new SignatureReader(signature).accept(traceSignatureVisitor);
stringBuilder.append("// declaration: ");
......@@ -1320,6 +1321,7 @@ public class Textifier extends Printer {
stringBuilder.append(traceSignatureVisitor.getReturnType());
stringBuilder.append(' ');
}
stringBuilder.append(name);
stringBuilder.append(traceSignatureVisitor.getDeclaration());
if (traceSignatureVisitor.getExceptions() != null) {
stringBuilder.append(" throws ").append(traceSignatureVisitor.getExceptions());
......
......@@ -15,7 +15,7 @@ class jdk5/AllStructures$1LocalClass {
// access flags 0x0
// signature (I)V
// declaration: void (int)
// declaration: void <init>(int)
<init>(Ljdk5/AllStructures;ILjava/lang/String;)V
// annotable parameter count: 1 (visible)
@Ljava/lang/Deprecated;() // parameter 0
......@@ -48,7 +48,7 @@ class jdk5/AllStructures$1LocalClass {
L3
LOCALVARIABLE this Ljdk5/AllStructures$1LocalClass; L0 L3 0
// signature Ljdk5/AllStructures.1LocalClass;
// declaration: extends jdk5.AllStructures.1LocalClass
// declaration: this extends jdk5.AllStructures.1LocalClass
LOCALVARIABLE value I L0 L3 2
MAXSTACK = 3
MAXLOCALS = 4
......
// class version 49.0 (49)
// access flags 0x4030
// signature Ljava/lang/Enum<Ljdk5/AllStructures$EnumClass;>;
// declaration: extends java.lang.Enum<jdk5.AllStructures$EnumClass>
// declaration: jdk5/AllStructures$EnumClass extends java.lang.Enum<jdk5.AllStructures$EnumClass>
final enum jdk5/AllStructures$EnumClass extends java/lang/Enum {
// compiled from: AllStructures.java
......@@ -50,7 +50,7 @@ final enum jdk5/AllStructures$EnumClass extends java/lang/Enum {
// access flags 0x2
// signature (I)V
// declaration: void (int)
// declaration: void <init>(int)
private <init>(Ljava/lang/String;II)V
L0
LINENUMBER 207 L0
......
......@@ -20,7 +20,7 @@ class jdk8/AllInstructions {
// access flags 0x1
// signature (Ljava/util/List<Ljava/lang/String;>;)V
// declaration: void (java.util.List<java.lang.String>)
// declaration: void invokedynamic(java.util.List<java.lang.String>)
public invokedynamic(Ljava/util/List;)V
// parameter strings
L0
......@@ -62,10 +62,10 @@ class jdk8/AllInstructions {
LOCALVARIABLE this Ljdk8/AllInstructions; L0 L3 0
LOCALVARIABLE strings Ljava/util/List; L0 L3 1
// signature Ljava/util/List<Ljava/lang/String;>;
// declaration: extends java.util.List<java.lang.String>
// declaration: strings extends java.util.List<java.lang.String>
LOCALVARIABLE validStrings Ljava/util/List; L1 L3 2
// signature Ljava/util/List<Ljava/lang/String;>;
// declaration: extends java.util.List<java.lang.String>
// declaration: validStrings extends java.util.List<java.lang.String>
MAXSTACK = 4
MAXLOCALS = 3
......
......@@ -26,7 +26,7 @@ class jdk8/AllStructures$1 implements java/lang/Runnable {
L1
LOCALVARIABLE this Ljdk8/AllStructures$1; L0 L1 0
// signature Ljdk8/AllStructures$1;
// declaration: extends jdk8.AllStructures$1
// declaration: this extends jdk8.AllStructures$1
LOCALVARIABLE this$0 Ljdk8/AllStructures; L0 L1 1
MAXSTACK = 2
MAXLOCALS = 2
......@@ -66,7 +66,7 @@ class jdk8/AllStructures$1 implements java/lang/Runnable {
L3
LOCALVARIABLE this Ljdk8/AllStructures$1; L0 L3 0
// signature Ljdk8/AllStructures$1;
// declaration: extends jdk8.AllStructures$1
// declaration: this extends jdk8.AllStructures$1
LOCALVARIABLE f D L1 L3 1
LOCALVARIABLE @Lannotations/VTUA;(v=0) : LOCAL_VARIABLE, null [ L1 - L3 - 1 ]
LOCALVARIABLE @Lannotations/ITUA;(v=1) : LOCAL_VARIABLE, null [ L1 - L3 - 1 ] // invisible
......
......@@ -38,7 +38,7 @@ class jdk8/AllStructures$InnerClass {
L3
LOCALVARIABLE this Ljdk8/AllStructures$InnerClass; L0 L3 0
// signature Ljdk8/AllStructures<TU0;TU1;TU2;>.InnerClass;
// declaration: extends jdk8.AllStructures<U0, U1, U2>.InnerClass
// declaration: this extends jdk8.AllStructures<U0, U1, U2>.InnerClass
LOCALVARIABLE f D L0 L3 2
MAXSTACK = 3
MAXLOCALS = 4
......@@ -55,7 +55,7 @@ class jdk8/AllStructures$InnerClass {
L1
LOCALVARIABLE this Ljdk8/AllStructures$InnerClass; L0 L1 0
// signature Ljdk8/AllStructures<TU0;TU1;TU2;>.InnerClass;
// declaration: extends jdk8.AllStructures<U0, U1, U2>.InnerClass
// declaration: this extends jdk8.AllStructures<U0, U1, U2>.InnerClass
LOCALVARIABLE x0 Ljdk8/AllStructures; L0 L1 1
LOCALVARIABLE x1 D L0 L1 2
LOCALVARIABLE x2 Ljdk8/AllStructures$1; L0 L1 4
......
// class version 52.0 (52)
// access flags 0x421
// signature <U0:Ljava/lang/Object;U1::Ljava/util/List<TU0;>;U2::Ljava/util/Collection<TU0;>;>Ljava/util/HashMap<TU0;TU1;>;Ljava/util/concurrent/Callable<TU0;>;Ljava/util/concurrent/Future<TU1;>;
// declaration: <U0, U1 extends java.util.List<U0>, U2 extends java.util.Collection<U0>> extends java.util.HashMap<U0, U1> implements java.util.concurrent.Callable<U0>, java.util.concurrent.Future<U1>
// declaration: jdk8/AllStructures<U0, U1 extends java.util.List<U0>, U2 extends java.util.Collection<U0>> extends java.util.HashMap<U0, U1> implements java.util.concurrent.Callable<U0>, java.util.concurrent.Future<U1>
public abstract class jdk8/AllStructures extends java/util/HashMap implements java/util/concurrent/Callable java/util/concurrent/Future {
// compiled from: AllStructures.java
......@@ -70,7 +70,7 @@ public abstract class jdk8/AllStructures extends java/util/HashMap implements ja
// access flags 0x1
// signature Ljava/util/HashMap<TU0;TU1;>;
// declaration: extends java.util.HashMap<U0, U1>
// declaration: f extends java.util.HashMap<U0, U1>
public Ljava/util/HashMap; f
@Lannotations/VFA;(v=28)
@Lannotations/IFA;(v=29) // invisible
......@@ -94,13 +94,13 @@ public abstract class jdk8/AllStructures extends java/util/HashMap implements ja
L1
LOCALVARIABLE this Ljdk8/AllStructures; L0 L1 0
// signature Ljdk8/AllStructures<TU0;TU1;TU2;>;
// declaration: extends jdk8.AllStructures<U0, U1, U2>
// declaration: this extends jdk8.AllStructures<U0, U1, U2>
MAXSTACK = 1
MAXLOCALS = 1
// access flags 0x1
// signature <V0:TU0;V1:TU1;>(TV0;TV1;Ljava/util/Map<+TV0;+TV1;>;)Ljava/util/Map<+TV0;+TV1;>;
// declaration: java.util.Map<? extends V0, ? extends V1> <V0 extends U0, V1 extends U1>(V0, V1, java.util.Map<? extends V0, ? extends V1>)
// declaration: java.util.Map<? extends V0, ? extends V1> m<V0 extends U0, V1 extends U1>(V0, V1, java.util.Map<? extends V0, ? extends V1>)
public m(Ljava/lang/Object;Ljava/util/List;Ljava/util/Map;)Ljava/util/Map; throws java/lang/IllegalStateException java/lang/IllegalArgumentException
// parameter p0
// parameter p1
......@@ -204,22 +204,22 @@ public abstract class jdk8/AllStructures extends java/util/HashMap implements ja
L10
LOCALVARIABLE this Ljdk8/AllStructures; L3 L10 0
// signature Ljdk8/AllStructures<TU0;TU1;TU2;>;
// declaration: extends jdk8.AllStructures<U0, U1, U2>
// declaration: this extends jdk8.AllStructures<U0, U1, U2>
LOCALVARIABLE p0 Ljava/lang/Object; L3 L10 1
// signature TV0;
// declaration: extends V0
// declaration: p0 extends V0
LOCALVARIABLE p1 Ljava/util/List; L3 L10 2
// signature TV1;
// declaration: extends V1
// declaration: p1 extends V1
LOCALVARIABLE p2 Ljava/util/Map; L3 L10 3
// signature Ljava/util/Map<+TV0;+TV1;>;
// declaration: extends java.util.Map<? extends V0, ? extends V1>
// declaration: p2 extends java.util.Map<? extends V0, ? extends V1>
LOCALVARIABLE l1 Ljava/util/List; L4 L10 4
// signature TV1;
// declaration: extends V1
// declaration: l1 extends V1
LOCALVARIABLE l2 Ljava/util/Map; L5 L10 5
// signature Ljava/util/Map<+TV0;+TV1;>;
// declaration: extends java.util.Map<? extends V0, ? extends V1>
// declaration: l2 extends java.util.Map<? extends V0, ? extends V1>
LOCALVARIABLE l3 Ljava/util/ArrayList; L0 L10 6
LOCALVARIABLE @Lannotations/VTUA;(v=70) : LOCAL_VARIABLE, 0; [ L5 - L10 - 5 ]
LOCALVARIABLE @Lannotations/VTUA;(v=72) : LOCAL_VARIABLE, 1; [ L5 - L10 - 5 ]
......@@ -230,7 +230,7 @@ public abstract class jdk8/AllStructures extends java/util/HashMap implements ja
// access flags 0xA
// signature <U:Ljava/lang/Object;V:Ljava/lang/Object;>()V
// declaration: void <U, V>()
// declaration: void m<U, V>()
private static m()V
L0
LINENUMBER 121 L0
......@@ -248,7 +248,7 @@ public abstract class jdk8/AllStructures extends java/util/HashMap implements ja
L1
LOCALVARIABLE this Ljdk8/AllStructures; L0 L1 0
// signature Ljdk8/AllStructures<TU0;TU1;TU2;>;
// declaration: extends jdk8.AllStructures<U0, U1, U2>
// declaration: this extends jdk8.AllStructures<U0, U1, U2>
MAXSTACK = 2
MAXLOCALS = 1
......@@ -264,7 +264,7 @@ public abstract class jdk8/AllStructures extends java/util/HashMap implements ja
L1
LOCALVARIABLE this Ljdk8/AllStructures; L0 L1 0
// signature Ljdk8/AllStructures<TU0;TU1;TU2;>;
// declaration: extends jdk8.AllStructures<U0, U1, U2>
// declaration: this extends jdk8.AllStructures<U0, U1, U2>
MAXSTACK = 3
MAXLOCALS = 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment