Re: [Codenarc-user] UnnecessaryGroovyImport handles static imports incorrectly
Brought to you by:
chrismair
From: Hamlet D'A. <ham...@gm...> - 2011-05-29 19:05:41
|
I agree with you René. I think these should not be violations. -- Hamlet D'Arcy ham...@gm... On Sun, May 29, 2011 at 8:59 PM, René Scheibe <ren...@go...> wrote: > Why does UnnecessaryGroovyImport mark static import of default imports as unnecessary? They are not staticly imported by default. > > Looking UnnecessaryGroovyImportTest shows that static imports are also tested. But the expected results are incorrect. See below: > > --------------------------------------------------------------- > void testApplyTo_StaticImport_Violations() { > final SOURCE = ''' > import static java.io.DataInputStream.* > import static java.lang.Integer.MAX_VALUE > ''' > assertTwoViolations(SOURCE, 2, 'import static java.io.DataInputStream.*', 3, 'import static java.lang.Integer.MAX_VALUE') > } > --------------------------------------------------------------- > > If for example MAX_VALUE from java.lang.Integer should be used directly without prefixing it with Integer, it has to be imported staticly. > > If you feel the samem just let me know and I will open a ticket and fix it. > > Regards, > René Scheibe > > ------------------------------------------------------------------------------ > vRanger cuts backup time in half-while increasing security. > With the market-leading solution for virtual backup and recovery, > you get blazing-fast, flexible, and affordable data protection. > Download your free trial now. > http://p.sf.net/sfu/quest-d2dcopy1 > _______________________________________________ > Codenarc-user mailing list > Cod...@li... > https://lists.sourceforge.net/lists/listinfo/codenarc-user > |