logo       


Re: Bug about multiple calls to same method.: msg#00039

Subject: Re: Bug about multiple calls to same method.
I have no idea what fb-contrib is or how to disable it.

-kto

Bill Pugh wrote:
OK, so it seems this bug warning is coming from fb-contrib, not from the detectors
includes with FindBugs.

Personally, I recommend disabling this detector.

    Bill

On Sep 15, 2006, at 4:05 PM, Dave Brosius wrote:

    <BugPattern type="RMC_REDUNDANT_METHOD_CALLS">
        <ShortDescription>Method calls the same method on the same object
redundantly</ShortDescription>
<LongDescription>Method {1} calls the same method on the same object
redundantly</LongDescription>
        <Details>
            <![CDATA[
<p>This method makes two consecutive calls to the same method using
the same constant
parameters, on the same instance without any intervening changes to
the objects. If this
method does not make changes to the object, which it appears it
doesn't, then making
two calls is just a waste. These method calls could be combined by
assigning the
result into a temporary, and using the temporary the second time.
            ]]>
        </Details>
    </BugPattern>




-----Original Message-----
From: "Bill Pugh" <pugh@xxxxxxxxxx>
Sent: Fri, September 15, 2006 3:22 pm
To: "Kelly O'Hair" <Kelly.Ohair@xxxxxxx>
Cc: findbugs-discuss@xxxxxxxxxxxxxxxxxx
Subject: Re: [FB-Discuss] Bug about multiple calls to same method.

I agree with your concern; that is bad advice.

Can you tell me the precise warning being generated by findbugs.
I need to identify which bug pattern that is being reported as,
or which detector is generating it.

    Bill

On Sep 15, 2006, at 3:16 PM, Kelly O'Hair wrote:


The most recent findbugs has found some new 'bugs' but after fixing
one I created a nasty bug.

In the past I've trusted the findbugs analysis, maybe too much, but
I recently had some code that looked like:

    int a = o.get();
    int b = o.get();
    int c = o.get();

(the names have changed to protect the innocent)
and findbugs said I've made three calls to the same method, could
just call
it once.  Ok (stupid me) makes sense to me, I change it to:

    int t = o.get();
    int a = t;
    int b = t;
    int c = t;

WRONG!  The get() method is walking through a byte buffer!
Seems like findbugs might want to limit this "bug" to leaf methods?
Or ones it knows doesn't have side effects?

-kto
_______________________________________________
Findbugs-discuss mailing list
Findbugs-discuss@xxxxxxxxxxxxxxxxxx
http://mailman.cs.umd.edu/mailman/listinfo/findbugs-discuss

_______________________________________________
Findbugs-discuss mailing list
Findbugs-discuss@xxxxxxxxxxxxxxxxxx
http://mailman.cs.umd.edu/mailman/listinfo/findbugs-discuss




Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
Search:
Java, servers, webhosting, VoIP...
more...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe