NPE fix for  Bug 318815 -  [otjld] [compiler] Support the "Internal Role" pattern
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.java
index e0ab228..78e04f6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MemberTypeBinding.java
@@ -142,7 +142,7 @@
 	    String circle = hasBaseclassCircularity();
 	    if (circle != null) {
 	    	circle = new String(readableName())+circle;
-	    	this.scope.problemReporter().baseclassCircularity(circle, this.scope.referenceContext.baseclass);
+	    	this.scope.problemReporter().baseclassCircularity(circle, this.scope.referenceContext);
 	    	this.roleModel._playedByEnclosing = true;
 	    }
     }
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
index 46c464d..a0ea077 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java
@@ -11376,14 +11376,17 @@
 			typeDecl.sourceEnd);
 
 }
-public void baseclassCircularity(String circle, TypeReference baseclass) {
+public void baseclassCircularity(String circle, TypeDeclaration roleDecl) {
+	int s, e;
+	if (roleDecl.baseclass != null) {
+		s = roleDecl.baseclass.sourceStart;
+		e = roleDecl.baseclass.sourceEnd;
+	} else {
+		s = roleDecl.sourceStart;
+		e = roleDecl.sourceEnd;
+	}
 	String[] args = new String[] { circle };
-	this.handle(
-			IProblem.BaseclassCircularity,
-			args,
-			args,
-			baseclass.sourceStart,
-			baseclass.sourceEnd);
+	this.handle(IProblem.BaseclassCircularity, args, args, s, e);
 }
 
 public void staleTSuperRole(ReferenceBinding roleType, ReferenceBinding tsuperRole, String methodDesignator) {