Ignore parameter assignment errors.
commit461b1860c3e446d6442a3f62a8f93639086328f1
authorShawn O. Pearce <spearce@spearce.org>
Tue, 30 Jan 2007 01:58:05 +0000 (29 20:58 -0500)
committerShawn O. Pearce <spearce@spearce.org>
Tue, 30 Jan 2007 01:58:05 +0000 (29 20:58 -0500)
tree76f54fe172a374b95d120a01c724b0e7cbdaf77e
parent7dd90fe38bf3bd352ddf5ebd5652b8fc8bdc0fa2
Ignore parameter assignment errors.

I've put some thought into this one, and I really dislike the parameter
assignment warning in Eclipse's JDT.

The problem is that it is very common to pass in an object to a method,
say an IProgressMonitor, and the parameter can be supplied as null. But
the method wants to always assume its not-null, as this simplifies the
code quite a bit.  So the method tests for the null parameter right away
and reassigns it to a NullProgressMonitor instance.  But setting up a
new local variable to hold either the input parameter value or the new
NullProgressMonitor is asking for trouble, as the parameter is still
visible within the scope of the method.  Its possible to have Eclipse
autocomplete the parameter, when really the local needed to be used.

So what I do here is I'm *very* much in the habit of declaring anything
final; parameters, local variables, instance members, etc, and I only
ever declare something to be not final when I really do intend on
modifying it within its scope.  Its unfortunate that final isn't the
default (or cannot be made to be the default), and its also unfortunate
that a variable cannot be declared to be final below a certain point
in a method.  Such is the quality of programming languages today.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.spearce.egit.core/.settings/org.eclipse.jdt.core.prefs
org.spearce.egit.ui/.settings/org.eclipse.jdt.core.prefs
org.spearce.jgit/.settings/org.eclipse.jdt.core.prefs