jhipster / jhipster/prettier-java
String concatenation formatting
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 120
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 27
Description
**Prettier-Java 1.6.1**
Related to https://github.com/jhipster/prettier-java/issues/77.
In this case we're getting compilable code, it's just sub-ideal.
```sh
# Options (if any):
--print-width 140
```
**Input:**
```java
PreparedStatement statement =
connection.prepareStatement(
"INSERT INTO noneofyourbusiness(" +
"field1," +
"field2," +
"field3," +
"field4) " +
"VALUES (?, ?, ?, ?)");
```
**Output:**
```java
PreparedStatement statement = connection.prepareStatement(
"INSERT INTO noneofyourbusiness(" + "field1," + "field2," + "field3," + "field4) " + "VALUES (?, ?, ?, ?)"
);
```
**Expected behavior:**
I see two options:
- do not join the lines if they contain string concatenation like this
- join, but make sure to get rid of all the concatenation
Contributor guide
Assessment
This issue has not been assessed yet.