File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
mvvm4fx-core/src/main/java/com/techsenger/mvvm4fx/core Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -47,8 +47,9 @@ public T getViewModel() {
4747 public final void initialize () {
4848 var descriptor = this .viewModel .getDescriptor ();
4949 try {
50- if (descriptor .stateWrapper ().get () != ComponentState .CREATING ) {
51- throw new IllegalStateException ("Unexpected state of the component" );
50+ var currentState = descriptor .stateWrapper ().get ();
51+ if (currentState != ComponentState .CREATING ) {
52+ throw new IllegalStateException ("Unexpected state of the component - " + currentState .name ());
5253 }
5354 preInitialize (viewModel );
5455 descriptor .stateWrapper ().set (ComponentState .INITIALIZING );
@@ -75,8 +76,9 @@ public final void initialize() {
7576 public final void deinitialize () {
7677 var descriptor = this .viewModel .getDescriptor ();
7778 try {
78- if (descriptor .stateWrapper ().get () != ComponentState .INITIALIZED ) {
79- throw new IllegalStateException ("Unexpected state of the component" );
79+ var currentState = descriptor .stateWrapper ().get ();
80+ if (currentState != ComponentState .INITIALIZED ) {
81+ throw new IllegalStateException ("Unexpected state of the component - " + currentState .name ());
8082 }
8183 preDeinitialize (viewModel );
8284 descriptor .stateWrapper ().set (ComponentState .DEINITIALIZING );
You can’t perform that action at this time.
0 commit comments