Bug 40620 - misinformed warning
Summary: misinformed warning
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1.1   Edit
Hardware: PC Windows 2000
: P3 critical (vote)
Target Milestone: 3.0 M3   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-22 15:56 EDT by matthew CLA
Modified: 2003-07-23 05:15 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description matthew CLA 2003-07-22 15:56:28 EDT
I have a java class

private class TableAlias extends Object
   {
      public String tableName;
      public String alias;
      
      public TableAlias( String tablename, String alias )
      {
         this.tableName = tableName;
         this.alias = alias;
      }
   }

and I get a warning -

"The assignment to variable tablename has no effect"

when in fact it will.

Thanks
Comment 1 Philipe Mulet CLA 2003-07-23 05:02:24 EDT
Reproduced, investigating
Comment 2 Philipe Mulet CLA 2003-07-23 05:02:31 EDT
Reproduced, investigating
Comment 3 Philipe Mulet CLA 2003-07-23 05:05:49 EDT
Problem is actually quite severe, the assignment warning reveals that the 
assignment actually doesn't even take place as considered as a no-op:

public class X {
      public String tableName;
      public String alias;
      
      public X( String tablename, String alias )
      {
         this.tableName = tableName;
         this.alias = alias;
      }
      
      public static void main(String[] args) {
		X x= new X("tableName", "alias");
		System.out.println(x.tableName);
	}
   }

When run, displays "null" !!!
Comment 4 Philipe Mulet CLA 2003-07-23 05:15:31 EDT
Actually, the argument is really unused, double check the case !
You scared me <g>