amahussein opened a new pull request #2143:
URL: https://github.com/apache/hadoop/pull/2143


   ## NOTICE
   
   As part In order to replace Guava Preconditions, we need to implement our 
own versions of the API.
   This PR is to create `checkNotNull` in a new package dubbed `unguava`.
   This is splitting the PR that was opened previously #2134
    
   **The plan is as follows**
   
   - create a new `package org.apache.hadoop.util.unguava`;
   - create `class Validate`
   - implement  `org.apache.hadoop.util.unguava.Validate`  with the following 
interface
     - `checkNotNull(final T obj)`
     - `checkNotNull(final T reference, final Object errorMessage)`
     - `checkNotNull(final T obj, final String message, final Object... values)`
     - `checkNotNull(final T obj,final Supplier<String> msgSupplier)`
   - `guava.preconditions` used `String.lenientformat` which suppressed 
exceptions caused by string formatting of the exception message . So, in order 
to avoid changing the behavior, the implementation catches exceptions triggered 
by building the message (IllegalFormat, InsufficientArg, NullPointer..etc)
   - After merging the new class, we can replace 
`guava.Preconditions.checkNotNull` by `unguava.Validate.checkNotNull`
   - We need the change to go into trunk, 3.1, 3.2, and 3.3
    
   Similar Jiras will be created to implement `checkState`, `checkArgument`, 
`checkIndex`
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to