Skip to content

Commit 1882ab4

Browse files
author
emmanue1
committed
Fix bug on method declarations
1 parent 1dd36f9 commit 1882ab4

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/main/java/org/jd/core/v1/service/converter/classfiletojavasyntax/util/SignatureParser.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,19 @@ public static int countDimension(String descriptor) {
203203
@SuppressWarnings("unchecked")
204204
protected MethodTypes parseMethodSignature(String signature, Method method) {
205205
String cacheKey = signature;
206+
boolean containsThrowsSignature = (signature.indexOf('^') != -1);
206207

207-
if (method != null) {
208+
if (!containsThrowsSignature && (method != null)) {
208209
AttributeExceptions attributeExceptions = method.getAttribute("Exceptions");
209210

210211
if (attributeExceptions != null) {
211-
cacheKey += attributeExceptions.getExceptionTypeNames().hashCode();
212+
StringBuilder sb = new StringBuilder(signature);
213+
214+
for (String exceptionTypeName : attributeExceptions.getExceptionTypeNames()) {
215+
sb.append("^L").append(exceptionTypeName).append(';');
216+
}
217+
218+
cacheKey = sb.toString();
212219
}
213220
}
214221

@@ -297,7 +304,7 @@ protected MethodTypes parseMethodSignature(String signature, Method method) {
297304
}
298305
}
299306

300-
methodTypesCache.put(signature, methodTypes);
307+
methodTypesCache.put(cacheKey, methodTypes);
301308
}
302309

303310
return methodTypes;

0 commit comments

Comments
 (0)