From 3030eb6cfde33d57de3fb28220defa91deb6cfe1 Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Fri, 10 Jan 2014 09:21:25 -0800 Subject: [PATCH] pr422943: tweak to avoid npe --- .../ajdt/internal/core/builder/AjState.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java index 76f6de5f5..965e87732 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java @@ -1826,13 +1826,13 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe // generic signature if (!CharOperation.equals(reader.getGenericSignature(), existingType.genericSignature)) { - logAnalysis(filename,"generic signature changed. old="+new String(existingType.genericSignature)+" new="+new String(reader.getGenericSignature())); + logAnalysis(filename,"generic signature changed. old="+stringify(existingType.genericSignature)+" new="+stringify(reader.getGenericSignature())); return true; } // superclass name if (!CharOperation.equals(reader.getSuperclassName(), existingType.superclassName)) { - logAnalysis(filename,"superclass name changed. old="+new String(existingType.superclassName)+" new="+new String(reader.getSuperclassName())); + logAnalysis(filename,"superclass name changed. old="+stringify(existingType.superclassName)+" new="+stringify(reader.getSuperclassName())); return true; } @@ -2052,7 +2052,8 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe } // TODO missing a return true here? Meaning we have a field in the new that we can't find in the old! } - + + logAnalysis(filename,"method changed. New method detected '"+stringify(method)+"' (might be a rename)"); return true; // (no match found) } @@ -2083,6 +2084,13 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe return false; } + private String stringify(char[] chars) { + if (chars == null) { + return "null"; + } + return new String(chars); + } + private String stringify(IBinaryNestedType[] binaryNestedTypes) { StringBuilder buf = new StringBuilder(); for (IBinaryNestedType binaryNestedType: binaryNestedTypes) { -- 2.39.5