Commit Graph

5462 Commits

Author SHA1 Message Date
Tagir Valeev
1e53d86ca5 [java-inspections] EqualsAndHashcode: do not report Java records that have hashCode but no equals (IDEA-264394)
GitOrigin-RevId: 15f83c984ebb807f9966407bf03a7e402c3ffded
2021-03-17 03:02:05 +00:00
Anna Kozlova
1d4af843d3 EA-260820 - SIOOBE: Type.getReturnTypeOffset
GitOrigin-RevId: 583cf1dff6d461e17d29b3033d8560170899ad86
2021-03-16 16:27:16 +00:00
Louis Vignier
170c838207 [java] Update inspection descriptions
GitOrigin-RevId: 1c55fac4ca08678e76aee02962ddf12153dd51cd
2021-03-16 14:56:20 +00:00
Louis Vignier
d830ccbf28 [java] Update inspection descriptions
GitOrigin-RevId: c9f960eb87b520f47644c31cdfabf03434ee9b59
2021-03-16 14:56:18 +00:00
Ilyas Selimov
64c30d9923 JavacQuirks - revert occasional fix
GitOrigin-RevId: 777bcca61b4515d9126631edbceda3dce093bc1d
2021-03-16 07:50:26 +00:00
Anna Kozlova
0b997bcaa0 java inspection descriptions updated
Deprecation.html; JavacQuirks.html; LoopConditionNotUpdatedInsideLoop.html; RawUseOfParameterizedType.html; UnnecessaryBoxing.html; TryWithIdenticalCatches.html; Anonymous2MethodRef.html; UnnecessaryLabelOnBreakStatement.html; StringBufferReplaceableByString.html; BusyWait.html; MetaAnnotationWithoutRuntimeRetention.html; TextLabelInSwitchStatement.html; SuspiciousIntegerDivAssignment.html; StringEquality.html; ReflectionForUnavailableAnnotation.html; NumberEquality.html; IterableUsedAsVararg.html; StringConcatenationInsideStringBufferAppend.html; ClassInitializerMayBeStatic.html

GitOrigin-RevId: 406bd9fd5e56ec9b30442d28591c8e759b8627cf
2021-03-15 14:48:35 +00:00
Ilyas Selimov
21e0f80a96 performance - small optimizations in DFA
GitOrigin-RevId: 305e5d03f4280bb99866c8912e5dd25a8392ca59
2021-03-15 07:06:03 +00:00
Tagir Valeev
7a0831408f [java-highlighting] IDEA-264182 Do not report 'Annotations are not allowed here' in unterminated parameter list
GitOrigin-RevId: 6c6aff57643ec10b1ba2c44b52e6db352d43513a
2021-03-12 13:26:52 +00:00
Andrey.Cherkasov
430ad9a42a [java-highlighting] IDEA-216120 Provide fix for the "Illegal initializer for ..." error
GitOrigin-RevId: edf4f5e72243afe44f0bcbbacd2e753a2e5faf1e
2021-03-12 10:42:19 +00:00
Ilyas Selimov
a2745001a9 IDEA-196862 - expanded hierarchical meta annotations processing to ignored and standard annotations
GitOrigin-RevId: 98890472e23e69068bb3a95f8f9460f6e288dfa9
2021-03-12 10:23:29 +00:00
Tagir Valeev
72626c4d29 [java-analysis] SuppressFix: avoid accessing invalid element after suppression is performed
Fixes EA-260182 - PIEAE: LeafPsiElement.invalid

GitOrigin-RevId: db71dec95345c551af7dfba1831d7cd81dc86930
2021-03-12 09:05:43 +00:00
Alexey Kudravtsev
f857875838 notnull
GitOrigin-RevId: ede492a63d3325613dee1eb4bf0e2bc2feb89756
2021-03-11 15:44:25 +00:00
Alexey Kudravtsev
34db17a916 optimisation: get rid of unnecessary stream allocation in some places in platform
GitOrigin-RevId: 2ae3a005678892ef2bae85b33b5ceb22fe46cea3
2021-03-11 15:39:51 +00:00
Ilyas Selimov
2da95e3f5d IDEA-196862 - added hierarchical meta annotations processing
GitOrigin-RevId: d7b4c2aa0c251b6fb2913927994ec4c5a61e6538
2021-03-11 13:30:24 +00:00
Andrey.Cherkasov
59907581a6 [java-inspections] IDEA-216271 Remove custom priority of CreateConstructorMatchingSuperFix for "Ambiguous method call"
GitOrigin-RevId: e07ef70a632f356fa4d9cba92a35128f22ab96ee
2021-03-11 13:23:50 +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
Ilyas Selimov
173a2a03e1 IDEA-196862 - added meta annotations processing
GitOrigin-RevId: c9cc025971ab76606d5d670efe9a472b3c9bd067
2021-03-10 19:48:39 +00:00
Andrey.Cherkasov
de64886d9e [java-highlighting] IDEA-216271 Provide fixes for the "Ambiguous method call" error
GitOrigin-RevId: c2cbd4f561b4d77b43a31d08b3ec8bb58f265f42
2021-03-10 12:24:57 +00:00
Aleksandra Zolushkina
3317739512 Proofread text in QuickFixBundle #proofread
ff4c5fc6fa17d2d78c9ac785ce09ceb5860d29bc,
(ac3611928f03ee4f221e1c68a09a94ef3ef9f017, 125531512ed1e3915ce37c6bdff34a0ed44d153c, 90ed58f0f0634fd0359142489aef1de73009a306)

