cheptsov / AdvancedExpressionFolding

https://plugins.jetbrains.com/plugin/9320?pr=idea
141 stars 29 forks source link

Incorrect string builder folding #91

Closed aristotll closed 6 years ago

aristotll commented 6 years ago
int curYear = calendar.get(1);
String date = (new StringBuilder()).append(curYear).append("01").toString();

The result: 2017-10-13 16 36 31

Two problems:

  1. curYear does not change.
  2. toString is redundant.

Thanks.

jfcabral commented 6 years ago

Hello I've tested this issue in v0.9.9.3 and:

  1. += operator still appears instead of +
  2. :white_check_mark: redundant toString seems to be fixed 👍
cheptsov commented 6 years ago

Thanks for reporting and the pull requests. Should work now with 0.9.9.4.