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 56630 Details for
Bug 167488
[compiler] Fup of bug 165291, the two warnings (assignment has no effect) should not be reported
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
167488.txt (text/plain), 6.62 KB, created by
Philipe Mulet
on 2007-01-09 11:22:47 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Philipe Mulet
Created:
2007-01-09 11:22:47 EST
Size:
6.62 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java,v >retrieving revision 1.578 >diff -u -r1.578 GenericTypeTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 8 Jan 2007 14:48:01 -0000 1.578 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 9 Jan 2007 16:15:50 -0000 >@@ -35789,47 +35789,37 @@ > "}", // ================= > }, > "----------\n" + >- "1. WARNING in Y.java (at line 2)\n" + >- " Z z1 = z1;\n" + >- " ^^^^^^^\n" + >- "The assignment to variable z1 has no effect\n" + >- "----------\n" + >- "2. ERROR in Y.java (at line 2)\n" + >+ "1. ERROR in Y.java (at line 2)\n" + > " Z z1 = z1;\n" + > " ^^\n" + > "Cannot reference a field before it is defined\n" + > "----------\n" + >- "3. WARNING in Y.java (at line 3)\n" + >- " Z[] z2 = z2;\n" + >- " ^^^^^^^\n" + >- "The assignment to variable z2 has no effect\n" + >- "----------\n" + >- "4. ERROR in Y.java (at line 3)\n" + >+ "2. ERROR in Y.java (at line 3)\n" + > " Z[] z2 = z2;\n" + > " ^^\n" + > "Cannot reference a field before it is defined\n" + > "----------\n" + >- "5. ERROR in Y.java (at line 6)\n" + >+ "3. ERROR in Y.java (at line 6)\n" + > " E e0 = es[0];\n" + > " ^^\n" + > "Cannot reference a field before it is defined\n" + > "----------\n" + >- "6. ERROR in Y.java (at line 7)\n" + >+ "4. ERROR in Y.java (at line 7)\n" + > " E e = e;\n" + > " ^\n" + > "Cannot reference a field before it is defined\n" + > "----------\n" + >- "7. ERROR in Y.java (at line 8)\n" + >+ "5. ERROR in Y.java (at line 8)\n" + > " E[] es = es;\n" + > " ^^\n" + > "Cannot reference a field before it is defined\n" + > "----------\n" + >- "8. ERROR in Y.java (at line 9)\n" + >+ "6. ERROR in Y.java (at line 9)\n" + > " E e2 = e2.e;\n" + > " ^^^^\n" + > "Cannot reference a field before it is defined\n" + > "----------\n" + >- "9. ERROR in Y.java (at line 9)\n" + >+ "7. ERROR in Y.java (at line 9)\n" + > " E e2 = e2.e;\n" + > " ^^^^\n" + > "e2.e cannot be resolved or is not a field\n" + >@@ -35948,17 +35938,12 @@ > " ^\n" + > "The field T.t is hiding another local variable defined in an enclosing type scope\n" + > "----------\n" + >- "3. WARNING in X.java (at line 5)\n" + >- " T t = t;\n" + >- " ^^^^^\n" + >- "The assignment to variable t has no effect\n" + >- "----------\n" + >- "4. ERROR in X.java (at line 5)\n" + >+ "3. ERROR in X.java (at line 5)\n" + > " T t = t;\n" + > " ^\n" + > "Cannot reference a field before it is defined\n" + > "----------\n" + >- "5. WARNING in X.java (at line 7)\n" + >+ "4. WARNING in X.java (at line 7)\n" + > " class U {\n" + > " ^\n" + > "The type U is hiding the type X.U\n" + >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java,v >retrieving revision 1.77 >diff -u -r1.77 ASTNode.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java 16 Dec 2006 20:35:20 -0000 1.77 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java 9 Jan 2007 16:15:52 -0000 >@@ -52,7 +52,7 @@ > public final static int Bit27 = 0x4000000; // parenthesis count (expression) > public final static int Bit28 = 0x8000000; // parenthesis count (expression) > public final static int Bit29 = 0x10000000; // parenthesis count (expression) >- public final static int Bit30 = 0x20000000; // elseif (if statement) | try block exit (try statement) | fall-through (case statement) >+ public final static int Bit30 = 0x20000000; // elseif (if statement) | try block exit (try statement) | fall-through (case statement) | ignore no effect assign (expression ref) > public final static int Bit31 = 0x40000000; // local declaration reachable (local decl) | ignore raw type check (type ref) | discard entire assignment (assignment) > public final static int Bit32 = 0x80000000; // reachable (statement) > >@@ -145,6 +145,7 @@ > // for expression > public static final int ParenthesizedSHIFT = 21; // Bit22 -> Bit29 > public static final int ParenthesizedMASK = Bit22|Bit23|Bit24|Bit25|Bit26|Bit27|Bit28|Bit29; // 8 bits for parenthesis count value (max. 255) >+ public static final int IgnoreNoEffectAssignCheck = Bit30; > > // for references on lhs of assignment > public static final int IsStrictlyAssigned = Bit14; // set only for true assignments, as opposed to compound ones >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.92 >diff -u -r1.92 SingleNameReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java 23 Nov 2006 08:44:46 -0000 1.92 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java 9 Jan 2007 16:15:52 -0000 >@@ -202,6 +202,7 @@ > && fieldBinding.id >= methodScope.lastVisibleFieldID > && (!fieldBinding.isStatic() || methodScope.isStatic)) { > scope.problemReporter().forwardReference(this, 0, methodScope.enclosingSourceType()); >+ this.bits |= ASTNode.IgnoreNoEffectAssignCheck; > } > return fieldBinding.type; > >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.74 >diff -u -r1.74 Assignment.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java 28 Oct 2006 04:11:27 -0000 1.74 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java 9 Jan 2007 16:15:52 -0000 >@@ -99,6 +99,9 @@ > } > > public static Binding getDirectBinding(Expression someExpression) { >+ if ((someExpression.bits & ASTNode.IgnoreNoEffectAssignCheck) != 0) { >+ return null; >+ } > if (someExpression instanceof SingleNameReference) { > return ((SingleNameReference)someExpression).binding; > } else if (someExpression instanceof FieldReference) {
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 167488
: 56630