diff --git a/build.xml b/build.xml
index 0cfdb03f43fd5e51e85c154aaacada2068bdcaac..e9e0d3558992dfc37a46bedb614483bce5234d24 100644
--- a/build.xml
+++ b/build.xml
@@ -137,20 +137,35 @@
            destdir="${build-test}"/>
     </target>
 
-    <!-- Thrift build based on http://www.flester.com/blog/2009/04/26/using-thrift-from-ant -->
-    <fileset id="thrift.files" dir="${thrift.dir}">
-        <include name="**/*.thrift"/>
-    </fileset>
-
     <target name="gen-thrift" depends="init">
-        <pathconvert property="thrift.file.list" refid="thrift.files"
-            pathsep=" " dirsep="/">
-        </pathconvert>
-        <echo message="Running thrift generator on ${thrift.file.list}"/>
-        <exec executable="thrift" dir="${basedir}" failonerror="true">
-            <arg line="--strict -v --gen java -o ${thrift.out.dir}/.. '${thrift.file.list}'"/>
+      <echo message="Running thrift on '${thrift.dir}'"/>
+      <apply executable="./thrift/compiler/cpp/thrift">
+	<fileset dir="${thrift.dir}" casesensitive="yes">
+	  <include name="**/*.thrift"/>
+	</fileset>
+	<arg value="--strict"/>
+	<arg value="-v"/>
+	<arg value="--gen"/>
+	<arg value="java"/>
+	<arg value="-o"/>
+	<arg value="${thrift.out.dir}/.."/>
+      </apply>
+      <echo message="Adding @SuppressWarning annotations"/>
+      <replaceregexp byline="true">
+	<regexp pattern="^public "/>
+	<substitution expression='@SuppressWarnings("all") public '/>
+	<fileset id="thrift.output.files" dir="${thrift.out.dir}/..">
+	  <include name="**/*.java"/>
+	</fileset>
+      </replaceregexp>
+    </target>
+
+    <target name="do-gen-thrift">
+        <exec executable="./thrift/compiler/cpp/thrift" dir="${basedir}" failonerror="true">
+            <arg line="--strict -v --gen java -o ${thrift.out.dir}/.. '${foreach.file}'"/>
         </exec>
         <!-- Get rid of annoying warnings in thrift java: at annotations -->
+
         <echo message="Adding @SuppressWarning annotations"/>
         <replaceregexp byline="true">
             <regexp pattern="^public "/>
diff --git a/lib/gen-java/net/floodlightcontroller/packetstreamer/thrift/PacketStreamer.java b/lib/gen-java/net/floodlightcontroller/packetstreamer/thrift/PacketStreamer.java
index f4e8ae512734dbf2253f92b2bde0f2387ca0eed2..d7e454716c55d7359c34b442d0d050783f5645b6 100644
--- a/lib/gen-java/net/floodlightcontroller/packetstreamer/thrift/PacketStreamer.java
+++ b/lib/gen-java/net/floodlightcontroller/packetstreamer/thrift/PacketStreamer.java
@@ -1618,8 +1618,6 @@ import org.slf4j.LoggerFactory;
 
     private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
       try {
-        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-        __isset_bit_vector = new BitSet(1);
         read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
       } catch (org.apache.thrift.TException te) {
         throw new java.io.IOException(te);