Revert "project leaks fixed"

This reverts commit 8e812ac6c6.

It is better to call clearFields instead of nullizing some fields
in different places. But clearFields just has to be called
in the right place, which will be done in the next commit.
This commit is contained in:
Kirill Likhodedov
2017-02-16 15:27:14 +00:00
parent 3539daee71
commit 6a23d203bf
4 changed files with 16 additions and 20 deletions
@@ -23,7 +23,6 @@ import com.intellij.openapi.progress.ProgressManager
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.text.StringUtil
import com.intellij.openapi.vcs.changes.ChangeListManager
import com.intellij.openapi.vcs.changes.ChangeListManagerEx
import com.intellij.openapi.vcs.changes.ChangeListManagerImpl
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager
import com.intellij.openapi.vfs.LocalFileSystem
@@ -33,7 +32,6 @@ import com.intellij.testFramework.PlatformTestCase
import com.intellij.testFramework.RunAll
import com.intellij.testFramework.TestLoggerFactory
import com.intellij.testFramework.runInEdtAndWait
import com.intellij.testFramework.vcs.MockChangeListManager
import com.intellij.util.ArrayUtil
import com.intellij.util.ThrowableRunnable
import java.io.File
@@ -51,7 +49,7 @@ abstract class VcsPlatformTest : PlatformTestCase() {
private lateinit var myTestStartedIndicator: String
private val asyncTasks = mutableSetOf<AsyncTask>()
protected lateinit var changeListManager: ChangeListManagerEx
protected lateinit var changeListManager: ChangeListManagerImpl
@Throws(Exception::class)
override fun setUp() {
@@ -73,12 +71,11 @@ abstract class VcsPlatformTest : PlatformTestCase() {
@Throws(Exception::class)
override fun tearDown() {
RunAll()
.append(ThrowableRunnable { waitForPendingTasks() })
.append(ThrowableRunnable { changeListManager = MockChangeListManager() })
.append(ThrowableRunnable { runInEdtAndWait { super@VcsPlatformTest.tearDown() }})
.append(ThrowableRunnable { if (myAssertionsInTestDetected) TestLoggerFactory.dumpLogToStdout(myTestStartedIndicator) })
.append(ThrowableRunnable { clearFields(this) })
RunAll().append(ThrowableRunnable
{ waitForPendingTasks() }).append(ThrowableRunnable
{ runInEdtAndWait { super@VcsPlatformTest.tearDown() }}).append(ThrowableRunnable
{ if (myAssertionsInTestDetected) TestLoggerFactory.dumpLogToStdout(myTestStartedIndicator) }).append(ThrowableRunnable
{ clearFields(this) })
.run()
}
@@ -140,7 +137,6 @@ abstract class VcsPlatformTest : PlatformTestCase() {
future.get(10, TimeUnit.SECONDS)
}
}
asyncTasks.clear()
}
protected fun executeOnPooledThread(runnable: () -> Unit){
@@ -16,7 +16,6 @@
package git4idea.checkin
import com.intellij.openapi.vcs.VcsConfiguration.StandardConfirmation.ADD
import com.intellij.openapi.vcs.changes.ChangeListManagerImpl
import com.intellij.openapi.vfs.VirtualFile
import git4idea.test.GitSingleRepoTest
import git4idea.test.git
@@ -41,7 +40,7 @@ class GitAddTest : GitSingleRepoTest() {
}
private fun addUnversionedFile(file: VirtualFile) {
(changeListManager as ChangeListManagerImpl).addUnversionedFiles(changeListManager.addChangeList("dummy", null), listOf(file))
changeListManager.addUnversionedFiles(changeListManager.addChangeList("dummy", null), listOf(file))
}
private fun assertStatus(file: VirtualFile, status: Char) {
@@ -78,7 +78,6 @@ public abstract class HgPlatformTest extends VcsPlatformTest {
finally {
try {
myVcs.getGlobalSettings().setHgExecutable(null);
myVcs = null;
}
finally {
super.tearDown();
@@ -63,13 +63,15 @@ public class HgReferenceValidatorTest extends HgPlatformTest {
@Override
@After
public void tearDown() throws Exception {
UIUtil.invokeAndWaitIfNeeded((Runnable)() -> {
try {
myValidator = null;
super.tearDown();
}
catch (Exception e) {
throw new RuntimeException(e);
UIUtil.invokeAndWaitIfNeeded(new Runnable() {
@Override
public void run() {
try {
HgReferenceValidatorTest.super.tearDown();
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
});
}