Commit Graph

100 Commits

Author SHA1 Message Date
Tagir Valeev
aa6829d7c1 [java-tests] IDEA-333831 Separate mock JDK and JetBrains annotations for testing
Also: avoid manual mocking of Java 10 classes in StreamCollector10Inlining test, use mockJDK11 instead
Also: rewrite SliceTestCase and its inheritors to LightJavaCodeInsightFixtureTestCase, as annotations.jar is not included into project created by DaemonAnalyzerTestCase
Also: 'mutates' attribute of @Contract annotation is resolvable now, as we can use newer jetbrains-annotations library.
Also: documentation tests now don't generate links to JetBrains annotations, which corresponds to the actual behavior in production

GitOrigin-RevId: e460826893c1277cb2b78b18aae9d5aca97d8333
2023-10-05 11:24:29 +00:00
Vladimir Krivosheev
50249d22c1 IJPL-238 fix BytecodeAnalysisResultsHighlightingTest
GitOrigin-RevId: 89b3726e70b73061b2b3abd6e9818a046b3e6209
2023-09-15 20:50:23 +00:00
Bas Leijdekkers
edfa8f41a5 Java: update "Non-terminal use of '\\s' escape sequence" now that PsiTemplate is not an expression anymore (IDEA-326944)
GitOrigin-RevId: cea018045f87fad01824bf68ebf10ecdb798e39d
2023-08-04 19:58:18 +00:00
Bas Leijdekkers
0431049876 Java: report \s in char literals (IDEA-325541)
GitOrigin-RevId: c933d7e21c35b263f62ee3cab43b3fca9a0696ff
2023-07-19 16:08:33 +00:00
Bas Leijdekkers
4fd8f46362 Java: avoid adding unnecessary parenthesis when replacing (IDEA-321503)
GitOrigin-RevId: d64dcbe79e592b6b814d32695b0c4681af641031
2023-07-12 09:21:00 +00:00
Nikolay Chashnikov
91d3e0a72b cleanup: remove redundant '@author' tags from javadoc comments - 26
Now we have Code Vision hints which determine the author via Git history and show it in the editor automatically, and this information is more accurate than the tags which were automatically added when files were created.

GitOrigin-RevId: 535941a4b79bc36c173a27f3e505b43ffc85edc1
2023-01-18 17:02:50 +00:00
Aleksandr Izmailov
1555d664b6 [blocking calls detection] IDEA-310256: handle implicit constructor calls
GitOrigin-RevId: d550a9ad10d014116378fd4800cff7b72b7b51c1
2023-01-12 17:36:33 +00:00
Tagir Valeev
c0f509d780 [java-inspections] EscapedSpaceInspection: proper unicode escape support
GitOrigin-RevId: 4595d28c6b09fa8ab5e1afe63cc34f95c5a17a86
2022-10-27 09:29:11 +00:00
Tagir Valeev
ba7878377e [java-inspections] EscapedSpaceInspection: do not report \s at the very end of text block
GitOrigin-RevId: 79fefb0845663c2624452480b17c5d00cc4ed0d0
2022-09-29 12:58:39 +00:00
Tagir Valeev
6ffb7e417e [java-dfa] Extract "Constant conditions" into separate "Constant values" inspection (IDEA-58235)
GitOrigin-RevId: 95a81fcd1546afec31afc2a044a9ba5fa1337411
2022-09-08 21:30:59 +00:00
Tagir Valeev
94528b7c67 [java-inspections] EscapedSpaceInspection: fix 'Fix all' action (do all the fixes in a single literal even without fix-all)
GitOrigin-RevId: d5fa9d51b3b8e911c599be1381b2a9e6a2041223
2022-07-29 17:55:08 +00:00
Tagir Valeev
aaa9392f8b [java-inspections] IDEA-298388 "Java | Code style issues | Non-terminal use of '\s' escape sequence" false positive
GitOrigin-RevId: 3e7989a3bf971e7b6be613abee893cbe334dde31
2022-07-25 16:07:09 +00:00
Tagir Valeev
a32d6613f7 [java-inspections] EscapedSpace: do not warn when there's a sequence of '\s' symbols; fix description
GitOrigin-RevId: b24a80bb7a292a1e16fd15d9393f17a2aab7b529
2022-07-13 19:29:07 +00:00
Tagir Valeev
c2c6689387 [java-inspections] IDEA-297407 Report uses of "\s" in string literals except at the end of the line in text blocks
GitOrigin-RevId: 87188f09412069b9410adf0d7a25db8bc7523c7c
2022-07-07 15:47:32 +00:00
Tagir Valeev
23019ddc39 [java-inspections] Avoid suggesting fix to cast when there's already erroneous <>
EA-538954 - AE: JavaParserUtil.parseFragment

