jhipster / jhipster/prettier-java
Comment section moved between two import declarations
- Vorherrschende Sprache
- Java
- Sterne
- 1.2k
- Forks
- 120
- Ø Merge
- 1 T. 14 Std.
- Gemergte PRs (30 T.)
- 27
Beschreibung
**Prettier-Java 0.7.0**
Launched through prettier-maven-plugin 0.7.0 without any option.
In the following case, the comment section is moved between two import lines.
This bugs depends on import declaration order. If "com.me.Util" is declared first, the generated file is OK.
**Input:**
```java
package org.mypackage;
/*-
*/
import java.lang.Util;
import java.util.Map;
import com.me.Util;
public class Prettier {}
```
**Output:**
```java
package org.mypackage;
import com.me.Util;
/*-
*/
import java.lang.Util;
import java.util.Map;
public class Prettier {}
```
**Expected behavior:**
```java
package org.mypackage;
/*-
*/
import java.lang.Util;
import java.util.Map;
import com.me.Util;
public class Prettier {}
```
Beitragsleitfaden
Rechercherichtung
Reproduce the issue with the supplied Java input and compare the formatter output with the expected import and comment placement. Trace the import-ordering and comment-handling path, then add a regression test for this case and verify that the comment remains before the imports as shown.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 52/100