Project
IntelliJ IDEA
Priority
Normal
Type
Feature
Fix versions
No Fix versions
State
Fixed
Assignee
Bas Leijdekkers
Subsystem
Code Analysis. Inspection
Affected versions
No Affected versions
Fixed in build
108.65  
  • Created by   Jonas Kvarnstrom
    6 years ago (04 Aug 2005 17:08)
  • Updated by   root
    2 years ago (17 Jan 2010 20:22)
  • Jira: IDEADEV-2277
    (history, comments)
 
IDEA-29727 Concatenation within append(): Ignore constant strings
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
The "string concatenation within append()" inspection is triggered by code such as this:

buf.append("foo\n" +
"bar"):

where concatenation is resolved by the compiler. Accepting the quickfix and converting to multiple append calls actually makes performance worse. Could this type of concatenation within append() be ignored by the inspection?

Issue was resolved
Comments (7)
 
History
 
Linked Issues (?)
 
Bas Leijdekkers
  Bas Leijdekkers
17 Aug 2005 19:28
6 years ago
What do you think, should I make it an option or just remove the current behaviour and ignore concatenation resolved at compile time in all cases?
Jonas Kvarnstrom
  Jonas Kvarnstrom
17 Aug 2005 19:34
6 years ago
Personally I think the value of this inspection is entirely in that it
lets you avoid the creation of multiple StringBuilders and all the
inefficiency that is associated with having to copy substrings multiple
times, and therefore I'm never interested in concatenation resolved at
compile time.
Jonas Kvarnstrom
  Jonas Kvarnstrom
14 Dec 2005 20:56
6 years ago
Personally I think the value of this inspection is entirely in that it
lets you avoid the creation of multiple StringBuilders and all the
inefficiency that is associated with having to copy substrings multiple
times, and therefore I'm never interested in concatenation resolved at
compile time.
Jonas Kvarnstrom
  Jonas Kvarnstrom
27 Dec 2006 22:42
5 years ago
Personally I think the value of this inspection is entirely in that it
lets you avoid the creation of multiple StringBuilders and all the
inefficiency that is associated with having to copy substrings multiple
times, and therefore I'm never interested in concatenation resolved at
compile time.
Jonas Kvarnstrom
  Jonas Kvarnstrom
22 Oct 2008 08:35
3 years ago
Personally I think the value of this inspection is entirely in that it
lets you avoid the creation of multiple StringBuilders and all the
inefficiency that is associated with having to copy substrings multiple
times, and therefore I'm never interested in concatenation resolved at
compile time.
Jonas Kvarnstrom
  Jonas Kvarnstrom
23 Dec 2008 11:39
3 years ago
Personally I think the value of this inspection is entirely in that it
lets you avoid the creation of multiple StringBuilders and all the
inefficiency that is associated with having to copy substrings multiple
times, and therefore I'm never interested in concatenation resolved at
compile time.
Jonas Kvarnstrom
  Jonas Kvarnstrom
19 Jan 2009 14:34
3 years ago
Personally I think the value of this inspection is entirely in that it
lets you avoid the creation of multiple StringBuilders and all the
inefficiency that is associated with having to copy substrings multiple
times, and therefore I'm never interested in concatenation resolved at
compile time.