GitOrigin-RevId: ee4c363d853cfd46285ee73381d69843b0560e6d
2022-06-15 11:38:59 +00:00
Tagir Valeev
5bbf1bb169 [java-inspections] Disable Insert '<>' fix when target type is raw
GitOrigin-RevId: 34c510ff233c039761d569e10a8a0d1520f1cbba
2022-05-17 08:48:47 +00:00
Tagir Valeev
1a074156ac [java-inspections] IDEA-293884 suggest auto-fix that adds diamond-operator for raw-type constructor invocation
GitOrigin-RevId: 983efe0042b584b07487619b1ed2b040abeda6d6
2022-05-12 13:47:10 +00:00
Andrey.Cherkasov
54d96d4525 [java-inspections] SillyAssignment: warn of assigning array element to itself
IDEA-254504

GitOrigin-RevId: 64c608f339c5c417848d7e82b378acb1d0dd3ac2
2022-04-27 21:58:22 +00:00
Tagir Valeev
657a344286 [java-inspections] Missing test added properly
GitOrigin-RevId: 73b1a299cda8fa84bdedb980f1826b5014e4b8a9
2021-10-21 04:59:15 +00:00
Tagir Valeev
308d1fd0e6 [java-inspections] LambdaUtil#isSafeLambdaReplacement: check whether functional interface type matches exactly
GitOrigin-RevId: 04b67615268182a09ce3a211547dc8213997eb58
2021-10-20 13:09:36 +00:00
Tagir Valeev
ed28503329 [java-inspections] ComparatorCombinatorsInspection: add explicit lambda parameter type when necessary
Fixes IDEA-279693 Replace with Comparator.comparing leads to red code
Also: improve RedundantLambdaParameterTypeInspection via isSafeLambdaReplacement

GitOrigin-RevId: 8125436ff758fe3e4a770b33933a94e44be199fb
2021-10-09 13:28:55 +00:00
Tagir Valeev
bdd7c56ba9 [java-inspections] IDEA-279333 Raw type inspection: provide fix on casts where using upper bound is possible
GitOrigin-RevId: 83ce4e9ddc79785e8b10859e5213b1fcf1709b2e
2021-09-30 10:57:36 +00:00
Yuriy Artamonov
9d7c5caf91 [java] Consider @Blocking and @NonBlocking on classes in BlockingMethodInNonBlockingContextInspection
GitOrigin-RevId: d3a486b85659c78901a326f08ebadeadd8e656ab
2021-09-05 16:21:13 +00:00
Yuriy Artamonov
f8d9ea5845 [reactive-streams] IDEA-277288 Provide better explanation for 'inappropriate method call'
GitOrigin-RevId: c167d2ab84ebbfe97173b412c3d0e0087e66f92d
2021-09-02 14:03:25 +00:00
Tagir Valeev
231c892de2 [java-analysis] Test for IDEA-266180
GitOrigin-RevId: bf9e92df66a2b0abf56230cefa04887abc847b22
2021-04-23 08:39:03 +03:00
Tagir Valeev
7b359df0e1 [java-inference] Avoid -> new; pure contracts on methods returning Collection or Map
We assume that such methods return local object. However, we also assume that Collection/Map size is its field. But in fact, it may delegate to another collection

Fixes IDEA-266180 Constant conditions & exceptions false positive with Guava Lists

GitOrigin-RevId: ba6f76bd1b34b1b9503b4be1ce85119ba54f6b3e
2021-04-09 05:13:19 +00:00
Tagir Valeev
5a04ca5310 [java-inference] Failure contract: better null->fail inference (IDEA-230802)
GitOrigin-RevId: 778b9be125871e9002c719fb50f205a202439b2f
2021-03-11 11:27:57 +00:00
Tagir Valeev
b4c69a9cec [java-inference] Failure contract inference improved
GitOrigin-RevId: 687b4c909c1d2ae67d519ec71899d52fa3e29434
2021-03-11 11:27:56 +00:00
Tagir Valeev
da4a1cc6a5 [java-analysis] Purity solver optimizations
1. Stop loading equations if the solution is definitely impure and return value is known
2. Replace "mutates" map with single value in MethodAnnotations

GitOrigin-RevId: 1fd25b97060b3f5a3c9ce3b22c24baa10d35a6f7
2021-02-05 10:51:47 +00:00
Andrey.Cherkasov
a6eed6fda2 IDEA-261081 Raw type inspection suggests using captured type
GitOrigin-RevId: dfe29e0b42ab083e8721583cb3928e4eff1a49f9
2021-02-04 00:06:40 +00:00
Tagir Valeev
c5c09c693a [java-analysis] Hard-code that Throwable.initCause is mutates_this
This allows contract inference for methods like AssertionError(Object) constructor.
Fixes IDEA-260003 A warning is shown when Optional.get is called even when Optional.isPresent is verified before

