rpms/eclipse/F-11 eclipse-jdt-264843.patch, NONE, 1.1 eclipse-jdt-257716.patch, NONE, 1.1 eclipse-jdt-249930.patch, NONE, 1.1 eclipse-jdt-266582.patch, NONE, 1.1 eclipse-jdt-265962.patch, NONE, 1.1 eclipse-jdt-263877.patch, NONE, 1.1 eclipse-jdt-265103.patch, NONE, 1.1 eclipse-jdt-261510.patch, NONE, 1.1 eclipse.spec, 1.634, 1.635
Alexander Kurtakov
akurtakov at fedoraproject.org
Mon Sep 28 12:59:26 UTC 2009
- Previous message (by thread): rpms/imsettings/devel .cvsignore, 1.18, 1.19 imsettings.spec, 1.42, 1.43 sources, 1.17, 1.18 imsettings-close-fd.patch, 1.1, NONE imsettings-unref-later.patch, 1.1, NONE imsettings-unref-notify.patch, 1.1, NONE imsettings-update-info.patch, 1.1, NONE
- Next message (by thread): rpms/kdelibs3/devel kdelibs3.spec,1.72,1.73
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: akurtakov
Update of /cvs/pkgs/rpms/eclipse/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9331/F-11
Modified Files:
eclipse.spec
Added Files:
eclipse-jdt-264843.patch eclipse-jdt-257716.patch
eclipse-jdt-249930.patch eclipse-jdt-266582.patch
eclipse-jdt-265962.patch eclipse-jdt-263877.patch
eclipse-jdt-265103.patch eclipse-jdt-261510.patch
Log Message:
* Mon Sep 28 2009 Alexander Kurtakov <akurtako at redhat.com> 1:3.4.2-16
- Add post 3.4.2 jdt.core patches. Fixes #525737.
eclipse-jdt-264843.patch:
ArrayInitializer.java | 7 +------
Assignment.java | 7 +------
CaseStatement.java | 6 +-----
FieldDeclaration.java | 6 +-----
LocalDeclaration.java | 6 +-----
ReturnStatement.java | 7 +------
Statement.java | 13 ++++++++++++-
7 files changed, 18 insertions(+), 34 deletions(-)
--- NEW FILE eclipse-jdt-264843.patch ---
### Eclipse Workspace Patch 1.0
#P org.eclipse.jdt.core
Index: compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java,v
retrieving revision 1.64
diff -u -r1.64 LocalDeclaration.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java 27 May 2008 22:21:13 -0000 1.64
+++ compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java 17 Feb 2009 19:32:06 -0000
@@ -198,11 +198,7 @@
&& (this.initialization.bits & ASTNode.UnnecessaryCast) == 0) {
CastExpression.checkNeedForAssignedCast(scope, variableType, (CastExpression) this.initialization);
}
- } else if (scope.isBoxingCompatibleWith(initializationType, variableType)
- || (initializationType.isBaseType() // narrowing then boxing ?
- && scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5 // autoboxing
- && !variableType.isBaseType()
- && initialization.isConstantValueOfTypeAssignableToType(initializationType, scope.environment().computeBoxingType(variableType)))) {
+ } else if (isBoxingCompatible(initializationType, variableType, this.initialization, scope)) {
this.initialization.computeConversion(scope, variableType, initializationType);
if (this.initialization instanceof CastExpression
&& (this.initialization.bits & ASTNode.UnnecessaryCast) == 0) {
Index: compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java,v
retrieving revision 1.41
diff -u -r1.41 Statement.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java 28 Mar 2006 20:29:57 -0000 1.41
+++ compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java 17 Feb 2009 19:32:06 -0000
@@ -104,7 +104,18 @@
}
public abstract void generateCode(BlockScope currentScope, CodeStream codeStream);
-
+
+ protected boolean isBoxingCompatible(TypeBinding expressionType, TypeBinding targetType, Expression expression, Scope scope) {
+ if (scope.isBoxingCompatibleWith(expressionType, targetType))
+ return true;
+
+ return expressionType.isBaseType() // narrowing then boxing ?
+ && !targetType.isBaseType()
+ && !targetType.isTypeVariable()
+ && scope.compilerOptions().sourceLevel >= org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK1_5 // autoboxing
+ && expression.isConstantValueOfTypeAssignableToType(expressionType, scope.environment().computeBoxingType( targetType));
+ }
+
public boolean isEmptyBlock() {
return false;
}
Index: compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java,v
retrieving revision 1.88
diff -u -r1.88 FieldDeclaration.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java 27 May 2008 22:21:13 -0000 1.88
+++ compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java 17 Feb 2009 19:32:06 -0000
@@ -230,11 +230,7 @@
&& (this.initialization.bits & ASTNode.UnnecessaryCast) == 0) {
CastExpression.checkNeedForAssignedCast(initializationScope, fieldType, (CastExpression) this.initialization);
}
- } else if (initializationScope.isBoxingCompatibleWith(initializationType, fieldType)
- || (initializationType.isBaseType() // narrowing then boxing ?
- && initializationScope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5 // autoboxing
- && !fieldType.isBaseType()
- && initialization.isConstantValueOfTypeAssignableToType(initializationType, initializationScope.environment().computeBoxingType(fieldType)))) {
+ } else if (isBoxingCompatible(initializationType, fieldType, this.initialization, initializationScope)) {
this.initialization.computeConversion(initializationScope, fieldType, initializationType);
if (this.initialization instanceof CastExpression
&& (this.initialization.bits & ASTNode.UnnecessaryCast) == 0) {
Index: compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java,v
retrieving revision 1.30
diff -u -r1.30 CaseStatement.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java 27 May 2008 22:21:13 -0000 1.30
+++ compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java 17 Feb 2009 19:32:06 -0000
@@ -127,11 +127,7 @@
} else {
return this.constantExpression.constant;
}
- } else if (scope.isBoxingCompatibleWith(caseType, switchExpressionType)
- || (caseType.isBaseType() // narrowing then boxing ?
- && scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5 // autoboxing
- && !switchExpressionType.isBaseType()
- && this.constantExpression.isConstantValueOfTypeAssignableToType(caseType, scope.environment().computeBoxingType(switchExpressionType)))) {
+ } else if (isBoxingCompatible(caseType, switchExpressionType, this.constantExpression, scope)) {
// constantExpression.computeConversion(scope, caseType, switchExpressionType); - do not report boxing/unboxing conversion
return this.constantExpression.constant;
}
Index: compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java,v
retrieving revision 1.62
diff -u -r1.62 ReturnStatement.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java 27 May 2008 22:21:13 -0000 1.62
+++ compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java 17 Feb 2009 19:32:06 -0000
@@ -11,7 +11,6 @@
package org.eclipse.jdt.internal.compiler.ast;
import org.eclipse.jdt.internal.compiler.ASTVisitor;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.codegen.*;
import org.eclipse.jdt.internal.compiler.flow.*;
import org.eclipse.jdt.internal.compiler.impl.Constant;
@@ -239,11 +238,7 @@
CastExpression.checkNeedForAssignedCast(scope, methodType, (CastExpression) this.expression);
}
return;
- } else if (scope.isBoxingCompatibleWith(expressionType, methodType)
- || (expressionType.isBaseType() // narrowing then boxing ?
- && scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5 // autoboxing
- && !methodType.isBaseType()
- && this.expression.isConstantValueOfTypeAssignableToType(expressionType, scope.environment().computeBoxingType(methodType)))) {
+ } else if (isBoxingCompatible(expressionType, methodType, this.expression, scope)) {
this.expression.computeConversion(scope, methodType, expressionType);
if (this.expression instanceof CastExpression
&& (this.expression.bits & (ASTNode.UnnecessaryCast|ASTNode.DisableUnnecessaryCastCheck)) == 0) {
Index: compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java,v
retrieving revision 1.82
diff -u -r1.82 Assignment.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java 27 May 2008 22:21:13 -0000 1.82
+++ compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java 17 Feb 2009 19:32:06 -0000
@@ -12,7 +12,6 @@
package org.eclipse.jdt.internal.compiler.ast;
import org.eclipse.jdt.internal.compiler.ASTVisitor;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.codegen.*;
import org.eclipse.jdt.internal.compiler.flow.*;
import org.eclipse.jdt.internal.compiler.impl.Constant;
@@ -214,11 +213,7 @@
CastExpression.checkNeedForAssignedCast(scope, lhsType, (CastExpression) this.expression);
}
return this.resolvedType;
- } else if (scope.isBoxingCompatibleWith(rhsType, lhsType)
- || (rhsType.isBaseType() // narrowing then boxing ?
- && scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5 // autoboxing
- && !lhsType.isBaseType()
- && this.expression.isConstantValueOfTypeAssignableToType(rhsType, scope.environment().computeBoxingType(lhsType)))) {
+ } else if (isBoxingCompatible(rhsType, lhsType, this.expression, scope)) {
this.expression.computeConversion(scope, lhsType, rhsType);
if (this.expression instanceof CastExpression
&& (this.expression.bits & ASTNode.UnnecessaryCast) == 0) {
Index: compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java,v
retrieving revision 1.50
diff -u -r1.50 ArrayInitializer.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java 27 May 2008 22:21:13 -0000 1.50
+++ compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java 17 Feb 2009 19:32:06 -0000
@@ -11,7 +11,6 @@
package org.eclipse.jdt.internal.compiler.ast;
import org.eclipse.jdt.internal.compiler.ASTVisitor;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.codegen.*;
import org.eclipse.jdt.internal.compiler.flow.*;
import org.eclipse.jdt.internal.compiler.impl.Constant;
@@ -169,11 +168,7 @@
|| (elementType.isBaseType() && BaseTypeBinding.isWidening(elementType.id, expressionType.id)))
|| expressionType.isCompatibleWith(elementType)) {
expression.computeConversion(scope, elementType, expressionType);
- } else if (scope.isBoxingCompatibleWith(expressionType, elementType)
- || (expressionType.isBaseType() // narrowing then boxing ?
- && scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5 // autoboxing
- && !elementType.isBaseType()
- && expression.isConstantValueOfTypeAssignableToType(expressionType, scope.environment().computeBoxingType(elementType)))) {
+ } else if (isBoxingCompatible(expressionType, elementType, expression, scope)) {
expression.computeConversion(scope, elementType, expressionType);
} else {
scope.problemReporter().typeMismatchError(expressionType, elementType, expression, null);
eclipse-jdt-257716.patch:
compiler/org/eclipse/jdt/internal/compiler/ast/Clinit.java | 1
compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java | 1
compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java | 12 +
compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java | 1
compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java | 23 ++-
compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java | 6
compiler/org/eclipse/jdt/internal/compiler/ast/TryStatement.java | 2
compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java | 13 --
compiler/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.java | 5
compiler/org/eclipse/jdt/internal/compiler/flow/FlowContext.java | 61 ++++++----
compiler/org/eclipse/jdt/internal/compiler/flow/InitializationFlowContext.java | 8 -
eval/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java | 3
12 files changed, 85 insertions(+), 51 deletions(-)
--- NEW FILE eclipse-jdt-257716.patch ---
### Eclipse Workspace Patch 1.0
#P org.eclipse.jdt.core
Index: compiler/org/eclipse/jdt/internal/compiler/flow/FlowContext.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FlowContext.java,v
retrieving revision 1.57
diff -u -r1.57 FlowContext.java
--- compiler/org/eclipse/jdt/internal/compiler/flow/FlowContext.java 2 Apr 2007 11:05:51 -0000 1.57
+++ compiler/org/eclipse/jdt/internal/compiler/flow/FlowContext.java 29 Jan 2009 17:06:52 -0000
@@ -18,6 +18,7 @@
import org.eclipse.jdt.internal.compiler.ast.Reference;
import org.eclipse.jdt.internal.compiler.ast.SubRoutineStatement;
import org.eclipse.jdt.internal.compiler.ast.TryStatement;
+import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
import org.eclipse.jdt.internal.compiler.codegen.BranchLabel;
import org.eclipse.jdt.internal.compiler.lookup.Binding;
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
@@ -44,6 +45,25 @@
boolean deferNullDiagnostic, preemptNullDiagnostic;
+public static final int
+ CAN_ONLY_NULL_NON_NULL = 0x0000,
+ // check against null and non null, with definite values -- comparisons
+ CAN_ONLY_NULL = 0x0001,
+ // check against null, with definite values -- comparisons
+ CAN_ONLY_NON_NULL = 0x0002,
+ // check against non null, with definite values -- comparisons
+ MAY_NULL = 0x0003,
+ // check against null, with potential values -- NPE guard
+ CHECK_MASK = 0x00FF,
+ IN_COMPARISON_NULL = 0x0100,
+ IN_COMPARISON_NON_NULL = 0x0200,
+ // check happened in a comparison
+ IN_ASSIGNMENT = 0x0300,
+ // check happened in an assignment
+ IN_INSTANCEOF = 0x0400,
+ // check happened in an instanceof expression
+ CONTEXT_MASK = ~CHECK_MASK;
+
public FlowContext(FlowContext parent, ASTNode associatedNode) {
this.parent = parent;
this.associatedNode = associatedNode;
@@ -287,6 +307,28 @@
return null;
}
+public FlowInfo getInitsForFinalBlankInitializationCheck(TypeBinding declaringType, FlowInfo flowInfo) {
+ FlowContext current = this;
+ FlowInfo inits = flowInfo;
+ do {
+ if (current instanceof InitializationFlowContext) {
+ InitializationFlowContext initializationContext = (InitializationFlowContext) current;
+ if (((TypeDeclaration)initializationContext.associatedNode).binding == declaringType) {
+ return inits;
+ }
+ inits = initializationContext.initsBeforeContext;
+ current = initializationContext.initializationParent;
+ } else if (current instanceof ExceptionHandlingFlowContext) {
+ ExceptionHandlingFlowContext exceptionContext = (ExceptionHandlingFlowContext) current;
+ current = exceptionContext.initializationParent == null ? exceptionContext.parent : exceptionContext.initializationParent;
+ } else {
+ current = current.parent;
+ }
+ } while (current != null);
+ // not found
+ return null;
+}
+
/*
* lookup through break labels
*/
@@ -468,25 +510,6 @@
}
}
-public static final int
- CAN_ONLY_NULL_NON_NULL = 0x0000,
- // check against null and non null, with definite values -- comparisons
- CAN_ONLY_NULL = 0x0001,
- // check against null, with definite values -- comparisons
- CAN_ONLY_NON_NULL = 0x0002,
- // check against non null, with definite values -- comparisons
- MAY_NULL = 0x0003,
- // check against null, with potential values -- NPE guard
- CHECK_MASK = 0x00FF,
- IN_COMPARISON_NULL = 0x0100,
- IN_COMPARISON_NON_NULL = 0x0200,
- // check happened in a comparison
- IN_ASSIGNMENT = 0x0300,
- // check happened in an assignment
- IN_INSTANCEOF = 0x0400,
- // check happened in an instanceof expression
- CONTEXT_MASK = ~CHECK_MASK;
-
/**
* Record a null reference for use by deferred checks. Only looping or
* finally contexts really record that information. The context may
Index: compiler/org/eclipse/jdt/internal/compiler/flow/InitializationFlowContext.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/InitializationFlowContext.java,v
retrieving revision 1.16
diff -u -r1.16 InitializationFlowContext.java
--- compiler/org/eclipse/jdt/internal/compiler/flow/InitializationFlowContext.java 28 Mar 2006 20:32:37 -0000 1.16
+++ compiler/org/eclipse/jdt/internal/compiler/flow/InitializationFlowContext.java 29 Jan 2009 17:06:52 -0000
@@ -26,17 +26,17 @@
public TypeBinding[] thrownExceptions = new TypeBinding[5];
public ASTNode[] exceptionThrowers = new ASTNode[5];
public FlowInfo[] exceptionThrowerFlowInfos = new FlowInfo[5];
+ public FlowInfo initsBeforeContext;
- public InitializationFlowContext(
- FlowContext parent,
- ASTNode associatedNode,
- BlockScope scope) {
+ public InitializationFlowContext(FlowContext parent, ASTNode associatedNode, FlowInfo initsBeforeContext, FlowContext initializationParent, BlockScope scope) {
super(
parent,
associatedNode,
Binding.NO_EXCEPTIONS, // no exception allowed by default
+ initializationParent,
scope,
FlowInfo.DEAD_END);
+ this.initsBeforeContext = initsBeforeContext;
}
public void checkInitializerExceptions(
Index: compiler/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.java,v
retrieving revision 1.42
diff -u -r1.42 ExceptionHandlingFlowContext.java
--- compiler/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.java 5 Mar 2008 07:57:20 -0000 1.42
+++ compiler/org/eclipse/jdt/internal/compiler/flow/ExceptionHandlingFlowContext.java 29 Jan 2009 17:06:52 -0000
@@ -41,7 +41,8 @@
boolean isMethodContext;
public UnconditionalFlowInfo initsOnReturn;
-
+ public FlowContext initializationParent; // special parent relationship only for initialization purpose
+
// for dealing with anonymous constructor thrown exceptions
public ArrayList extendedExceptions;
@@ -49,6 +50,7 @@
FlowContext parent,
ASTNode associatedNode,
ReferenceBinding[] handledExceptions,
+ FlowContext initializationParent,
BlockScope scope,
UnconditionalFlowInfo flowInfo) {
@@ -79,6 +81,7 @@
System.arraycopy(this.isReached, 0, this.isNeeded, 0, cacheSize);
}
this.initsOnReturn = FlowInfo.DEAD_END;
+ this. initializationParent = initializationParent;
}
public void complainIfUnusedExceptionHandlers(AbstractMethodDeclaration method) {
Index: compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java,v
retrieving revision 1.148
diff -u -r1.148 TypeDeclaration.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java 27 May 2008 22:21:13 -0000 1.148
+++ compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java 29 Jan 2009 17:06:52 -0000
@@ -594,8 +594,8 @@
this.scope.problemReporter().unusedPrivateType(this);
}
}
- InitializationFlowContext initializerContext = new InitializationFlowContext(null, this, this.initializerScope);
- InitializationFlowContext staticInitializerContext = new InitializationFlowContext(null, this, this.staticInitializerScope);
+ InitializationFlowContext initializerContext = new InitializationFlowContext(null, this, flowInfo, flowContext, this.initializerScope);
+ InitializationFlowContext staticInitializerContext = new InitializationFlowContext(null, this, flowInfo, flowContext, this.staticInitializerScope);
FlowInfo nonStaticFieldInfo = flowInfo.unconditionalFieldLessCopy();
FlowInfo staticFieldInfo = flowInfo.unconditionalFieldLessCopy();
if (this.fields != null) {
@@ -610,11 +610,7 @@
} else {*/
staticInitializerContext.handledExceptions = Binding.ANY_EXCEPTION; // tolerate them all, and record them
/*}*/
- staticFieldInfo =
- field.analyseCode(
- this.staticInitializerScope,
- staticInitializerContext,
- staticFieldInfo);
+ staticFieldInfo = field.analyseCode(this.staticInitializerScope, staticInitializerContext, staticFieldInfo);
// in case the initializer is not reachable, use a reinitialized flowInfo and enter a fake reachable
// branch, since the previous initializer already got the blame.
if (staticFieldInfo == FlowInfo.DEAD_END) {
@@ -630,8 +626,7 @@
} else {*/
initializerContext.handledExceptions = Binding.ANY_EXCEPTION; // tolerate them all, and record them
/*}*/
- nonStaticFieldInfo =
- field.analyseCode(this.initializerScope, initializerContext, nonStaticFieldInfo);
+ nonStaticFieldInfo = field.analyseCode(this.initializerScope, initializerContext, nonStaticFieldInfo);
// in case the initializer is not reachable, use a reinitialized flowInfo and enter a fake reachable
// branch, since the previous initializer already got the blame.
if (nonStaticFieldInfo == FlowInfo.DEAD_END) {
Index: compiler/org/eclipse/jdt/internal/compiler/ast/Clinit.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Clinit.java,v
retrieving revision 1.51.2.1
diff -u -r1.51.2.1 Clinit.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/Clinit.java 1 Jul 2008 11:24:16 -0000 1.51.2.1
+++ compiler/org/eclipse/jdt/internal/compiler/ast/Clinit.java 29 Jan 2009 17:06:49 -0000
@@ -53,6 +53,7 @@
staticInitializerFlowContext.parent,
this,
Binding.NO_EXCEPTIONS,
+ staticInitializerFlowContext,
scope,
FlowInfo.DEAD_END);
Index: compiler/org/eclipse/jdt/internal/compiler/ast/TryStatement.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TryStatement.java,v
retrieving revision 1.108
diff -u -r1.108 TryStatement.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/TryStatement.java 31 Aug 2007 19:41:31 -0000 1.108
+++ compiler/org/eclipse/jdt/internal/compiler/ast/TryStatement.java 29 Jan 2009 17:06:51 -0000
@@ -87,6 +87,7 @@
flowContext,
this,
this.caughtExceptionTypes,
+ null,
this.scope,
flowInfo.unconditionalInits());
handlingContext.initsOnFinally =
@@ -198,6 +199,7 @@
insideSubContext,
this,
this.caughtExceptionTypes,
+ null,
this.scope,
flowInfo.unconditionalInits());
handlingContext.initsOnFinally =
Index: compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java,v
retrieving revision 1.92.2.2
diff -u -r1.92.2.2 ConstructorDeclaration.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java 8 Jul 2008 13:22:06 -0000 1.92.2.2
+++ compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java 29 Jan 2009 17:06:50 -0000
@@ -77,6 +77,7 @@
initializerFlowContext.parent,
this,
this.binding.thrownExceptions,
+ initializerFlowContext,
this.scope,
FlowInfo.DEAD_END);
initializerFlowContext.checkInitializerExceptions(
Index: compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java,v
retrieving revision 1.103.2.3
diff -u -r1.103.2.3 SingleNameReference.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java 27 Nov 2008 10:13:10 -0000 1.103.2.3
+++ compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java 29 Jan 2009 17:06:51 -0000
@@ -62,7 +62,8 @@
FieldBinding fieldBinding;
if ((fieldBinding = (FieldBinding) this.binding).isBlankFinal()
&& currentScope.needBlankFinalFieldInitializationCheck(fieldBinding)) {
- if (!flowInfo.isDefinitelyAssigned(fieldBinding)) {
+ FlowInfo fieldInits = flowContext.getInitsForFinalBlankInitializationCheck(fieldBinding.declaringClass.original(), flowInfo);
+ if (!fieldInits.isDefinitelyAssigned(fieldBinding)) {
currentScope.problemReporter().uninitializedBlankFinalField(fieldBinding, this);
}
}
@@ -148,7 +149,8 @@
// check if reading a final blank field
FieldBinding fieldBinding = (FieldBinding) this.binding;
if (fieldBinding.isBlankFinal() && currentScope.needBlankFinalFieldInitializationCheck(fieldBinding)) {
- if (!flowInfo.isDefinitelyAssigned(fieldBinding)) {
+ FlowInfo fieldInits = flowContext.getInitsForFinalBlankInitializationCheck(fieldBinding.declaringClass.original(), flowInfo);
+ if (!fieldInits.isDefinitelyAssigned(fieldBinding)) {
currentScope.problemReporter().uninitializedBlankFinalField(fieldBinding, this);
}
}
Index: compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java,v
retrieving revision 1.116.2.2
diff -u -r1.116.2.2 FieldReference.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java 2 Oct 2008 15:29:33 -0000 1.116.2.2
+++ compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java 29 Jan 2009 17:06:50 -0000
@@ -57,15 +57,17 @@
}
-public FlowInfo analyseAssignment(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo, Assignment assignment, boolean isCompound) {
+public FlowInfo analyseAssignment(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo, Assignment assignment, boolean isCompound) {
// compound assignment extra work
if (isCompound) { // check the variable part is initialized if blank final
if (this.binding.isBlankFinal()
&& this.receiver.isThis()
- && currentScope.needBlankFinalFieldInitializationCheck(this.binding)
- && (!flowInfo.isDefinitelyAssigned(this.binding))) {
- currentScope.problemReporter().uninitializedBlankFinalField(this.binding, this);
- // we could improve error msg here telling "cannot use compound assignment on final blank field"
+ && currentScope.needBlankFinalFieldInitializationCheck(this.binding)) {
+ FlowInfo fieldInits = flowContext.getInitsForFinalBlankInitializationCheck(this.binding.declaringClass.original(), flowInfo);
+ if (!fieldInits.isDefinitelyAssigned(this.binding)) {
+ currentScope.problemReporter().uninitializedBlankFinalField(this.binding, this);
+ // we could improve error msg here telling "cannot use compound assignment on final blank field"
+ }
}
manageSyntheticAccessIfNecessary(currentScope, flowInfo, true /*read-access*/);
}
Index: compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java,v
retrieving revision 1.125.2.3
diff -u -r1.125.2.3 QualifiedNameReference.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java 27 Nov 2008 10:13:10 -0000 1.125.2.3
+++ compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java 29 Jan 2009 17:06:50 -0000
@@ -74,10 +74,9 @@
if (lastFieldBinding.isBlankFinal()
&& this.otherBindings != null // the last field binding is only assigned
&& currentScope.needBlankFinalFieldInitializationCheck(lastFieldBinding)) {
- if (!flowInfo.isDefinitelyAssigned(lastFieldBinding)) {
- currentScope.problemReporter().uninitializedBlankFinalField(
- lastFieldBinding,
- this);
+ FlowInfo fieldInits = flowContext.getInitsForFinalBlankInitializationCheck(lastFieldBinding.declaringClass.original(), flowInfo);
+ if (!fieldInits.isDefinitelyAssigned(lastFieldBinding)) {
+ currentScope.problemReporter().uninitializedBlankFinalField(lastFieldBinding, this);
}
}
break;
@@ -122,9 +121,11 @@
if (isCompound) {
if (otherBindingsCount == 0
&& lastFieldBinding.isBlankFinal()
- && currentScope.needBlankFinalFieldInitializationCheck(lastFieldBinding)
- && (!flowInfo.isDefinitelyAssigned(lastFieldBinding))) {
- currentScope.problemReporter().uninitializedBlankFinalField(lastFieldBinding, this);
+ && currentScope.needBlankFinalFieldInitializationCheck(lastFieldBinding)) {
+ FlowInfo fieldInits = flowContext.getInitsForFinalBlankInitializationCheck(lastFieldBinding.declaringClass.original(), flowInfo);
+ if (!fieldInits.isDefinitelyAssigned(lastFieldBinding)) {
+ currentScope.problemReporter().uninitializedBlankFinalField(lastFieldBinding, this);
+ }
}
TypeBinding lastReceiverType;
switch (otherBindingsCount) {
@@ -212,9 +213,11 @@
FieldBinding fieldBinding = (FieldBinding) this.binding;
// check if reading a final blank field
if (fieldBinding.isBlankFinal()
- && currentScope.needBlankFinalFieldInitializationCheck(fieldBinding)
- && !flowInfo.isDefinitelyAssigned(fieldBinding)) {
- currentScope.problemReporter().uninitializedBlankFinalField(fieldBinding, this);
+ && currentScope.needBlankFinalFieldInitializationCheck(fieldBinding)) {
+ FlowInfo fieldInits = flowContext.getInitsForFinalBlankInitializationCheck(fieldBinding.declaringClass.original(), flowInfo);
+ if (!fieldInits.isDefinitelyAssigned(fieldBinding)) {
+ currentScope.problemReporter().uninitializedBlankFinalField(fieldBinding, this);
+ }
}
}
break;
Index: compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java,v
retrieving revision 1.65
diff -u -r1.65 MethodDeclaration.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java 27 May 2008 22:21:13 -0000 1.65
+++ compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java 29 Jan 2009 17:06:50 -0000
@@ -72,6 +72,7 @@
initializationContext,
this,
this.binding.thrownExceptions,
+ null,
this.scope,
FlowInfo.DEAD_END);
Index: eval/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java,v
retrieving revision 1.52
diff -u -r1.52 CodeSnippetSingleNameReference.java
--- eval/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java 27 May 2008 22:27:12 -0000 1.52
+++ eval/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java 29 Jan 2009 17:06:52 -0000
@@ -45,7 +45,8 @@
FieldBinding fieldBinding;
if ((fieldBinding = (FieldBinding) this.binding).isBlankFinal()
&& currentScope.needBlankFinalFieldInitializationCheck(fieldBinding)) {
- if (!flowInfo.isDefinitelyAssigned(fieldBinding)) {
+ FlowInfo fieldInits = flowContext.getInitsForFinalBlankInitializationCheck(fieldBinding.declaringClass.original(), flowInfo);
+ if (!fieldInits.isDefinitelyAssigned(fieldBinding)) {
currentScope.problemReporter().uninitializedBlankFinalField(fieldBinding, this);
}
}
eclipse-jdt-249930.patch:
JavaModelManager.java | 44 +++++++++++---------------------------------
SetClasspathOperation.java | 18 ++++++++++++++++++
2 files changed, 29 insertions(+), 33 deletions(-)
--- NEW FILE eclipse-jdt-249930.patch ---
### Eclipse Workspace Patch 1.0
#P org.eclipse.jdt.core
Index: model/org/eclipse/jdt/internal/core/SetClasspathOperation.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetClasspathOperation.java,v
retrieving revision 1.153
diff -u -r1.153 SetClasspathOperation.java
--- model/org/eclipse/jdt/internal/core/SetClasspathOperation.java 27 May 2008 23:40:18 -0000 1.153
+++ model/org/eclipse/jdt/internal/core/SetClasspathOperation.java 6 Feb 2009 11:35:03 -0000
@@ -10,7 +10,11 @@
*******************************************************************************/
package org.eclipse.jdt.internal.core;
+import org.eclipse.core.resources.IResourceRuleFactory;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.MultiRule;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaModelStatus;
@@ -64,6 +68,20 @@
done();
}
}
+
+ protected ISchedulingRule getSchedulingRule() {
+ if (this.canChangeResources) {
+ IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
+ return new MultiRule(new ISchedulingRule[] {
+ // use project modification rule as this is needed to create the .classpath file if it doesn't exist yet, or to update project references
+ ruleFactory.modifyRule(this.project.getProject()),
+
+ // and external project modification rule in case the external folders are modified
+ ruleFactory.modifyRule(JavaModelManager.getExternalManager().getExternalFoldersProject())
+ });
+ }
+ return super.getSchedulingRule();
+ }
public String toString(){
StringBuffer buffer = new StringBuffer(20);
Index: model/org/eclipse/jdt/internal/core/JavaModelManager.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java,v
retrieving revision 1.397.2.4
diff -u -r1.397.2.4 JavaModelManager.java
--- model/org/eclipse/jdt/internal/core/JavaModelManager.java 8 Dec 2008 14:41:23 -0000 1.397.2.4
+++ model/org/eclipse/jdt/internal/core/JavaModelManager.java 6 Feb 2009 11:35:03 -0000
@@ -1188,41 +1188,19 @@
return buffer.toString();
}
- public boolean writeAndCacheClasspath(final JavaProject javaProject, final IClasspathEntry[] newRawClasspath, final IPath newOutputLocation) throws JavaModelException {
- final boolean[] result = new boolean[1];
+ public boolean writeAndCacheClasspath(JavaProject javaProject, final IClasspathEntry[] newRawClasspath, final IPath newOutputLocation) throws JavaModelException {
try {
- // use a workspace runnable so that the notification of .classpath file change is done outside the synchronized block (to avoid deadlocks)
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- workspace.run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- // ensure that the writing of the .classpath file and the caching in memory are synchronized (see also readAnCacheClasspath which is synchronized)
- try {
- PerProjectInfo.this.writtingRawClasspath = true;
- synchronized (PerProjectInfo.this) {
- if (!javaProject.writeFileEntries(newRawClasspath, newOutputLocation)) {
- result[0] = false;
- return;
- }
- // store new raw classpath, new output and new status, and null out resolved info
- setClasspath(newRawClasspath, newOutputLocation, JavaModelStatus.VERIFIED_OK, null, null, null, null);
- result[0] = true;
- }
- } finally {
- PerProjectInfo.this.writtingRawClasspath = false;
- }
- }
- },
- workspace.getRuleFactory().modifyRule(this.project), // use project modification rule as this is needed to create the .classpath file if it doesn't exist yet
- IWorkspace.AVOID_UPDATE,
- null);
- } catch (JavaModelException e) {
- // rethrow exception (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=245576 )
- throw e;
- } catch (CoreException e) {
- // rethrow exception (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=245576 )
- throw new JavaModelException(e);
+ this.writtingRawClasspath = true;
+ // write .classpath
+ if (!javaProject.writeFileEntries(newRawClasspath, newOutputLocation)) {
+ return false;
+ }
+ // store new raw classpath, new output and new status, and null out resolved info
+ setClasspath(newRawClasspath, newOutputLocation, JavaModelStatus.VERIFIED_OK, null, null, null, null);
+ } finally {
+ this.writtingRawClasspath = false;
}
- return result[0];
+ return true;
}
}
eclipse-jdt-266582.patch:
compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java | 21 -
compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java | 8
compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java | 201 ++++++----
eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java | 3
model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java | 3
5 files changed, 159 insertions(+), 77 deletions(-)
--- NEW FILE eclipse-jdt-266582.patch ---
### Eclipse Workspace Patch 1.0
#P org.eclipse.jdt.core
Index: compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java,v
retrieving revision 1.111.2.2
diff -u -r1.111.2.2 BinaryTypeBinding.java
--- compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java 23 Oct 2008 07:14:42 -0000 1.111.2.2
+++ compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java 3 Mar 2009 16:39:27 -0000
@@ -243,91 +243,101 @@
return availableMethods;
}
void cachePartsFrom(IBinaryType binaryType, boolean needFieldsAndMethods) {
- // default initialization for super-interfaces early, in case some aborting compilation error occurs,
- // and still want to use binaries passed that point (e.g. type hierarchy resolver, see bug 63748).
- this.typeVariables = Binding.NO_TYPE_VARIABLES;
- this.superInterfaces = Binding.NO_SUPERINTERFACES;
-
- // must retrieve member types in case superclass/interfaces need them
- this.memberTypes = Binding.NO_MEMBER_TYPES;
- IBinaryNestedType[] memberTypeStructures = binaryType.getMemberTypes();
- if (memberTypeStructures != null) {
- int size = memberTypeStructures.length;
- if (size > 0) {
- this.memberTypes = new ReferenceBinding[size];
- for (int i = 0; i < size; i++)
- // attempt to find each member type if it exists in the cache (otherwise - resolve it when requested)
- this.memberTypes[i] = environment.getTypeFromConstantPoolName(memberTypeStructures[i].getName(), 0, -1, false, null /* could not be missing */);
- this.tagBits |= TagBits.HasUnresolvedMemberTypes;
- }
- }
-
-
- long sourceLevel = environment.globalOptions.sourceLevel;
- char[] typeSignature = null;
- if (sourceLevel >= ClassFileConstants.JDK1_5) {
- typeSignature = binaryType.getGenericSignature();
- this.tagBits |= binaryType.getTagBits();
- }
- char[][][] missingTypeNames = binaryType.getMissingTypeNames();
- if (typeSignature == null) {
- char[] superclassName = binaryType.getSuperclassName();
- if (superclassName != null) {
- // attempt to find the superclass if it exists in the cache (otherwise - resolve it when requested)
- this.superclass = environment.getTypeFromConstantPoolName(superclassName, 0, -1, false, missingTypeNames);
- this.tagBits |= TagBits.HasUnresolvedSuperclass;
- }
-
+ try {
+ // default initialization for super-interfaces early, in case some aborting compilation error occurs,
+ // and still want to use binaries passed that point (e.g. type hierarchy resolver, see bug 63748).
+ this.typeVariables = Binding.NO_TYPE_VARIABLES;
this.superInterfaces = Binding.NO_SUPERINTERFACES;
- char[][] interfaceNames = binaryType.getInterfaceNames();
- if (interfaceNames != null) {
- int size = interfaceNames.length;
+
+ // must retrieve member types in case superclass/interfaces need them
+ this.memberTypes = Binding.NO_MEMBER_TYPES;
+ IBinaryNestedType[] memberTypeStructures = binaryType.getMemberTypes();
+ if (memberTypeStructures != null) {
+ int size = memberTypeStructures.length;
if (size > 0) {
- this.superInterfaces = new ReferenceBinding[size];
+ this.memberTypes = new ReferenceBinding[size];
for (int i = 0; i < size; i++)
- // attempt to find each superinterface if it exists in the cache (otherwise - resolve it when requested)
- this.superInterfaces[i] = environment.getTypeFromConstantPoolName(interfaceNames[i], 0, -1, false, missingTypeNames);
- this.tagBits |= TagBits.HasUnresolvedSuperinterfaces;
+ // attempt to find each member type if it exists in the cache (otherwise - resolve it when requested)
+ this.memberTypes[i] = environment.getTypeFromConstantPoolName(memberTypeStructures[i].getName(), 0, -1, false, null /* could not be missing */);
+ this.tagBits |= TagBits.HasUnresolvedMemberTypes;
}
}
- } else {
- // ClassSignature = ParameterPart(optional) super_TypeSignature interface_signature
- SignatureWrapper wrapper = new SignatureWrapper(typeSignature);
- if (wrapper.signature[wrapper.start] == '<') {
- // ParameterPart = '<' ParameterSignature(s) '>'
- wrapper.start++; // skip '<'
- this.typeVariables = createTypeVariables(wrapper, true, missingTypeNames);
- wrapper.start++; // skip '>'
- this.tagBits |= TagBits.HasUnresolvedTypeVariables;
- this.modifiers |= ExtraCompilerModifiers.AccGenericSignature;
- }
- // attempt to find the superclass if it exists in the cache (otherwise - resolve it when requested)
- this.superclass = (ReferenceBinding) environment.getTypeFromTypeSignature(wrapper, Binding.NO_TYPE_VARIABLES, this, missingTypeNames);
- this.tagBits |= TagBits.HasUnresolvedSuperclass;
+ long sourceLevel = environment.globalOptions.sourceLevel;
+ char[] typeSignature = null;
+ if (sourceLevel >= ClassFileConstants.JDK1_5) {
+ typeSignature = binaryType.getGenericSignature();
+ this.tagBits |= binaryType.getTagBits();
+ }
+ char[][][] missingTypeNames = binaryType.getMissingTypeNames();
+ if (typeSignature == null) {
+ char[] superclassName = binaryType.getSuperclassName();
+ if (superclassName != null) {
+ // attempt to find the superclass if it exists in the cache (otherwise - resolve it when requested)
+ this.superclass = environment.getTypeFromConstantPoolName(superclassName, 0, -1, false, missingTypeNames);
+ this.tagBits |= TagBits.HasUnresolvedSuperclass;
+ }
+
+ this.superInterfaces = Binding.NO_SUPERINTERFACES;
+ char[][] interfaceNames = binaryType.getInterfaceNames();
+ if (interfaceNames != null) {
+ int size = interfaceNames.length;
+ if (size > 0) {
+ this.superInterfaces = new ReferenceBinding[size];
+ for (int i = 0; i < size; i++)
+ // attempt to find each superinterface if it exists in the cache (otherwise - resolve it when requested)
+ this.superInterfaces[i] = environment.getTypeFromConstantPoolName(interfaceNames[i], 0, -1, false, missingTypeNames);
+ this.tagBits |= TagBits.HasUnresolvedSuperinterfaces;
+ }
+ }
+ } else {
+ // ClassSignature = ParameterPart(optional) super_TypeSignature interface_signature
+ SignatureWrapper wrapper = new SignatureWrapper(typeSignature);
+ if (wrapper.signature[wrapper.start] == '<') {
+ // ParameterPart = '<' ParameterSignature(s) '>'
+ wrapper.start++; // skip '<'
+ this.typeVariables = createTypeVariables(wrapper, true, missingTypeNames);
+ wrapper.start++; // skip '>'
+ this.tagBits |= TagBits.HasUnresolvedTypeVariables;
+ this.modifiers |= ExtraCompilerModifiers.AccGenericSignature;
+ }
+ TypeVariableBinding[] typeVars = Binding.NO_TYPE_VARIABLES;
+ char[] methodDescriptor = binaryType.getEnclosingMethod();
+ if (methodDescriptor != null) {
+ MethodBinding enclosingMethod = findMethod(methodDescriptor, missingTypeNames);
+ typeVars = enclosingMethod.typeVariables;
+ }
- this.superInterfaces = Binding.NO_SUPERINTERFACES;
- if (!wrapper.atEnd()) {
- // attempt to find each superinterface if it exists in the cache (otherwise - resolve it when requested)
- java.util.ArrayList types = new java.util.ArrayList(2);
- do {
- types.add(environment.getTypeFromTypeSignature(wrapper, Binding.NO_TYPE_VARIABLES, this, missingTypeNames));
- } while (!wrapper.atEnd());
- this.superInterfaces = new ReferenceBinding[types.size()];
- types.toArray(this.superInterfaces);
- this.tagBits |= TagBits.HasUnresolvedSuperinterfaces;
+ // attempt to find the superclass if it exists in the cache (otherwise - resolve it when requested)
+ this.superclass = (ReferenceBinding) environment.getTypeFromTypeSignature(wrapper, typeVars, this, missingTypeNames);
+ this.tagBits |= TagBits.HasUnresolvedSuperclass;
+
+ this.superInterfaces = Binding.NO_SUPERINTERFACES;
+ if (!wrapper.atEnd()) {
+ // attempt to find each superinterface if it exists in the cache (otherwise - resolve it when requested)
+ java.util.ArrayList types = new java.util.ArrayList(2);
+ do {
+ types.add(environment.getTypeFromTypeSignature(wrapper, typeVars, this, missingTypeNames));
+ } while (!wrapper.atEnd());
+ this.superInterfaces = new ReferenceBinding[types.size()];
+ types.toArray(this.superInterfaces);
+ this.tagBits |= TagBits.HasUnresolvedSuperinterfaces;
+ }
}
- }
- if (needFieldsAndMethods) {
- createFields(binaryType.getFields(), sourceLevel, missingTypeNames);
- createMethods(binaryType.getMethods(), sourceLevel, missingTypeNames);
- } else { // protect against incorrect use of the needFieldsAndMethods flag, see 48459
- this.fields = Binding.NO_FIELDS;
- this.methods = Binding.NO_METHODS;
- }
- if (this.environment.globalOptions.storeAnnotations)
- setAnnotations(createAnnotations(binaryType.getAnnotations(), this.environment, missingTypeNames));
+ if (needFieldsAndMethods) {
+ createFields(binaryType.getFields(), sourceLevel, missingTypeNames);
+ createMethods(binaryType.getMethods(), sourceLevel, missingTypeNames);
+ }
+ if (this.environment.globalOptions.storeAnnotations)
+ setAnnotations(createAnnotations(binaryType.getAnnotations(), this.environment, missingTypeNames));
+ } finally {
+ // protect against incorrect use of the needFieldsAndMethods flag, see 48459
+ if (this.fields == null)
+ this.fields = Binding.NO_FIELDS;
+ if (this.methods == null)
+ this.methods = Binding.NO_METHODS;
+ }
}
private void createFields(IBinaryField[] iFields, long sourceLevel, char[][][] missingTypeNames) {
this.fields = Binding.NO_FIELDS;
@@ -647,6 +657,45 @@
this.tagBits |= TagBits.AreFieldsComplete;
return fields;
}
+private MethodBinding findMethod(char[] methodDescriptor, char[][][] missingTypeNames) {
+ int index = -1;
+ while (methodDescriptor[++index] != '(') {
+ // empty
+ }
+ char[] selector = new char[index];
+ System.arraycopy(methodDescriptor, 0, selector, 0, index);
+ TypeBinding[] parameters = Binding.NO_PARAMETERS;
+ int numOfParams = 0;
+ char nextChar;
+ while ((nextChar = methodDescriptor[++index]) != ')') {
+ if (nextChar != '[') {
+ numOfParams++;
+ if (nextChar == 'L')
+ while ((nextChar = methodDescriptor[++index]) != ';'){/*empty*/}
+ }
+ }
+
+ int startIndex = 0;
+ if (numOfParams > 0) {
+ parameters = new TypeBinding[numOfParams];
+ index = 1;
+ int end = 0; // first character is always '(' so skip it
+ for (int i = 0; i < numOfParams; i++) {
+ while ((nextChar = methodDescriptor[++end]) == '['){/*empty*/}
+ if (nextChar == 'L')
+ while ((nextChar = methodDescriptor[++end]) != ';'){/*empty*/}
+
+ if (i >= startIndex) { // skip the synthetic arg if necessary
+ parameters[i - startIndex] = this.environment.getTypeFromSignature(methodDescriptor, index, end, false, this, missingTypeNames);
+ }
+ index = end + 1;
+ }
+ }
+
+ return CharOperation.equals(selector, TypeConstants.INIT)
+ ? this.enclosingType.getExactConstructor(parameters)
+ : this.enclosingType.getExactMethod(selector, parameters, null);
+}
/**
* @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#genericTypeSignature()
*/
Index: model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java,v
retrieving revision 1.37
diff -u -r1.37 HierarchyBinaryType.java
--- model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java 27 May 2008 23:40:22 -0000 1.37
+++ model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java 3 Mar 2009 16:39:27 -0000
@@ -51,6 +51,9 @@
public IBinaryAnnotation[] getAnnotations() {
return null;
}
+public char[] getEnclosingMethod() {
+ return null;
+}
/**
* Answer the resolved name of the enclosing type in the
* class file format as specified in section 4.2 of the Java 2 VM spec
Index: eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java,v
retrieving revision 1.41
diff -u -r1.41 CodeSnippetSkeleton.java
--- eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java 27 May 2008 22:27:12 -0000 1.41
+++ eval/org/eclipse/jdt/internal/eval/CodeSnippetSkeleton.java 3 Mar 2009 16:39:27 -0000
@@ -108,6 +108,9 @@
public IBinaryAnnotation[] getAnnotations() {
return null;
}
+public char[] getEnclosingMethod() {
+ return null;
+}
public char[] getEnclosingTypeName() {
return null;
}
Index: compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java,v
retrieving revision 1.85
diff -u -r1.85 ClassFileReader.java
--- compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java 27 May 2008 22:21:14 -0000 1.85
+++ compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java 3 Mar 2009 16:39:27 -0000
@@ -50,6 +50,7 @@
private long version;
private char[] enclosingTypeName;
private char[][][] missingTypeNames;
+ private int enclosingNameAndTypeIndex;
private static String printTypeModifiers(int modifiers) {
java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();
@@ -276,8 +277,9 @@
case 'E' :
if (CharOperation.equals(attributeName, AttributeNamesConstants.EnclosingMethodName)) {
utf8Offset =
- constantPoolOffsets[u2At(constantPoolOffsets[u2At(readOffset + 6)] - structOffset + 1)] - structOffset;
+ this.constantPoolOffsets[u2At(this.constantPoolOffsets[u2At(readOffset + 6)] + 1)];
this.enclosingTypeName = utf8At(utf8Offset + 3, u2At(utf8Offset + 1));
+ this.enclosingNameAndTypeIndex = u2At(readOffset + 8);
}
break;
case 'D' :
@@ -445,6 +447,23 @@
return this.constantPoolOffsets;
}
+public char[] getEnclosingMethod() {
+ if (this.enclosingNameAndTypeIndex <= 0) {
+ return null;
+ }
+ // read the name
+ StringBuffer buffer = new StringBuffer();
+
+ int nameAndTypeOffset = this.constantPoolOffsets[this.enclosingNameAndTypeIndex];
+ int utf8Offset = this.constantPoolOffsets[u2At(nameAndTypeOffset + 1)];
+ buffer.append(utf8At(utf8Offset + 3, u2At(utf8Offset + 1)));
+
+ utf8Offset = this.constantPoolOffsets[u2At(nameAndTypeOffset + 3)];
+ buffer.append(utf8At(utf8Offset + 3, u2At(utf8Offset + 1)));
+
+ return String.valueOf(buffer).toCharArray();
+}
+
/*
* Answer the resolved compoundName of the enclosing type
* or null if the receiver is a top level type.
Index: compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java,v
retrieving revision 1.30
diff -u -r1.30 IBinaryType.java
--- compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java 27 May 2008 22:21:14 -0000 1.30
+++ compiler/org/eclipse/jdt/internal/compiler/env/IBinaryType.java 3 Mar 2009 16:39:27 -0000
@@ -24,6 +24,14 @@
IBinaryAnnotation[] getAnnotations();
/**
+ * Answer the enclosing method (including method selector and method descriptor), or
+ * null if none.
+ *
+ * For example, "foo()Ljava/lang/Object;V"
+ */
+
+char[] getEnclosingMethod();
+/**
* Answer the resolved name of the enclosing type in the
* class file format as specified in section 4.2 of the Java 2 VM spec
* or null if the receiver is a top level type.
eclipse-jdt-265962.patch:
ast/DoStatement.java | 26 +++++++++++++-------------
flow/FlowInfo.java | 2 +-
flow/UnconditionalFlowInfo.java | 5 ++++-
3 files changed, 18 insertions(+), 15 deletions(-)
--- NEW FILE eclipse-jdt-265962.patch ---
### Eclipse Workspace Patch 1.0
#P org.eclipse.jdt.core
Index: compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java,v
retrieving revision 1.60
diff -u -r1.60 UnconditionalFlowInfo.java
--- compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java 5 Dec 2006 11:46:08 -0000 1.60
+++ compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java 4 Mar 2009 16:56:17 -0000
@@ -1544,7 +1544,10 @@
}
public FlowInfo setReachMode(int reachMode) {
- if (reachMode == REACHABLE && this != DEAD_END) { // cannot modify DEAD_END
+ if (this == DEAD_END) {
+ return this; // cannot modify DEAD_END
+ }
+ if (reachMode == REACHABLE) {
this.tagBits &= ~UNREACHABLE;
}
else {
Index: compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java,v
retrieving revision 1.35
diff -u -r1.35 FlowInfo.java
--- compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java 26 Sep 2006 12:04:03 -0000 1.35
+++ compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java 4 Mar 2009 16:56:16 -0000
@@ -58,7 +58,7 @@
}
public static FlowInfo conditional(FlowInfo initsWhenTrue, FlowInfo initsWhenFalse){
-
+ if (initsWhenTrue == initsWhenFalse) return initsWhenTrue;
// if (initsWhenTrue.equals(initsWhenFalse)) return initsWhenTrue; -- could optimize if #equals is defined
return new ConditionalFlowInfo(initsWhenTrue, initsWhenFalse);
}
Index: compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java,v
retrieving revision 1.56
diff -u -r1.56 DoStatement.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java 6 Mar 2007 02:38:48 -0000 1.56
+++ compiler/org/eclipse/jdt/internal/compiler/ast/DoStatement.java 4 Mar 2009 16:56:16 -0000
@@ -144,19 +144,19 @@
// continue label (135602)
if (hasContinueLabel) {
this.continueLabel.place();
- }
- // generate condition
- Constant cst = this.condition.optimizedBooleanConstant();
- boolean isConditionOptimizedFalse = cst != Constant.NotAConstant && cst.booleanValue() == false;
- if (isConditionOptimizedFalse){
- this.condition.generateCode(currentScope, codeStream, false);
- } else if (hasContinueLabel) {
- this.condition.generateOptimizedBoolean(
- currentScope,
- codeStream,
- actionLabel,
- null,
- true);
+ // generate condition
+ Constant cst = this.condition.optimizedBooleanConstant();
+ boolean isConditionOptimizedFalse = cst != Constant.NotAConstant && cst.booleanValue() == false;
+ if (isConditionOptimizedFalse){
+ this.condition.generateCode(currentScope, codeStream, false);
+ } else {
+ this.condition.generateOptimizedBoolean(
+ currentScope,
+ codeStream,
+ actionLabel,
+ null,
+ true);
+ }
}
// May loose some local variable initializations : affecting the local variable attributes
if (this.mergedInitStateIndex != -1) {
eclipse-jdt-263877.patch:
QualifiedNameReference.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- NEW FILE eclipse-jdt-263877.patch ---
### Eclipse Workspace Patch 1.0
#P org.eclipse.jdt.core
Index: compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java,v
retrieving revision 1.125.2.3
diff -u -r1.125.2.3 QualifiedNameReference.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java 27 Nov 2008 10:13:10 -0000 1.125.2.3
+++ compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java 6 Feb 2009 12:34:15 -0000
@@ -780,8 +780,8 @@
}
if (field.isStatic()) {
- ReferenceBinding declaringClass = field.original().declaringClass;
- if (declaringClass.isEnum()) {
+ if ((field.modifiers & ClassFileConstants.AccEnum) != 0) { // enum constants are checked even when qualified)
+ ReferenceBinding declaringClass = field.original().declaringClass;
MethodScope methodScope = scope.methodScope();
SourceTypeBinding sourceType = methodScope.enclosingSourceType();
if ((this.bits & ASTNode.IsStrictlyAssigned) == 0
@@ -1014,13 +1014,13 @@
MethodScope methodScope = scope.methodScope();
TypeBinding declaringClass = fieldBinding.original().declaringClass;
// check for forward references
- if ((this.indexOfFirstFieldBinding == 1 || declaringClass.isEnum())
+ if ((this.indexOfFirstFieldBinding == 1 || (fieldBinding.modifiers & ClassFileConstants.AccEnum) != 0) // enum constants are checked even when qualified
&& methodScope.enclosingSourceType() == declaringClass
&& methodScope.lastVisibleFieldID >= 0
&& fieldBinding.id >= methodScope.lastVisibleFieldID
&& (!fieldBinding.isStatic() || methodScope.isStatic)) {
scope.problemReporter().forwardReference(this, 0, fieldBinding);
- }
+ }
if (fieldBinding.isStatic()) {
// check if accessing enum static field in initializer
if (declaringClass.isEnum()) {
eclipse-jdt-265103.patch:
ClasspathJar.java | 64 ++++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 50 insertions(+), 14 deletions(-)
--- NEW FILE eclipse-jdt-265103.patch ---
### Eclipse Workspace Patch 1.0
#P org.eclipse.jdt.core
Index: batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java,v
retrieving revision 1.45.2.1
diff -u -r1.45.2.1 ClasspathJar.java
--- batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java 10 Nov 2008 17:46:09 -0000 1.45.2.1
+++ batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java 4 Mar 2009 16:09:54 -0000
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Fabrice Matrat - fix for 265103
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.batch;
@@ -54,18 +55,20 @@
READING_JAR = 4,
CONTINUING = 5,
SKIP_LINE = 6;
- private static final char[] CLASSPATH_HEADER_TOKEN =
+ private static final char[] CLASSPATH_HEADER_TOKEN =
"Class-Path:".toCharArray(); //$NON-NLS-1$
- private int ClasspathSectionsCount;
+ private int classpathSectionsCount;
private ArrayList calledFilesNames;
public boolean analyzeManifestContents(Reader reader) throws IOException {
int state = START, substate = 0;
StringBuffer currentJarToken = new StringBuffer();
int currentChar;
- this.ClasspathSectionsCount = 0;
+ this.classpathSectionsCount = 0;
this.calledFilesNames = null;
for (;;) {
currentChar = reader.read();
+ if (currentChar == '\r') // skip \r, will consider \n later (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=251079 )
+ currentChar = reader.read();
switch (state) {
case START:
if (currentChar == -1) {
@@ -91,50 +94,71 @@
case PAST_CLASSPATH_HEADER:
if (currentChar == ' ') {
state = SKIPPING_WHITESPACE;
- this.ClasspathSectionsCount++;
+ this.classpathSectionsCount++;
} else {
return false;
}
break;
case SKIPPING_WHITESPACE:
if (currentChar == -1) {
+ // >>>>>>>>>>>>>>>>>> Add the latest jar read
+ addCurrentTokenJarWhenNecessary(currentJarToken);
return true;
} else if (currentChar == '\n') {
state = CONTINUING;
} else if (currentChar != ' ') {
currentJarToken.append((char) currentChar);
state = READING_JAR;
+ } else {
+ // >>>>>>>>>>>>>>>>>> Add the latest jar read
+ addCurrentTokenJarWhenNecessary(currentJarToken);
}
break;
case CONTINUING:
if (currentChar == -1) {
+ // >>>>>>>>>>>>>>>>>> Add the latest jar read
+ addCurrentTokenJarWhenNecessary(currentJarToken);
return true;
} else if (currentChar == '\n') {
+ addCurrentTokenJarWhenNecessary(currentJarToken);
state = START;
} else if (currentChar == ' ') {
state = SKIPPING_WHITESPACE;
} else if (currentChar == CLASSPATH_HEADER_TOKEN[0]) {
+ addCurrentTokenJarWhenNecessary(currentJarToken);
state = IN_CLASSPATH_HEADER;
substate = 1;
} else if (this.calledFilesNames == null) {
- return false;
+ // >>>>>>>>>>>>>>>>>> Add the latest jar read
+ addCurrentTokenJarWhenNecessary(currentJarToken);
+ state = START;
} else {
+ // >>>>>>>>>>>>>>>>>> Add the latest jar read
+ addCurrentTokenJarWhenNecessary(currentJarToken);
state = SKIP_LINE;
}
break;
case SKIP_LINE:
if (currentChar == -1) {
+ if (this.classpathSectionsCount != 0) {
+ if (this.calledFilesNames == null) {
+ return false;
+ }
+ }
return true;
} else if (currentChar == '\n') {
state = START;
}
break;
- case READING_JAR:
+ case READING_JAR:
if (currentChar == -1) {
+ // >>>>>>>>>>>>>>>>>> Add the latest jar read
return false;
} else if (currentChar == '\n') {
// appends token below
state = CONTINUING;
+ // >>>>>>>>>>> Add a break to not add the jar yet as it can continue on the next line
+ break;
} else if (currentChar == ' ') {
// appends token below
state = SKIPPING_WHITESPACE;
@@ -142,17 +166,29 @@
currentJarToken.append((char) currentChar);
break;
}
- if (this.calledFilesNames == null) {
- this.calledFilesNames = new ArrayList();
- }
- this.calledFilesNames.add(currentJarToken.toString());
- currentJarToken.setLength(0);
+ addCurrentTokenJarWhenNecessary(currentJarToken);
break;
}
- }
+ }
+ }
+
+ // >>>>>>>>>>>>>>>> Method Extracted from analyzeManifestContents in the READING_JAR Block
+ private boolean addCurrentTokenJarWhenNecessary(StringBuffer currentJarToken) {
+ if (currentJarToken != null && currentJarToken.length() > 0) {
+ if (this.calledFilesNames == null) {
+ this.calledFilesNames = new ArrayList();
+ }
+ this.calledFilesNames.add(currentJarToken.toString());
+ currentJarToken.setLength(0);
+ return true;
+ }
+ return false;
}
+ // <<<<<<<<<<<<<<<<<<<<<<
+
+
public int getClasspathSectionsCount() {
- return this.ClasspathSectionsCount;
+ return this.classpathSectionsCount;
}
public List getCalledFileNames() {
return this.calledFilesNames;
eclipse-jdt-261510.patch:
ast/IntLiteral.java | 18 ++----------------
ast/IntLiteralMinValue.java | 5 ++---
ast/LongLiteral.java | 18 ++----------------
ast/LongLiteralMinValue.java | 3 +--
impl/IntConstant.java | 4 +++-
impl/LongConstant.java | 3 +++
6 files changed, 13 insertions(+), 38 deletions(-)
--- NEW FILE eclipse-jdt-261510.patch ---
### Eclipse Workspace Patch 1.0
#P org.eclipse.jdt.core
Index: compiler/org/eclipse/jdt/internal/compiler/impl/IntConstant.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IntConstant.java,v
retrieving revision 1.25
diff -u -r1.25 IntConstant.java
--- compiler/org/eclipse/jdt/internal/compiler/impl/IntConstant.java 28 Mar 2006 20:33:18 -0000 1.25
+++ compiler/org/eclipse/jdt/internal/compiler/impl/IntConstant.java 2 Feb 2009 15:15:01 -0000
@@ -13,7 +13,8 @@
public class IntConstant extends Constant {
int value;
-
+
+ private static final IntConstant MIN_VALUE = new IntConstant(Integer.MIN_VALUE);
private static final IntConstant MINUS_FOUR = new IntConstant(-4);
private static final IntConstant MINUS_THREE = new IntConstant(-3);
private static final IntConstant MINUS_TWO = new IntConstant(-2);
@@ -33,6 +34,7 @@
public static Constant fromValue(int value) {
switch (value) {
+ case Integer.MIN_VALUE : return IntConstant.MIN_VALUE;
case -4 : return IntConstant.MINUS_FOUR;
case -3 : return IntConstant.MINUS_THREE;
case -2 : return IntConstant.MINUS_TWO;
Index: compiler/org/eclipse/jdt/internal/compiler/impl/LongConstant.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/LongConstant.java,v
retrieving revision 1.23
diff -u -r1.23 LongConstant.java
--- compiler/org/eclipse/jdt/internal/compiler/impl/LongConstant.java 28 Mar 2006 20:33:18 -0000 1.23
+++ compiler/org/eclipse/jdt/internal/compiler/impl/LongConstant.java 2 Feb 2009 15:15:01 -0000
@@ -12,12 +12,15 @@
public class LongConstant extends Constant {
private static final LongConstant ZERO = new LongConstant(0L);
+private static final LongConstant MIN_VALUE = new LongConstant(Long.MIN_VALUE);
private long value;
public static Constant fromValue(long value) {
if (value == 0L) {
return ZERO;
+ } else if (value == Long.MIN_VALUE) {
+ return MIN_VALUE;
}
return new LongConstant(value);
}
Index: compiler/org/eclipse/jdt/internal/compiler/ast/LongLiteral.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LongLiteral.java,v
retrieving revision 1.25
diff -u -r1.25 LongLiteral.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/LongLiteral.java 6 Mar 2007 02:38:48 -0000 1.25
+++ compiler/org/eclipse/jdt/internal/compiler/ast/LongLiteral.java 2 Feb 2009 15:15:01 -0000
@@ -17,7 +17,6 @@
import org.eclipse.jdt.internal.compiler.parser.ScannerHelper;
public class LongLiteral extends NumberLiteral {
- static final Constant FORMAT_ERROR = DoubleConstant.fromValue(1.0/0.0); // NaN;
public LongLiteral(char[] token, int s,int e) {
super(token, s,e);
@@ -52,7 +51,7 @@
int digitValue ;
if ((digitValue = ScannerHelper.digit(source[j++],radix)) < 0 ) {
- constant = FORMAT_ERROR; return ;
+ return /*constant stays null*/ ;
}
if (digitValue >= 8)
nbDigit = 4;
@@ -65,7 +64,7 @@
computedValue = digitValue ;
while (j<length) {
if ((digitValue = ScannerHelper.digit(source[j++],radix)) < 0) {
- constant = FORMAT_ERROR; return ;
+ return /*constant stays null*/ ;
}
if ((nbDigit += shift) > 64)
return /*constant stays null*/ ;
@@ -137,19 +136,6 @@
(source[18] == '8') &&
(((this.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT) == 0));
}
-public TypeBinding resolveType(BlockScope scope) {
- // the format may be incorrect while the scanner could detect
- // such error only on painfull tests...easier and faster here
-
- TypeBinding tb = super.resolveType(scope);
- if (constant == FORMAT_ERROR) {
- constant = Constant.NotAConstant;
- scope.problemReporter().constantOutOfFormat(this);
- this.resolvedType = null;
- return null;
- }
- return tb;
-}
public void traverse(ASTVisitor visitor, BlockScope scope) {
visitor.visit(this, scope);
visitor.endVisit(this, scope);
Index: compiler/org/eclipse/jdt/internal/compiler/ast/LongLiteralMinValue.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LongLiteralMinValue.java,v
retrieving revision 1.12
diff -u -r1.12 LongLiteralMinValue.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/LongLiteralMinValue.java 6 Mar 2007 02:38:48 -0000 1.12
+++ compiler/org/eclipse/jdt/internal/compiler/ast/LongLiteralMinValue.java 2 Feb 2009 15:15:01 -0000
@@ -15,11 +15,10 @@
public class LongLiteralMinValue extends LongLiteral {
final static char[] CharValue = new char[]{'-', '9','2','2','3','3','7','2','0','3','6','8','5','4','7','7','5','8','0','8','L'};
- final static Constant MIN_VALUE = LongConstant.fromValue(Long.MIN_VALUE) ;
public LongLiteralMinValue(){
super(CharValue,0,0);
- constant = MIN_VALUE;
+ constant = LongConstant.fromValue(Long.MIN_VALUE);
}
public void computeConstant() {
Index: compiler/org/eclipse/jdt/internal/compiler/ast/IntLiteralMinValue.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IntLiteralMinValue.java,v
retrieving revision 1.10
diff -u -r1.10 IntLiteralMinValue.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/IntLiteralMinValue.java 28 Mar 2006 20:29:57 -0000 1.10
+++ compiler/org/eclipse/jdt/internal/compiler/ast/IntLiteralMinValue.java 2 Feb 2009 15:15:01 -0000
@@ -15,11 +15,10 @@
public class IntLiteralMinValue extends IntLiteral {
final static char[] CharValue = new char[]{'-','2','1','4','7','4','8','3','6','4','8'};
- final static Constant MIN_VALUE = IntConstant.fromValue(Integer.MIN_VALUE) ;
public IntLiteralMinValue() {
- super(CharValue,0,0,Integer.MIN_VALUE);
- constant = MIN_VALUE;
+ super(CharValue, 0,0, Integer.MIN_VALUE);
+ constant = IntConstant.fromValue(Integer.MIN_VALUE);
}
public void computeConstant(){
Index: compiler/org/eclipse/jdt/internal/compiler/ast/IntLiteral.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IntLiteral.java,v
retrieving revision 1.23
diff -u -r1.23 IntLiteral.java
--- compiler/org/eclipse/jdt/internal/compiler/ast/IntLiteral.java 28 Oct 2006 04:11:27 -0000 1.23
+++ compiler/org/eclipse/jdt/internal/compiler/ast/IntLiteral.java 2 Feb 2009 15:15:01 -0000
@@ -22,7 +22,6 @@
public static final IntLiteral
One = new IntLiteral(new char[]{'1'},0,0,1);//used for ++ and --
- static final Constant FORMAT_ERROR = DoubleConstant.fromValue(1.0/0.0); // NaN;
public IntLiteral(char[] token, int s, int e) {
super(token, s,e);
}
@@ -71,7 +70,7 @@
while (j<length)
{ int digitValue ;
if ((digitValue = ScannerHelper.digit(source[j++],radix)) < 0 )
- { constant = FORMAT_ERROR; return ;}
+ { return /*constant stays null*/ ;}
computedValue = (computedValue<<shift) | digitValue ;
if (computedValue > MAX) return /*constant stays null*/ ;}}
else
@@ -79,7 +78,7 @@
for (int i = 0 ; i < length;i++)
{ int digitValue ;
if ((digitValue = ScannerHelper.digit(source[i],10)) < 0 )
- { constant = FORMAT_ERROR; return ;}
+ { return /*constant stays null*/ ; }
computedValue = 10*computedValue + digitValue;
if (computedValue > MAX) return /*constant stays null*/ ; }}
@@ -122,19 +121,6 @@
(source[9] == '8') &&
(((this.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT) == 0));
}
-public TypeBinding resolveType(BlockScope scope) {
- // the format may be incorrect while the scanner could detect
- // such an error only on painfull tests...easier and faster here
-
- TypeBinding tb = super.resolveType(scope);
- if (constant == FORMAT_ERROR) {
- constant = Constant.NotAConstant;
- scope.problemReporter().constantOutOfFormat(this);
- this.resolvedType = null;
- return null;
- }
- return tb;
-}
public StringBuffer printExpression(int indent, StringBuffer output){
if (source == null) {
Index: eclipse.spec
===================================================================
RCS file: /cvs/pkgs/rpms/eclipse/F-11/eclipse.spec,v
retrieving revision 1.634
retrieving revision 1.635
diff -u -p -r1.634 -r1.635
--- eclipse.spec 9 Sep 2009 14:07:25 -0000 1.634
+++ eclipse.spec 28 Sep 2009 12:59:26 -0000 1.635
@@ -29,7 +29,7 @@ Epoch: 1
Summary: An open, extensible IDE
Name: eclipse
Version: %{eclipse_majmin}.%{eclipse_micro}
-Release: 15%{?dist}
+Release: 16%{?dist}
License: EPL
Group: Text Editors/Integrated Development Environments (IDE)
URL: http://www.eclipse.org/
@@ -160,6 +160,16 @@ Patch45: %{name}-swt-buildagainst
# https://bugs.eclipse.org/bugs/attachment.cgi?id=130611
Patch46: %{name}-swt-xulrunner191.patch
+#Post 3.4.2 ecj patches
+Patch47: %{name}-jdt-261510.patch
+Patch48: %{name}-jdt-249930.patch
+Patch49: %{name}-jdt-263877.patch
+Patch50: %{name}-jdt-257716.patch
+Patch51: %{name}-jdt-264843.patch
+Patch52: %{name}-jdt-266582.patch
+Patch53: %{name}-jdt-265103.patch
+Patch54: %{name}-jdt-265962.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: ant
BuildRequires: jpackage-utils >= 0:1.5, make, gcc
@@ -663,6 +673,17 @@ popd
%patch43
%patch44
+pushd plugins/org.eclipse.jdt.core
+%patch47
+%patch48
+%patch49
+%patch50
+%patch51
+%patch52
+%patch53
+%patch54
+popd
+
%build
ORIGCLASSPATH=$CLASSPATH
@@ -1491,6 +1512,9 @@ fi
#%{_libdir}/%{name}/configuration/org.eclipse.equinox.source
%changelog
+* Mon Sep 28 2009 Alexander Kurtakov <akurtako at redhat.com> 1:3.4.2-16
+- Add post 3.4.2 jdt.core patches. Fixes #525737.
+
* Wed Sep 09 2009 Jan Horak <jhorak at redhat.com> - 1:3.4.2-15
- Rebuild against newer gecko
- Previous message (by thread): rpms/imsettings/devel .cvsignore, 1.18, 1.19 imsettings.spec, 1.42, 1.43 sources, 1.17, 1.18 imsettings-close-fd.patch, 1.1, NONE imsettings-unref-later.patch, 1.1, NONE imsettings-unref-notify.patch, 1.1, NONE imsettings-update-info.patch, 1.1, NONE
- Next message (by thread): rpms/kdelibs3/devel kdelibs3.spec,1.72,1.73
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list