[java] AvoidPrintStackTrace - fix tests and deprecation warning
This commit is contained in:
@ -188,7 +188,7 @@ Avoid printStackTrace(); use a logger call instead.
|
|||||||
//PrimaryExpression[
|
//PrimaryExpression[
|
||||||
( PrimaryPrefix[Name[contains(@Image,'printStackTrace')]]
|
( PrimaryPrefix[Name[contains(@Image,'printStackTrace')]]
|
||||||
| PrimarySuffix[@Image='printStackTrace']
|
| PrimarySuffix[@Image='printStackTrace']
|
||||||
)/following-sibling::*[1][self::PrimarySuffix/Arguments[@ArgumentCount=0]]
|
)/following-sibling::*[1][self::PrimarySuffix/Arguments[@Size=0]]
|
||||||
]
|
]
|
||||||
]]>
|
]]>
|
||||||
</value>
|
</value>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<test-code>
|
<test-code>
|
||||||
<description>simple failure</description>
|
<description>simple failure</description>
|
||||||
<expected-problems>1</expected-problems>
|
<expected-problems>1</expected-problems>
|
||||||
<expected-linenumbers>4</expected-linenumbers>
|
<expected-linenumbers>5</expected-linenumbers>
|
||||||
<code><![CDATA[
|
<code><![CDATA[
|
||||||
public class Foo {
|
public class Foo {
|
||||||
void bar() {
|
void bar() {
|
||||||
@ -38,10 +38,12 @@ public class Foo {
|
|||||||
<test-code>
|
<test-code>
|
||||||
<description>pos in call chain #2437</description>
|
<description>pos in call chain #2437</description>
|
||||||
<expected-problems>1</expected-problems>
|
<expected-problems>1</expected-problems>
|
||||||
|
<expected-linenumbers>5</expected-linenumbers>
|
||||||
<code><![CDATA[
|
<code><![CDATA[
|
||||||
public class Foo {
|
public class Foo {
|
||||||
void bar() {
|
void bar() {
|
||||||
try {} catch (Exception e) {
|
try {
|
||||||
|
} catch (Exception e) {
|
||||||
e.getCause().printStackTrace();
|
e.getCause().printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -55,7 +57,8 @@ public class Foo {
|
|||||||
<code><![CDATA[
|
<code><![CDATA[
|
||||||
public class Foo {
|
public class Foo {
|
||||||
void bar() {
|
void bar() {
|
||||||
try {} catch (Exception e) {
|
try {
|
||||||
|
} catch (Exception e) {
|
||||||
e.getCause().printStackTrace;
|
e.getCause().printStackTrace;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -69,7 +72,8 @@ public class Foo {
|
|||||||
<code><![CDATA[
|
<code><![CDATA[
|
||||||
public class Foo {
|
public class Foo {
|
||||||
void bar() {
|
void bar() {
|
||||||
try {} catch (Exception e) {
|
try {
|
||||||
|
} catch (Exception e) {
|
||||||
e.printStackTrace;
|
e.printStackTrace;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -83,7 +87,8 @@ public class Foo {
|
|||||||
<code><![CDATA[
|
<code><![CDATA[
|
||||||
public class Foo {
|
public class Foo {
|
||||||
void bar() {
|
void bar() {
|
||||||
try {} catch (Exception e) {
|
try {
|
||||||
|
} catch (Exception e) {
|
||||||
e.printStackTrace(e);
|
e.printStackTrace(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user