private void validateAttrs(){
  if (numberOfStars <= 0) {
    throw new IllegalArgumentException(String.format("SimpleRatingBar initialized with invalid value for numberOfStars. Found %d, but should be greater than 0",numberOfStars));
  }
  if (desiredStarSize != Integer.MAX_VALUE && maxStarSize != Integer.MAX_VALUE && desiredStarSize > maxStarSize) {
    Log.w("SimpleRatingBar",String.format("Initialized with conflicting values: starSize is greater than maxStarSize (%f > %f). I will ignore maxStarSize",desiredStarSize,maxStarSize));
  }
  if (stepSize <= 0) {
    throw new IllegalArgumentException(String.format("SimpleRatingBar initialized with invalid value for stepSize. Found %f, but should be greater than 0",stepSize));
  }
  if (starBorderWidth <= 0) {
    throw new IllegalArgumentException(String.format("SimpleRatingBar initialized with invalid value for starBorderWidth. Found %f, but should be greater than 0",starBorderWidth));
  }
  if (starCornerRadius < 0) {
    throw new IllegalArgumentException(String.format("SimpleRatingBar initialized with invalid value for starCornerRadius. Found %f, but should be greater or equal than 0",starBorderWidth));
  }
}

private void validateAttrs ( ) { if ( numberOfStars <= 0 ) { throw new IllegalArgumentException ( String . format ( "SimpleRatingBar initialized with invalid value for numberOfStars. Found %d, but should be greater than 0" , numberOfStars ) ) ; } if ( desiredStarSize != Integer . MAX_VALUE && maxStarSize != Integer . MAX_VALUE && desiredStarSize > maxStarSize ) { Log . w ( "SimpleRatingBar" , String . format ( "Initialized with conflicting values: starSize is greater than maxStarSize (%f > %f). I will ignore maxStarSize" , desiredStarSize , maxStarSize ) ) ; } if ( stepSize <= 0 ) { throw new IllegalArgumentException ( String . format ( "SimpleRatingBar initialized with invalid value for stepSize. Found %f, but should be greater than 0" , stepSize ) ) ; } if ( starBorderWidth <= 0 ) { throw new IllegalArgumentException ( String . format ( "SimpleRatingBar initialized with invalid value for starBorderWidth. Found %f, but should be greater than 0" , starBorderWidth ) ) ; } if ( starCornerRadius < 0 ) { throw new IllegalArgumentException ( String . format ( "SimpleRatingBar initialized with invalid value for starCornerRadius. Found %f, but should be greater or equal than 0" , starBorderWidth ) ) ; } }
validates parsed attributes . it will throw illegalargumentexception if severe inconsistency is found . warnings will be logged to logcat .
