Path-Length Analysis for Object-Oriented Programs