diff --git a/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/bek/BekBranch.java b/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/bek/BekBranch.java index 647bb05f4e51..885c5d14dba4 100644 --- a/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/bek/BekBranch.java +++ b/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/bek/BekBranch.java @@ -15,6 +15,7 @@ */ package com.intellij.vcs.log.graph.impl.facade.bek; +import com.intellij.openapi.diagnostic.Logger; import com.intellij.vcs.log.graph.api.LinearGraph; import com.intellij.vcs.log.graph.utils.TimestampGetter; import org.jetbrains.annotations.NotNull; @@ -25,6 +26,7 @@ import java.util.List; import static com.intellij.vcs.log.graph.utils.LinearGraphUtils.getDownNodes; class BekBranch { + private final static Logger LOG = Logger.getInstance(BekBranch.class); private static final int MAX_BLOCK_SIZE = 20; private static final int MAX_DELTA_TIME = 60 * 60 * 24 * 3 * 1000; @@ -45,7 +47,7 @@ class BekBranch { } public void updatePrepareForInsertPart(@NotNull TimestampGetter timestampGetter, @NotNull BekEdgeRestrictions edgeRestrictions) { - assert myPrepareForInsertPart == null; + LOG.assertTrue(myPrepareForInsertPart == null); int currentNode = myNodeIndexes.get(myNoInsertSize - 1); if (edgeRestrictions.hasRestriction(currentNode)) return; @@ -83,7 +85,7 @@ class BekBranch { } public void doneInsertPreparedPart() { - assert myPrepareForInsertPart != null; + LOG.assertTrue(myPrepareForInsertPart != null); myNoInsertSize -= myPrepareForInsertPart.size(); myPrepareForInsertPart = null; } diff --git a/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/bek/BekBranchCreator.java b/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/bek/BekBranchCreator.java index 171a8a4b2a71..b7024260d88f 100644 --- a/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/bek/BekBranchCreator.java +++ b/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/bek/BekBranchCreator.java @@ -1,6 +1,7 @@ // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.vcs.log.graph.impl.facade.bek; +import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.util.Pair; import com.intellij.vcs.log.graph.api.LinearGraph; import com.intellij.vcs.log.graph.impl.permanent.GraphLayoutImpl; @@ -17,6 +18,7 @@ import static com.intellij.vcs.log.graph.utils.LinearGraphUtils.getDownNodes; import static com.intellij.vcs.log.graph.utils.LinearGraphUtils.getUpNodes; class BekBranchCreator { + private final static Logger LOG = Logger.getInstance(BekBranchCreator.class); @NotNull private final LinearGraph myPermanentGraph; @NotNull private final GraphLayoutImpl myGraphLayout; @NotNull private final Flags myDoneNodes; @@ -43,7 +45,7 @@ class BekBranchCreator { public List createNextBranch(int headNode) { final List nodeIndexes = new ArrayList<>(); - assert !myDoneNodes.get(headNode); + LOG.assertTrue(!myDoneNodes.get(headNode)); myDoneNodes.set(headNode, true); nodeIndexes.add(headNode); diff --git a/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/bek/BekBranchMerger.java b/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/bek/BekBranchMerger.java index 86faae968ec1..ec32850fb546 100644 --- a/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/bek/BekBranchMerger.java +++ b/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/bek/BekBranchMerger.java @@ -1,6 +1,7 @@ // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.vcs.log.graph.impl.facade.bek; +import com.intellij.openapi.diagnostic.Logger; import com.intellij.util.containers.ContainerUtil; import com.intellij.vcs.log.graph.utils.TimestampGetter; import org.jetbrains.annotations.NotNull; @@ -9,6 +10,7 @@ import java.util.ArrayList; import java.util.List; class BekBranchMerger { + private final static Logger LOG = Logger.getInstance(BekBranchMerger.class); @NotNull private final List myBekBranches; @NotNull private final BekEdgeRestrictions myEdgeRestrictions; @NotNull private final TimestampGetter myTimestampGetter; @@ -41,7 +43,7 @@ class BekBranchMerger { List prepareForInsertPart = bekBranch.getPrepareForInsertPart(); if (prepareForInsertPart == null) return Long.MAX_VALUE; - assert !prepareForInsertPart.isEmpty(); + LOG.assertTrue(!prepareForInsertPart.isEmpty()); int nodeIndex = prepareForInsertPart.get(0); return myTimestampGetter.getTimestamp(nodeIndex); } @@ -55,7 +57,7 @@ class BekBranchMerger { } List prepareForInsertPart = selectBranch.getPrepareForInsertPart(); - assert prepareForInsertPart != null; + LOG.assertTrue(prepareForInsertPart != null); for (int insertedNode : prepareForInsertPart) { myEdgeRestrictions.removeRestriction(insertedNode); } diff --git a/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/bek/BekSorter.java b/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/bek/BekSorter.java index eeac972f509f..b2154d60577f 100644 --- a/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/bek/BekSorter.java +++ b/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/bek/BekSorter.java @@ -1,6 +1,7 @@ // Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.vcs.log.graph.impl.facade.bek; +import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.util.Pair; import com.intellij.vcs.log.graph.api.LinearGraph; import com.intellij.vcs.log.graph.impl.permanent.GraphLayoutImpl; @@ -12,6 +13,8 @@ import org.jetbrains.annotations.NotNull; import java.util.List; public final class BekSorter { + private final static Logger LOG = Logger.getInstance(BekSorter.class); + @NotNull public static BekIntMap createBekMap(@NotNull LinearGraph permanentGraph, @NotNull GraphLayoutImpl graphLayout, @@ -19,7 +22,7 @@ public final class BekSorter { BekSorter bekSorter = new BekSorter(permanentGraph, graphLayout, timestampGetter); List result = bekSorter.getResult(); - assert result.size() == permanentGraph.nodesCount(); + LOG.assertTrue(result.size() == permanentGraph.nodesCount()); return createBekIntMap(result); }