[#6699] DSL.trueCondition() and DSL.falseCondition() should return constants

This commit is contained in:
lukaseder 2017-10-12 18:06:19 +02:00
parent b952cb5c2f
commit a4407cbfcd
3 changed files with 6 additions and 4 deletions

View File

@ -10338,7 +10338,7 @@ public class DSL {
*/
@Support
public static True trueCondition() {
return new TrueCondition();
return TrueCondition.INSTANCE;
}
/**
@ -10346,7 +10346,7 @@ public class DSL {
*/
@Support
public static False falseCondition() {
return new FalseCondition();
return FalseCondition.INSTANCE;
}
/**

View File

@ -48,6 +48,7 @@ final class FalseCondition extends AbstractCondition implements False {
private static final long serialVersionUID = -3972466479081463547L;
private static final Clause[] CLAUSES = { CONDITION, CONDITION_COMPARISON };
static final FalseCondition INSTANCE = new FalseCondition();
@Override
public final void accept(Context<?> ctx) {
@ -59,5 +60,5 @@ final class FalseCondition extends AbstractCondition implements False {
return CLAUSES;
}
FalseCondition() {}
private FalseCondition() {}
}

View File

@ -49,6 +49,7 @@ final class TrueCondition extends AbstractCondition implements True {
private static final long serialVersionUID = 775364624704563687L;
private static final Clause[] CLAUSES = { CONDITION, CONDITION_COMPARISON };
static final TrueCondition INSTANCE = new TrueCondition();
@Override
public final void accept(Context<?> ctx) {
@ -60,5 +61,5 @@ final class TrueCondition extends AbstractCondition implements True {
return CLAUSES;
}
TrueCondition() {}
private TrueCondition() {}
}