|
Re: [ 1608715 ] New Quick-Fixes for the eclipse plug-in: msg#00039java.findbugs.general
You have to be very careful in suggesting quick fixes. More careful than you are. For example, your suggested fix for a useless self assignment is to remove the statement containing the self assignment. That fix would almost certainly be wrong and would obscure the actual error. For example, in: class Foo { int lowerBound, upperBound; Foo(int LowerBound, int UpperBound) { this.lowerBound = LowerBound; this.upperBound = upperBound; } } The assignment to this.upperBound is a useless self assignment. But fixing it by removing the assignment is a horrible thing to do, since it wouldn't fix the code and would hide the error. If you want to implement a quick fix, you should first review a dozen occurrences of that warning on production code, and determine if your solution would be the correct fix to at least 10 of them. If not, suggesting the quick fix would be very ill advised. Bill Pugh On Dec 16, 2006, at 9:48 AM, <mbusarel@xxxxxx> <mbusarel@xxxxxx> wrote: Hi Peter
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: [ 1608715 ] New Quick-Fixes for the eclipse plug-in, mbusarel |
|---|---|
| Next by Date: | FindBugs 1.1.2-rc4, Bill Pugh |
| Previous by Thread: | RE: [ 1608715 ] New Quick-Fixes for the eclipse plug-in, mbusarel |
| Next by Thread: | AW: [ 1608715 ] New Quick-Fixes for the eclipse plug-in, mbusarel |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |