From: Andrew Cagney <cagney@redhat.com>
To: Mark Wielaard <mark@klomp.org>
Cc: frysk <frysk@sources.redhat.com>
Subject: Re: inner classes with fields names similar to outer class/method fields
Date: Tue, 03 Jul 2007 18:44:00 -0000 [thread overview]
Message-ID: <468A990C.8060409@redhat.com> (raw)
In-Reply-To: <1183483619.3599.41.camel@dijkstra.wildebeest.org>
Mark Wielaard wrote:
>
> And ask yourself which 'task' is being referred to in the execute()
> method of the anonymous class given to the add() method. Is it the final
> field in the outer class method called task, or is it the inherited
> protected field called task from the super class TaskEvent? The "right"
> answer is the protected field task from the super class, but since that
> is in a completely different file while the final field task in the
> enclosing method looks like the only task in scope some confusion
> ensues. Renaming (one of) the fields is the best solution seeing some
> compilers also seem to get this one wrong.
>
Ok, this is a very different problem; I have my doubts that jv-scan
could be used to detect this. Can you create a frysk bug to track it
and a test case for reference?
Andrew
> Cheers,
>
> Mark
>
>
next prev parent reply other threads:[~2007-07-03 18:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-02 12:32 Mark Wielaard
2007-07-03 15:34 ` Andrew Cagney
2007-07-03 17:27 ` Mark Wielaard
2007-07-03 18:44 ` Andrew Cagney [this message]
2007-07-03 19:21 ` Mark Wielaard
2007-07-05 18:43 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=468A990C.8060409@redhat.com \
--to=cagney@redhat.com \
--cc=frysk@sources.redhat.com \
--cc=mark@klomp.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).