Permalink
Browse files

Few small fixes

  • Loading branch information...
me4502 committed Dec 4, 2018
1 parent d0a9b29 commit 5ac3d03f09081af409715fa4b8423418933ce7ee
@@ -271,10 +271,10 @@ private Extent wrapExtent(Extent extent, EventBus eventBus, EditSessionEvent eve

// pkg private for TracedEditSession only, may later become public API
boolean commitRequired() {
if (reorderExtent.commitRequired()) {
if (reorderExtent != null && reorderExtent.commitRequired()) {
return true;
}
if (isBatchingChunks() && chunkBatchingExtent.commitRequired()) {
if (chunkBatchingExtent != null && chunkBatchingExtent.commitRequired()) {
return true;
}
if (fastModeExtent != null && fastModeExtent.commitRequired()) {
@@ -294,7 +294,7 @@ public void enableStandardMode() {
}

/**
* Sets the {@link ReorderMode} of this EditSession.
* Sets the {@link ReorderMode} of this EditSession, and flushes the session.
*
* @param reorderMode The reorder mode
*/
@@ -305,6 +305,8 @@ public void setReorderMode(ReorderMode reorderMode) {
if (reorderMode == ReorderMode.MULTI_STAGE && reorderExtent == null) {
throw new IllegalArgumentException("An EditSession without a reorder extent tried to use it for reordering!");
}
flushSession();

this.reorderMode = reorderMode;
switch (reorderMode) {
case MULTI_STAGE:
@@ -73,7 +73,7 @@ public void setEnabled(boolean enabled) {
}

public boolean commitRequired() {
return batches.size() > 0;
return enabled && batches.size() > 0;
}

@Override

0 comments on commit 5ac3d03

Please sign in to comment.