Changeset 31209 for other-projects

Show
Ignore:
Timestamp:
12.12.2016 15:24:54 (2 years ago)
Author:
davidb
Message:

checkArgument added in

Location:
other-projects/hathitrust/wcsa/extracted-features-solr/trunk/solr-ingest/src/main/java/com/google/common/hash
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • other-projects/hathitrust/wcsa/extracted-features-solr/trunk/solr-ingest/src/main/java/com/google/common/hash/BloomFilterAdvanced.java

    r31207 r31209  
    1515package com.google.common.hash; 
    1616 
    17 import static com.google.common.base.Preconditions.checkArgument; 
     17//import static com.google.common.base.Preconditions.checkArgument; 
    1818import static com.google.common.base.Preconditions.checkNotNull; 
    1919 
     
    529529    } 
    530530  } 
     531   
     532  public static void checkArgument(boolean expression, @Nullable Object errorMessage) { 
     533      if (!expression) { 
     534        throw new IllegalArgumentException(String.valueOf(errorMessage)); 
     535      } 
     536    } 
     537  public static void checkArgument( 
     538          boolean expression, 
     539          @Nullable String errorMessageTemplate, 
     540          @Nullable Object... errorMessageArgs) { 
     541        if (!expression) { 
     542          throw new IllegalArgumentException(String.format(errorMessageTemplate, errorMessageArgs)); 
     543        } 
     544      } 
     545  public static void checkArgument( 
     546          boolean b, @Nullable String errorMessageTemplate, @Nullable Object p1, @Nullable Object p2) { 
     547        if (!b) { 
     548          throw new IllegalArgumentException(String.format(errorMessageTemplate, p1, p2)); 
     549        } 
     550      } 
     551 
     552 
    531553} 
  • other-projects/hathitrust/wcsa/extracted-features-solr/trunk/solr-ingest/src/main/java/com/google/common/hash/BloomFilterAdvancedStrategies.java

    r31207 r31209  
    1515package com.google.common.hash; 
    1616 
    17 import static com.google.common.base.Preconditions.checkArgument; 
     17//import static com.google.common.base.Preconditions.checkArgument; 
    1818 
    1919import com.google.common.math.LongMath; 
     
    2323import java.util.Arrays; 
    2424import javax.annotation.Nullable; 
     25 
    2526 
    2627/** 
     
    214215      return Arrays.hashCode(data); 
    215216    } 
     217     
     218    public static void checkArgument(boolean expression, @Nullable Object errorMessage) { 
     219        if (!expression) { 
     220          throw new IllegalArgumentException(String.valueOf(errorMessage)); 
     221        } 
     222      } 
     223    public static void checkArgument( 
     224              boolean b, @Nullable String errorMessageTemplate, @Nullable Object p1, @Nullable Object p2) { 
     225            if (!b) { 
     226              throw new IllegalArgumentException(String.format(errorMessageTemplate, p1, p2)); 
     227            } 
     228          } 
     229 
    216230  } 
    217231}