Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Andreas Leitgeb Newsgroups: comp.lang.java.programmer Subject: Re: Eclipse Date: Thu, 13 Jul 2017 09:29:11 -0000 (UTC) Organization: A noiseless patient Spider Lines: 18 Message-ID: References: <8b4bfc08-ccdb-40bf-a4f6-875d0cd9a058@googlegroups.com> <5314f277-558b-43d1-8564-460ab8dab26a@googlegroups.com> <1b033cbe-4bc2-497f-9c93-e6e90b75f39b@googlegroups.com> <9baefae1-7fe6-4ce6-a1f0-89546b85bf5e@googlegroups.com> Reply-To: avl@logic.at Injection-Date: Thu, 13 Jul 2017 09:29:11 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="891ec2ce37e0ba46fd2b2385f5ad4a6c"; logging-data="3907"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Oy7ibxOxeJTscmNROMtKy" User-Agent: slrn/1.0.2 (Linux) Cancel-Lock: sha1:dgtJR2tRxiPdwEuaJSrFP0oJKKY= Xref: csiph.com comp.lang.java.programmer:36876 Eric Douglas wrote: > Eclipse conflicts itself. > given: ArrayList myArray, and Component c > > instead of if (!myArray.contains(c)), it doesn't complain if we write > if (!(oc instanceof MyCustomInterface) || !myArray.contains((MyCustomInterface)c)). > > Source > Cleanup has an option 'Remove unnecessary casts'. If you use this it does > remove this cast on the (MyCustomInterface)c, then it throws the new > 'Unlikely type argument' error on that line. Either the cast is necessary and > I need to remove that cleanup option, or it's not necessary and I need to > completely ignore that error/warning (or add the @SuppressWarnings("unlikely-arg-type")). Good catch! I'd call it a bug. Did you report it on some eclipse bug-tracker? (if you intend to do it, first check if it hasn't already been reported, of course.)