Skip to content

Commit f6c1b8c

Browse files
committed
HHH-19699 Split assertion and mutating call to Stack#pop
1 parent 2b7969b commit f6c1b8c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

hibernate-core/src/main/java/org/hibernate/type/format/StringJsonDocumentWriter.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ private void moveProcessingStateMachine() {
173173
if ( this.processingStates.getCurrent().equals( JsonProcessingState.ARRAY ) ) {
174174
this.processingStates.pop();
175175
}
176-
assert this.processingStates.pop().equals( JsonProcessingState.STARTING_ARRAY );
176+
final JsonProcessingState arrayStart = this.processingStates.pop();
177+
assert arrayStart.equals( JsonProcessingState.STARTING_ARRAY );
177178
break;
178179
case ENDING_OBJECT:
179180
// when ending an object, we have one or two states.
@@ -185,7 +186,8 @@ private void moveProcessingStateMachine() {
185186
if ( this.processingStates.getCurrent().equals( JsonProcessingState.OBJECT ) ) {
186187
this.processingStates.pop();
187188
}
188-
assert this.processingStates.pop().equals( JsonProcessingState.STARTING_OBJECT );
189+
final JsonProcessingState objectStart = this.processingStates.pop();
190+
assert objectStart.equals( JsonProcessingState.STARTING_OBJECT );
189191
break;
190192
default:
191193
//nothing to do for the other ones.

0 commit comments

Comments
 (0)