another race condition with accessing SrcFileAnnotator.myFile after it has been disposed (https://ea.jetbrains.com/browser/ea_reports/772151)

This commit is contained in:
Dmitry Jemerov
2015-01-12 18:01:07 +01:00
parent dad60f7b9c
commit 398323f36a

View File

@@ -1,5 +1,17 @@
/*
* Copyright (c) 2000-2006 JetBrains s.r.o. All Rights Reserved.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.coverage;
@@ -287,7 +299,8 @@ public class SrcFileAnnotator implements Disposable {
// let's find old content in local history and build mapping from old lines to new one
// local history doesn't index libraries, so let's distinguish libraries content with other one
final ProjectFileIndex projectFileIndex = ProjectRootManager.getInstance(myProject).getFileIndex();
final VirtualFile file = getVirtualFile();
final VirtualFile file = psiFile.getVirtualFile();
LOG.assertTrue(file != null);
final long fileTimeStamp = file.getTimeStamp();
final long coverageTimeStamp = suite.getLastCoverageTimeStamp();