GitOrigin-RevId: 2a5f9418b4d16d125d0bd04e738c01905ab7c2ba
2021-03-10 09:54:02 +00:00
Andrey.Cherkasov
c19534589b [java-highlighting] IDEA-216274 Provide fix for the "Not allowed in interface" error
GitOrigin-RevId: 1290ab27997b03c6a75b1c8172a3477722144941
2021-03-10 01:57:16 +00:00
Roman Shevchenko
f35ec3bc15 Cleanup (warnings; formatting)
GitOrigin-RevId: dd7be54aefc1ab20c7f4b24fb46d139908eeec67
2021-03-09 21:19:51 +00:00
Andrey.Cherkasov
64323d8ab0 [java-highlighting] Change text of fix for duplicate interfaces implemented
GitOrigin-RevId: a2b6f39e8722928193ff4c3ea9a65e4a9f041fd8
2021-03-09 15:44:23 +00:00
Tagir Valeev
cae5d31945 [java-dfa] Handling special cases for modular division
GitOrigin-RevId: 1acfd9722b1e171abd61181d35f856e3eba171eb
2021-03-09 10:26:27 +00:00
Tagir Valeev
3d0fc89544 [java-dfa] Apply relations like a>b on a=b+c if c>0 & no overflow
GitOrigin-RevId: 604d68f6741b9fde615067e3295ac7dce7cea286
2021-03-09 10:26:25 +00:00
Tagir Valeev
125e80de25 [java-dfa] Fixes in locality checks
1. ConstructionUtils.isCollectionConstructor checks whether an argument method is actually a constructor
2. HardcodedContracts.NO_PARAMETER_LEAK_METHODS: add putAll, removeAll, retainAll
3. Purity contract for contains/containsAll

GitOrigin-RevId: 00b68f68ef1c69ab996ff9a04d50ea5228ac629e
2021-03-05 13:31:19 +00:00
Tagir Valeev
43a3ebca10 [java-inspections] Do not annotate overridden methods having different nullness annotation that means the same nullness
Fixes IDEA-262718 Bug in NullableStuffInspectionBase#checkOverriders

GitOrigin-RevId: 38844520a9101d9335d9cfd0076c96bfbab780b7
2021-03-04 11:01:33 +00:00
Tagir Valeev
f5221013e6 [java-dfa] Remove method argument in SideEffectHandler
GitOrigin-RevId: ef14967bc6e9e405b0b3851a36299097baddf26c
2021-03-04 11:01:32 +00:00
Tagir Valeev
b25bfaa051 [java-intentions] More fixes with fix-all option enabled
GitOrigin-RevId: 54332122dce741d43b75ff3c2d8c60454c88eb5b
2021-03-04 11:01:31 +00:00
Tagir Valeev
04bfdb3f76 [java-dfa] Recognize some known methods that keep locality
GitOrigin-RevId: 5acf10b887aae06aa4d8f96faa987766162aeba5
2021-03-04 11:01:30 +00:00
Tagir Valeev
565b253400 [java-dfa] Use realMethod in SideEffectHandler
GitOrigin-RevId: 8a68c2382e6132b1c9028ef61ca68245aeb94ce8
2021-03-04 11:01:28 +00:00
Tagir Valeev
2642c3d0e3 [java-intentions] RemoveTypeArgumentsFix removed, replaced with DeleteElementFix
GitOrigin-RevId: b154c6bcab74ac4bf8ec09cfc3a09b5ab647759d
2021-03-04 11:01:27 +00:00
Tagir Valeev
a0b14b0e24 [java-highlighting] IDEA-263473 'Fix all' action for (at least some) compilation errors (initial support for several actions)
GitOrigin-RevId: 9462a17952f9d97eefbf27058ac36ff7b9902df6
2021-03-04 03:50:24 +00:00
Tagir Valeev
97feb54751 [java-analysis] insert.super.constructor.call.family rewording
GitOrigin-RevId: 6e106e9a668a586e6722950b0a7001f0bfa3b398
2021-03-04 03:50:22 +00:00
Andrey.Cherkasov
3753fdc967 [java-highlighting] IDEA-216255 Provide fix for the "Foo is not a functional interface" error and the like
GitOrigin-RevId: 9658873f49ff547a4f9c424e87a202e3546e0993
2021-03-03 17:45:02 +00:00
Andrey.Cherkasov
22fc82203f [java-highlighting] IDEA-216260 Provide fix for the "The receiver type does not match the enclosing class type" error
GitOrigin-RevId: 6c13081a405e2ae1d9bcb8716ae60d777376740e
2021-03-03 15:24:54 +00:00
Andrey.Cherkasov
374febfd1b [java-intention] IDEA-216266 UnimplementInterfaceAction: solve "caret after last symbol" & refactoring
GitOrigin-RevId: d569a61960c0d677527affd56448bf5c501018d8
2021-03-03 15:24:53 +00:00
Yann Cébron
2b2ad50680 replace "the the" -> "the" + minor javadoc cleanup
GitOrigin-RevId: 6dd2e60918da4054b185ac025abacab32b8a912b
2021-03-03 10:53:15 +00:00
Ilyas Selimov
93ac26e818 IDEA-260215 - reverted copying extensions for each method call, caching extensions as jdom.Elements to refresh the options
GitOrigin-RevId: cd95325f997b3bd45ce73ebcba3ca5bc34cbdb58
2021-03-03 10:40:19 +00:00
Tagir Valeev
7f55376006 [java-dfa] Reduce analysis complexity for completion (should help IDEA-261235 as well)
GitOrigin-RevId: 2a1a847b37cce0d2989bf02b25cb951edf8efc94
2021-03-02 08:37:51 +00:00
Tagir Valeev
341ca651e7 [java-completion] GuessManagerRunner is private now
GitOrigin-RevId: b43cb08c209919add0f3ff668f9b3739d38eff3d
2021-03-02 08:37:48 +00:00
Artemiy Sartakov
ccc5077467 MemberModel: detect possible out of class definitions and suggest to move them into class (IDEA-258839)
GitOrigin-RevId: 7708fdc7b3191bcd0ba46767160c4ec0b5a179da
2021-03-02 05:37:58 +00:00
Tagir Valeev
d29ba7ca74 [java-dfa] isLambdaChainParameterReference: require at least one qualifier call with arguments of the requested type
This would allow skipping DFA in the chain beginning, like list.stream().filter(x -> x.<caret>)
Improves performance in IDEA-261235 code completion in lamda is slow

