PDA

View Full Version : [FIXED] Compile - BaseModel.remove



lahu
24 May 2008, 4:26 AM
With the latest svn(291) I get this error:




compile:
[javac] Compiling 1 source file to C:\pomop_dev\tools\gxt\build\bin
[javac] C:\pomop_dev\tools\gxt\user\src\com\extjs\gxt\ui\client\data\BaseModel.java:108: type parameters of <X>X cannot be determined; no unique maximal instance exists for type variable X with upper bounds X,java.lang.Object
[javac] X oldValue = super.remove(name);
[javac] ^
[javac] Note: C:\pomop_dev\tools\gxt\user\src\com\extjs\gxt\ui\client\data\BaseModel.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 error

BUILD FAILED

This points this code:


@Override
public <X> X remove(String name) {
if (map.containsKey(name)) {
X oldValue = super.remove(name);
notifyPropertyChanged(name, null, oldValue);
return oldValue;
}
return null;
}

How should this work? You never set an upper bound for the generic X ??? With casting it to X it works.



X oldValue = (X)super.remove(name);
greets, Lars

darrellmeyer
25 May 2008, 5:45 PM
Fixed in SVN.