Don't expand formatted ranges to include neighbouring tokens

If the formatted range starts or ends on whitespace, previously we would expand
the range to the next token. This meant that if the formatted range
started/ended on whitespace or comments, neighbouring statements owuld also get
reformatted.

This change causes the formatter to contract the range instead.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=95241146
3 files changed
tree: b70a64f4d561cee3e4034a3f8a7ddca64f73b2a8
  1. core/
  2. .gitignore
  3. .travis.yml
  4. CONTRIBUTING.md
  5. LICENSE
  6. pom.xml
  7. README.md
README.md

google-java-format

Build Status

google-java-format is a program that reformats Java source code to comply with Google Java Style.