Add missing javadoc

diff --git a/compiler/cpp/README.md b/compiler/cpp/README.md
index 8d6edac..8e3a90b 100644
--- a/compiler/cpp/README.md
+++ b/compiler/cpp/README.md
@@ -58,8 +58,9 @@
 - Install/update flex, bison and cmake with brew
 
 ```
-brew install cmake
+brew install flex
 brew install bison
+brew install cmake
 ```
 
 - Go to **thrift\compiler\cpp**
@@ -73,7 +74,7 @@
 
 #### Usage of other IDEs
 
-Please check list of supported IDE 
+Please check list of supported IDE
 
 ```
 cmake --help
@@ -84,7 +85,7 @@
 ### Prerequisites
 - Install CMake - https://cmake.org/download/
 - In case if you want to build without Git Bash - install winflexbison - https://sourceforge.net/projects/winflexbison/
-- In case if you want to build with Visual Studio - install Visual Studio 
+- In case if you want to build with Visual Studio - install Visual Studio
   - Better to use the latest stable Visual Studio Community Edition - https://www.visualstudio.com/vs/whatsnew/ (ensure that you installed workload "Desktop Development with C++" for VS2017) - Microsoft added some support for CMake and improving it in Visual Studio
 
 ### Build using Git Bash
@@ -125,11 +126,11 @@
 
 If you don't want to use CMake you can use the already available Visual Studio 2010 solution.
 
-The Visual Studio project contains pre-build commands to generate the thriftl.cc, thrifty.cc and thrifty.hh files which are necessary to build the compiler. 
+The Visual Studio project contains pre-build commands to generate the thriftl.cc, thrifty.cc and thrifty.hh files which are necessary to build the compiler.
 
 These depend on bison, flex and their dependencies to work properly.
 
-Download flex & bison as described above. 
+Download flex & bison as described above.
 
 Place these binaries somewhere in the path and rename win_flex.exe and win_bison.exe to flex.exe and bison.exe respectively.
 
@@ -172,4 +173,4 @@
 
 - pls check **tests** folder
 
-# Have a Happy free time and holidays 
+# Have a Happy free time and holidays
diff --git a/lib/java/src/org/apache/thrift/Option.java b/lib/java/src/org/apache/thrift/Option.java
index d5cd309..f02eae0 100644
--- a/lib/java/src/org/apache/thrift/Option.java
+++ b/lib/java/src/org/apache/thrift/Option.java
@@ -96,8 +96,8 @@
 
     /**
      * Wraps value in an Option type, depending on whether or not value is null
-     * @param value
-     * @param <T> type of value
+     * @param value the value to wrap in Option
+     * @param <T> the type of value
      * @return Some(value) if value is not null, None if value is null
      */
     public static <T> Option<T> fromNullable(T value) {
@@ -110,8 +110,8 @@
 
     /**
      * Wrap value in a Some type (NB! value must not be null!)
-     * @param value
-     * @param <T> type of value
+     * @param value the value to wrap.
+     * @param <T> the type of value
      * @return a new Some(value)
      */
     public static <T> Some<T> some(T value) {
@@ -122,4 +122,4 @@
     public static <T> None<T> none() {
         return (None<T>) NONE;
     }
-}
\ No newline at end of file
+}
diff --git a/lib/java/src/org/apache/thrift/TApplicationException.java b/lib/java/src/org/apache/thrift/TApplicationException.java
index 4d693d9..59cff69 100644
--- a/lib/java/src/org/apache/thrift/TApplicationException.java
+++ b/lib/java/src/org/apache/thrift/TApplicationException.java
@@ -125,6 +125,10 @@
 
   /**
    * Convenience factory method for constructing a TApplicationException given a TProtocol input
+   *
+   * @param iprot protocol from which an instance of TApplicationException is read.
+   * @return an instance of TApplicationException read from iprot.
+   * @throws TException if there is an error reading from iprot.
    */
   public static TApplicationException readFrom(TProtocol iprot) throws TException
   {
diff --git a/lib/java/src/org/apache/thrift/TAsyncProcessor.java b/lib/java/src/org/apache/thrift/TAsyncProcessor.java
index 5e287d5..d435b08 100644
--- a/lib/java/src/org/apache/thrift/TAsyncProcessor.java
+++ b/lib/java/src/org/apache/thrift/TAsyncProcessor.java
@@ -27,6 +27,7 @@
    * <b>Note:</b> Implementations must call fb.responseReady() once processing
    * is complete
    *
+   * @param fb the frame buffer to process.
    * @throws TException if the frame cannot be processed
    */
   public void process(final AsyncFrameBuffer fb) throws TException;
diff --git a/lib/java/src/org/apache/thrift/TBase.java b/lib/java/src/org/apache/thrift/TBase.java
index e1489d5..be8ef9b 100644
--- a/lib/java/src/org/apache/thrift/TBase.java
+++ b/lib/java/src/org/apache/thrift/TBase.java
@@ -31,13 +31,17 @@
 
   /**
    * Get the F instance that corresponds to fieldId.
+   *
+   * @param fieldId the ID of the requested field.
+   * @return F instance that corresponds to fieldId.
    */
   public F fieldForId(int fieldId);
 
   /**
    * Check if a field is currently set or unset.
    *
-   * @param field
+   * @param field the field to check.
+   * @return true if the field is set, false otherwise.
    */
   public boolean isSet(F field);
 
@@ -45,7 +49,8 @@
    * Get a field's value by field variable. Primitive types will be wrapped in
    * the appropriate "boxed" types.
    *
-   * @param field
+   * @param field the field whose value is requested.
+   * @return the value of the requested field.
    */
   public Object getFieldValue(F field);
 
@@ -53,10 +58,16 @@
    * Set a field's value by field variable. Primitive types must be "boxed" in
    * the appropriate object wrapper type.
    *
-   * @param field
+   * @param field the field whose value is to be set.
+   * @param value the value to be assigned to field.
    */
   public void setFieldValue(F field, Object value);
 
+  /**
+   * Performs a deep copy of this instance and returns the copy.
+   *
+   * @return a deep copy of this instance.
+   */
   public T deepCopy();
 
   /**
diff --git a/lib/java/src/org/apache/thrift/TDeserializer.java b/lib/java/src/org/apache/thrift/TDeserializer.java
index 29be557..8a14cc5 100644
--- a/lib/java/src/org/apache/thrift/TDeserializer.java
+++ b/lib/java/src/org/apache/thrift/TDeserializer.java
@@ -63,6 +63,7 @@
    *
    * @param base The object to read into
    * @param bytes The array to read from
+   * @throws TException if an error is encountered during deserialization.
    */
   public void deserialize(TBase base, byte[] bytes) throws TException {
       deserialize(base, bytes, 0, bytes.length);
@@ -75,6 +76,7 @@
    * @param bytes The array to read from
    * @param offset The offset into {@code bytes}
    * @param length The length to read from {@code bytes}
+   * @throws TException if an error is encountered during deserialization.
    */
   public void deserialize(TBase base, byte[] bytes, int offset, int length) throws TException {
     try {
@@ -93,6 +95,7 @@
    * @param base The object to read into
    * @param data The string to read from
    * @param charset Valid JVM charset
+   * @throws TException if an error is encountered during deserialization.
    */
   public void deserialize(TBase base, String data, String charset) throws TException {
     try {
@@ -111,7 +114,7 @@
    * @param bytes The serialized object to read from
    * @param fieldIdPathFirst First of the FieldId's that define a path tb
    * @param fieldIdPathRest The rest FieldId's that define a path tb
-   * @throws TException
+   * @throws TException if an error is encountered during deserialization.
    */
   public void partialDeserialize(TBase tb, byte[] bytes, TFieldIdEnum fieldIdPathFirst, TFieldIdEnum ... fieldIdPathRest) throws TException {
     try {
@@ -133,7 +136,7 @@
    * @param bytes The serialized object to read from
    * @param fieldIdPathFirst First of the FieldId's that define a path to a boolean field
    * @param fieldIdPathRest The rest FieldId's that define a path to a boolean field
-   * @throws TException
+   * @throws TException if an error is encountered during deserialization.
    */
   public Boolean partialDeserializeBool(byte[] bytes, TFieldIdEnum fieldIdPathFirst, TFieldIdEnum ... fieldIdPathRest) throws TException {
     return (Boolean) partialDeserializeField(TType.BOOL, bytes, fieldIdPathFirst, fieldIdPathRest);
@@ -145,7 +148,7 @@
    * @param bytes The serialized object to read from
    * @param fieldIdPathFirst First of the FieldId's that define a path to a byte field
    * @param fieldIdPathRest The rest FieldId's that define a path to a byte field
-   * @throws TException
+   * @throws TException if an error is encountered during deserialization.
    */
   public Byte partialDeserializeByte(byte[] bytes, TFieldIdEnum fieldIdPathFirst, TFieldIdEnum ... fieldIdPathRest) throws TException {
     return (Byte) partialDeserializeField(TType.BYTE, bytes, fieldIdPathFirst, fieldIdPathRest);
@@ -157,7 +160,7 @@
    * @param bytes The serialized object to read from
    * @param fieldIdPathFirst First of the FieldId's that define a path to a double field
    * @param fieldIdPathRest The rest FieldId's that define a path to a double field
-   * @throws TException
+   * @throws TException if an error is encountered during deserialization.
    */
   public Double partialDeserializeDouble(byte[] bytes, TFieldIdEnum fieldIdPathFirst, TFieldIdEnum ... fieldIdPathRest) throws TException {
     return (Double) partialDeserializeField(TType.DOUBLE, bytes, fieldIdPathFirst, fieldIdPathRest);
@@ -169,7 +172,7 @@
    * @param bytes The serialized object to read from
    * @param fieldIdPathFirst First of the FieldId's that define a path to an i16 field
    * @param fieldIdPathRest The rest FieldId's that define a path to an i16 field
-   * @throws TException
+   * @throws TException if an error is encountered during deserialization.
    */
   public Short partialDeserializeI16(byte[] bytes, TFieldIdEnum fieldIdPathFirst, TFieldIdEnum ... fieldIdPathRest) throws TException {
     return (Short) partialDeserializeField(TType.I16, bytes, fieldIdPathFirst, fieldIdPathRest);
@@ -181,7 +184,7 @@
    * @param bytes The serialized object to read from
    * @param fieldIdPathFirst First of the FieldId's that define a path to an i32 field
    * @param fieldIdPathRest The rest FieldId's that define a path to an i32 field
-   * @throws TException
+   * @throws TException if an error is encountered during deserialization.
    */
   public Integer partialDeserializeI32(byte[] bytes, TFieldIdEnum fieldIdPathFirst, TFieldIdEnum ... fieldIdPathRest) throws TException {
     return (Integer) partialDeserializeField(TType.I32, bytes, fieldIdPathFirst, fieldIdPathRest);
@@ -193,7 +196,7 @@
    * @param bytes The serialized object to read from
    * @param fieldIdPathFirst First of the FieldId's that define a path to an i64 field
    * @param fieldIdPathRest The rest FieldId's that define a path to an i64 field
-   * @throws TException
+   * @throws TException if an error is encountered during deserialization.
    */
   public Long partialDeserializeI64(byte[] bytes, TFieldIdEnum fieldIdPathFirst, TFieldIdEnum ... fieldIdPathRest) throws TException {
     return (Long) partialDeserializeField(TType.I64, bytes, fieldIdPathFirst, fieldIdPathRest);
@@ -205,7 +208,7 @@
    * @param bytes The serialized object to read from
    * @param fieldIdPathFirst First of the FieldId's that define a path to a string field
    * @param fieldIdPathRest The rest FieldId's that define a path to a string field
-   * @throws TException
+   * @throws TException if an error is encountered during deserialization.
    */
   public String partialDeserializeString(byte[] bytes, TFieldIdEnum fieldIdPathFirst, TFieldIdEnum ... fieldIdPathRest) throws TException {
     return (String) partialDeserializeField(TType.STRING, bytes, fieldIdPathFirst, fieldIdPathRest);
@@ -217,7 +220,7 @@
    * @param bytes The serialized object to read from
    * @param fieldIdPathFirst First of the FieldId's that define a path to a binary field
    * @param fieldIdPathRest The rest FieldId's that define a path to a binary field
-   * @throws TException
+   * @throws TException if an error is encountered during deserialization.
    */
   public ByteBuffer partialDeserializeByteArray(byte[] bytes, TFieldIdEnum fieldIdPathFirst, TFieldIdEnum ... fieldIdPathRest) throws TException {
     // TType does not have binary, so we use the arbitrary num 100
@@ -230,7 +233,7 @@
    * @param bytes The serialized object to read from
    * @param fieldIdPathFirst First of the FieldId's that define a path to a TUnion
    * @param fieldIdPathRest The rest FieldId's that define a path to a TUnion
-   * @throws TException
+   * @throws TException if an error is encountered during deserialization.
    */
   public Short partialDeserializeSetFieldIdInUnion(byte[] bytes, TFieldIdEnum fieldIdPathFirst, TFieldIdEnum ... fieldIdPathRest)  throws TException {
     try {
@@ -333,6 +336,7 @@
    *
    * @param base The object to read into
    * @param data The string to read from
+   * @throws TException if an error is encountered during deserialization.
    */
   public void fromString(TBase base, String data) throws TException {
     deserialize(base, data.getBytes());
diff --git a/lib/java/src/org/apache/thrift/TFieldIdEnum.java b/lib/java/src/org/apache/thrift/TFieldIdEnum.java
index 2956fba..20b845e 100644
--- a/lib/java/src/org/apache/thrift/TFieldIdEnum.java
+++ b/lib/java/src/org/apache/thrift/TFieldIdEnum.java
@@ -23,12 +23,16 @@
  */
 public interface TFieldIdEnum {
   /**
-   * Get the Thrift field id for the named field.
+   * Gets the Thrift field id for the named field.
+   *
+   * @return the Thrift field id for the named field.
    */
   public short getThriftFieldId();
 
   /**
-   * Get the field's name, exactly as in the IDL.
+   * Gets the field's name, exactly as in the IDL.
+   *
+   * @return the field's name, exactly as in the IDL.
    */
   public String getFieldName();
 }
diff --git a/lib/java/src/org/apache/thrift/TSerializable.java b/lib/java/src/org/apache/thrift/TSerializable.java
index 80002c7..317814b 100644
--- a/lib/java/src/org/apache/thrift/TSerializable.java
+++ b/lib/java/src/org/apache/thrift/TSerializable.java
@@ -31,6 +31,7 @@
    * Reads the TObject from the given input protocol.
    *
    * @param iprot Input protocol
+   * @throws TException if there is an error reading from iprot
    */
   public void read(TProtocol iprot) throws TException;
 
@@ -38,6 +39,7 @@
    * Writes the objects out to the protocol
    *
    * @param oprot Output protocol
+   * @throws TException if there is an error writing to oprot
    */
   public void write(TProtocol oprot) throws TException;
 
diff --git a/lib/java/src/org/apache/thrift/TSerializer.java b/lib/java/src/org/apache/thrift/TSerializer.java
index 90cc039..def4fb6 100644
--- a/lib/java/src/org/apache/thrift/TSerializer.java
+++ b/lib/java/src/org/apache/thrift/TSerializer.java
@@ -74,6 +74,7 @@
    *
    * @param base The object to serialize
    * @return Serialized object in byte[] format
+   * @throws TException if an error is encountered during serialization.
    */
   public byte[] serialize(TBase base) throws TException {
     baos_.reset();
@@ -87,9 +88,9 @@
    *
    * @param base The object to serialize
    * @return Serialized object as a String
+   * @throws TException if an error is encountered during serialization.
    */
   public String toString(TBase base) throws TException {
     return new String(serialize(base));
   }
 }
-
diff --git a/lib/java/src/org/apache/thrift/TUnion.java b/lib/java/src/org/apache/thrift/TUnion.java
index 1ef11df..388aef7 100644
--- a/lib/java/src/org/apache/thrift/TUnion.java
+++ b/lib/java/src/org/apache/thrift/TUnion.java
@@ -43,7 +43,7 @@
     setField_ = null;
     value_ = null;
   }
-  
+
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
     schemes.put(StandardScheme.class, new TUnionStandardSchemeFactory());
@@ -153,22 +153,25 @@
   }
 
   /**
-   * Implementation should be generated so that we can efficiently type check 
+   * Implementation should be generated so that we can efficiently type check
    * various values.
-   * @param setField
-   * @param value
+   * @param setField the field to assign value to.
+   * @param value the value to be assigned to setField.
+   * @throws ClassCastException if the type of value is incompatible with the type of setField.
    */
   protected abstract void checkType(F setField, Object value) throws ClassCastException;
 
   /**
-   * Implementation should be generated to read the right stuff from the wire 
-   * based on the field header. 
-   * @param field
+   * Implementation should be generated to read the right stuff from the wire
+   * based on the field header.
+   *
+   * @param iprot input protocol from which to read a value.
+   * @param field the field whose value is to be read from iprot.
    * @return read Object based on the field header, as specified by the argument.
    */
   protected abstract Object standardSchemeReadValue(TProtocol iprot, TField field) throws TException;
   protected abstract void standardSchemeWriteValue(TProtocol oprot) throws TException;
-  
+
   protected abstract Object tupleSchemeReadValue(TProtocol iprot, short fieldID) throws TException;
   protected abstract void tupleSchemeWriteValue(TProtocol oprot) throws TException;
 
@@ -203,13 +206,13 @@
     this.setField_ = null;
     this.value_ = null;
   }
-  
+
   private static class TUnionStandardSchemeFactory implements SchemeFactory {
     public TUnionStandardScheme getScheme() {
       return new TUnionStandardScheme();
     }
   }
-  
+
   private static class TUnionStandardScheme extends StandardScheme<TUnion> {
 
     @Override
@@ -247,13 +250,13 @@
       oprot.writeStructEnd();
     }
   }
-  
+
   private static class TUnionTupleSchemeFactory implements SchemeFactory {
     public TUnionTupleScheme getScheme() {
       return new TUnionTupleScheme();
     }
   }
-  
+
   private static class TUnionTupleScheme extends TupleScheme<TUnion> {
 
     @Override
diff --git a/lib/java/src/org/apache/thrift/utils/StringUtils.java b/lib/java/src/org/apache/thrift/utils/StringUtils.java
index 9b9671b..b54388a 100644
--- a/lib/java/src/org/apache/thrift/utils/StringUtils.java
+++ b/lib/java/src/org/apache/thrift/utils/StringUtils.java
@@ -30,7 +30,7 @@
   /**
    * Stringify a byte array to the hex representation for each byte.
    *
-   * @param bytes
+   * @param bytes the byte array to convert to hex string.
    * @return hex string.
    */
   public static String bytesToHexString(byte[] bytes) {