Skip to content

Commit

Permalink
trying without the return type
Browse files Browse the repository at this point in the history
  • Loading branch information
monperrus committed Sep 28, 2017
1 parent 628ed5f commit ac737f5
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions src/main/java/spoon/support/visitor/SignaturePrinter.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import spoon.reflect.declaration.CtConstructor;
import spoon.reflect.declaration.CtMethod;
import spoon.reflect.declaration.CtParameter;
import spoon.reflect.declaration.CtTypeParameter;
import spoon.reflect.reference.CtArrayTypeReference;
import spoon.reflect.reference.CtExecutableReference;
import spoon.reflect.reference.CtIntersectionTypeReference;
Expand Down Expand Up @@ -51,10 +50,10 @@ public <T> void visitCtArrayTypeReference(CtArrayTypeReference<T> reference) {

@Override
public <T> void visitCtExecutableReference(CtExecutableReference<T> reference) {
if (reference.getType() != null && !reference.isConstructor()) {
reference.getType().accept(this);
write(" ");
}
// if (reference.getType() != null && !reference.isConstructor()) {
// reference.getType().accept(this);
// write(" ");
// }
writeNameAndParameters(reference);
}

Expand Down Expand Up @@ -137,22 +136,22 @@ public <T> void visitCtAnnotationMethod(CtAnnotationMethod<T> annotationMethod)
*/
@Override
public <T> void visitCtMethod(CtMethod<T> m) {
if (!m.getFormalCtTypeParameters().isEmpty()) {
write("<");
for (CtTypeParameter typeParameter : m.getFormalCtTypeParameters()) {
scan(typeParameter.getReference());
write(",");
}
if (m.getFormalCtTypeParameters().size() > 0) {
clearLast();
}
write("> ");
}
// the return type is required, see example in SimilarSignatureMethodes in test code (name and arguments are identical)
if (m.getType() != null) {
write(m.getType().getQualifiedName());
}
write(" ");
// if (!m.getFormalCtTypeParameters().isEmpty()) {
// write("<");
// for (CtTypeParameter typeParameter : m.getFormalCtTypeParameters()) {
// scan(typeParameter.getReference());
// write(",");
// }
// if (m.getFormalCtTypeParameters().size() > 0) {
// clearLast();
// }
// write("> ");
// }
// // the return type is required, see example in SimilarSignatureMethodes in test code (name and arguments are identical)
// if (m.getType() != null) {
// write(m.getType().getQualifiedName());
// }
// write(" ");
write(m.getSimpleName());
write("(");
for (CtParameter<?> p : m.getParameters()) {
Expand Down

0 comments on commit ac737f5

Please sign in to comment.