You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thanks for sharing the library. So... got an issue on methods naming that using a class object that is unwrapped on a client app using my lib (version 1.x). Later on i had to add a new field (version 2.x) but the client was still unwrapping using the old lib version 1.x. Saw on generated $$Pacelable the the new field was not added at the end of the wirte and read bytes calls, but was put at first because of its naming starting with "a" so ordering alphabetically messing up the old bytes read fields
Above is the code of 1.x and commented the new field added in 2.x:
And this is the generated class with the code of 2.x (uncommented lines):
//// Source code recreated from a .class file by IntelliJ IDEA// (powered by Fernflower decompiler)//packagebr.com.testparcel;
importandroid.os.Parcel;
importandroid.os.Parcelable;
importandroid.os.Parcelable.Creator;
importorg.parceler.IdentityCollection;
importorg.parceler.ParcelWrapper;
importorg.parceler.ParcelerRuntimeException;
publicclassMyData$$ParcelableimplementsParcelable, ParcelWrapper<MyData> {
privateMyDatamyData$$0;
publicstaticfinalCreator<MyData$$Parcelable> CREATOR = newCreator<MyData$$Parcelable>() {
publicMyData$$ParcelablecreateFromParcel(Parcelparcel$$2) {
returnnewMyData$$Parcelable(MyData$$Parcelable.read(parcel$$2, newIdentityCollection()));
}
publicMyData$$Parcelable[] newArray(intsize) {
returnnewMyData$$Parcelable[size];
}
};
publicMyData$$Parcelable(MyDatamyData$$2) {
this.myData$$0 = myData$$2;
}
publicvoidwriteToParcel(Parcelparcel$$0, intflags) {
write(this.myData$$0, parcel$$0, flags, newIdentityCollection());
}
publicstaticvoidwrite(MyDatamyData$$1, Parcelparcel$$1, intflags$$0, IdentityCollectionidentityMap$$0) {
intidentity$$0 = identityMap$$0.getKey(myData$$1);
if (identity$$0 != -1) {
parcel$$1.writeInt(identity$$0);
} else {
parcel$$1.writeInt(identityMap$$0.put(myData$$1));
parcel$$1.writeString(myData$$1.getAcqAdditional());
parcel$$1.writeString(myData$$1.getAcqPath());
parcel$$1.writeString(myData$$1.getPathResponse());
parcel$$1.writeString(myData$$1.getResponseMessage());
}
}
publicintdescribeContents() {
return0;
}
publicMyDatagetParcel() {
returnthis.myData$$0;
}
publicstaticMyDataread(Parcelparcel$$3, IdentityCollectionidentityMap$$1) {
intidentity$$1 = parcel$$3.readInt();
if (identityMap$$1.containsKey(identity$$1)) {
if (identityMap$$1.isReserved(identity$$1)) {
thrownewParcelerRuntimeException("An instance loop was detected whild building Parcelable and deseralization cannot continue. This error is most likely due to using @ParcelConstructor or @ParcelFactory.");
} else {
return (MyData)identityMap$$1.get(identity$$1);
}
} else {
intreservation$$0 = identityMap$$1.reserve();
MyDatamyData$$4 = newMyData();
identityMap$$1.put(reservation$$0, myData$$4);
myData$$4.setAcqAdditional(parcel$$3.readString());
myData$$4.setAcqPath(parcel$$3.readString());
myData$$4.setPathResponse(parcel$$3.readString());
myData$$4.setResponseMessage(parcel$$3.readString());
identityMap$$1.put(identity$$1, myData$$4);
returnmyData$$4;
}
}
}
After all, want to know if is there a way of making the get and set of AcqAdditional be at the end of the write and read methods after the setResponseMessage and getResponseMessage without having to rename the AcqAdditional field because it is already in use for other clients
Thanks again
The text was updated successfully, but these errors were encountered:
First, thanks for sharing the library. So... got an issue on methods naming that using a class object that is unwrapped on a client app using my lib (version 1.x). Later on i had to add a new field (version 2.x) but the client was still unwrapping using the old lib version 1.x. Saw on generated $$Pacelable the the new field was not added at the end of the wirte and read bytes calls, but was put at first because of its naming starting with "a" so ordering alphabetically messing up the old bytes read fields
Above is the code of 1.x and commented the new field added in 2.x:
And this is the generated class with the code of 2.x (uncommented lines):
After all, want to know if is there a way of making the get and set of
AcqAdditional
be at the end of the write and read methods after thesetResponseMessage
andgetResponseMessage
without having to rename the AcqAdditional field because it is already in use for other clientsThanks again
The text was updated successfully, but these errors were encountered: