Skip to content

Commit 1dd36f9

Browse files
author
emmanue1
committed
Fix bug on method declarations
1 parent 7d8a365 commit 1dd36f9

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008-2019 Emmanuel Dupuy.
2+
* Copyright (c) 2008, 2019 Emmanuel Dupuy.
33
* This project is distributed under the GPLv3 license.
44
* This is a Copyleft license that gives the user the right to use,
55
* copy and modify the code freely for non-commercial purposes.
@@ -124,6 +124,7 @@ public MethodTypes parseConstructorSignature(Method method) {
124124
if (attributeSignature == null) {
125125
return parseMethodSignature(method.getDescriptor(), method);
126126
} else {
127+
// Signature does not contain synthetic parameters like outer type name, for example.
127128
MethodTypes mt1 = parseMethodSignature(attributeSignature.getSignature(), method);
128129
MethodTypes mt2 = parseMethodSignature(method.getDescriptor(), method);
129130

@@ -201,7 +202,17 @@ public static int countDimension(String descriptor) {
201202
*/
202203
@SuppressWarnings("unchecked")
203204
protected MethodTypes parseMethodSignature(String signature, Method method) {
204-
MethodTypes methodTypes = methodTypesCache.get(signature);
205+
String cacheKey = signature;
206+
207+
if (method != null) {
208+
AttributeExceptions attributeExceptions = method.getAttribute("Exceptions");
209+
210+
if (attributeExceptions != null) {
211+
cacheKey += attributeExceptions.getExceptionTypeNames().hashCode();
212+
}
213+
}
214+
215+
MethodTypes methodTypes = methodTypesCache.get(cacheKey);
205216

206217
if (methodTypes == null) {
207218
SignatureReader reader = new SignatureReader(signature);

0 commit comments

Comments
 (0)