# HG changeset patch # User kvn # Date 1319764850 25200 # Node ID 446510be531a0d57878107f0738a3309c69b805b # Parent ace1746b24ab0bb90a7afb81e226f16bdde09244 7105611: Set::print() is broken Summary: Reimplemented class VSetI_ to restore Set::print(). Reviewed-by: never diff -r ace1746b24ab -r 446510be531a hotspot/src/share/vm/libadt/vectset.cpp --- a/hotspot/src/share/vm/libadt/vectset.cpp Thu Oct 27 14:40:25 2011 -0700 +++ b/hotspot/src/share/vm/libadt/vectset.cpp Thu Oct 27 18:20:50 2011 -0700 @@ -350,6 +350,21 @@ return (int)_xor; } +//------------------------------iterate---------------------------------------- +// Used by Set::print(). +class VSetI_ : public SetI_ { + VectorSetI vsi; +public: + VSetI_( const VectorSet *vset, uint &elem ) : vsi(vset) { elem = vsi.elem; } + + uint next(void) { ++vsi; return vsi.elem; } + int test(void) { return vsi.test(); } +}; + +SetI_ *VectorSet::iterate(uint &elem) const { + return new(ResourceObj::C_HEAP) VSetI_(this, elem); +} + //============================================================================= //------------------------------next------------------------------------------- // Find and return the next element of a vector set, or return garbage and diff -r ace1746b24ab -r 446510be531a hotspot/src/share/vm/libadt/vectset.hpp --- a/hotspot/src/share/vm/libadt/vectset.hpp Thu Oct 27 14:40:25 2011 -0700 +++ b/hotspot/src/share/vm/libadt/vectset.hpp Thu Oct 27 18:20:50 2011 -0700 @@ -151,7 +151,7 @@ private: - SetI_ *iterate(uint&) const { ShouldNotCallThis(); return NULL; } // Removed + SetI_ *iterate(uint&) const; }; //------------------------------Iteration--------------------------------------