Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2013-08-18 17:50:02 +0000
committerStephan Herrmann2013-08-18 17:50:02 +0000
commitfafb2dc68e9656aa163ddd55309d4bcb6df6ee09 (patch)
treed31377457becbaa5744a6079f3a5f5dedcd92365
parent55099d2c60113e1ad2e8ab8558e8720dd555fab8 (diff)
downloadeclipse.jdt.core-fafb2dc68e9656aa163ddd55309d4bcb6df6ee09.tar.gz
eclipse.jdt.core-fafb2dc68e9656aa163ddd55309d4bcb6df6ee09.tar.xz
eclipse.jdt.core-fafb2dc68e9656aa163ddd55309d4bcb6df6ee09.zip
Bug 415043 - [1.8][null] Follow-up re null type annotations after
bug 392099 - (2) ConditionalExpression: always use unannotated() unless identical
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java
index 8d21847b6c..8666e92d5d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java
@@ -20,7 +20,8 @@
* bug 345305 - [compiler][null] Compiler misidentifies a case of "variable can only be null"
* bug 383368 - [compiler][null] syntactic null analysis for field references
* bug 400761 - [compiler][null] null may be return as boolean without a diagnostic
- * Bug 392099 - [1.8][compiler][null] Apply null annotation on types for null analysis
+ * Bug 392099 - [1.8][compiler][null] Apply null annotation on types for null analysis
+ * Bug 415043 - [1.8][null] Follow-up re null type annotations after bug 392099
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
@@ -470,13 +471,9 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext,
TypeBinding valueIfTrueType = this.originalValueIfTrueType;
TypeBinding valueIfFalseType = this.originalValueIfFalseType;
- if (use18specifics && valueIfTrueType != null && valueIfFalseType != null) {
- if (valueIfTrueType.isAnnotatedTypeWithoutArguments() != valueIfFalseType.isAnnotatedTypeWithoutArguments()) {
- if (valueIfTrueType.isAnnotatedTypeWithoutArguments()) // FIXME(stephan) mixed scenarios: null tag bits & type arguments
- valueIfTrueType = valueIfTrueType.original();
- else
- valueIfFalseType = valueIfFalseType.original();
- }
+ if (use18specifics && valueIfTrueType != null && valueIfFalseType != null && valueIfTrueType != valueIfFalseType) {
+ valueIfTrueType = valueIfTrueType.unannotated();
+ valueIfFalseType = valueIfFalseType.unannotated();
}
if (use15specifics && valueIfTrueType != valueIfFalseType) {
if (valueIfTrueType.isBaseType()) {

Back to the top