mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 08:18:55 +00:00
Merge pull request #1661 from eclipse/cd_fixNPE
fixed npe in formatter in tests
This commit is contained in:
commit
e3d79e99f1
1 changed files with 1 additions and 1 deletions
|
@ -16,7 +16,7 @@ public class FileAwareTestLanguageFormatter extends AbstractJavaFormatter {
|
|||
|
||||
protected void format(PackageDeclaration pkg, IFormattableDocument doc) {
|
||||
doc.append(regionFor(pkg).feature(FileAwarePackage.Literals.PACKAGE_DECLARATION__NAME), it -> it.setNewLines(2));
|
||||
Import last = Iterables.getLast(pkg.getImports());
|
||||
Import last = Iterables.getLast(pkg.getImports(), null);
|
||||
for (Import imp : pkg.getImports()) {
|
||||
doc.format(imp);
|
||||
doc.append(imp, it -> it.setNewLines(imp == last ? 2 : 1));
|
||||
|
|
Loading…
Reference in a new issue