#353 Suggestion - NecessaryGString


Codenarc catches UnecessaryGString... which will tend to make the developer habitually use single quotes.

It should probably also do the inverse..NecessaryGString

    def x=1
    println 'x= $\{x\}'


  • Comment has been marked as spam. 

    You can see all pending comments posted by this user  here

    Anonymous - 2011-09-20
    • summary: Suggestion - scan for --> Suggestion - NecessaryGString
  • Chris Mair

    Chris Mair - 2011-09-21

    Great idea!

  • Chris Mair

    Chris Mair - 2011-11-03
    • status: open --> closed-duplicate
  • Chris Mair

    Chris Mair - 2011-11-03
    • status: closed-duplicate --> open
  • Chris Mair

    Chris Mair - 2011-11-03

    Okay, on second thought, I am reopening, since that other issue is more specific. We can reconsider overlap later.

  • Ken Krebs

    Ken Krebs - 2011-11-15

    I would agree using an unnecessary doubleQuotes should be allowed for the reason originally specified. I prefer to use doubleQuotes if I am not sure whether it will always be a String or GString. It is also the case that Groovy itself will optimize this and create a String, not a Gstring in this situation.

  • Chris Mair

    Chris Mair - 2012-10-11

    Moving this over to Feature Requests


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks