mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
remove TransactionKind.NO_MERGE as it seems to have no use cases
This commit is contained in:
@@ -94,7 +94,7 @@ public abstract class TransactionGuard {
|
||||
* @param transaction code to execute inside a transaction.
|
||||
*/
|
||||
public static void submitTransaction(@NotNull Runnable transaction) {
|
||||
getInstance().submitMergeableTransaction(TransactionKind.NO_MERGE, transaction);
|
||||
getInstance().submitMergeableTransaction(TransactionKind.ANY_CHANGE, transaction);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,11 +27,6 @@ public interface TransactionKind {
|
||||
*/
|
||||
TransactionKind TEXT_EDITING = Common.TEXT_EDITING;
|
||||
|
||||
/**
|
||||
* Same as {@link Common#NO_MERGE}
|
||||
*/
|
||||
TransactionKind NO_MERGE = Common.NO_MERGE;
|
||||
|
||||
/**
|
||||
* Same as {@link Common#ANY_CHANGE}
|
||||
*/
|
||||
@@ -56,11 +51,7 @@ public interface TransactionKind {
|
||||
* <li>Project root set change
|
||||
* <li>Dumb mode (reindexing) start/finish, (see {@link com.intellij.openapi.project.DumbService}).
|
||||
*/
|
||||
ANY_CHANGE,
|
||||
ANY_CHANGE
|
||||
|
||||
/**
|
||||
* Transactions of this kind won't be merged into other transactions
|
||||
*/
|
||||
NO_MERGE
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,5 +18,5 @@ public @interface WrapInTransaction {
|
||||
/**
|
||||
* @return the kind of transaction to wrap the action into. By default, it's {@link TransactionKind#NO_MERGE}.
|
||||
*/
|
||||
TransactionKind.Common value() default TransactionKind.Common.NO_MERGE;
|
||||
TransactionKind.Common value() default TransactionKind.Common.ANY_CHANGE;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class TransactionGuardImpl extends TransactionGuard {
|
||||
@NotNull
|
||||
public AccessToken startSynchronousTransaction(@NotNull TransactionKind kind) throws IllegalStateException {
|
||||
ApplicationManager.getApplication().assertIsDispatchThread();
|
||||
if (kind != TransactionKind.NO_MERGE && myMergeableKinds.contains(kind)) {
|
||||
if (myMergeableKinds.contains(kind)) {
|
||||
return AccessToken.EMPTY_ACCESS_TOKEN;
|
||||
}
|
||||
if (myTransactionStartTrace != null) {
|
||||
@@ -71,7 +71,7 @@ public class TransactionGuardImpl extends TransactionGuard {
|
||||
|
||||
Runnable next = myQueue.poll();
|
||||
if (next != null) {
|
||||
runSyncTransaction(TransactionKind.NO_MERGE, next);
|
||||
runSyncTransaction(TransactionKind.ANY_CHANGE, next);
|
||||
}
|
||||
}
|
||||
}, app.getDisposed());
|
||||
@@ -118,7 +118,7 @@ public class TransactionGuardImpl extends TransactionGuard {
|
||||
}
|
||||
|
||||
protected boolean canRunTransactionNow(@NotNull TransactionKind kind) {
|
||||
return !isInsideTransaction() || kind != TransactionKind.NO_MERGE && myMergeableKinds.contains(kind);
|
||||
return !isInsideTransaction() || myMergeableKinds.contains(kind);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user