Re: [Codenarc-user] def x = "" -> UnnecessaryGString
Brought to you by:
chrismair
From: Hamlet D. <ham...@ca...> - 2011-07-04 15:07:03
|
The website sometimes has fuller descriptions of the errors: http://codenarc.sourceforge.net/codenarc-rules-unnecessary.html "String objects should be created with single quotes, and GString objects created with double quotes. Creating normal String objects with double quotes is confusing to readers." Yes the compiler allows you to create a String with "", but if your intent is to create a String then use ''. Feel free to turn this rule off if you disagree :) ----- Original Message ----- > > Hi, > > > Why does using > ----------------------- > def x = "" > ----------------------- > > > result in " UnnecessaryGString " error? > > > It's not a GString that Groovy gives here, right? > > > > -- > Roshan > Blog: http://roshandawrani.wordpress.com/ > Twitter: @roshandawrani > Skype: roshandawrani > > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously > valuable. > Why? It contains a definitive record of application performance, > security > threats, fraudulent activity, and more. Splunk takes this data and > makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > Codenarc-user mailing list > Cod...@li... > https://lists.sourceforge.net/lists/listinfo/codenarc-user > |