Repository navigation
Closed
Description
I have this code
@Transactional
public class FichasRepository {
private final SQLQueryFactory queryFactory;
@Inject
public FichasRepository(SQLQueryFactory queryFactory) {
this.queryFactory = queryFactory;
}
public Integer getFichaId(
int codEscola, int codCurso, int nPlano, int nDiscipplina, int nOpcao, int anoLect) {
QGeFichas f = Tables.GE_FICHAS;
QIpbDisciplinas d = Tables.IPB_DISCIPLINAS;
QIpbOpcoes o = Tables.IPB_OPCOES;
queryFactory
.select(f.idFicha)
.from(f)
.join(d)
.on(d.codEscola.eq(f.codEscola), d.codCurso.eq(f.codCurso),
d.nPlano.eq(f.nPlano), d.nDisciplina.eq(f.nDisciplina))
.leftJoin(o)
.on(o.codEscola.eq(d.codEscola), o.codCurso.eq(d.codCurso), o.nPlano.eq(f.nPlano));
return null;
}
}when formatted form command line becomes:
@Transactional
public class FichasRepository {
private final SQLQueryFactory queryFactory;
@Inject
public FichasRepository(SQLQueryFactory queryFactory) {
this.queryFactory = queryFactory;
}
public Integer getFichaId(
int codEscola, int codCurso, int nPlano, int nDiscipplina, int nOpcao, int anoLect) {
QGeFichas f = Tables.GE_FICHAS;
QIpbDisciplinas d = Tables.IPB_DISCIPLINAS;
QIpbOpcoes o = Tables.IPB_OPCOES;
queryFactory
.select(f.idFicha)
.from(f)
.join(d)
.on(
d.codEscola.eq(f.codEscola), d.codCurso.eq(f.codCurso),
d.nPlano.eq(f.nPlano), d.nDisciplina.eq(f.nDisciplina))
.leftJoin(o)
.on(o.codEscola.eq(d.codEscola), o.codCurso.eq(d.codCurso), o.nPlano.eq(f.nPlano));
return null;
}
}but with
@Transactional
public class FichasRepository {
private final SQLQueryFactory queryFactory;
@Inject
public FichasRepository(SQLQueryFactory queryFactory) {
this.queryFactory = queryFactory;
}
public Integer getFichaId(
int codEscola, int codCurso, int nPlano, int nDiscipplina, int nOpcao, int anoLect) {
QGeFichas f = Tables.GE_FICHAS;
QIpbDisciplinas d = Tables.IPB_DISCIPLINAS;
QIpbOpcoes o = Tables.IPB_OPCOES;
queryFactory
.select(f.idFicha)
.from(f)
.join(d)
.on(d.codEscola.eq(f.codEscola), d.codCurso.eq(f.codCurso), d.nPlano.eq(f.nPlano), d.nDisciplina.eq(f.nDisciplina))
.leftJoin(o)
.on(o.codEscola.eq(d.codEscola), o.codCurso.eq(d.codCurso), o.nPlano.eq(f.nPlano));
return null;
}
}becomes:
@Transactional
public class FichasRepository {
private final SQLQueryFactory queryFactory;
@Inject
public FichasRepository(SQLQueryFactory queryFactory) {
this.queryFactory = queryFactory;
}
public Integer getFichaId(
int codEscola, int codCurso, int nPlano, int nDiscipplina, int nOpcao, int anoLect) {
QGeFichas f = Tables.GE_FICHAS;
QIpbDisciplinas d = Tables.IPB_DISCIPLINAS;
QIpbOpcoes o = Tables.IPB_OPCOES;
queryFactory
.select(f.idFicha)
.from(f)
.join(d)
.on(
d.codEscola.eq(f.codEscola),
d.codCurso.eq(f.codCurso),
d.nPlano.eq(f.nPlano),
d.nDisciplina.eq(f.nDisciplina))
.leftJoin(o)
.on(o.codEscola.eq(d.codEscola), o.codCurso.eq(d.codCurso), o.nPlano.eq(f.nPlano));
return null;
}
}shouldn't the result be same?
I'm using the last snapshot.
Metadata
Metadata
Assignees
Labels
No labels
Activity
cushon commentedon Aug 24, 2018
The source of the inconsistency is that the formatter has some logic to try to preserve arguments laid out in a grid, e.g.:
... since that reads better than:
This is one of the few places the output depends on the existing formatting of the input.