Skip to content

Commit 34c0622

Browse files
committed
Revert addtion of AssertionErrors
Also remove comment
1 parent d15498f commit 34c0622

2 files changed

Lines changed: 0 additions & 21 deletions

File tree

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

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -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

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ public SoftButtonState(@NonNull String name, String text, SdlArtwork artwork) {
6666
if (text == null && artwork == null) {
6767
DebugTool.logError(TAG, "Attempted to create an invalid soft button state: text and artwork are both null");
6868
softButton = null;
69-
if (BuildConfig.DEBUG)
70-
throw new AssertionError("Attempted to create an invalid soft button state: text and artwork are both null");
7169
return;
7270
}
7371
this.name = name;

0 commit comments

Comments
 (0)