Commit Graph

5392 Commits

Author SHA1 Message Date
Tagir Valeev
ac0c57748b [java-inspections] IDEA-346005 Add new inspection: Unnecessary keySet() call
GitOrigin-RevId: d1f1db0ae939017a8550b91cd8742dc222a8db99
2024-09-17 07:28:39 +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
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
Tagir Valeev
8ed70be46d [java-inspections] IDEA-359031 Preview API use warning: ignore imports
GitOrigin-RevId: d9ba762be3f03f60372a70471f4c04efc26a9a66
2024-09-11 12:08:36 +00:00
Tagir Valeev
9092a09789 [java-intentions] BindFieldsFromParameters: disable for existing field if static or type doesn't match
GitOrigin-RevId: ad1d93533626f5e76a3f53c5ab25b06a5aa07f1e
2024-09-10 23:44:56 +00:00
Tagir Valeev
0f2865b919 [java-intentions] DefineParamsDefaultValueAction: better check of possible signature conflicts
GitOrigin-RevId: 5eb26ee62852e2e5e6188e740b807c775ded0277
2024-09-10 23:44:55 +00:00
Tagir Valeev
cf460af83e [java-inspections] IDEA-358770 Stream/Optional desugaring: support Predicate.not
GitOrigin-RevId: af9cdb5e674406bbbe94a746e85a662a590a4d3d
2024-09-05 12:54:57 +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
ed81723f17 Java: don't evaluate constant for incomplete expressions
GitOrigin-RevId: 15542db6b8631edbc96bd7ea9cc2b1a975fcbcbb
2024-08-29 19:03:09 +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
Georgii Ustinov
940f66f53d [Java. Inspections] Add tests for not showing popup for add exception to method signature
IDEA-358300

GitOrigin-RevId: a7b8c716d772ae5ca631037ebb923bb796946af9
2024-08-27 10:05:40 +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
Mathias Boulay
d56883b763 fix(JavaDoc): formatter, inspections
GitOrigin-RevId: 77686401cbf38ea31e93311a608bac7472ccc73c
2024-08-26 10:42:10 +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
Mikhail Pyltsin
cd14483af8 [java-highlighting] IDEA-357866 Spurious "Different case kinds used in the switch" error on incomplete code
- improve error message

GitOrigin-RevId: 2a8da472e07dd10bdb0ae75e679b6056ab884b72
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
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
cb37003541 [java-inspections] IDEA-357323 Propose case null during adding all cases
GitOrigin-RevId: 6d7ffccc28d64ed0f52db0235c41796d1d81284e
2024-08-09 11:00:42 +00:00
Bas Leijdekkers
4426c2fc85 Java: create field from parameter with method type parameter type correctly (IDEA-357162)
GitOrigin-RevId: 3a9947fa58b394f0e0b5377fbe75702f3d4b8f6a
2024-08-06 10:48:28 +00:00
Bas Leijdekkers
24aaef624d Java: fix false positive on reference to enum constant (IDEA-357156)
GitOrigin-RevId: 7c833e46823ab41c9bdf275308ccee226d7e1a5f
2024-08-06 10:48:28 +00:00
Mikhail Pyltsin
ccf2a6bae5 [java-inspections] IDEA-356982 PsiImplicitClass is created for certain invalid code and renders the whole file gray
- skip implicit classes in unused analysis

GitOrigin-RevId: 6eb880108723b3623b0cc449d76f9f87942fc8b7
2024-08-01 16:00:34 +00:00
Bas Leijdekkers
a35a9f91ba Java: improve error highlighting for unknown annotation method
GitOrigin-RevId: 6fdb6e2f397280cf4795cbd09ddcc1461a5897ff
2024-07-30 22:37:25 +00:00
Bas Leijdekkers
1bdb332af2 Java: better error recovery on annotation parsing (IDEA-209573)
GitOrigin-RevId: a600121ecbd9fa6338237f0d3802486c7f8a5656
2024-07-30 22:37:25 +00:00
Tagir Valeev
1fe9c2e631 [java-intentions] Do not suggest to add a cast to new expression (except) upcast
Part of IDEA-356767

GitOrigin-RevId: e9f9e6c1a46ade85c14f20811444299e8aff0c17
2024-07-26 10:51:23 +00:00
Bas Leijdekkers
7f47f19875 Java: support for JEP 382: Flexible constructor bodies (IDEA-355054)
GitOrigin-RevId: f6146f9e06b0f618f1512b7b864532e126d7beda
2024-07-19 20:23:55 +00:00
Bas Leijdekkers
5b1dbe4383 Java: fix and improve error message (IDEA-356573)
GitOrigin-RevId: 0b3ff17ed8d439ff99ce1e2294a6fac2dcb83770
2024-07-19 20:23:55 +00:00
Bas Leijdekkers
291bb89726 Java:Highlight "Recursive constructor invocation" error on the constructor call (IDEA-356563)
GitOrigin-RevId: ec04cb0aa5b234ea9814d78400c83fa70e6bd29b
2024-07-19 20:23:55 +00:00
Mikhail Pyltsin
b0c458cfac [java-highlighting] IJ-CR-140387 IDEA-356470 Support jep 455. Generate true and false cases for boolean selector
- support constants, fix test

GitOrigin-RevId: 9f00f2d2a896af54e15e1ea72d35a473fddf18b8
2024-07-19 19:51:57 +00:00
Mikhail Pyltsin
01b39de56a [java-highlighting] IJ-CR-140387 IDEA-356470 Support jep 455. Generate true and false cases for boolean selector
- support constants

