From 7f047e71ec9819479ca0e58a7c301e72f42b9972 Mon Sep 17 00:00:00 2001 From: Eric Milles Date: Wed, 7 Mar 2018 10:52:55 -0600 Subject: [PATCH] Fix for issue #519: add null safety to binding.superInterfaces --- .../internal/compiler/ast/GroovyClassScope.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/base/org.eclipse.jdt.groovy.core/src/org/codehaus/jdt/groovy/internal/compiler/ast/GroovyClassScope.java b/base/org.eclipse.jdt.groovy.core/src/org/codehaus/jdt/groovy/internal/compiler/ast/GroovyClassScope.java index 8396cbbca6..43897d9d84 100644 --- a/base/org.eclipse.jdt.groovy.core/src/org/codehaus/jdt/groovy/internal/compiler/ast/GroovyClassScope.java +++ b/base/org.eclipse.jdt.groovy.core/src/org/codehaus/jdt/groovy/internal/compiler/ast/GroovyClassScope.java @@ -92,14 +92,12 @@ protected MethodBinding[] augmentMethodBindings(MethodBinding[] methodBindings) } boolean implementsGroovyLangObject = false; - ReferenceBinding[] superInterfaces = binding.superInterfaces; - if (superInterfaces != null) { - for (int i = 0, max = superInterfaces.length; i < max; i++) { - char[][] interfaceName = superInterfaces[i].compoundName; - if (CharOperation.equals(interfaceName, GROOVY_LANG_GROOVYOBJECT)) { - implementsGroovyLangObject = true; - break; - } + ReferenceBinding[] superInterfaces = binding.superInterfaces != null ? binding.superInterfaces : new ReferenceBinding[0]; + for (int i = 0, max = superInterfaces.length; i < max; i++) { + char[][] interfaceName = superInterfaces[i].compoundName; + if (CharOperation.equals(interfaceName, GROOVY_LANG_GROOVYOBJECT)) { + implementsGroovyLangObject = true; + break; } }