mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-24 09:20:53 +07:00
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
28 lines
707 B
Java
28 lines
707 B
Java
// "Fix all 'Redundant 'throws' clause' problems in file" "true"
|
|
|
|
import java.io.FileNotFoundException;
|
|
import java.io.IOException;
|
|
|
|
class A {
|
|
/**
|
|
* @since 2020.3
|
|
* @author me
|
|
* @throws Exception first exception
|
|
* @throws Exception second exception
|
|
* @throws Exception
|
|
* @throws Exception
|
|
* @throws Exception
|
|
* @throws IOException IO exception 1
|
|
* @throws Exception
|
|
* @throws Exception
|
|
* @throws Exception
|
|
* @throws FileNotFoundException file not found
|
|
* @throws IOException IO exception 2
|
|
*/
|
|
void f() throws /* 1 */ E<caret>xception /* 2 */, /* 3 */ Exception /* 4 */, /* 5 */ IOException /* 6 */,
|
|
// seven
|
|
|
|
/* 8 */ FileNotFoundException /* 9 */ { }
|
|
}
|
|
|