diff options
author | Noah Stanford <noah@livio.io> | 2022-01-07 16:47:51 -0500 |
---|---|---|
committer | Noah Stanford <noah@livio.io> | 2022-01-07 16:47:51 -0500 |
commit | 386027f7423b93c104f66a8cfdcbe39b29e67521 (patch) | |
tree | 4ef8b1246b6c34fb270cb38099ecb76147ec6a6c /base | |
parent | 9d475122ab407dbd32775030d6dd20fa202c0d21 (diff) | |
download | sdl_android-386027f7423b93c104f66a8cfdcbe39b29e67521.tar.gz |
Remove redundant conditions and commented code
Diffstat (limited to 'base')
-rw-r--r-- | base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java b/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java index 8e369268f..f5f8a54e3 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java @@ -96,13 +96,13 @@ public class SoftButtonObject implements Cloneable{ if (repeatedStateNames) { DebugTool.logError(TAG, "A SoftButtonObject must have states with different names."); - if (BuildConfig.DEBUG && repeatedStateNames) + if (BuildConfig.DEBUG) throw new AssertionError("A SoftButtonObject must have states with different names."); return; } if (!hasStateWithInitialName) { DebugTool.logError(TAG, "A SoftButtonObject must have a state with initialStateName."); - if (BuildConfig.DEBUG && !hasStateWithInitialName) + if (BuildConfig.DEBUG) throw new AssertionError("A SoftButtonObject must have a state with initialStateName."); return; } @@ -291,28 +291,18 @@ public class SoftButtonObject implements Cloneable{ * @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> */ public void setStates(@NonNull List<SoftButtonState> states) { - /*// If the list of states is empty, throw an error with DebugTool and return - if (states.isEmpty()) { - DebugTool.logError(TAG,"The state list is empty"); - return; - } - // Make sure there aren't two states with the same name - if (hasTwoStatesOfSameName(states)) { - DebugTool.logError(TAG, "Two states have the same name in states list for soft button object"); - return; - }*/ boolean repeatedStateNames = hasTwoStatesOfSameName(states); if (repeatedStateNames) { DebugTool.logError(TAG, "A SoftButtonObject must have states with different names."); - if (BuildConfig.DEBUG && repeatedStateNames) + if (BuildConfig.DEBUG) throw new AssertionError("A SoftButtonObject must have states with different names."); return; } if (states.isEmpty()) { DebugTool.logError(TAG, "A SoftButtonState list must contain at least one state"); - if (BuildConfig.DEBUG && states.isEmpty()) + if (BuildConfig.DEBUG) throw new AssertionError("A SoftButtonState list must contain at least one state"); return; } |