1. #1
    lahu
    Guest

    Default [FIXED] Compile - BaseModel.remove

    [FIXED] Compile - BaseModel.remove


    With the latest svn(291) I get this error:

    Code:
    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:
    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.

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

  2. #2
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242
    Vote Rating
    2
    darrellmeyer is on a distinguished road

      0  

    Default


    Fixed in SVN.

Thread Participants: 1