GitOrigin-RevId: 548008f5462b828e0346f089474182f59ec39bd1
2021-01-22 12:55:45 +00:00
Andrey.Cherkasov
48e696ee5d IDEA-224606: Merge RawUseOfParameterizedTypeInspection and RawTypeCanBeGenericInspection into one inspection
GitOrigin-RevId: c47c2210c6718617c8a14a18b31607cda9d45e11
2021-01-14 07:45:13 +00:00
Tagir Valeev
7272dee697 [java-inspections] IDEA-253317 Warn when record component annotation is overridden by explicit member
GitOrigin-RevId: 0a4d9eff57219873c09661321899340d00ae6e73
2020-10-22 11:17:31 +00:00
Ilyas Selimov
80ee8725fd IDEA-238099 - moved test cases to an appropriate place, fixed an error which could lead to unexpected element deletion
GitOrigin-RevId: f79de804e604675868d58715b65fd291da8e5483
2020-05-21 15:25:59 +03:00
Ilyas Selimov
003a9988e5 IDEA-238099 - handled the case of chained variable assignment, which has been led to compilation failure, refactoring
GitOrigin-RevId: 4c85a2e582fc60fedfed55618fdeb05a740cfdf4
2020-05-20 18:27:41 +03:00
Tagir Valeev
d17aa59d6d IDEA-237601 Infer mutation signature from the bytecode
GitOrigin-RevId: d3c47f6a35f948f65f5d447d8561044d7ec9ce23
2020-04-14 12:31:00 +00:00
Tagir Valeev
097416297a Duplicate class files removed
GitOrigin-RevId: 7fa735dd7eaefadc358d6c6876f71d5fa2d14e2e
2020-04-14 12:31:00 +00:00
Peter Gromov
a79c3fd906 avoid endless recursion prevention in RedundantLambdaParameterTypeInspectionTest.testTypeParam
GitOrigin-RevId: e4e5b0b88dd72646d440d7cdf25d8d4ee41c29f1
2019-12-09 17:04:58 +00:00
Tagir Valeev
6ed3465b66 BytecodeAnalysisIndex: use faster hashes; encode key in 12 bytes instead of 14
Bytes per class in integration test reduced from 2083 to 1900

GitOrigin-RevId: 1c0e84b6c70869283e9db48b718e44e78dc3c554
2019-11-07 02:40:58 +00:00
Tagir Valeev
79cc904ff9 BytecodeAnalysis: infer @NotNull for static final fields (for now: non-branching clinit only)
Fixes IDEA-223861 Infer static field nullability from the bytecode

GitOrigin-RevId: 2ee3102df5677e567defbe849900769237a728bc
2019-10-02 10:07:03 +00:00
Rustam Vishnyakov
123242c4b2 EditorConfig documentation test
GitOrigin-RevId: fd52ace3d7a32ecd02c2c5ab90e077967604c15e
2019-06-16 04:03:21 +03:00
Egor Zhdan
c1813cfb52 Cleanup: NotNull/Nullable
GitOrigin-RevId: b8e892f32ea84c2115973155dba7127b892cc36e
2019-06-16 04:02:08 +03:00
Anna Kozlova
91f7445298 constructor reference: don't ignore constructor parameters during method reference inference (IDEA-185578)
GitOrigin-RevId: e836468e05db28157713e9edd3c70382f8ecdebc
2019-06-13 03:15:49 +03:00
Egor Zhdan
39d2d77155 Cleanup: NotNull/Nullable
GitOrigin-RevId: b8e892f32ea84c2115973155dba7127b892cc36e
2019-06-13 03:14:35 +03:00
Dmitry Avdeev
83f21c7197 Merge remote-tracking branch 'origin/master'
GitOrigin-RevId: 211e84dab4063848c1d3d835a526271ee1466636
2019-05-07 17:03:19 +03:00
Dmitry Avdeev
f9664fc455 IDEA-211555 Freeze on completion in XML file
do not process xincludes in ExtensionDomExtender

GitOrigin-RevId: d631dcd52d5bf500b61960473e16237008ad02a3
2019-05-07 17:02:41 +03:00
Alexey Kudravtsev
5910039653 attach JDK Annotations automatically on JDK creation to fix IDEA-211771
GitOrigin-RevId: 975cffd646b68abb31a61eb6ac50de264c428cdc
2019-05-03 03:07:50 +03:00
peter
506f7989e0 Revert "IDEA-201136 Update velocity library to 2.0"
it's too troublesome and has no clear benefits for now
we can return to this when we have more convincing reasons to upgrade than just "it's too old"
2019-01-14 22:18:42 +01:00
peter
c1d1037f47 IDEA-201136 Update velocity library to 2.0 2019-01-02 12:59:17 +01:00
Tagir Valeev
5422868682 BytecodeAnalysisIntegrationTest: depend on exact versions of velocity and collections 2018-10-26 16:00:05 +07:00