Commit Graph

3000 Commits

Author SHA1 Message Date
Tagir Valeev
c890dda4f6 [java-psi] LambdaUtil.getFunctionalInterfaceType: force returning null type for variables with inferred type
Otherwise, we may have a chicken-egg problem, when the inferred type is computed using its initializer and the initializer type is computed using the variable type which is not computed yet
Fixes IDEA-371650 [Java] test problem com.intellij.java.codeInsight.daemon.LightAdvLVTIHighlightingTest.testSimpleAvailability: Non-idempotent computation


(cherry picked from commit 69f4608ea9ba6ce98cda8c02acdc51134d4c5552)

IJ-CR-163729

GitOrigin-RevId: 6dbe3502b3d730b04766567feaff8442988971f9
2025-05-22 20:10:35 +00:00
Anna Kozlova
ba21f5f3f2 [kotlin] don't start navigation element computation for physical files
- in the end, for the physical binary file, the language level would be calculated by the file itself, and for the source file, the navigation element should be the same file anyway

^KTIJ-33883 fixed

KT-75830


(cherry picked from commit fece6faa6154eadfb6565ad3ae093c2e7840d31a)

IJ-CR-160935

GitOrigin-RevId: 88c2a5d41f41d1c823ca7de6df5e938811e223f0
2025-05-05 18:08:27 +00:00
Tagir Valeev
a1141237c8 [java-inspections] When analyzing annotation conflict, ignore container annotation if non-container is present
Fixes IDEA-369220 JSpecify support - wrong warning when Nullable method is declared in NullMarked scope and overridden


(cherry picked from commit 50163bfda72bd1f583dda644c668b78859fac022)

IJ-CR-159281

GitOrigin-RevId: fc33b9c9f8ae165baba5a70c00b91267e57d68b1
2025-04-12 07:11:23 +00:00
Mikhail Pyltsin
0ff6bc9f98 [java-debugger] IDEA-367755 Stream trace debugging gives Internal Error in implicitly declared class
- set language level explicitly


(cherry picked from commit 01b844c4f0d812c4505491121429af3cc7df24c5)

IJ-CR-159083

GitOrigin-RevId: d6cca2ad6ad3a3717d27bba341419cb0c236833a
2025-04-02 22:12:05 +00:00
Tagir Valeev
87a0f8f217 [java-dfa] IDEA-358087 Local variable nullability annotations are ignored with default qualifier
(cherry picked from commit e640517083910df691b58415f7ba706be37223ec)

IJ-CR-157989

GitOrigin-RevId: 1bea6bffbedaf9d2b1b372a9c5683da64e5373d5
2025-04-01 11:29:08 +00:00
Bart van Helvert
09b55a16cc [java] Migrate contract provider extension point to hard coded values
#IDEA-366120 #IJ-CR-155341

(cherry picked from commit f0a38cf77f2a636e4d2b58f93f6d225d57d5738f)

GitOrigin-RevId: 34263eb95a904729580bd9180dbbad2c1124ea33
2025-03-11 00:36:09 +00:00
Leonid Shalupov
244718d26b housekeeping: remove java unused imports
IJ-MR-154242

GitOrigin-RevId: 8fec0cba7ae2368e51b21a8b9bfb2f445fdc0f68
2025-02-14 18:08:16 +00:00
Nikolay Chashnikov
2e152d37bf [java] API cleanup: mark deprecated unused API for removal (IJPL-163936)
GitOrigin-RevId: dc2eb0f6251c889df4ae78d08c9633f4935cc844
2025-02-14 14:23:04 +00:00
Mikhail Pyltsin
add71cb7da [java-run] IDEA-367503 and IDEA-365965 hide gutters for java 22 and higher when it is impossible to create class
GitOrigin-RevId: be53750f3f70e70fde24181912887a36a874ab35
2025-02-13 20:06:20 +00:00
Max Medvedev
6f5402325c IJPL-339 resolve for Java
GitOrigin-RevId: 7194b296f17b5318d0aae88b85c99631018ce90f
2025-02-13 19:25:07 +00:00
Tagir Valeev
b9cd1e1a86 [java-analysis] Do not apply container annotation to local variables if their type is a bounded type parameter
Fixes IDEA-362982 JSpecify: Local variable incorrectly asserted as NotNull with generics

GitOrigin-RevId: c310d57d875b4f63370daf0b77caece902681a06
2025-02-12 20:34:11 +00:00
Aleksey Dobrynin
c81ddecac8 [java, jigsaw] support JEP 11 class file attributes (IDEA-366117)
GitOrigin-RevId: 0e2bfa39e5a86fb5663e407d7c33bea177234ecc
2025-02-10 18:41:05 +00:00
Mikhail Pyltsin
3402d737d7 [java-import] IDEA-366927 and IDEA-366926 improve auto-import
- use code style for on-demand imports
- support members for auto-import, not the whole class

GitOrigin-RevId: 32d14c06819a1b1062b081756f614113e22c9858
2025-02-04 20:23:25 +00:00
Tagir Valeev
577de68f8a [java-highlighting] Most of method-reference problems migrated
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 03528950826974c1875e89868dc335c88c2e8149
2025-02-04 19:21:50 +00:00
Andrey Zaytsev
76a0e8cdea [wobbler] move additional java stub index out of community
GitOrigin-RevId: 4c57346e93b44dc284d1cde81f55ebe160839942
2025-02-01 16:06:30 +00:00
Andrey Zaytsev
e28fe78235 [wobbler] get kotlin-src -> java-src resolve working
GitOrigin-RevId: be35003debe792017e51d7792f1b1b09d2fe075b
2025-02-01 16:06:29 +00:00
Tagir Valeev
cd9760a15f [java-highlighting] More instanceof/cast/pattern errors migrated
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: e137879fe6320d4a01b0595a7399b29148161450
2025-01-31 15:31:12 +00:00
Tagir Valeev
f912c93cec [java-psi] PsiUtil: comment spelling, cosmetic changes
GitOrigin-RevId: f2e0138fa51de28988148b06323bb8bbc80d5c99
2025-01-29 11:35:29 +00:00
Nikolay Chashnikov
33d409a034 [java] cleanup: pass 'alwaysTrue' predicate instead of 'null' in PsiElementFinder.hasClass for clarity (IJ-CR-153415)
GitOrigin-RevId: 644c809bd7bcb7711924f0ab9e11cabbf4795775
2025-01-24 18:53:31 +00:00
Tagir Valeev
61db218886 [java-highlighting] checkGenericArrayCreation -> GenericsChecker
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: cb63c9a7c244af1d53d6ab428b2c679ab61e47b8
2025-01-24 14:41:53 +00:00
Tagir Valeev
d5182121d1 [java-highlighting] checkConstructorCallProblems, checkSuperAbstractMethodDirectCall -> ExpressionChecker
Also: constructor-related methods from JavaHighlightUtil moved to JavaPsiConstructorUtil
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 75d736e0472b7f004dfce5de2aaf1e52b23dab20
2025-01-23 13:15:09 +00:00
Nikolay Chashnikov
94f165e257 [java] optimization: introduce JavaPsiFacade::hasClass method and use it in JavaLibraryUtil (IJPL-166229)
If there are multiple classes with the provided name in the scope, 'findClass' and 'findClasses' sort them according to their positions in the classpath. This requires building the OrderEntryGraph, which may take considerable time in a big project (see IJPL-930). New methods 'hasClass' are added to JavaPsiFacade, PsiElementFinder, JavaFileManager. Their implementations don't need to sort the results and therefore don't require building OrderEntryGraph. JavaLibraryUtil is migrated to use the new method.

