Bug 228817 - Wrong message "assignemt has no effect" for ++ operator
Summary: Wrong message "assignemt has no effect" for ++ operator
Status: RESOLVED DUPLICATE of bug 228816
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-25 00:33 EDT by Eric Bodden CLA
Modified: 2008-04-25 08:39 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Bodden CLA 2008-04-25 00:33:58 EDT
Build ID: 3.3.0

Steps To Reproduce:
See the following two little programs:
	public static void main(String[] args) {
		int i = 9;
		i = i++;
		System.out.println(i);
	}

	public static void main(String[] args) {
		int i = 9;
		i = ++i;
		System.out.println(i);
	}

In the first program the assignment has no effect because the increment only happens *after* the assignment. The program will print 9. In the second program, the assignment does have an effect, printing 10. This is all correct. However, Eclipse puts a yellow squiggle under the assignment in the second, not the first program. That's completely the wrong way around (I think).

More information:
Comment 1 Olivier Thomann CLA 2008-04-25 08:39:43 EDT

*** This bug has been marked as a duplicate of bug 228816 ***