mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
check that all params are serializable
DEBUG builds only.
This commit is contained in:
parent
455b6e79f0
commit
6cee0c5bca
1 changed files with 14 additions and 1 deletions
|
@ -24,6 +24,7 @@ import android.os.Bundle;
|
|||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
@ -61,7 +62,19 @@ public class DlgState implements Parcelable {
|
|||
public DlgState setAction( Action action )
|
||||
{ m_action = action; return this; }
|
||||
public DlgState setParams( Object... params )
|
||||
{ m_params = params; return this; }
|
||||
{
|
||||
if ( BuildConfig.DEBUG ) {
|
||||
for ( Object obj : params ) {
|
||||
if ( null != obj && !(obj instanceof Serializable) ) {
|
||||
Log.d( TAG, "OOPS: %s not Serializable",
|
||||
obj.getClass().getName() );
|
||||
Assert.assertFalse( BuildConfig.DEBUG );
|
||||
}
|
||||
}
|
||||
}
|
||||
m_params = params;
|
||||
return this;
|
||||
}
|
||||
public DlgState setActionPair( ActionPair pair )
|
||||
{ m_pair = pair; return this; }
|
||||
public DlgState setOnNA( Action na )
|
||||
|
|
Loading…
Reference in a new issue