Defensive String equals comparison in ClassReader

Issue: SPR-12382
This commit is contained in:
Juergen Hoeller
2014-10-28 13:23:55 +01:00
parent 4945cf1bd1
commit cb095132b1

View File

@@ -928,7 +928,8 @@ public class ClassReader {
*/
if (WRITER && mv instanceof MethodWriter) {
MethodWriter mw = (MethodWriter) mv;
if (mw.cw.cr == this && signature == mw.signature) {
if (mw.cw.cr == this &&
(signature != null ? signature.equals(mw.signature) : mw.signature == null)) {
boolean sameExceptions = false;
if (exceptions == null) {
sameExceptions = mw.exceptionCount == 0;