From 386027f7423b93c104f66a8cfdcbe39b29e67521 Mon Sep 17 00:00:00 2001 From: Noah Stanford Date: Fri, 7 Jan 2022 16:47:51 -0500 Subject: Remove redundant conditions and commented code --- .../managers/screen/SoftButtonObject.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'base') 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. states should be unique for every SoftButtonObject. A SoftButtonState instance cannot be reused for multiple SoftButtonObjects. */ public void setStates(@NonNull List 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; } -- cgit v1.2.1