Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2018-02-11 19:35:35 +0000
committerStephan Herrmann2018-02-11 20:02:30 +0000
commitc63fba5e8b9f65b57c59fdde0278e8171cfd97b9 (patch)
tree2e5ae9164072e571eac43b833c14b3f4e529d4c3
parent72ad7190a636525268173196145ee5e1e0724abb (diff)
downloadorg.eclipse.objectteams-c63fba5e8b9f65b57c59fdde0278e8171cfd97b9.tar.gz
org.eclipse.objectteams-c63fba5e8b9f65b57c59fdde0278e8171cfd97b9.tar.xz
org.eclipse.objectteams-c63fba5e8b9f65b57c59fdde0278e8171cfd97b9.zip
Fixed a merge bug plus added robustness to fix AIOOBE in
AAIORC.test1314_strongerRedefinedMethodAccess1()
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java11
1 files changed, 8 insertions, 3 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 ec674d973..d4b19ff1f 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
@@ -1287,14 +1287,16 @@ private void internalAnalyseCode(FlowContext flowContext, FlowInfo flowInfo) {
}
}
}
-//{ObjectTeams: RoFi with incomplete method bodies don't analyze:
- if (this.compilationUnit == null || this.compilationUnit.parseMethodBodies)
-// SH}
if (this.scope.compilerOptions().complianceLevel >= ClassFileConstants.JDK9) {
// synthesize <clinit> if one is not present. Required to initialize
// synthetic final fields as modifying final fields outside of a <clinit>
// is disallowed in Java 9
+//{ObjectTeams: robustness:
+/* orig:
if (this.methods == null || !this.methods[0].isClinit()) {
+ :giro */
+ if (this.methods == null || this.methods.length == 0 || !this.methods[0].isClinit()) {
+// SH}
Clinit clinit = new Clinit(this.compilationResult);
clinit.declarationSourceStart = clinit.sourceStart = this.sourceStart;
clinit.declarationSourceEnd = clinit.sourceEnd = this.sourceEnd;
@@ -1306,6 +1308,9 @@ private void internalAnalyseCode(FlowContext flowContext, FlowInfo flowInfo) {
System.arraycopy(this.methods, 0, methodDeclarations, 1, length);
}
}
+//{ObjectTeams: RoFi with incomplete method bodies don't analyze:
+ if (this.compilationUnit == null || this.compilationUnit.parseMethodBodies)
+// SH}
if (this.methods != null) {
UnconditionalFlowInfo outerInfo = flowInfo.unconditionalFieldLessCopy();
FlowInfo constructorInfo = nonStaticFieldInfo.unconditionalInits().discardNonFieldInitializations().addInitializationsFrom(outerInfo);

Back to the top