GitOrigin-RevId: a5ba60488f191206e3cb52edd5c23778251f86ac
2021-03-01 09:36:47 +00:00
Tagir Valeev
4907badc7c [java-completion] Stop DFA once we visited the completion place and exited all the loops afterwards
Visiting the rest of the method is just burning CPU for nothing
Partially improves IDEA-261235 code completion in lambda is slow

GitOrigin-RevId: 185a3c586e550dabbb076ed6e5a973f716e64789
2021-03-01 09:36:45 +00:00
Tagir Valeev
601116fdcf [java-dfa] Support instance initializers when calculating field nullability (IJ-CR-5889)
GitOrigin-RevId: 7a6f3963ed6ba03877de00a39de5d26a60c0730c
2021-02-26 08:24:54 +00:00
Tagir Valeev
9063af0d1e [java-inspections] NullableStuffInspection: avoid possible NPE due to contains(null) check
Fixes EA-257931 - NPE: NullableNotNullManager.lambda$findExplicitNullabilityAnnotation$0

GitOrigin-RevId: 03529307828282912341542535639942fa18c26b
2021-02-26 04:11:21 +00:00
Tagir Valeev
14d6ae1b03 [java-dfa] Remove incorrect range-narrowing in ModRange.plus
If we overflow and myMod is not a power of 2, we cannot rotate remainders: overflowed subrange may have different remainders. E.g. floorMod(Integer.MAX_VALUE, 6) = 1 but floorMod(Integer.MAX_VALUE+1, 6) = 4, not 2.
Better algorithm is possible if we initially split our range at overflow point, then perform addition separately but for now let's just produce a correct result
Fixes EA-257681 - IAE: LongRangeSet$Range.<init>

GitOrigin-RevId: 45a3a870ae238800386b6ce739694f8f847e6340
2021-02-25 06:26:23 +00:00
Tagir Valeev
a83367dfb6 [java-inference] Handle index inconsistency for findMutationSignature (EA-257506)
GitOrigin-RevId: efec1e13f0174481a2cfcc84ec3b7e9474a323ad
2021-02-24 12:23:09 +00:00
Tagir Valeev
d5bc8ede09 [java-dfa] acceptBinaryRightOperand: properly process polyadic expressions where type changes between operands
Fixes IDEA-262701 Dataflow analysis fails to detect overflow in expression

GitOrigin-RevId: 42f400c0c2c43e4178121dc07ab710ed7dc8a225
2021-02-24 08:21:52 +00:00
Tagir Valeev
567f58b7c7 [java-dfa] PrimitiveConversionInstruction: NotNull target type; display target type in toString
GitOrigin-RevId: bfa959e977a164cf496d4b15b2dff246a11bf687
2021-02-24 08:21:51 +00:00