Commit Graph

7841 Commits

Author SHA1 Message Date
Mikhail Pyltsin
f73a4d96be [java-inspections] IDEA-201932 Provide inspection to highlight redundant creation operations in java date time api
GitOrigin-RevId: 6b246167dda52272122d356c3f6a787eab5a2542
2024-09-20 14:10:17 +00:00
Tagir Valeev
c3ecaaa190 [java-dfa] More annotations; annotations for comparators; warn on nullity violation from methodref return
GitOrigin-RevId: d0b1a4967d361f409d4d25562c595e2812fc8044
2024-09-19 19:06:26 +00:00
Mikhail Pyltsin
abb1899900 [java-inspections] IDEA-357009 new option to configure custom classes for IncorrectMessageFormatInspection
GitOrigin-RevId: ab026ee405f78ff29519afb0db62449a682b5bd3
2024-09-19 12:20:53 +00:00
Tagir Valeev
35c9c6ca5a [java-dfa] Basic support for Unmodifiable type annotation
GitOrigin-RevId: 4bc07e2533efa45356ba26b89c065b453a40d253
2024-09-18 20:27:35 +00:00
Tagir Valeev
ffd5d01482 [java-dfa] Type annotations for stream collectors; now, special processing of non-null collections is unnecessary
Part of IDEA-231901 Support TYPE_USE in external annotations

GitOrigin-RevId: 34e116eddf5dbc90468311e5fd2d0c30e600fc1a
2024-09-18 20:27:35 +00:00
Tagir Valeev
b50767f679 [java] Basic support for external type annotations
Only in XML directly; no editing UI for now; no inlays for now; only for libraries (Cls), currently no intent to extend to sources (Psi)
Part of IDEA-231901 Support TYPE_USE in external annotations

GitOrigin-RevId: 672ed09f57ffc40b61e8fe4dd33d0f9acdac92dc
2024-09-18 20:06:30 +00:00
Tagir Valeev
528b777e4a [java-dfa] ControlFlowAnalyzer: do not compare PsiType by ==
GitOrigin-RevId: c24b6038b522eddefc8defbbddb59015bd90ae2e
2024-09-18 12:08:09 +00:00
Tagir Valeev
0ddb0d84b3 [java-analysis] JavaSourceInference.isUnusedInAnonymousClass: avoid using heavy search
GitOrigin-RevId: 2fd2f4c0a0109db9cc91e5c49c5fa832b9ec90ed
2024-09-18 12:07:43 +00:00
Tagir Valeev
ac0c57748b [java-inspections] IDEA-346005 Add new inspection: Unnecessary keySet() call
GitOrigin-RevId: d1f1db0ae939017a8550b91cd8742dc222a8db99
2024-09-17 07:28:39 +00:00
Tagir Valeev
05de6a6bdb Less raw types
GitOrigin-RevId: 2a6e712b4017cf1ead7870543e562acb654fbeaf
2024-09-16 11:23:15 +00:00
Yuriy Artamonov
47f1c44a90 [java] IJPL-158521 Actions: fix ellipsis in messages for Java actions
GitOrigin-RevId: bfce0d6efa8747660c4b9af3d8defbfa47e4509a
2024-09-15 14:50:09 +00:00
Alexey Kudravtsev
401bcbb8ef optimization: do not allocate empty maps
GitOrigin-RevId: 77883bfa5f82626a8b116ee9ce72752e70a1f313
2024-09-13 22:48:02 +00:00
Bas Leijdekkers
5c06f74975 Java: don't report non-private field as assigned not accessed when it is implicitly read and written (IDEA-357404)
GitOrigin-RevId: 943ef6961c19510e5d4291367293424a87499487
2024-09-13 16:40:26 +00:00
Aleksey Dobrynin
f590114d83 [java, highlighting] Fix module conflict highlighting for exported packages IDEA-352819
GitOrigin-RevId: d4479fb863280674ae8960c930e6e8b1628b7321
2024-09-13 06:24:34 +00:00
Alexey Kudravtsev
a7c08af12a optimization: do not recalculate hashCode of 10K+-sized lists on each typing, do not store them in the map keys (part of KTIJ-27513 K2 IDE: Slow reference search for specific symbols in unused symbol inspection)
GitOrigin-RevId: 62930faef52b3b5039e7f20720de5970a22d943e
2024-09-12 14:15:42 +00:00
Tagir Valeev
41c0081fd8 [java-dfa] Work-around K2 problem KT-71407 K2: Do not report @JvmField default value as PsiField initializer in K2
GitOrigin-RevId: 1cdf4ac181c63cf9e0d348c7e4b48d449cc031c2
2024-09-11 20:52:54 +00:00
Michail Plushnikov
6ebc72d816 [lombok] IDEA-345991 Fix Error Highlighting: Lombok Builder.Default on Final Fields
GitOrigin-RevId: 839bffdf12b4c5046ed8ec0732bfce9f09801516
2024-09-10 23:11:10 +00:00
Bas Leijdekkers
9eb3b6bb58 Java: introduce another visitSwitchBlock() method
GitOrigin-RevId: 97f3edcab34837c124e1426d97a6d6590e67a053
2024-09-06 13:43:06 +00:00
Bas Leijdekkers
028d526405 Java: fix false positive when using java 21 pattern matching (IDEA-357175)
in "'equals()' should check the class of its parameter" inspection

