@Override
    public void fromData(PdxReader reader) {
      if (getVersion() == 3) {
        f2 = reader.readInt("f2");
      }
      f1 = reader.readInt("f1");
      if (getVersion() == 2) {
        f2 = reader.readInt("f2");
      }
    }
Make sure that if a class adds a field that pdx serialization will preserve the extra field.
geode-core/src/integrationTest/java/org/apache/geode/pdx/PdxSerializableJUnitTest.java