|
1 | 1 | /* |
2 | | - * Copyright (c) 2008-2019 Emmanuel Dupuy. |
| 2 | + * Copyright (c) 2008, 2019 Emmanuel Dupuy. |
3 | 3 | * This project is distributed under the GPLv3 license. |
4 | 4 | * This is a Copyleft license that gives the user the right to use, |
5 | 5 | * copy and modify the code freely for non-commercial purposes. |
@@ -124,6 +124,7 @@ public MethodTypes parseConstructorSignature(Method method) { |
124 | 124 | if (attributeSignature == null) { |
125 | 125 | return parseMethodSignature(method.getDescriptor(), method); |
126 | 126 | } else { |
| 127 | + // Signature does not contain synthetic parameters like outer type name, for example. |
127 | 128 | MethodTypes mt1 = parseMethodSignature(attributeSignature.getSignature(), method); |
128 | 129 | MethodTypes mt2 = parseMethodSignature(method.getDescriptor(), method); |
129 | 130 |
|
@@ -201,7 +202,17 @@ public static int countDimension(String descriptor) { |
201 | 202 | */ |
202 | 203 | @SuppressWarnings("unchecked") |
203 | 204 | 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); |
205 | 216 |
|
206 | 217 | if (methodTypes == null) { |
207 | 218 | SignatureReader reader = new SignatureReader(signature); |
|
0 commit comments