Safety net for comment 5 Bug 571454 - [16] Order of compilation units
leaves canonical constructor in incomplete state

Change-Id: I91dee3efb840a48487fae039391ae18580842317
Signed-off-by: Manoj Palat <manpalat@in.ibm.com>
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
index 1971851..391ccc8 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
@@ -484,6 +484,9 @@
 
 	private boolean checkAndFlagExplicitConstructorCallInCanonicalConstructor(AbstractMethodDeclaration methodDecl, BlockScope scope) {
 
+		if (methodDecl.binding == null || methodDecl.binding.declaringClass == null
+				|| !methodDecl.binding.declaringClass.isRecord())
+			return true;
 		boolean isInsideCCD = methodDecl instanceof CompactConstructorDeclaration;
 		if (this.accessMode != ExplicitConstructorCall.ImplicitSuper) {
 			if (isInsideCCD)