Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2017-12-07 00:48:17 +0000
committerStephan Herrmann2018-02-10 22:40:10 +0000
commitdda2cd20a3cb221d3effda3685632170280d45aa (patch)
tree1e9dc7740c7ac54bcbb51fc4d42948de52e13162
parent20c2bef85c7298d2cfa88c1e0cef56b9d405bb98 (diff)
downloadorg.eclipse.objectteams-dda2cd20a3cb221d3effda3685632170280d45aa.tar.gz
org.eclipse.objectteams-dda2cd20a3cb221d3effda3685632170280d45aa.tar.xz
org.eclipse.objectteams-dda2cd20a3cb221d3effda3685632170280d45aa.zip
Backport Fix NPE in OTReconcilerTests.testClassLiteralForRoFi
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
index 5b9be9923..ec674d973 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
@@ -1820,11 +1820,14 @@ public void resolve() {
boolean hasEnumConstants = false;
FieldDeclaration[] enumConstantsWithoutBody = null;
- if (this.memberTypes != null) {
//{ObjectTeams: don't cache count, array may grow during this loop!
-/* orig:
+ int resolvedMemberCount = 0; // but remember for later :)
+// orig:
+ if (this.memberTypes != null) {
+/*
for (int i = 0, count = this.memberTypes.length; i < count; i++) {
:giro */
+ resolvedMemberCount = this.memberTypes.length;
for (int i = 0; i < this.memberTypes.length; i++) {
// SH}
this.memberTypes[i].resolve(this.scope);
@@ -1947,6 +1950,12 @@ public void resolve() {
return;
}
StateMemento.methodResolveStart(this.binding);
+ // any role types found during field resolve? If so, catch up now:
+ if (this.memberTypes != null && this.memberTypes.length > resolvedMemberCount
+ && this.teamModel != null)
+ {
+ Dependencies.lateRolesCatchup(this.teamModel);
+ }
// SH}
//{ObjectTeams: should we work?
if (fieldsAndMethods) {

Back to the top