Return-Path: Delivered-To: apmail-incubator-cxf-dev-archive@locus.apache.org Received: (qmail 56341 invoked from network); 11 Dec 2007 13:11:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Dec 2007 13:11:57 -0000 Received: (qmail 41527 invoked by uid 500); 11 Dec 2007 13:11:46 -0000 Delivered-To: apmail-incubator-cxf-dev-archive@incubator.apache.org Received: (qmail 41319 invoked by uid 500); 11 Dec 2007 13:11:45 -0000 Mailing-List: contact cxf-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-dev@incubator.apache.org Received: (qmail 41310 invoked by uid 99); 11 Dec 2007 13:11:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Dec 2007 05:11:45 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bimargulies@gmail.com designates 64.233.184.237 as permitted sender) Received: from [64.233.184.237] (HELO wr-out-0506.google.com) (64.233.184.237) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Dec 2007 13:11:23 +0000 Received: by wr-out-0506.google.com with SMTP id c8so2233756wra for ; Tue, 11 Dec 2007 05:11:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; bh=RfhLXBOoGKBgy2IdUMh3wbvWX9TuGzQfcrRUKNB+/kU=; b=nTRZ6noZpi7wZuLxEG6g5/QTSzAE5VpDBJKJuAwke0axfeDRTQKce4IgSdkvONjQ/T2Czaxn3EUBUmfp42lqTyH7HaIA3CVYTr2g/38VRUqVEPGdVJn6VBPV4DWouQfdBu/MfSoyJCV+lo7Yp97duYUCqho2pgSCos2QkE9PxrM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; b=QGf1z+DGZt+537aHBM5an0Fxhdtr1nlDIsfoDknC1BlXAoWMIlvpcBFN0hVOA7s8BynWe0ZqCuFfNclly1ykIXJexXUeAGJnsR7guXr1/xWGTmZMLMSLHIxOzs0K1KmZtowNt6kMoapILtkKZFjhTKPgKKmIMX/20+S1Wg3ibxQ= Received: by 10.70.126.10 with SMTP id y10mr6208848wxc.1197378682311; Tue, 11 Dec 2007 05:11:22 -0800 (PST) Received: from ?10.1.7.199? ( [199.88.205.1]) by mx.google.com with ESMTPS id h18sm16702229wxd.2007.12.11.05.11.12 (version=SSLv3 cipher=RC4-MD5); Tue, 11 Dec 2007 05:11:20 -0800 (PST) Subject: @SuppressWarnings("unchecked") From: Benson Margulies To: cxf-dev@incubator.apache.org Content-Type: text/plain Date: Tue, 11 Dec 2007 08:11:09 -0500 Message-Id: <1197378669.6915.8.camel@bim1330.basistech.net> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org In general, the CXF rules insist that we avoid Java constructs that produce warnings. One significant exception to this is generics. CXF has a significant population of @SuppressWarnings("unchecked") I would like to open for discussion (and possible vote) a proposal to clean them all up and then treat them as errors. In my perhaps unfair opinion, these cases often look like the standard results of expecting Java generics to have the same flavor as C++ parameterized types. More specifically, I see three categories: 1) Simple failures to use the 'cast' method. These are cases where a generic method has the right signature, but is using a () cast and @SuppressWarnings("unchecked") instead of class.cast(value). When I see these, I fix them. 2) Not enough Class arguments to functions. The most common C++ crossover is to think that from public T somefunction() you can return a T without adding Class to the arguments. When I've seen these with a few spare minutes, I've fixed them as well. 3) The hard cases. The Databinding methods that are writer and reader factories are the big examples here. The functions take Class and want to return SomeClass. I have not yet figured out the alternative here. Arguably, the whole idea of DataReader as opposed to XXXDataReader extends DataReader is an example of round C++ parameterized type thinking trying to be inserted into a square Java generic hole. With all due respect to the author(s), I'd offer for consideration refactoring this code to just extend a base class instead of being a generic. Thoughts?