Skip to content

Commit 386027f

Browse files
committed
Remove redundant conditions and commented code
1 parent 9d47512 commit 386027f

1 file changed

Lines changed: 4 additions & 14 deletions

File tree

base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ public SoftButtonObject(@NonNull String name, @NonNull List<SoftButtonState> sta
9696

9797
if (repeatedStateNames) {
9898
DebugTool.logError(TAG, "A SoftButtonObject must have states with different names.");
99-
if (BuildConfig.DEBUG && repeatedStateNames)
99+
if (BuildConfig.DEBUG)
100100
throw new AssertionError("A SoftButtonObject must have states with different names.");
101101
return;
102102
}
103103
if (!hasStateWithInitialName) {
104104
DebugTool.logError(TAG, "A SoftButtonObject must have a state with initialStateName.");
105-
if (BuildConfig.DEBUG && !hasStateWithInitialName)
105+
if (BuildConfig.DEBUG)
106106
throw new AssertionError("A SoftButtonObject must have a state with initialStateName.");
107107
return;
108108
}
@@ -291,28 +291,18 @@ public List<SoftButtonState> getStates() {
291291
* @param states a list of the object's soft button states. <strong>states should be unique for every SoftButtonObject. A SoftButtonState instance cannot be reused for multiple SoftButtonObjects.</strong>
292292
*/
293293
public void setStates(@NonNull List<SoftButtonState> states) {
294-
/*// If the list of states is empty, throw an error with DebugTool and return
295-
if (states.isEmpty()) {
296-
DebugTool.logError(TAG,"The state list is empty");
297-
return;
298-
}
299-
// Make sure there aren't two states with the same name
300-
if (hasTwoStatesOfSameName(states)) {
301-
DebugTool.logError(TAG, "Two states have the same name in states list for soft button object");
302-
return;
303-
}*/
304294

305295
boolean repeatedStateNames = hasTwoStatesOfSameName(states);
306296

307297
if (repeatedStateNames) {
308298
DebugTool.logError(TAG, "A SoftButtonObject must have states with different names.");
309-
if (BuildConfig.DEBUG && repeatedStateNames)
299+
if (BuildConfig.DEBUG)
310300
throw new AssertionError("A SoftButtonObject must have states with different names.");
311301
return;
312302
}
313303
if (states.isEmpty()) {
314304
DebugTool.logError(TAG, "A SoftButtonState list must contain at least one state");
315-
if (BuildConfig.DEBUG && states.isEmpty())
305+
if (BuildConfig.DEBUG)
316306
throw new AssertionError("A SoftButtonState list must contain at least one state");
317307
return;
318308
}

0 commit comments

Comments
 (0)