Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Gavino" Newsgroups: comp.lang.java.programmer Subject: Re: Curious compiler warning Date: Wed, 11 Jan 2012 20:05:15 +0100 Lines: 24 Message-ID: <9n64r6F3upU1@mid.individual.net> References: X-Trace: individual.net Gi03V9RzANPjrtAmMGYIXAJNmhbmQ7oMrXOPWhi2FWt0gVFhc6 Cancel-Lock: sha1:dQebc+qZxMZOyVXtTcHj5LGTdoU= X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:11235 "Lew" wrote in message news:jeiu63$es3$1@news.albasani.net... > I also found an explanation in the Eclipse help of all places for the > warning: > "Parameter assignment > "Assigning a value to a parameter is generally considered poor style > programming. When this option is enabled, the compiler will signal such > scenario either as an error or a warning." > > Notice that they point out that it's considered poor style. The > engineering reason behind this is that parameter assignment goes away at > the end of the method block. But that would also apply to any local variables, and it's clearly not considered poor style to assign to those. The real engineering reason is surely just that method code is generally easier to understand and maintain if the parameters are used as constants, and not changed in the method body.