From FindBugs Middle School Java "three"

Source: Internet
Author: User

2. bx_boxing_immediately_unboxed

Double A = 100d;double D = double.valueof (a);

Primitive value is boxed and then immediately unboxed.

Non-essential boxing and immediate unpacking operation.

Intellij will also give such a hint:

There's nothing to say.


3. Iju_setup_no_super

Seems to be a legacy problem, appearing in the era of JUnit3, e.g.

JUnit3 would do that.

public class Thetest extends TestCase {//test methods ... public static test suite () {return new Testsetup (New TestSuite (T Hetest.class) {protected void SetUp () throws Exception {Super.setup ();//set-up code called only once}protected void tear Down () throws Exception {//Tear-down code called only Oncesuper.teardown ();}};

So we need this super.setup () to initialize

JUNIT4 began to use annotation on a massive scale, and we had @before @After to do it.

Of course, now JUNIT4 has been used for many years, such as the Spock test Framework is also very useful ~






Ref:1 2 3

From FindBugs Middle School Java "three"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.