Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re[4]: [jdt-core-dev] Re: What should Eclipse compiler default settings be ?

Friday, October 18, 2002, 4:31:09 AM, Philippe Mulet wrote:

PM> Interesting... if you have a testcase to reproduce this, I'd be
PM> curious to see it. It smells like our bug. If a type is referred
PM> to in the signature of a method, it should be sufficient to use a
PM> corresponding import...

Philippe,
         I didn't do a very good job of explaining the problem. I
         identified the wrong checkbox <g>. The case I was referring
         to is the "Unused parameters (i.e. never read)

         Here is a rewriting of the original message with that small
         substitution. I'm really a human and not a poorly written
         robot!

One of the problems that I've run into when using "Unused parameters" is
it's very easy to have many cases of unused parameters if you implement
an interface. It's not unusual to have methods defined on the interface
that contain arguments that you don't need, not to mention the adapter
style of implementing that contains no implementation.

Seems like there may need to be special cases to handle these. Something
along the lines of if the method's body is empty then exclude that
method from the unused parameters warning.

Or something along the lines of, if the method is implementing an
interface method then exclude it. Not ideal so I guess these would
need to be a preference too....

Have others been bothered by this?
         


PM> Wednesday, October 16, 2002, 9:25:25 AM, Olivier Thomann wrote:

OT>> I do believe that some warnings are useful to clean up some code.
OT>> I am thinking about unused locals, unused imports, access to a
OT>> static context through a non-static reference, access to synthetic
OT>> methods. More warnings simply mean that the user might want to
OT>> reconsider the corresponding pieces of code. Helping the user to
OT>> write good code is also a task of a compiler, isn't it?

PM> One of the problems that I've run into when using "Unused imports" is
PM> it's very easy to have many cases of unused imports if you implement
PM> an interface. It's not unusual to have methods defined on the interface
PM> that contain arguments that you don't need, not to mention the adapter
PM> style of implementing that contains no implementation.

PM> Seems like there may need to be special cases to handle these. Something
PM> along the lines of if the method's body is empty then exclude that
PM> method from the unused import warning.

PM> Or something along the lines of, if the method is implementing an
PM> interface method then exclude it. Not ideal so I guess these would
PM> need to be a preference too....

PM> Have others been bothered by this?

PM> Chris
PM> --
PM> Chris Grindstaff
PM> chrisg@xxxxxxxxxxxxxxxxxxxx  |  www.appliedReasoning.com

PM> _______________________________________________
PM> jdt-core-dev mailing list
PM> jdt-core-dev@xxxxxxxxxxx
PM> http://dev.eclipse.org/mailman/listinfo/jdt-core-dev




PM> _______________________________________________
PM> jdt-core-dev mailing list
PM> jdt-core-dev@xxxxxxxxxxx
PM> http://dev.eclipse.org/mailman/listinfo/jdt-core-dev

-- 
Chris Grindstaff
chrisg@xxxxxxxxxxxxxxxxxxxx  |  www.appliedReasoning.com



Back to the top