@@ -73,17 +73,6 @@ public class SoftButtonObject implements Cloneable{
7373 */
7474 public SoftButtonObject (@ NonNull String name , @ NonNull List <SoftButtonState > states , @ NonNull String initialStateName , OnEventListener onEventListener ) {
7575
76- /*// If the list of states is empty, throw an error with DebugTool and return
77- if (states.isEmpty()) {
78- DebugTool.logError(TAG,"The state list is empty");
79- return;
80- }
81- // Make sure there aren't two states with the same name
82- if (hasTwoStatesOfSameName(states)) {
83- DebugTool.logError(TAG, "Two states have the same name in states list for soft button object");
84- return;
85- }*/
86-
8776 boolean repeatedStateNames = hasTwoStatesOfSameName (states );
8877
8978 boolean hasStateWithInitialName = false ;
@@ -96,14 +85,10 @@ public SoftButtonObject(@NonNull String name, @NonNull List<SoftButtonState> sta
9685
9786 if (repeatedStateNames ) {
9887 DebugTool .logError (TAG , "A SoftButtonObject must have states with different names." );
99- if (BuildConfig .DEBUG )
100- throw new AssertionError ("A SoftButtonObject must have states with different names." );
10188 return ;
10289 }
10390 if (!hasStateWithInitialName ) {
10491 DebugTool .logError (TAG , "A SoftButtonObject must have a state with initialStateName." );
105- if (BuildConfig .DEBUG )
106- throw new AssertionError ("A SoftButtonObject must have a state with initialStateName." );
10792 return ;
10893 }
10994 this .name = name ;
@@ -296,14 +281,10 @@ public void setStates(@NonNull List<SoftButtonState> states) {
296281
297282 if (repeatedStateNames ) {
298283 DebugTool .logError (TAG , "A SoftButtonObject must have states with different names." );
299- if (BuildConfig .DEBUG )
300- throw new AssertionError ("A SoftButtonObject must have states with different names." );
301284 return ;
302285 }
303286 if (states .isEmpty ()) {
304287 DebugTool .logError (TAG , "A SoftButtonState list must contain at least one state" );
305- if (BuildConfig .DEBUG )
306- throw new AssertionError ("A SoftButtonState list must contain at least one state" );
307288 return ;
308289 }
309290
0 commit comments