Roi.getXCoordinates is very unstable, returned value is unpredicable

I draw a very simple polygon Roi and try to get (x,y) position for each point on the polygon Roi.

 aRoi. = ips.getRoi;
  Xs = aRoi.getXCoordinates;
  Ys = aRoi.getYCoordinates;

For the same polygon Roi with 5 points, the above code retuns differently from run to run. Sometimes Xs has 1000 values, with 99.9% is zero, and only 4~5 is not zero. However, even though, the Ys 's non-zero value sometimes are not consistent with Xs’s non-zero value . Sometimes it returned only a few values,but not equal to the number of points I draw.

Is there something I did wrong ?
Thanks

The source code says:
/** Obsolete; replaced by either getPolygon() or getFloatPolygon(). */

	public int[] getXCoordinates() {
		if (xSpline!=null)
			return toIntR(xSpline);
		else if (xpf!=null)
			return toIntR(xpf);
		else
			return xp;
	}

Yes!
This solved my problem:

            aPolygon = aRoi.getPolygon;
            aXs_ = aPolygon.xpoints
            aYs_ = aPolygon.ypoints