Commit Graph

5222 Commits

Author SHA1 Message Date
Bas Leijdekkers
d0adc5895a Java: fix good code is red super() call problem 3 (IDEA-340994)
"Cannot reference class before supertype constructor has been called"

GitOrigin-RevId: 70471c3f1a58c5c57ab229e24d39baa1794b8e72
2023-12-15 12:27:55 +00:00
Bas Leijdekkers
6b8d6303b4 Java: fix good code is red super() call problem 2 (IDEA-340994)
"Cannot reference class before supertype constructor has been called"

GitOrigin-RevId: 510ee2de490dce949a0926303de39e69c998e6e3
2023-12-15 12:27:51 +00:00
Bas Leijdekkers
0b42cca24f Java: fix good code is red super() call problem 1 (IDEA-340994)
"Cannot reference method before supertype constructor has been called"

GitOrigin-RevId: c65ab2d636671ec192dbdbec67c0afd494224fd9
2023-12-15 12:27:47 +00:00
Mikhail Pyltsin
58e3af039d [java-highlighting] IDEA-340604 Improve an error message for unresolved references for implicit classes
GitOrigin-RevId: a4f319c4e48053ec57bce1e171f61d665154ed55
2023-12-14 19:49:24 +00:00
Mikhail Pyltsin
ed67eee493 [java-inspection] IDEA-340576 Uncompilable code generated for switch pattern matching
- class, which has permitted list, doesn't have `sealed` modifier, process this class as sealed

GitOrigin-RevId: afaccb6f6479c90ad431b9300a586854e89ea204
2023-12-14 19:49:13 +00:00
Mikhail Pyltsin
43ad0b4707 [java-inspection] IDEA-281947 Useless pattern guard not suggested for removal
- remove guard if it is always true

GitOrigin-RevId: 168a103e93a42c9a82657abffcbd7626047cab3d
2023-12-14 19:49:09 +00:00
Bas Leijdekkers
88bd39ef0d Java: remove spurious error highlighting (IDEA-340885)
GitOrigin-RevId: 955d86aca0ceb262cee8f3ae5744856108eeb412
2023-12-14 16:13:39 +00:00
Tagir Valeev
46e00356c2 [java-highlighting] IDEA-340618 Update String templates type and exception for Java 22
GitOrigin-RevId: fc208b0f19ef048bce0baf462b227f6b16d34a2f
2023-12-13 15:22:17 +00:00
Bas Leijdekkers
463df28ff9 Java: fix bad code is green issue (IDEA-340583)
"cannot reference this before supertype constructor has been called"

GitOrigin-RevId: a3ad20e76d749a97b51a1c4d962d491029b6a7b2
2023-12-13 12:14:18 +00:00
Aleksey Dobrynin
131bfc4609 [java] add default static imports
GitOrigin-RevId: 746402d1272aa0a410abbbfb18bd8571f545029c
2023-12-13 11:31:37 +00:00
Mikhail Pyltsin
45b4e8e23c [java-intentions] IDEA-340601 allow creating methods in ImplicitClass
GitOrigin-RevId: 1e0cd613359f27e889df5cf03ce535c1a1a99ca7
2023-12-12 20:14:00 +00:00
Tagir Valeev
d8175c6e01 [java-inspections] ReplaceConstructorWithFactoryAction: turn off in implicit classes
GitOrigin-RevId: 2d2e3691b2127ab193226009f4dc5c5d86e40843
2023-12-12 14:11:42 +00:00
Mikhail Pyltsin
257b0938c1 [java-highlighting] IDEA-340048 Incorrect reference highlighting in implicitly declared classes
- test is improved

GitOrigin-RevId: 09b79f74426d01c893257d42fe284b0a1b9495bf
2023-12-12 12:25:47 +00:00
Tagir Valeev
6e1d684df0 [java-inspections] UseHashCodeMethodInspection: support double type
Also: fix comment processing
Improvement of IDEA-338114

GitOrigin-RevId: 87d057ccbea4262c40e2717c2ea3c004ac9865b0
2023-12-11 21:37:14 +00:00
Mikhail Pyltsin
9f280818c9 [java-highlighting] IDEA-340048 Incorrect reference highlighting in implicitly declared classes
GitOrigin-RevId: ab40db645c83da5c715b4b09ef58c873a7dccfd3
2023-12-11 21:05:52 +00:00
Mikhail Pyltsin
3f86cf9292 [java-highlighting] IDEA-339935 JEP 463
- rename unnamed classes to implicitly declared classes

GitOrigin-RevId: 2c6d7f16a1dc6d2371b8f8b5f5675246c9bc99f9
2023-12-11 15:49:28 +00:00
Tagir Valeev
5b6191dd34 [java] "any" type parsing (early Valhalla prototype) dropped
It's unlikely that the final version of value types in Java will use this syntax.

GitOrigin-RevId: 382ec771eaac29c079cf48819f98fd155775b283
2023-12-09 11:55:52 +00:00
Mikhail Pyltsin
9aa54b1fd4 [java-highlighting] IDEA-340211 Unnamed variables, turn on for java 22 (JEP 456)
- turn on for java 22
- add more tests for java 22

GitOrigin-RevId: 62b25e768ef827da94acffc8a9054c6b5775254e
2023-12-08 17:13:29 +00:00
Tagir Valeev
b7d4e8a3b2 [java-inspections] UseHashCodeMethodInspection: fix inspection name, support boxed Long type
IDEA-338114, IDEA-339366

GitOrigin-RevId: 5e51384d160e29f3c81b99c9c50260cb883d9c46
2023-12-01 18:37:05 +00:00
Bas Leijdekkers
a50138d2c8 Java: improve javac quirks inspection texts (IJPF-CR-15669)
GitOrigin-RevId: fa038ac62b8f9e0a4fd56a483578741a353e0886
2023-11-29 20:30:35 +00:00
Tagir Valeev
853a7a46fc [mod-commands] Use RenamerFactory when executing rename to make it more similar to normal rename
Provide an interface to specify suggested names from outside
Still part of IDEA-338334

GitOrigin-RevId: 7bb09b7150b463ed8a0c24453c968d60d9e716fa
2023-11-27 19:09:17 +00:00
Tagir Valeev
a8914e5c86 [java-inspections] IDEA-338478 Pattern variable can be used: support more narrow casts
Also, support the same in SimplifyBooleanExpressionFix (IDEA-336123)

GitOrigin-RevId: 240383f6ca67d8b7734ac51a6fe8781538e4f254
2023-11-22 20:31:30 +00:00
Tagir Valeev
08632d3227 [java-inspections] SimplifyBooleanExpressionFix: disallow retarget to existing pattern variable if variable was changed (IDEA-336123)
GitOrigin-RevId: 82ce60a815b80bad2593de8f5a20af7e53acb5c7
2023-11-17 18:11:01 +00:00
Tagir Valeev
51849dbdf2 [java-inspections] SimplifyBooleanExpressionFix: retarget to existing pattern variable (IDEA-336123)
GitOrigin-RevId: c3e7f12fb11926084fa8a71467394635d1cfc5d9
2023-11-17 18:10:58 +00:00
Tagir Valeev
66d4dad965 [java-inspections] SimplifyBooleanExpressionFix: resolve name conflicts when retargeting the variable (IDEA-336123)
GitOrigin-RevId: 022886c909025e09655ab8704c6b095adc9a4bd8
2023-11-17 18:10:56 +00:00
Tagir Valeev
ff15d064cd [java-inspections] SimplifyBooleanExpressionFix: try to move pattern variable to another instanceof when possible
Fixes IDEA-336123 "Constant values" fix produces red code when pattern variable is removed

GitOrigin-RevId: 7faf8dd77569c21d69a9a7226d6db1b0097f9231
2023-11-15 21:43:24 +00:00
Tagir Valeev
2770254f2f [java-inspections] IDEA-338114 Suggest to replace (int)(v ^ (v >>> 32)) with a Long.hashCode(v)
GitOrigin-RevId: 2d9591f9d9a558c4a61ac226556ef9f551d6e0c2
2023-11-15 21:43:17 +00:00
Tagir Valeev
3f0c4e919a [java-inspections] SameErasureButDifferentMethodsFix: ModCommand
GitOrigin-RevId: 5fbc113100be4f0d0dfcbf32f97342a69b089b39
2023-11-14 11:01:24 +00:00
Mikhail Pyltsin
87dc3f3fbf [java-highlighting] IDEA-289314 Missing highlighting for nested type annotations on static types
- annotations are checked recursively

GitOrigin-RevId: a8343f6bbfbf2dd39b29dad8ce1e989e71a0e549
2023-11-13 17:04:49 +00:00
Mikhail Pyltsin
8adeaf3193 [java-highlighting] IDEA-306108 Assignment to a variable with non-denotable type: confusing error message and useless quick-fix
- add `anonymous` when it is not clear what type is used

GitOrigin-RevId: f3395a590fd4a48a5570fdf9ace540845e5f3879
2023-11-13 17:04:45 +00:00
Bas Leijdekkers
b3d096b7fc Java: create constant from usage when non-constant is not compilable (IDEA-337261)
GitOrigin-RevId: 5be5a1c196902431a582768fbc461d0d09b14aac
2023-11-09 21:59:18 +00:00
Alexey Kudravtsev
5aba03d2ea cleanup: inline some test data to make it easier to modify
GitOrigin-RevId: 24d99b677e7c0e143ae343ecc69a682ae10e3a26
2023-11-08 15:29:41 +00:00
Bas Leijdekkers
0124a1c191 Java: allow Create field from Usage on records (to create static field, IDEA-337138)
GitOrigin-RevId: b541e7958b4636dbcd84ea4ee35f96e0e8f04e6c
2023-11-06 11:17:07 +00:00
Bas Leijdekkers
38649ac539 Java: create dependent constant from usage in interface correctly (IDEA-337008)
GitOrigin-RevId: 3afbc697d94e692278ea74fe73fa3bc8982e50af
2023-11-06 11:17:04 +00:00
Bas Leijdekkers
5fb47bfc3e Java: make "Create enum constant" quick-fix more available (IDEA-239983)
GitOrigin-RevId: b0d9510a97e4d5af5c6dea8e640938268b7874c4
2023-11-06 11:17:00 +00:00
Bas Leijdekkers
60a6cb2a00 Java: Provide better error message - illegal forward reference (IDEA-337031)
GitOrigin-RevId: 789b0bca6e6b1f9d0d366cd20a011c194cf1af0d
2023-11-06 11:16:57 +00:00
Bas Leijdekkers
8cbdbab21a Java: move old check to quirks inspection
GitOrigin-RevId: f1201462a504c09c1d4ca10e813c343d03be55ac
2023-11-06 11:16:53 +00:00
Bas Leijdekkers
13826505b1 Java: improve error message - repeated modifier (IDEA-330995)
GitOrigin-RevId: c2e4ddef81f2df01c0cd16ebc989f8130d255056
2023-11-01 16:15:17 +00:00
Mikhail Pyltsin
3d7a18e986 [java-highlighting] IDEA-315469 Quickfixes for switch labels with 'default'
- fix to reverse 'case default, null'
- fix to replace 'case default' with 'default'

GitOrigin-RevId: 3762a40c859bb7a13a638614b3200b0005d8e85a
2023-11-01 10:23:57 +00:00
Bas Leijdekkers
8925dcb722 Java: highlight bad \s escapes instead of entire literal (IDEA-336833)
GitOrigin-RevId: 411d46f84e960631d9b7cb31604c1c6e86fa2a51
2023-10-31 23:25:40 +00:00
Aleksey Dobrynin
eb3bf098b3 [java, fix] support creating static methods for inner classes IDEA-310703
GitOrigin-RevId: bcb0a09fd5d3e92957b4543880c5ef4640eb4d8f
2023-10-31 18:52:22 +00:00
Aleksey Dobrynin
a9510604c5 [java, fix] add missing STR processor IDEA-333509
GitOrigin-RevId: 10a42247d542ea3a67a1a9692c133adc0e25fc7c
2023-10-30 23:36:35 +00:00
Tagir Valeev
33ca32a1bc [java-intentions] ReplaceImplementsWithStaticImportAction: ModCommand
GitOrigin-RevId: 53f1e33ee88b8336a3cd20d55bd640cfbc88c580
2023-10-26 10:47:21 +00:00
Tagir Valeev
b59721ab73 [java-inspections] CreateTypeParameterFromUsageFix: mod-command
Part of IDEA-322693 Migrate as much as possible Java intentions and quick-fixes to ModCommand API

GitOrigin-RevId: 898bf526ac0700c29641e09ffccd10bf2a7ab3f1
2023-10-24 17:00:37 +00:00
Tagir Valeev
f94d4a27d9 [java-inspections] AddExceptionToThrowsFix, AddRuntimeExceptionToThrowsAction: mod-command
Part of IDEA-322693 Migrate as much as possible Java intentions and quick-fixes to ModCommand API

GitOrigin-RevId: 4ae648a956c9a33b5649aa6ffff99a6fa9a18f71
2023-10-24 16:54:37 +00:00
Tagir Valeev
116aeed551 [xml] HtmlUtil#getStartTag: support tags with digits, like <h2>
GitOrigin-RevId: c3997423c38ade8a759aa086bc7d788c18e834b8
2023-10-16 20:19:26 +00:00
Roman Ivanov
426dfe92a6 do highlighting when the file name of the unnamed class is not a vaild identifier IDEA-333231
GitOrigin-RevId: 25df95741ad34a814e8e61bd0928a01b98589ce6
2023-10-12 17:37:47 +00:00
Mikhail Pyltsin
299b7e468b [java-highlighting] IDEA-334683 (EA-921945) anonymous classes and local classes must not inherit sealed classes
- fix for completion
- fix for error highlighting

GitOrigin-RevId: 337131aab1bc7473711ffc078175b5adba34f30d
2023-10-12 11:53:56 +00:00
Alexey Kudravtsev
e1e3a31e1b cleanup: move "accessibility can be weaken"/"class in the wrong package" inspections out of the way of testing suppression
GitOrigin-RevId: b9a76fc3cc4cad29a3babcb35fac27477fd68116
2023-10-11 11:13:02 +00:00
Tagir Valeev
77d1d0ab2e [java-tests] Mock JDK 21 (downloaded from the repository); remove in-place mocks where possible
Part of IDEA-334171 Store MockJDK in artifact repository, rather than in Git

GitOrigin-RevId: 9c6214e3ead47cc164d20813f5a2b37136607213
2023-10-06 10:48:24 +00:00