GitOrigin-RevId: f84071ea339bf690eadcba60d491eebe4cb21a7e
2024-09-05 15:02:58 +00:00
Mikhail Pyltsin
7a9b0a636a [java] IDEA-358431 Support MessageFormat specifier-to-argument navigation, similar to String.format
- fix place for formatted index (without style)

GitOrigin-RevId: aa82d7312bab57ce7b2dc736456574746da5fd9d
2024-09-05 12:57:16 +00:00
Max Medvedev
e54b7f9eb7 IJPL-797 intellij.platform.analysis.impl don't expose Int2IntMap in API
GitOrigin-RevId: 729a4c894919858c1c60dde419fc4d7cbe111c5c
2024-09-04 17:23:17 +00:00
Tagir Valeev
3c7271ac4e [java-inspections] DuplicateExpressions: recognize stable methods from GetterDescriptor; add some methods from java.io.File
Fixes to some extent IDEA-114778 IntelliJ: add "locate multiple occurrence"

GitOrigin-RevId: a20d9db31a79cdc963075993a09a6a6115947621
2024-09-02 21:50:32 +00:00
Tagir Valeev
49f0880f57 [java] IDEA-358431 Support MessageFormat specifier-to-argument navigation, similar to String.format
GitOrigin-RevId: 5bfb87b48e714f92f5c469d4110426ff76f8c14b
2024-09-02 21:01:25 +00:00
Daniil Ovchinnikov
c3cebbf8dd move ExperimentalUI to intellij.platform.core.ui
GitOrigin-RevId: 9bf55dab6a2d5c0be392634dd31b18efaf401b45
2024-09-02 19:10:22 +00:00
Mikhail Pyltsin
dd822c1bc7 IJ-CR-142710 [java-inspections] IDEA-357725 LoggerInitializedWithForeignClassInspection should skip when the logger is not the final field
- fix texts

GitOrigin-RevId: 85d86f362ce860118d2a047321bf4916e01757da
2024-09-02 18:36:41 +00:00
Mathias Boulay
d4e45d6061 tweak(JavaDoc): Disable some inspections on older javadoc
Some inspections are pointless to check, related to javadoc tags.

GitOrigin-RevId: b7bb8bba4b51f1d90678705af3da8e5e5c4a4907
2024-09-02 16:39:21 +00:00
Tagir Valeev
5abb2bda0d [java-analysis] VariableAccessUtils.getVariableReferences: do not query LocalRefUseInfo for non-physical files
Non-physical copies are usually created for a single purpose (completion, or a single ModCommand quick-fix to apply), so computing all the references is likely not useful and only creates performance overhead.
Should fix IDEA-357624 Slow code completion in large Java file in lines being assigned to "final var"

GitOrigin-RevId: c942fb2a91bd3bcbd4cb67d48f2801e256ab64a1
2024-09-02 12:18:12 +00:00
Bas Leijdekkers
f198a23cdf Java: don't evaluate enum constants as constants expressions
GitOrigin-RevId: c5d703ce78b569a3bdab9e8e9dcc2e95bdadd07f
2024-08-29 19:03:09 +00:00
Bas Leijdekkers
8827db8d65 Java: remove enum functionality from constant evaluator
GitOrigin-RevId: edcb80e7ddeee3a45b83c98cf77f3c56fd850298
2024-08-29 19:03:09 +00:00
Tagir Valeev
07c73fd64a [java-dfa] Recognize String.strip/stripLeading/stripTrailing/isBlank
Also: limit the length of the resulting string if the length of the original string is known

GitOrigin-RevId: bfe3752b15949047366c3d3d79c7d13a49193abd
2024-08-29 14:08:22 +00:00
Tagir Valeev
59325634ab [java-inspections] IDEA-356832 Inspections ignore redundant Class::cast method call
GitOrigin-RevId: 390a19d69020bc91f1395e6c4d23f14992ca396b
2024-08-28 17:54:26 +00:00
Tagir Valeev
646b6ff3d1 [java] VariableNameGenerator: contracts
GitOrigin-RevId: f22a0ac01694934f291d31f0322f4c01d271418e
2024-08-28 17:54:26 +00:00
Tagir Valeev
70aabe4830 [java-inspections] AbstractClassNeverImplemented: improve description; reorder check for efficiency
GitOrigin-RevId: 4a7508def1712070c231ddc3ce6fd804bbc05784
2024-08-27 16:39:09 +00:00
Mikhail Pyltsin
71f4656438 IJ-CR-142399 [java-inspections] IDEA-356745 False positive 'Incorrect 'MessageFormat' pattern' when argument is array
-simplify variables