GitOrigin-RevId: ff51020da5086de2e59439647588e8b5c4ba4c85
2024-07-19 11:56:23 +00:00
Mikhail Pyltsin
0b30038602 [java-highlighting] IDEA-356470 Support jep 455. Generate true and false cases for boolean selector
GitOrigin-RevId: fbd879f172639f3db1b0d9c12f98fcb3868fa1a9
2024-07-18 20:11:33 +00:00
Mikhail Pyltsin
eee416a4e8 [java] IDEA-355777 Support implicit imports
- Support implicitly imported modules

GitOrigin-RevId: dbf10158847f652936c405a1ad20ce4dd04dbba7
2024-07-17 18:18:57 +00:00
Tagir Valeev
2c766e6df0 [java-inspections] TrivialFunctionalExpressionUsage: do not report for any parent statement
Also: report any lambda inside parent return statement
Fixes IDEA-356003 Method call should not be simplified

GitOrigin-RevId: cb39dd33d27ba402a503707daffcc831ab59b49e
2024-07-16 16:41:55 +00:00
Tagir Valeev
5778a45943 [java-inspections] FunctionalExpressionCanBeFolded: disable if qualifier subtype overrides default methods of function
Fixes IDEA-310524 "Method reference can be replaced with qualifier changes" suggestion changes behavior in unwanted ways. (Spring Security)

GitOrigin-RevId: f927ab534894188fa418a499c98af3a7c169b0cd
2024-07-11 11:02:28 +00:00
Mikhail Pyltsin
634c6b833b [java] IDEA-352189 Support JEP 455. Implement increase language level check and fix
- add more tests

GitOrigin-RevId: 2545d756cff9650487cc2b12c0b8b5390d1863e7
2024-07-05 11:34:47 +00:00
Mikhail Pyltsin
ff1ce5a0bd [java] IDEA-352189 Support JEP 455. Implement increase language level check and fix
GitOrigin-RevId: d69e01d624fcfc4ddb3af7292693ed056efc88a4
2024-07-04 15:25:05 +00:00
Tagir Valeev
174c24c450 [java-highlighting] Fix testdata (IDEA-355703)
We report less errors after [java-incomplete-model] Assume that any unresolved class-type is assignable to java.lang.Object

GitOrigin-RevId: a94eda62a430367a8fb1b5159fae4446a35687e1
2024-07-03 22:09:42 +00:00
Mikhail Pyltsin
f90bd8b6f1 [java-inspections] IDEA-355790 JEP 477. Suppress for class doesn't work
- These changes disable suppressions for implicit classes

GitOrigin-RevId: ff2fac065c092f257548bbfec5c799d48e116cac
2024-07-03 22:08:48 +00:00
Mikhail Pyltsin
07178b990f [java-highlighting] IDEA-355777 Support JEP 477: implicit imports
- support implicit import for java.io.IO
- reimplement implicit static imports

GitOrigin-RevId: 3e2650128d43b1cff40c21c0539869070c6094d0
2024-07-03 22:08:38 +00:00
Tagir Valeev
b023c1d252 [java-highlighting] error.unnamed.variable.brackets: proof-reading
GitOrigin-RevId: b30031e9d76de357434f48e71b099cf27d4b90e4
2024-07-03 17:42:16 +00:00
Bas Leijdekkers
a01eb76a76 [java] disable String Templates for Java 23 (IDEA-355055)
GitOrigin-RevId: cc2b3dfffd4fe0ba34a91b0d9f342e32304bfd2c
2024-07-03 16:10:48 +00:00
Bas Leijdekkers
6916b6b005 Java: better error message when there are more arguments than parameters (IDEA-336129)
GitOrigin-RevId: a17a5f0f3878b9baf211737a614d1aa1a5103d31
2024-06-28 17:14:56 +00:00
Mikhail Pyltsin
330ba98e01 [java] IDEA-354964 Migrate standard descriptors like JAVA_21 to TYPE_USE annotations
- fix NullableManager, when it can't find annotation in type

GitOrigin-RevId: 121927429534971abb4a50d1f670afbed9384045
2024-06-26 20:34:48 +00:00
Tagir Valeev
15bb3eb9f4 [java-incomplete-model] Support declared but unresolved exceptions
GitOrigin-RevId: 2e493f1820ce2e676708e191c0ff0b72b4ecaa59
2024-06-25 16:42:40 +00:00
Tagir Valeev
c93d4b68d2 [java-incomplete-model] Support unknown exceptions thrown from try block
GitOrigin-RevId: f968327e98f7f9804973c8ff9adf6366a5aec490
2024-06-25 13:54:11 +00:00
Tagir Valeev
838cf2d73c [java-incomplete-model] Assume that any unresolved class-type is assignable to java.lang.Object
Partially improves inference in incomplete mode

GitOrigin-RevId: 1d9c7c75afd524ea02980be8f96c19fba1eaaf54
2024-06-25 13:54:11 +00:00
Tagir Valeev
e377c6f30c [java-incomplete-model] Support concatenation with null-type expressions
GitOrigin-RevId: 19cdff4368ec690fb291f5eb25c381dbbba3cdd4
2024-06-25 09:23:05 +00:00
Tagir Valeev
7b5b0bd4e4 [java-incomplete-model] Support known constructors with unresolved components
GitOrigin-RevId: 12f529c3eae1abba306c6318f189d08c877f9aa7
2024-06-25 09:23:05 +00:00
Tagir Valeev
b6771f471e [java-incomplete-model] Fix unresolved method call with qualifier and incomplete hierarchy
GitOrigin-RevId: 94881c672bb3c1a5c3ea9dde381c6223a4996fca
2024-06-25 09:23:05 +00:00