Commit Graph

12 Commits

Author SHA1 Message Date
Bas Leijdekkers
9addc5eaf7 java: include parentheses () in text when referring to methods
GitOrigin-RevId: 1cfc8afb26b5db175d865f6bbdc752356040d8bb
2022-08-22 17:58:06 +00:00
Tagir Valeev
7e1064ea3c [java-intentions] More preview tests; minor fixes
GitOrigin-RevId: 22a46c15d8900d8a31514846755a013f6a67ad42
2022-07-29 17:55:13 +00:00
Nikita Eshkeev
82099584a0 [codeInsight] IDEA-201714 Missing "fix all" for "Redundant throws clause"
This patch fixes the notes from the code review it includes:

- splitting the code that detects related @throws in the local inspection from the code that is used in the global one
- related @throws are no longer returned if one of the duplicates in the throws list is being removed
- related @throw tags are not being removed if there is an element in the throws list that can be assigned with the class of the @throws tag

Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com>

GitOrigin-RevId: e68823093d88427dbbb7efa0cd1171988d1f5360
2020-07-21 22:58:57 +00:00
Nikita Eshkeev
a2c8f3ed4a [codeInsight] IDEA-201714 Missing "fix all" for "Redundant throws clause"
Redundant throws exception inspetction used to report both the redundant
exceptions in the throws list and @throws tags in the javadoc. It was
not convenient since the same problem got reported twice. This patch
changes this behaviour, no @throws tags is reported as redundant. If
there are redundant @throws tags they get removed when its corresponding
throws declarations is being removed. The redundant @throws tags are
detected like this:

1. If there is only one throws declaration in the throws list of a
method then all the @throws tags get removed.
2. A @throws tag is considered related to the throws declaration that is
being removed if it is the exact match with the throws declaration or if
it is a subclass of it and there are no exact matches for the @throws
tag in the throws list.
3. If there are duplicates in the throws list then when one of the
duplicates is getting removed then all the related @throws tags are
considered related to that copy leaving the other duplicates without any
related @throws tag in the javadoc.

Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com>

GitOrigin-RevId: 1c4d0388903411a424fd5e4ca37aa71d5a606500
2020-07-17 17:18:38 +00:00
Nikita Eshkeev
03c771b5bc [codeInsight] IDEA-201714 Missing "fix all" for "Redundant throws clause"
This patch fixes the problem with the absent the "fix all" quick fix for
redundant throws clause inspection. It also does a major refactoring in
the both global and local redundant throws clause exceptions applying
modern code technics.

Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com>

GitOrigin-RevId: 9336c9afd9a6c64b12d4e29f58e1c9da4f33e25e
2020-07-10 14:30:55 +00:00
Dmitry Batkovich
183921ba14 add test for IDEA-205525 2019-01-18 22:19:56 +03:00
Dmitry Batkovich
e34c1fed9e local redundant throws should respect exception subclasses when checking inherited method exceptions (add test) 2018-07-02 18:44:15 +03:00
Dmitry Batkovich
cc8d990786 redundant throws fix should remove javadoc tag too (IDEA-185105) 2018-01-18 15:05:24 +03:00
Dmitry Batkovich
7fb26c249d redundant throws: filter out unchecked exception (IDEA-177478, IDEA-177506) 2017-08-14 10:47:25 +03:00
Dmitry Batkovich
52cf50c461 redundant throws inspection:
1. global and local inspections are merged to one
2. local inspection reports "non-final" methods (if cheap enough) IDEA-177230
2017-08-09 12:14:26 +03:00
Anna Kozlova
4f45f25c38 redundant exception: ignore recursive calls (IDEA-157773) 2016-06-22 17:58:08 +03:00
Alexey Kudravtsev
2718da9fc7 more java tests moved to community 2010-06-25 12:46:40 +04:00