GitOrigin-RevId: f67c6172e1dcf8a61d6c335429de990de02b7ad6
2024-08-27 09:13:47 +00:00
Mikhail Pyltsin
76e51824bf [java-inspection] IDEA-356207 incorrect work with typeUseWithType option
GitOrigin-RevId: b4affe09ebbf3269881bf00d48f75cca3fd27a59
2024-08-27 09:13:47 +00:00
Bas Leijdekkers
f8f22f782d Java: cleanup AddTypeCastFix.java
GitOrigin-RevId: 01d277b7a19d255153f1632292df479845064a6c
2024-08-26 18:38:16 +00:00
Bas Leijdekkers
18cb209fa7 Java: add cast to single branch of conditional expression when possible (IDEA-358278)
GitOrigin-RevId: 8f3137172d8a1526da2228e3c9ed911f9805c16c
2024-08-26 18:38:16 +00:00
Bas Leijdekkers
83bba063e7 Java: improve message for cast fix
GitOrigin-RevId: 40cd180ca8fdae46a3ea0216ec7b08e82ca22364
2024-08-26 18:38:16 +00:00
Alexey Kudravtsev
baa254d5eb IJPL-160883 Apply ChangeLocalityDetector even if PSI reference or declaration is changed
do not disable ChangeLocalityDetector produced scope when the reference was changed in languages other than Java/Kotlin, because the rules might be different there. Instead, move that logic inside the java/kotlin ChangeLocalityDetectors

GitOrigin-RevId: 4aafa966186fe038c25e0a2512c80ba1b1d93eeb
2024-08-26 17:04:03 +00:00
Tagir Valeev
deec897dd4 [java-analysis] MutationSignature: startsWith -> equals (IDEA-355908)
GitOrigin-RevId: 7f344d27d39416cfe160c0ad648d625034e1a03d
2024-08-26 16:33:36 +00:00
Max Medvedev
1729cd94d5 cleanup JavaTelescope
GitOrigin-RevId: 881c66ff97088cd4e97cf2567c9fd7935578ddf0
2024-08-25 16:36:01 +00:00
Mikhail Pyltsin
e01d24d5c8 [java-highlighting] IDEA-357866 Spurious "Different case kinds used in the switch" error on incomplete code
- fixes
- not double error messages

GitOrigin-RevId: 8f789243ee4e09d3eb8de6a2db7dcbe25ee517db
2024-08-22 16:03:56 +00:00
Bas Leijdekkers
1a5e213e96 Java: "Suppress for <x>" fix should not make code uncompilable (IDEA-358115)
GitOrigin-RevId: 754d0bac805a0e9d56489c63e5486d6e7e15a4db
2024-08-22 15:27:14 +00:00
Mikhail Pyltsin
e39d914c56 [java-highlighting] IDEA-357868 Better error message for primitive types in instanceof
GitOrigin-RevId: bb638cf01ec27474d89859c27c5410add6be5931
2024-08-22 09:22:53 +00:00
Bas Leijdekkers
7db980cfcf Java: remove unneeded ':' from inspection problem report
GitOrigin-RevId: 9b0c070c8ca2a883d0d07f0064b67f22594cbced
2024-08-21 09:12:08 +00:00
Bas Leijdekkers
bd7f1f4270 Java: proper order of 'true' and 'false' in quick-fix name (IDEA-357973)
also fixes internationalization and the incorrect comma in the name
for "Create missing switch branches" quick-fix

GitOrigin-RevId: 16285e054447d8d15318df8889499bbbf91243a7
2024-08-21 09:12:08 +00:00
Mikhail Pyltsin
5b107c226b [java-property-tests] UninitializedReadCollector supports PsiForeachPatternStatement
GitOrigin-RevId: 9d52770fcc09b9c64a2db8d5449eb5c7277f7cd5
2024-08-19 17:36:49 +00:00
Mikhail Pyltsin
c56e5e7313 [java-inspections] IDEA-357725 LoggerInitializedWithForeignClassInspection should skip when the logger is the final field
GitOrigin-RevId: e910d9bb094f058c363148a3d08b695276bcc2c6
2024-08-15 18:02:00 +00:00
Bas Leijdekkers
adbb319537 Java: handle multiline headings a little better (IJ-CR-142291)
GitOrigin-RevId: 0c132d6b41dfc634c15bbe47d8176612909cf3f7
2024-08-15 15:56:37 +00:00
Bas Leijdekkers
a12f4edd1a Java: Use "isMarkdownComment()" (IJ-CR-142291)
GitOrigin-RevId: 24c203a2c93286e733933c554ad338db460a313f
2024-08-15 15:56:37 +00:00