7105611: Set::print() is broken

Thu, 27 Oct 2011 18:20:50 -0700

author
kvn
date
Thu, 27 Oct 2011 18:20:50 -0700
changeset 3247
f350490a45fd
parent 3246
34535d2cb362
child 3248
eba044a722a4

7105611: Set::print() is broken
Summary: Reimplemented class VSetI_ to restore Set::print().
Reviewed-by: never

src/share/vm/libadt/vectset.cpp file | annotate | diff | comparison | revisions
src/share/vm/libadt/vectset.hpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/libadt/vectset.cpp	Thu Oct 27 14:40:25 2011 -0700
     1.2 +++ b/src/share/vm/libadt/vectset.cpp	Thu Oct 27 18:20:50 2011 -0700
     1.3 @@ -350,6 +350,21 @@
     1.4    return (int)_xor;
     1.5  }
     1.6  
     1.7 +//------------------------------iterate----------------------------------------
     1.8 +// Used by Set::print().
     1.9 +class VSetI_ : public SetI_ {
    1.10 +  VectorSetI vsi;
    1.11 +public:
    1.12 +  VSetI_( const VectorSet *vset, uint &elem ) : vsi(vset) { elem = vsi.elem; }
    1.13 +
    1.14 +  uint next(void) { ++vsi; return vsi.elem; }
    1.15 +  int  test(void) { return vsi.test(); }
    1.16 +};
    1.17 +
    1.18 +SetI_ *VectorSet::iterate(uint &elem) const {
    1.19 +  return new(ResourceObj::C_HEAP) VSetI_(this, elem);
    1.20 +}
    1.21 +
    1.22  //=============================================================================
    1.23  //------------------------------next-------------------------------------------
    1.24  // Find and return the next element of a vector set, or return garbage and
     2.1 --- a/src/share/vm/libadt/vectset.hpp	Thu Oct 27 14:40:25 2011 -0700
     2.2 +++ b/src/share/vm/libadt/vectset.hpp	Thu Oct 27 18:20:50 2011 -0700
     2.3 @@ -151,7 +151,7 @@
     2.4  
     2.5  
     2.6  private:
     2.7 -  SetI_ *iterate(uint&) const { ShouldNotCallThis(); return NULL; } // Removed
     2.8 +  SetI_ *iterate(uint&) const;
     2.9  };
    2.10  
    2.11  //------------------------------Iteration--------------------------------------

mercurial