private static int[] validateCoordinates(int x1,int y1,int x2,int y2){
  if ((x1 > x2) | (y1 < y2)) {
    if (x1 > x2) {
      final int temp=x1;
      x1=x2;
      x2=temp;
      LogWriter.writeLog("x1 > x2, coordinates were swapped to validate");
    }
    if (y1 < y2) {
      final int temp=y1;
      y1=y2;
      y2=temp;
      LogWriter.writeLog("y1 < y2, coordinates were swapped to validate");
    }
  }
  return new int[]{x1,y1,x2,y2};
}

private static int [ ] validateCoordinates ( int x1 , int y1 , int x2 , int y2 ) { if ( ( x1 > x2 ) | ( y1 < y2 ) ) { if ( x1 > x2 ) { final int temp = x1 ; x1 = x2 ; x2 = temp ; LogWriter . writeLog ( "x1 > x2, coordinates were swapped to validate" ) ; } if ( y1 < y2 ) { final int temp = y1 ; y1 = y2 ; y2 = temp ; LogWriter . writeLog ( "y1 < y2, coordinates were swapped to validate" ) ; } } return new int [ ] { x1 , y1 , x2 , y2 } ; }
make sure co - ords valid and throw exception if not
