protected boolean equals(URL u1,URL u2){
  String ref1=u1.getRef();
  String ref2=u2.getRef();
  return (ref1 == ref2 || (ref1 != null && ref1.equals(ref2))) && sameFile(u1,u2);
}

protected boolean equals ( URL u1 , URL u2 ) { String ref1 = u1 . getRef ( ) ; String ref2 = u2 . getRef ( ) ; return ( ref1 == ref2 || ( ref1 != null && ref1 . equals ( ref2 ) ) ) && sameFile ( u1 , u2 ) ; }
provides the default equals calculation . may be overidden by handlers for other protocols that have different requirements for equals ( ) . this method requires that none of its arguments is null . this is guaranteed by the fact that it is only called by java . net . url class .
