Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 31731 invoked from network); 6 Jan 2011 14:51:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 Jan 2011 14:51:08 -0000 Received: (qmail 7334 invoked by uid 500); 6 Jan 2011 14:51:08 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 7007 invoked by uid 500); 6 Jan 2011 14:51:08 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 6992 invoked by uid 99); 6 Jan 2011 14:51:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jan 2011 14:51:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jan 2011 14:51:07 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id p06EokqL022637 for ; Thu, 6 Jan 2011 14:50:46 GMT Message-ID: <24776920.189371294325446702.JavaMail.jira@thor> Date: Thu, 6 Jan 2011 09:50:46 -0500 (EST) From: "Sebb (JIRA)" To: issues@commons.apache.org Subject: [jira] Created: (MATH-467) HarmonicCoefficientsGuesser.sortObservations() potentlal NPE warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 HarmonicCoefficientsGuesser.sortObservations() potentlal NPE warning -------------------------------------------------------------------- Key: MATH-467 URL: https://issues.apache.org/jira/browse/MATH-467 Project: Commons Math Issue Type: Bug Affects Versions: 3.0 Reporter: Sebb Priority: Minor HarmonicCoefficientsGuesser.sortObservations() generates an NPE warning from Eclipse which thinks that mI can be null in the while condition. The code looks like: {code} WeightedObservedPoint mI = observations[i]; while ((i >= 0) && (curr.getX() < mI.getX())) { observations[i + 1] = mI; if (i-- != 0) { mI = observations[i]; } else { mI = null; } } // mI is not used further {code} It looks to me as though the "mI = null" statement is either redundant or wrong - why would one want to replace one of the observations with null during a sort? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.