From 1480e7881b45cae2b129df9a64c5ff5279b59ac4 Mon Sep 17 00:00:00 2001 From: Mikhail Pyltsin Date: Thu, 15 Aug 2024 10:47:47 +0200 Subject: [PATCH] [java-compiler] IDEA-354499 After building the project, find usages is broken for Record - update jps GitOrigin-RevId: 1db8fcf4e15b4e8053afdbb1db2bbc7b36eb73fe --- .idea/libraries/jps_javac_extension.xml | 8 ++++---- .../backwardRefs/CompilerReferenceServiceBase.java | 12 ++---------- java/plugin/plugin-content.yaml | 2 +- .../jps/backwardRefs/index/JavaCompilerIndices.java | 4 ++-- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/.idea/libraries/jps_javac_extension.xml b/.idea/libraries/jps_javac_extension.xml index 2da5f4f97594..806e83f7a2c8 100644 --- a/.idea/libraries/jps_javac_extension.xml +++ b/.idea/libraries/jps_javac_extension.xml @@ -1,14 +1,14 @@ - + - - 221fe6fbee5d47c00104716f94401b0b4119d1c5b558e09f64ad874d35cf3870 + + 86b9d2a2378cff951f3bd0750d56ff4cef64f78dbb33e9f7abd9c7e6e14d99de - + diff --git a/java/compiler/impl/src/com/intellij/compiler/backwardRefs/CompilerReferenceServiceBase.java b/java/compiler/impl/src/com/intellij/compiler/backwardRefs/CompilerReferenceServiceBase.java index 028ba4f055e0..697f019a7c55 100644 --- a/java/compiler/impl/src/com/intellij/compiler/backwardRefs/CompilerReferenceServiceBase.java +++ b/java/compiler/impl/src/com/intellij/compiler/backwardRefs/CompilerReferenceServiceBase.java @@ -1,4 +1,4 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.compiler.backwardRefs; import com.intellij.compiler.CompilerDirectHierarchyInfo; @@ -24,7 +24,6 @@ import com.intellij.openapi.project.ProjectUtil; import com.intellij.openapi.roots.ProjectFileIndex; import com.intellij.openapi.roots.ProjectRootManager; import com.intellij.openapi.util.ModificationTracker; -import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.ThrowableComputable; import com.intellij.openapi.util.io.FileAttributes; @@ -33,7 +32,6 @@ import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.util.registry.RegistryManager; import com.intellij.openapi.vfs.VfsUtilCore; import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.psi.PsiClass; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiNamedElement; @@ -361,13 +359,7 @@ public abstract class CompilerReferenceServiceBase result = ReadAction.compute( - () -> new Pair<>(element.getContainingFile(), - element instanceof PsiClass psiClass && psiClass.isRecord())); - if (result.second) { - return false; //a workaround until jps-javac-extension will not be fixed - } - PsiFile file = result.getFirst(); + PsiFile file = ReadAction.compute(() -> element.getContainingFile()); return file != null && !InjectedLanguageManager.getInstance(project).isInjectedFragment(file); } diff --git a/java/plugin/plugin-content.yaml b/java/plugin/plugin-content.yaml index 5266a2fd7d8b..81288744e448 100644 --- a/java/plugin/plugin-content.yaml +++ b/java/plugin/plugin-content.yaml @@ -105,7 +105,7 @@ projectLibraries: - name: jps-javac-extension files: - - name: $MAVEN_REPOSITORY$/org/jetbrains/jps/jps-javac-extension/9/jps-javac-extension-9.jar + - name: $MAVEN_REPOSITORY$/org/jetbrains/jps/jps-javac-extension/10/jps-javac-extension-10.jar reason: withProjectLibrary - name: lib/jps-launcher.jar modules: diff --git a/jps/jps-builders/src/org/jetbrains/jps/backwardRefs/index/JavaCompilerIndices.java b/jps/jps-builders/src/org/jetbrains/jps/backwardRefs/index/JavaCompilerIndices.java index b4d3b34bb138..c810712b79dc 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/backwardRefs/index/JavaCompilerIndices.java +++ b/jps/jps-builders/src/org/jetbrains/jps/backwardRefs/index/JavaCompilerIndices.java @@ -1,4 +1,4 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.jps.backwardRefs.index; import com.intellij.openapi.util.io.DataInputOutputUtilRt; @@ -23,7 +23,7 @@ import java.util.List; public final class JavaCompilerIndices { //TODO manage version separately - public static final int VERSION = 7; + public static final int VERSION = 8; public static final IndexId BACK_USAGES = IndexId.create("back.refs"); public static final IndexId> BACK_HIERARCHY = IndexId.create("back.hierarchy");