Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 188486 Details for
Bug 324178
[null] ConditionalExpression.nullStatus(..) doesn't take into account the analysis of condition itself
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
proposed fix
Bug_324178_v0.patch (text/plain), 4.42 KB, created by
Stephan Herrmann
on 2011-02-07 19:03:58 EST
(
hide
)
Description:
proposed fix
Filename:
MIME Type:
Creator:
Stephan Herrmann
Created:
2011-02-07 19:03:58 EST
Size:
4.42 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java,v >retrieving revision 1.98 >diff -u -r1.98 ConditionalExpression.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java 14 Jan 2011 17:02:24 -0000 1.98 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java 7 Feb 2011 23:52:10 -0000 >@@ -84,35 +84,7 @@ > } else if (isConditionOptimizedFalse) { > mergedInfo = falseFlowInfo.addPotentialInitializationsFrom(trueFlowInfo); > } else { >- // if ((t && (v = t)) ? t : t && (v = f)) r = v; -- ok >- cst = this.optimizedIfTrueConstant; >- boolean isValueIfTrueOptimizedTrue = cst != null && cst != Constant.NotAConstant && cst.booleanValue() == true; >- boolean isValueIfTrueOptimizedFalse = cst != null && cst != Constant.NotAConstant && cst.booleanValue() == false; >- >- cst = this.optimizedIfFalseConstant; >- boolean isValueIfFalseOptimizedTrue = cst != null && cst != Constant.NotAConstant && cst.booleanValue() == true; >- boolean isValueIfFalseOptimizedFalse = cst != null && cst != Constant.NotAConstant && cst.booleanValue() == false; >- >- UnconditionalFlowInfo trueInfoWhenTrue = trueFlowInfo.initsWhenTrue().unconditionalCopy(); >- UnconditionalFlowInfo falseInfoWhenTrue = falseFlowInfo.initsWhenTrue().unconditionalCopy(); >- UnconditionalFlowInfo trueInfoWhenFalse = trueFlowInfo.initsWhenFalse().unconditionalInits(); >- UnconditionalFlowInfo falseInfoWhenFalse = falseFlowInfo.initsWhenFalse().unconditionalInits(); >- if (isValueIfTrueOptimizedFalse) { >- trueInfoWhenTrue.setReachMode(FlowInfo.UNREACHABLE); >- } >- if (isValueIfFalseOptimizedFalse) { >- falseInfoWhenTrue.setReachMode(FlowInfo.UNREACHABLE); >- } >- if (isValueIfTrueOptimizedTrue) { >- trueInfoWhenFalse.setReachMode(FlowInfo.UNREACHABLE); >- } >- if (isValueIfFalseOptimizedTrue) { >- falseInfoWhenFalse.setReachMode(FlowInfo.UNREACHABLE); >- } >- mergedInfo = >- FlowInfo.conditional( >- trueInfoWhenTrue.mergedWith(falseInfoWhenTrue), >- trueInfoWhenFalse.mergedWith(falseInfoWhenFalse)); >+ mergedInfo = FlowInfo.conditional(trueFlowInfo, falseFlowInfo); > } > this.mergedInitStateIndex = > currentScope.methodScope().recordInitializationStates(mergedInfo); >@@ -314,8 +286,8 @@ > } > return this.valueIfFalse.nullStatus(flowInfo); > } >- int ifTrueNullStatus = this.valueIfTrue.nullStatus(flowInfo), >- ifFalseNullStatus = this.valueIfFalse.nullStatus(flowInfo); >+ int ifTrueNullStatus = this.valueIfTrue.nullStatus(flowInfo.initsWhenTrue()), >+ ifFalseNullStatus = this.valueIfFalse.nullStatus(flowInfo.initsWhenFalse()); > if (ifTrueNullStatus == ifFalseNullStatus) { > return ifTrueNullStatus; > } >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.78 >diff -u -r1.78 LocalDeclaration.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java 22 Jan 2011 23:39:25 -0000 1.78 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/LocalDeclaration.java 7 Feb 2011 23:52:10 -0000 >@@ -71,17 +71,15 @@ > if ((this.initialization.implicitConversion & TypeIds.UNBOXING) != 0) { > this.initialization.checkNPE(currentScope, flowContext, flowInfo); > } >- int nullStatus = this.initialization.nullStatus(flowInfo); >- flowInfo = >- this.initialization >- .analyseCode(currentScope, flowContext, flowInfo) >- .unconditionalInits(); >+ FlowInfo unflattenedInfo = this.initialization.analyseCode(currentScope, flowContext, flowInfo); >+ flowInfo = unflattenedInfo.unconditionalInits(); > if (!flowInfo.isDefinitelyAssigned(this.binding)){// for local variable debug attributes > this.bits |= FirstAssignmentToLocal; > } else { > this.bits &= ~FirstAssignmentToLocal; // int i = (i = 0); > } > flowInfo.markAsDefinitelyAssigned(this.binding); >+ int nullStatus = this.initialization.nullStatus(unflattenedInfo); > nullStatus = checkAgainstNullAnnotation(currentScope, this.binding, nullStatus); > if ((this.binding.type.tagBits & TagBits.IsBaseType) == 0) { > flowInfo.markNullStatus(this.binding, nullStatus);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 324178
:
188486
|
189907
|
190328
|
190428
|
190447