Community
Participate
Working Groups
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
Reproduced, investigating
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" !!!
Actually, the argument is really unused, double check the case ! You scared me <g>