Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[java] PreserveStackTrace false-positive #1747

Closed
boris-petrov opened this issue Apr 1, 2019 · 1 comment · Fixed by #3179
Closed

[java] PreserveStackTrace false-positive #1747

boris-petrov opened this issue Apr 1, 2019 · 1 comment · Fixed by #3179
Labels
a:false-positive PMD flags a piece of code that is not problematic
Projects
Milestone

Comments

@boris-petrov
Copy link
Contributor

boris-petrov commented Apr 1, 2019

PMD version 6.13.0.

Rule: PreserveStackTrace

try {
	...
} catch (IOException exception) {
	if (exception.getMessage().contains("foobar")) {
		throw new SomeOtherUserDefinedException("Error", exception);
	}
	throw exception;
}

This code produces a PreserveStackTrace error but it shouldn't according to the documentation of PreserveStackTrace.

@jsotuyod jsotuyod added the a:false-positive PMD flags a piece of code that is not problematic label Apr 1, 2019
oowekyala added a commit to oowekyala/pmd that referenced this issue Mar 28, 2021
@adangel adangel added this to the 7.0.0 milestone Apr 1, 2021
@adangel adangel linked a pull request Apr 1, 2021 that will close this issue
5 tasks
@oowekyala oowekyala added this to Done in PMD 7 Apr 3, 2021
@adangel adangel mentioned this issue Jan 23, 2023
55 tasks
@adangel
Copy link
Member

adangel commented Apr 22, 2023

This has been fixed with PMD 7.0.0-rc1.

@adangel adangel closed this as completed Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:false-positive PMD flags a piece of code that is not problematic
Projects
No open projects
PMD 7
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants