Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 5c46da2a authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Refinement of EfficientStringsChecker.

It's okay if callers try mixing "static final" values into strings,
since the compiler will inline these to avoid the StringBuilder.

We also expand to catch any arguments that might be dynamically
calculated, such as method invocations.

Identify additional inefficient code patterns:

-- Passing dynamic strings into a StringBuilder, which acquires a
transparent StringBuilder for each append.
-- Using "str += val;" style concatenation, which acquires a
transparent StringBuilder for each append.
-- Using StringBuffer which has synchronization overhead.

Bug: 170978902
Test: atest error_prone_android_framework_test
Change-Id: Ia3758dd55a0e6753b0cc5bc83ae8fe45b6bfde1f
parent c0e3a096
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment