From: Bryce McKinlay <bmckinlay@gmail.com>
To: David Michel <dmichel76@googlemail.com>
Cc: java@gcc.gnu.org
Subject: Re: how to deal with non-generic (legacy) code ?
Date: Tue, 04 Aug 2009 15:21:00 -0000 [thread overview]
Message-ID: <7230133d0908040821n20b93a83x52020fc022c42e3@mail.gmail.com> (raw)
In-Reply-To: <b5bf7a380908040809n691480caib4107ffd7d77479c@mail.gmail.com>
On Tue, Aug 4, 2009 at 4:09 PM, David Michel <dmichel76@googlemail.com> wrote:
> We all know that generics have been introduced in jdk 1.5 and that
> Sun's javac still accepts raw types for backward compatibility.
>
> With gcj, however, one will always get some warnings like "Vector is a
> raw type. References to generic type Vector<T> should be
> parameterized" when using raw types. It's easy to write the code with
> generics properly so that these warnings do not appear, however, how
> does one deal with, for instance, a method from a somewhat older
> legacy code that returns a raw type.
>
> What is the proper way to deal with this ?
> Is there a way to switch these warnings off ?
Put @SuppressWarnings("unchecked") at the top of the method (or class)
that does the unchecked type parameter conversions.
Bryce
next prev parent reply other threads:[~2009-08-04 15:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-04 15:09 David Michel
2009-08-04 15:20 ` Philip A. Chapman
2009-08-04 15:21 ` Bryce McKinlay [this message]
2009-08-04 15:26 ` David Michel
2009-08-04 15:28 ` Andrew John Hughes
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=7230133d0908040821n20b93a83x52020fc022c42e3@mail.gmail.com \
--to=bmckinlay@gmail.com \
--cc=dmichel76@googlemail.com \
--cc=java@gcc.gnu.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).