Skip to content

Commit

Permalink
optimize Kotlin coverage performance by avoiding calls to getContaini…
Browse files Browse the repository at this point in the history
…ngFile() on AbstractLightClass instances
  • Loading branch information
yole committed Jan 13, 2015
1 parent e43a20e commit 0d8f676
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion plugins/coverage/src/com/intellij/coverage/PackageAnnotator.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* 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;

import com.intellij.openapi.application.ApplicationManager;
Expand Down Expand Up @@ -300,7 +315,7 @@ public Boolean compute() {
JavaPsiFacade.getInstance(myManager.getProject()).findClass(toplevelClassSrcFQName, GlobalSearchScope.moduleScope(module));
if (aClass == null || !aClass.isValid()) return Boolean.FALSE;
psiClassRef.set(aClass);
containingFileRef.set(aClass.getContainingFile().getVirtualFile());
containingFileRef.set(aClass.getNavigationElement().getContainingFile().getVirtualFile());
if (containingFileRef.isNull()) {
LOG.info("No virtual file found for: " + aClass);
return null;
Expand Down

0 comments on commit 0d8f676

Please sign in to comment.