Revision 45252

View differences:

trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureQuery.java
603 603
        
604 604
        
605 605
        this.order = (FeatureQueryOrder) state.get("order");
606
        this.groupByColumns = (List) state.getList("groupByColumns");
607
        this.aggregateFunctions = (Map) state.getMap("aggregateFunctions");
606
        this.groupByColumns = new ArrayList<>((List) state.getList("groupByColumns"));
607
        this.aggregateFunctions = new HashMap<>((Map) state.getMap("aggregateFunctions"));
608 608
        this.extraColumn = (FeatureExtraColumns) state.get("extraColumn");
609 609

  
610 610
    
......
743 743

  
744 744
  @Override
745 745
  public String getAggregate(String name) {    
746
      String fn = this.aggregateFunctions.get(name);
746
      String fn = this.getAggregateFunctions().get(name);
747 747
      if( StringUtils.isAlphanumeric(fn) ) {
748 748
        return fn + "(\""+ name + "\")";
749 749
      }
......
752 752
  
753 753
  @Override
754 754
  public String getAggregate(String tableName, String name) {    
755
      String fn = this.aggregateFunctions.get(name);
755
      String fn = this.getAggregateFunctions().get(name);
756 756
      if (!tableName.startsWith("\"")) {
757 757
         tableName = "\""+tableName+"\"";
758 758
      }
......
764 764
  
765 765
  @Override
766 766
  public boolean hasAggregateFunctions() {
767
    return this.aggregateFunctions == null || this.aggregateFunctions.isEmpty();
767
    return this.aggregateFunctions != null && !this.aggregateFunctions.isEmpty();
768 768
  }
769 769

  
770 770
  @Override
......
808 808
      this.aggregateFunctions.clear();
809 809
      this.aggregateFunctions.putAll(other.aggregateFunctions);
810 810
    } else if( other.aggregateFunctions!=null ) {
811
      this.aggregateFunctions = new HashMap<>();
812
      this.aggregateFunctions.putAll(other.aggregateFunctions);
811
      this.aggregateFunctions = new HashMap<>(other.aggregateFunctions);
813 812
    } else if( this.aggregateFunctions!=null ) {
814 813
      this.aggregateFunctions=null;
815 814
    }

Also available in: Unified diff