I wonder if JVM/javac is smart enough to turn
// This line... string a = foo(); string foo() { return bar(); } string bar() { return some-complicated-s
The JVM will most likely inline. In general it's best to optimize for human readability. Let the JVM do the runtime optimization.
JVM expert Brian Goetz says final has no impact on methods being inlined.
final