Skip to content

Commit

Permalink
Create toShortSignature() in Method.java (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
eklaDFF authored May 25, 2024
1 parent 77befe2 commit 3650f5a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/classes/modules/java.base/java/lang/reflect/Method.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ public boolean isSynthetic (){
@Override
public native String toString();


String toShortSignature(){
StringBuilder sb = new StringBuilder();
sb.append(getName());
Class<?>[] ps = getParameterTypes();
for (int i=0; i<ps.length; i++){
Class<?> parameter = ps[i];
sb.append(parameter.getTypeName());
}
return sb.toString();
}

// for Annotations - return the default value of the annotation member
// represented by this method
public native Object getDefaultValue();
Expand Down

0 comments on commit 3650f5a

Please sign in to comment.