GitOrigin-RevId: 0b4b05f54a5234e4e585c293bd9bd4a1957a4d70
2025-01-22 14:17:36 +00:00
Mikhail Pyltsin
b1a1f903ba [java-imports] IDEA-13817 Create "favorites" for static import and completion
GitOrigin-RevId: 786ff0d07a68ecb53f3c929600353bc28f483bf0
2025-01-16 14:21:49 +00:00
Bas Leijdekkers
f42116023e Java: add some documentation
GitOrigin-RevId: 3505bb86d31820c00596af5ed196aae8b53d5c65
2025-01-15 19:47:39 +00:00
Tagir Valeev
f1b1712b43 [java-highlighting] More method-related checks to MethodChecker
Unify add/remove modifier fixes
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 83db9a85524edc7c39737a75b470e0697a9c02db
2025-01-15 19:19:41 +00:00
Tagir Valeev
aefc2b83e7 [java-highlighting] Literal and comment problems; findSingleError
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 6e0c38d1caea9272cee420c35589dfb859950793
2025-01-14 12:42:34 +00:00
Tagir Valeev
da4abf5c5d [java-psi] PsiTypesUtil.isRestrictedIdentifier: reference to isSoftKeyword
GitOrigin-RevId: 30c5ee82ad824f8024530cbe0b4f5d1fbae0dfb7
2025-01-13 09:44:55 +00:00
Tagir Valeev
c5f55df055 [java-highlighting] checkClassRestrictedKeyword -> ClassChecker
Move isRestrictedIdentifier to PsiTypesUtil
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: d31ca6bd7de9b28b963d95dbbdaa169d5532f138
2025-01-13 09:44:55 +00:00
Tagir Valeev
ee123058f6 [java-highlighting] PsiTypesUtil.isValidAnnotationMethodType
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 20f7189c30ab52a667b810fb5cde6395d196301a
2025-01-09 12:30:34 +00:00
Tagir Valeev
d083ed8b59 [java-inspection] PossibleHeapPollutionVarargsInspection: remove refactoring remnant
GitOrigin-RevId: 4cb0809cde9fa8242bf30a1e0ae68a4532dae941
2025-01-08 19:09:54 +00:00
Tagir Valeev
c7edfdbe4a [java-highlighting] SafeVarargs checks -> AnnotationChecker
Also, warnings are moved out to inspections
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 2292723fde787454467307c213ea38e730aa0ff5
2025-01-08 16:42:47 +00:00
Tagir Valeev
2deda60303 [java] LambdaUtil.checkInterfaceFunctional
GitOrigin-RevId: 1c383884c65fb288d7aa8306e27cfda4920b8b76
2025-01-03 19:17:43 +00:00
Vladimir Krivosheev
0bc1cf1557 update bazel files
GitOrigin-RevId: 7320d3eff3aba093692ce66839c720ece6d7c4db
2024-12-30 11:28:24 +00:00
Vladimir Krivosheev
7b9ec58009 do not export intellij.database.connectivity.tests
GitOrigin-RevId: a1ef44dfa34cde110c9e6cad19d11b5e3019ab72
2024-12-28 21:45:55 +00:00
Vladimir Krivosheev
051ed2529b cleanup
GitOrigin-RevId: 6fa4f979e0a6641885e2225eb985b13713373ac5
2024-12-26 14:56:01 +00:00
Bas Leijdekkers
2b32d9bb56 Java: basic support for Valhalla Value Classes (IDEA-364548)
GitOrigin-RevId: 93b0394866aae35772ccc90e7de822af8a94c6ce
2024-12-18 18:05:29 +00:00
Vladimir Krivosheev
98799639aa do not use _test as lib - test targets do not support this
GitOrigin-RevId: f2f49db4294b6a64040dbbd5f1d95e972cbd70a3
2024-12-15 18:32:30 +00:00
Alexey Kudravtsev
34e0db8b2c fix "immutable collection is mutated" warnings
GitOrigin-RevId: 349d304256615309e34049a1b76347f2bbbef0e1
2024-12-10 21:19:54 +00:00
Alexey Kudravtsev
856297dd43 new utility method ConcurrencyUtil.computeIfAbsent
GitOrigin-RevId: 580fecce7b3420ce8ed6671a71eb59a5a0f165d1
2024-12-09 16:06:34 +00:00
Alexey Kudravtsev
31185c6576 Propagate @Unmodifiable to enable data-flow inspection to analyze more code
GitOrigin-RevId: 288358515ebebd840b45244cd3d5b251385ff1b8
2024-12-03 15:50:19 +00:00
Alexey Kudravtsev
3215d88629 remove usages of deprecated immutableSet
GitOrigin-RevId: 412c66898fa8af08406267ba73fbe7f108fd154c
2024-11-29 17:34:20 +00:00
Tagir Valeev
5dca817b05 Add missing @Override annotations
GitOrigin-RevId: 56b084f82d4f4ec5153645b4d745bc881b803a26
2024-11-29 12:51:16 +00:00
Bartek Pacia
6682d9efc3 [java-inspections] Non functional style Optional.isPresent - missed opportunity
IDEA-360860 fixed

* split tests into individual methods, to make debugging easier
* add javadoc for VariableAccessUtils#isVariableTypeChangeSafeForReference


(cherry picked from commit f6b3468079959f7adec737e0b8ec3ad1d97e7ad2)

IJ-MR-150176

GitOrigin-RevId: 4b430e49819c7cba1e08ecee47b881f05be570d4
2024-11-28 23:23:40 +00:00
Mikhail Pyltsin
aadaf0a684 [java-inspections] IDEA-361609 variable cannot be inline inside switch expression
GitOrigin-RevId: 8d2a9c8bd978bea833e8f975da7c9195256350a3
2024-11-27 14:07:46 +00:00
Vladimir Krivosheev
17916c90f8 libraries -> lib, resources, opt-in, test deps
GitOrigin-RevId: db66ee95dcb0f0553b40c9cc56cd6afed8634cdd
2024-11-27 13:53:42 +00:00
Alexey Kudravtsev
9cef099839 propagate @Unmodifiable to more methods calling ContainerUtil, to enable data-flow inspection to highlight more warnings
GitOrigin-RevId: 01d3c976ffd35c3290433d0cd6c0f2d59df894f1
2024-11-27 12:57:34 +00:00
Tagir Valeev
515d32af52 [java-psi] Snippet API non-experimental anymore
GitOrigin-RevId: 41633ba4069240ef4abd6dfd63bf2e87a9571a67
2024-11-14 17:05:05 +00:00
Andrzej Głuszak
cbca664f6c [bazel] Second attempt at generating tests
GitOrigin-RevId: 7763c9994b7c311310b83b98a542775feb00ed68
2024-11-09 11:06:41 +00:00
Marco Pennekamp
44f3b13c4f [PSI] Honor global search scope when searching classes contained in a PsiPackage
- Similarly to class names, `PsiElementFinderImpl.getClasses` only filtered directories by the scope, but not individual classes/files contained in the directory.

^IJPL-165129

GitOrigin-RevId: 9fdf755aaf80ad6af7435ad9c69eaca757c90277
2024-11-05 18:39:42 +00:00
Bas Leijdekkers
54f80ad00b [java] define "record header" element kind
GitOrigin-RevId: 91f02e6ab23e47e05612413074ef30eb31dd854d
2024-11-02 01:09:48 +00:00