mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-10 02:39:39 +02:00
ImplementationFactory: Avoid accessing subclass in parent class initialization
This commit is contained in:
parent
8539157405
commit
adc69caa51
1 changed files with 4 additions and 1 deletions
|
@ -42,13 +42,16 @@ import org.pgpainless.util.Passphrase;
|
||||||
|
|
||||||
public abstract class ImplementationFactory {
|
public abstract class ImplementationFactory {
|
||||||
|
|
||||||
private static ImplementationFactory FACTORY_IMPLEMENTATION = new BcImplementationFactory();
|
private static ImplementationFactory FACTORY_IMPLEMENTATION;
|
||||||
|
|
||||||
public static void setFactoryImplementation(ImplementationFactory implementation) {
|
public static void setFactoryImplementation(ImplementationFactory implementation) {
|
||||||
FACTORY_IMPLEMENTATION = implementation;
|
FACTORY_IMPLEMENTATION = implementation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ImplementationFactory getInstance() {
|
public static ImplementationFactory getInstance() {
|
||||||
|
if (FACTORY_IMPLEMENTATION == null) {
|
||||||
|
FACTORY_IMPLEMENTATION = new BcImplementationFactory();
|
||||||
|
}
|
||||||
return FACTORY_IMPLEMENTATION;
|
return FACTORY_IMPLEMENTATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue