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 209734 Details for
Bug 247564
[compiler][null] Detecting null field reference
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
proposal re item (c)
Bug_247564_item_c.patch (text/plain), 4.70 KB, created by
Stephan Herrmann
on 2012-01-19 05:24:25 EST
(
hide
)
Description:
proposal re item (c)
Filename:
MIME Type:
Creator:
Stephan Herrmann
Created:
2012-01-19 05:24:25 EST
Size:
4.70 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java >index e492447..89615c3 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java >@@ -691,7 +691,7 @@ private void internalAnalyseCode(FlowContext flowContext, FlowInfo flowInfo) { > UnconditionalFlowInfo outerInfo = flowInfo.unconditionalFieldLessCopy(); > UnconditionalFlowInfo staticFieldUnconditionalInfo = staticFieldInfo.unconditionalInits(); > flowInfo.addNullInfoFrom(staticFieldUnconditionalInfo.discardNonFieldInitializations()); >- flowInfo.addConstantFieldsMask(staticFieldInfo); // prevent resetting null info for constant fields inside methods >+ flowInfo.addConstantFieldsMask(staticFieldUnconditionalInfo); // prevent resetting null info for constant fields inside methods > flowInfo.resetNullInfoForFields(); // only preserve null info for constant fields > > FlowInfo constructorInfo = nonStaticFieldInfo.unconditionalInits().discardNonFieldInitializations().addInitializationsFrom(flowInfo); >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/ConditionalFlowInfo.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/ConditionalFlowInfo.java >index 3deeb9e..5128a63 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/ConditionalFlowInfo.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/ConditionalFlowInfo.java >@@ -165,7 +165,7 @@ public void updateConstantFieldsMask(FieldBinding field) { > this.initsWhenFalse.updateConstantFieldsMask(field); > } > >-public void addConstantFieldsMask(FlowInfo other) { >+public void addConstantFieldsMask(UnconditionalFlowInfo other) { > this.initsWhenTrue.addConstantFieldsMask(other); > this.initsWhenFalse.addConstantFieldsMask(other); > } >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java >index 29b0abe..f472070 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/FlowInfo.java >@@ -54,10 +54,6 @@ public abstract class FlowInfo { > DEAD_END.tagBits = UNREACHABLE; > } > >- public long constantFieldsMask; // record positions of constant fields so that they don't get reset in resetNullInfoForFields() >- >- public long extraConstantFieldMask[]; // extra mask for larger number of fields >- > /** > * Add other inits to this flow info, then return this. The operation semantics > * are to match as closely as possible the application to this flow info of all >@@ -291,7 +287,7 @@ abstract public void markAsComparedEqualToNull(VariableBinding binding); > /** > * add the constant fields info from the other flow info > */ >- abstract public void addConstantFieldsMask(FlowInfo other); >+ abstract public void addConstantFieldsMask(UnconditionalFlowInfo other); > > /** > * Record a field or local may have got assigned to unknown (set the bit on existing info). >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java >index b1e824f..b278627 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java >@@ -93,6 +93,8 @@ public class UnconditionalFlowInfo extends FlowInfo { > // Constants > public static final int BitCacheSize = 64; // 64 bits in a long. > public int[] nullStatusChangedInAssert; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=303448 >+ public long constantFieldsMask; >+ public long extraConstantFieldMask[]; > private static final int AccConstant = ClassFileConstants.AccStatic|ClassFileConstants.AccFinal; > > public static final int indexOfConstantFieldBitStream = 6; // the index just after nullBit4 i.e. extraLength >@@ -1605,7 +1607,7 @@ public void updateConstantFieldsMask(FieldBinding field) { > * All the infos originate in TypeDeclaration.analyseCode(). So making sure that this method is called for every info that is sent into > * methods/constructors should be sufficient > */ >-public void addConstantFieldsMask(FlowInfo other) { >+public void addConstantFieldsMask(UnconditionalFlowInfo other) { > this.constantFieldsMask |= other.constantFieldsMask; > if (other.extraConstantFieldMask != null) { > int oldLength = 0;
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 247564
:
185536
|
185729
|
186938
|
187094
|
188023
|
206514
|
206570
|
206572
|
207019
|
209475
|
209486
|
209552
|
209734
|
209741
|
209759
|
209774
|
209775