|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
### Eclipse Workspace Patch 1.0
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
#P org.eclipse.jdt.core
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
Index: compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
===================================================================
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java,v
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
retrieving revision 1.64
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
diff -u -r1.64 LocalDeclaration.java
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
--- compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java 27 May 2008 22:21:13 -0000 1.64
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+++ compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java 17 Feb 2009 19:32:06 -0000
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
@@ -198,11 +198,7 @@
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
&& (this.initialization.bits & ASTNode.UnnecessaryCast) == 0) {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
CastExpression.checkNeedForAssignedCast(scope, variableType, (CastExpression) this.initialization);
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
}
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- } else if (scope.isBoxingCompatibleWith(initializationType, variableType)
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- || (initializationType.isBaseType() // narrowing then boxing ?
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- && scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5 // autoboxing
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- && !variableType.isBaseType()
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- && initialization.isConstantValueOfTypeAssignableToType(initializationType, scope.environment().computeBoxingType(variableType)))) {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+ } else if (isBoxingCompatible(initializationType, variableType, this.initialization, scope)) {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
this.initialization.computeConversion(scope, variableType, initializationType);
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
if (this.initialization instanceof CastExpression
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
&& (this.initialization.bits & ASTNode.UnnecessaryCast) == 0) {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
Index: compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
===================================================================
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java,v
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
retrieving revision 1.41
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
diff -u -r1.41 Statement.java
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
--- compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java 28 Mar 2006 20:29:57 -0000 1.41
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+++ compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java 17 Feb 2009 19:32:06 -0000
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
@@ -104,7 +104,18 @@
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
}
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
public abstract void generateCode(BlockScope currentScope, CodeStream codeStream);
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
-
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+ protected boolean isBoxingCompatible(TypeBinding expressionType, TypeBinding targetType, Expression expression, Scope scope) {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+ if (scope.isBoxingCompatibleWith(expressionType, targetType))
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+ return true;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+ return expressionType.isBaseType() // narrowing then boxing ?
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+ && !targetType.isBaseType()
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+ && !targetType.isTypeVariable()
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+ && scope.compilerOptions().sourceLevel >= org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK1_5 // autoboxing
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+ && expression.isConstantValueOfTypeAssignableToType(expressionType, scope.environment().computeBoxingType( targetType));
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
public boolean isEmptyBlock() {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
return false;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
}
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
Index: compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
===================================================================
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java,v
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
retrieving revision 1.88
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
diff -u -r1.88 FieldDeclaration.java
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
--- compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java 27 May 2008 22:21:13 -0000 1.88
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+++ compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java 17 Feb 2009 19:32:06 -0000
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
@@ -230,11 +230,7 @@
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
&& (this.initialization.bits & ASTNode.UnnecessaryCast) == 0) {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
CastExpression.checkNeedForAssignedCast(initializationScope, fieldType, (CastExpression) this.initialization);
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
}
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- } else if (initializationScope.isBoxingCompatibleWith(initializationType, fieldType)
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- || (initializationType.isBaseType() // narrowing then boxing ?
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- && initializationScope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5 // autoboxing
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- && !fieldType.isBaseType()
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- && initialization.isConstantValueOfTypeAssignableToType(initializationType, initializationScope.environment().computeBoxingType(fieldType)))) {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+ } else if (isBoxingCompatible(initializationType, fieldType, this.initialization, initializationScope)) {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
this.initialization.computeConversion(initializationScope, fieldType, initializationType);
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
if (this.initialization instanceof CastExpression
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
&& (this.initialization.bits & ASTNode.UnnecessaryCast) == 0) {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
Index: compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
===================================================================
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java,v
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
retrieving revision 1.30
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
diff -u -r1.30 CaseStatement.java
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
--- compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java 27 May 2008 22:21:13 -0000 1.30
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+++ compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java 17 Feb 2009 19:32:06 -0000
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
@@ -127,11 +127,7 @@
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
} else {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
return this.constantExpression.constant;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
}
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- } else if (scope.isBoxingCompatibleWith(caseType, switchExpressionType)
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- || (caseType.isBaseType() // narrowing then boxing ?
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- && scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5 // autoboxing
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- && !switchExpressionType.isBaseType()
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- && this.constantExpression.isConstantValueOfTypeAssignableToType(caseType, scope.environment().computeBoxingType(switchExpressionType)))) {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+ } else if (isBoxingCompatible(caseType, switchExpressionType, this.constantExpression, scope)) {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
// constantExpression.computeConversion(scope, caseType, switchExpressionType); - do not report boxing/unboxing conversion
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
return this.constantExpression.constant;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
}
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
Index: compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
===================================================================
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java,v
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
retrieving revision 1.62
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
diff -u -r1.62 ReturnStatement.java
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
--- compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java 27 May 2008 22:21:13 -0000 1.62
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+++ compiler/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java 17 Feb 2009 19:32:06 -0000
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
@@ -11,7 +11,6 @@
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
package org.eclipse.jdt.internal.compiler.ast;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
import org.eclipse.jdt.internal.compiler.ASTVisitor;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
import org.eclipse.jdt.internal.compiler.codegen.*;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
import org.eclipse.jdt.internal.compiler.flow.*;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
import org.eclipse.jdt.internal.compiler.impl.Constant;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
@@ -239,11 +238,7 @@
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
CastExpression.checkNeedForAssignedCast(scope, methodType, (CastExpression) this.expression);
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
}
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
return;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- } else if (scope.isBoxingCompatibleWith(expressionType, methodType)
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- || (expressionType.isBaseType() // narrowing then boxing ?
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- && scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5 // autoboxing
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- && !methodType.isBaseType()
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- && this.expression.isConstantValueOfTypeAssignableToType(expressionType, scope.environment().computeBoxingType(methodType)))) {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+ } else if (isBoxingCompatible(expressionType, methodType, this.expression, scope)) {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
this.expression.computeConversion(scope, methodType, expressionType);
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
if (this.expression instanceof CastExpression
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
&& (this.expression.bits & (ASTNode.UnnecessaryCast|ASTNode.DisableUnnecessaryCastCheck)) == 0) {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
Index: compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
===================================================================
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java,v
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
retrieving revision 1.82
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
diff -u -r1.82 Assignment.java
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
--- compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java 27 May 2008 22:21:13 -0000 1.82
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+++ compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java 17 Feb 2009 19:32:06 -0000
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
@@ -12,7 +12,6 @@
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
package org.eclipse.jdt.internal.compiler.ast;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
import org.eclipse.jdt.internal.compiler.ASTVisitor;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
import org.eclipse.jdt.internal.compiler.codegen.*;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
import org.eclipse.jdt.internal.compiler.flow.*;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
import org.eclipse.jdt.internal.compiler.impl.Constant;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
@@ -214,11 +213,7 @@
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
CastExpression.checkNeedForAssignedCast(scope, lhsType, (CastExpression) this.expression);
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
}
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
return this.resolvedType;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- } else if (scope.isBoxingCompatibleWith(rhsType, lhsType)
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- || (rhsType.isBaseType() // narrowing then boxing ?
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- && scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5 // autoboxing
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- && !lhsType.isBaseType()
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- && this.expression.isConstantValueOfTypeAssignableToType(rhsType, scope.environment().computeBoxingType(lhsType)))) {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+ } else if (isBoxingCompatible(rhsType, lhsType, this.expression, scope)) {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
this.expression.computeConversion(scope, lhsType, rhsType);
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
if (this.expression instanceof CastExpression
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
&& (this.expression.bits & ASTNode.UnnecessaryCast) == 0) {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
Index: compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
===================================================================
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java,v
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
retrieving revision 1.50
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
diff -u -r1.50 ArrayInitializer.java
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
--- compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java 27 May 2008 22:21:13 -0000 1.50
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+++ compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java 17 Feb 2009 19:32:06 -0000
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
@@ -11,7 +11,6 @@
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
package org.eclipse.jdt.internal.compiler.ast;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
import org.eclipse.jdt.internal.compiler.ASTVisitor;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
import org.eclipse.jdt.internal.compiler.codegen.*;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
import org.eclipse.jdt.internal.compiler.flow.*;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
import org.eclipse.jdt.internal.compiler.impl.Constant;
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
@@ -169,11 +168,7 @@
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
|| (elementType.isBaseType() && BaseTypeBinding.isWidening(elementType.id, expressionType.id)))
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
|| expressionType.isCompatibleWith(elementType)) {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
expression.computeConversion(scope, elementType, expressionType);
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- } else if (scope.isBoxingCompatibleWith(expressionType, elementType)
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- || (expressionType.isBaseType() // narrowing then boxing ?
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- && scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5 // autoboxing
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- && !elementType.isBaseType()
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
- && expression.isConstantValueOfTypeAssignableToType(expressionType, scope.environment().computeBoxingType(elementType)))) {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
+ } else if (isBoxingCompatible(expressionType, elementType, expression, scope)) {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
expression.computeConversion(scope, elementType, expressionType);
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
} else {
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
scope.problemReporter().typeMismatchError(expressionType, elementType, expression, null);
|
|
![](https://seccdn.libravatar.org/avatar/0c6e9e514c88ccbca155e733902412a80831318f713070d1dc699d09361db751?s=16&d=retro) |
db9e6cd |
|