mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-07 05:24:46 +01:00
fix some bundling/serialization problems
Now that params[] are being bundled all objects passed that way must be serializeable. And as long as I'm asserting bundle success using equals() the objects being serialized must implement it.
This commit is contained in:
parent
80cc12fc79
commit
d55d9573e4
3 changed files with 24 additions and 4 deletions
|
@ -49,6 +49,7 @@ import java.io.ByteArrayOutputStream;
|
|||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
|
@ -446,13 +447,29 @@ public class DBUtils {
|
|||
return result;
|
||||
}
|
||||
|
||||
public static class SentInvitesInfo {
|
||||
public static class SentInvitesInfo implements Serializable {
|
||||
public long m_rowid;
|
||||
private ArrayList<InviteMeans> m_means;
|
||||
private ArrayList<String> m_targets;
|
||||
private ArrayList<Timestamp> m_timestamps;
|
||||
private int m_cachedCount = 0;
|
||||
|
||||
@Override
|
||||
public boolean equals( Object other )
|
||||
{
|
||||
boolean result = null != other && other instanceof SentInvitesInfo;
|
||||
if ( result ) {
|
||||
SentInvitesInfo it = (SentInvitesInfo)other;
|
||||
result = it.m_rowid == m_rowid
|
||||
&& it.m_means.equals(m_means)
|
||||
&& it.m_targets.equals(m_targets)
|
||||
&& it.m_timestamps.equals(m_timestamps)
|
||||
&& it.m_cachedCount == m_cachedCount;
|
||||
}
|
||||
// Log.d( TAG, "equals() => %b", result );
|
||||
return result;
|
||||
}
|
||||
|
||||
private SentInvitesInfo( long rowID ) {
|
||||
m_rowid = rowID;
|
||||
m_means = new ArrayList<InviteMeans>();
|
||||
|
|
|
@ -100,7 +100,7 @@ public class DlgState implements Parcelable {
|
|||
DlgState other = (DlgState)it;
|
||||
result = other != null
|
||||
&& m_id.equals(other.m_id)
|
||||
&& m_msg.equals(other.m_msg)
|
||||
&& ((null == m_msg) ? (null == other.m_msg) : m_msg.equals(other.m_msg))
|
||||
&& m_posButton == other.m_posButton
|
||||
&& m_negButton == other.m_negButton
|
||||
&& m_action == other.m_action
|
||||
|
@ -157,7 +157,10 @@ public class DlgState implements Parcelable {
|
|||
|
||||
DlgState newState = DlgState.CREATOR.createFromParcel(parcel);
|
||||
Assert.assertFalse(newState == this);
|
||||
Assert.assertTrue(this.equals(newState));
|
||||
if ( !this.equals(newState) ) {
|
||||
Log.d( TAG, "restore failed!!: %s => %s", this, newState );
|
||||
Assert.fail();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -439,7 +439,7 @@ public class GameSummary implements Serializable {
|
|||
Log.ex( TAG, ex );
|
||||
}
|
||||
}
|
||||
Log.i( TAG, "getStringExtra(%s) => %s", key, result );
|
||||
// Log.i( TAG, "getStringExtra(%s) => %s", key, result );
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue