Tagir Valeev
655bf65a7d
[java-refactoring] Inline variable: ignore references from method calls
...
Fixes IDEA-356914 Exception in Inline variable on red code
GitOrigin-RevId: ca785f72ba4b99fed0a0f3410a21df7dd13b7c5a
2024-08-02 14:18:00 +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
c72b96d481
Java: enable Pratt parser by default (IDEA-305898)
...
GitOrigin-RevId: 597cfc30aeff88a7791e9e185b5c08426844d4da
2024-08-01 12:35:28 +00:00
Bas Leijdekkers
c8215f8fbc
Java: more sensible parse of incomplete binary expression (IDEA-305898)
...
GitOrigin-RevId: 3d3b59be1621fea7a4702109e1d654b47c5c76f7
2024-08-01 12:35:28 +00:00
Bas Leijdekkers
c122a5897f
Java: remove heavily broken code from test data(IDEA-305898)
...
GitOrigin-RevId: 4bffa1842be6eaa4e9a48b8b5ee0ec381a6ff93f
2024-08-01 12:35:28 +00:00
Mikhail Pyltsin
4a9f1b4fee
[java-inspections] IDEA-356945 'insert default branch' suggests uncompilable code
...
GitOrigin-RevId: 44f277da31601775e3ce75021155bf7c37a6311c
2024-08-01 12:29:33 +00:00
Mikhail Pyltsin
1c6e73ad39
[java-inspections] IDEA-356841 Convert to switch expression generates invalid code on line comments
...
GitOrigin-RevId: 840ad7d5fe656b7cc443b67df30f60b0bb35b41d
2024-08-01 12:29:33 +00:00
Alexandr Suhinin
ed6d7fbc6d
[extract method] IDEA-356707: simplify and speedup name suggestion
...
GitOrigin-RevId: 5a8baeec399127391f8e2069e6915f322c524458
2024-07-31 14:26:46 +00:00
Tagir Valeev
90543d0e24
[java-inspections] InlineVariableFix: avoid PSI writes after highlighting
...
Highlighting causes PSI commit and reformatting. It looks like modifying PSI after that may cause problems. Probably we can fix it later in ModCommand API, but for now we can just reorder things.
Fixes IDEA-355992 "Inline variable" quick-fix doesn't work if the variable initializer is on the next line
GitOrigin-RevId: f0a2418ac5618f91291b1f74ad2168d26c612447
2024-07-31 11:41:55 +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
Bas Leijdekkers
0274e2096d
Java: remove unuseful parser test (IDEA-305898)
...
GitOrigin-RevId: 1af85dda474342a1b70bedfd17ab6b469b93465c
2024-07-30 22:37:25 +00:00
Bas Leijdekkers
c014a1f2f1
Java: render incomplete polyadic expressions correctly (IDEA-356837)
...
GitOrigin-RevId: 6b9de40ba5ba85a0a27a1e7e8f85150058510fc9
2024-07-30 22:37:25 +00:00
Tagir Valeev
330a18544a
[java-dfa] Ignore type annotations hierarchy on local variables
...
Fixes IDEA-348069 Local variable holding result of JSpecify-`@Nullable`-annotated method in `@NullMarked` package is unexpectedly non-null
GitOrigin-RevId: c43ef9636dd903250ae698d30e571d2df7f793d8
2024-07-30 16:34:11 +00:00
Tagir Valeev
01e84b64d3
[java-inspections] Annotate parameter as Nullable: support record components (IDEA-356915)
...
GitOrigin-RevId: d9d972ba2559077b345aa65e447f7b24025be23c
2024-07-30 16:34:11 +00:00
Georgii Ustinov
6a72b8abb5
[Java. Code Formatting] Fix broken test for newline in method call arguments
...
IDEA-165216
GitOrigin-RevId: fb63484f5410c3e4749f3453fd87d5b9ca25a645
2024-07-29 19:15:53 +00:00
Georgii Ustinov
c9243c5975
[Java. Code Formatting] Add new tests to JavaFormatterNewLineAfterLBraceTest
...
IDEA-165216
GitOrigin-RevId: 313a43a7c081c604ca96be3b68f231a18d998650
2024-07-29 19:15:53 +00:00
Georgii Ustinov
5813964716
[Java. Code Formatting] Add tests for idempontent formatting for java method declarations
...
IDEA-165216
GitOrigin-RevId: cc5cd68d5c16b737052765809c075d4a473fa7ad
2024-07-29 19:15:53 +00:00
Mikhail Pyltsin
d186699847
[java-inspection] IDEA-355916 update implicit<->explicit classes inspections
...
- tests
- optimize imports
- ReplaceOnDemandImportIntention supports module imports
GitOrigin-RevId: 228135179fc26f44064dd196ae70326fd91fb3ee
2024-07-26 12:44:48 +00:00
Mikhail Pyltsin
7b0eaea1e9
[java-inspection] IDEA-356474 Support JEP 477: support implicitly imported modules in optimize imports
...
GitOrigin-RevId: d4fb59ccffbf0a51f97b1ba965f2d0d59834940e
2024-07-26 12:44:48 +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
Mikhail Pyltsin
11f2d22415
[java-inspection] IDEA-356474 Support JEP 477: support implicitly imported modules in optimize imports
...
- added test
- the main logic was implemented in IDEA-356672
GitOrigin-RevId: cea8a71db91527ae175da2060c65423dec740b46
2024-07-25 09:33:08 +00:00
Mikhail Pyltsin
6d101f8467
[java-inspection] IDEA-356699 Support JEP 477. UnusedImportInspection doesn't support implicit imports and modules
...
GitOrigin-RevId: b3fbb9aea04067e704e3ef3dba9e16262e33b0c6
2024-07-25 09:33:08 +00:00
Mikhail Pyltsin
ee4964a9a9
[java] UnusedImportGlobalInspectionTest convert to string block
...
GitOrigin-RevId: cfa22e2d932d1dad579e907d2a7e018a8e277587
2024-07-25 09:33:08 +00:00
Mikhail Pyltsin
8f3e75e7db
[java-inspections] IDEA-356672 Support JEP 477. Incorrect intentions and actions with implicit imports
...
- improve ImplicitImportChecker to support modules
- check conflict for modules
- new method `PsiImportModuleStatement.findImportedPackage` is added
GitOrigin-RevId: 0d0f61916bdda17b8c9d9146a13aa8d6d0876bb1
2024-07-25 09:33:07 +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
Tagir Valeev
097332e117
[java-completion] IDEA-356400 Join lines adds \n outside text block literal
...
GitOrigin-RevId: 8afe6a733da77bb78e42feec646437af62400d23
2024-07-18 14:59:48 +00:00
Mikhail Pyltsin
d0c8d95e30
[java] IDEA-356446 Support module imports
...
- Support keyword completion
GitOrigin-RevId: 10dcdc049838efa601e6bf0bbaf180ab4a8556de
2024-07-17 18:18:57 +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
Mikhail Pyltsin
8ce06c83bb
[java-inspection] IJ-CR-135317 IDEA-352587 Support JEP 455: Improve conversion from if to switch
...
- fix naming
- add more tests
- check cases when variables can be assigned
- track primitive variables when new cases are created
GitOrigin-RevId: 84a77676a627cc0fffce8e7219daa2b1fd13949d
2024-07-17 18:18:57 +00:00
Aleksey Dobrynin
c96bc2d64f
[java, import-module] resolve "import module" jep 476 IDEA-355535
...
GitOrigin-RevId: 4a4ee8cfafdba657d062317d3e014061af69a3e4
2024-07-17 12:27:11 +00:00
SirYwell
f49ee04957
[java-inspections] Fix false warnings on signature polymorphic method lookup
...
PR#2804
Reviewed-by: Tagir Valeev <tagir.valeev@jetbrains.com >
GitOrigin-RevId: 28a1abe7b3d83e40737df88c5ce1d39933858755
2024-07-17 09:49:37 +00:00
Tagir Valeev
79a4788e62
[java-dfa] Fix additionMayOverflow for long values
...
It appears that one cannot represent additionMayOverflow as a negation of subtractionMayOverflow, due to the special handling of Long.MIN_VALUE
Fixes IDEA-356345 "Constant values" false-positive, when adding Long.MIN_VALUE to a negative number
GitOrigin-RevId: 5144b29023860aab3be05edbeffe7527b4793337
2024-07-17 08:36:52 +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
Eugene Zhuravlev
0143e8951f
adjust test data to test that only direct subclasses are affected
...
GitOrigin-RevId: 91017ce9dd9038879a7ce0e44a6c1dc9c2dfd000
2024-07-11 20:07:18 +00:00
Tagir Valeev
c53b8ee683
[java-dfa] TimeUnit.convert contract: returns first arg if qualifier is equal to the second arg
...
Also, report if the result is equal to the first arg (part of IDEA-172428)
GitOrigin-RevId: 1a9743305e75f1fdb772c7287e8cee0068bd31e1
2024-07-11 19:20:37 +00:00
Georgii Ustinov
b1466c2651
[Java. Code Formatting] Add migration test to JavaCodeStyleSettingsTest
...
IDEA-110857
GitOrigin-RevId: 99e5f481fd6a1351728d8194f56421bb23c07be1
2024-07-11 12:29:38 +00:00
Georgii Ustinov
029e881a2f
[Java. Code Formatting] Fix tests in JavaFormatterAroundBlankLines after new behaviour
...
IDEA-110857
GitOrigin-RevId: 61e86ace3749d42347ace6738c6b9f2a1a341148
2024-07-11 12:29:38 +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
Bas Leijdekkers
90930f2998
Java: handle reassigned parameters better (IDEA-256096)
...
for "Convert to instance method" refactoring
GitOrigin-RevId: 957b0b0cecf93f6ff849d4105ed864bc6ba99c8f
2024-07-10 19:17:56 +00:00
Bas Leijdekkers
610358505b
Java: stable method ordering for "Convert to instance method" (IDEA-356128)
...
GitOrigin-RevId: 81b2e38494d7792dfe3ec13703851e4eb1539e71
2024-07-10 19:17:56 +00:00
Mikhail Pyltsin
61eda5ef9f
[java-inspections] IDEA-356142 Support several unconditional cases in "Replace if with switch"
...
GitOrigin-RevId: 55d493b34da246aa205be0fab09bf538d25b49fa
2024-07-10 18:15:49 +00:00
Bas Leijdekkers
d3f94f2739
Java: test qualifiers shown in ui (IJ-CR-138368)
...
for "Convert to instance method" refactoring
GitOrigin-RevId: a4bb1ef732d71359e52ed778f9ad36c776533e47
2024-07-10 15:32:54 +00:00
Bas Leijdekkers
941612674c
Java: need to check if resolve is valid, otherwise there is no conflict (IJ-CR-138369)
...
GitOrigin-RevId: 2f895cdc66ded3ec8fb4c59843c1969e95f1c2d1
2024-07-10 15:32:54 +00:00
Tagir Valeev
02b38656a1
[java-inspections] ExpressionComparedToItself: do not duplicate reports of constant values (IDEA-345669)
...
GitOrigin-RevId: 4a7158afc602b12e7dbcf4d8d55a75c9a66f642a
2024-07-09 16:13:26 +00:00