mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-01-10 20:27:58 +01: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 {
|
||||
|
||||
private static ImplementationFactory FACTORY_IMPLEMENTATION = new BcImplementationFactory();
|
||||
private static ImplementationFactory FACTORY_IMPLEMENTATION;
|
||||
|
||||
public static void setFactoryImplementation(ImplementationFactory implementation) {
|
||||
FACTORY_IMPLEMENTATION = implementation;
|
||||
}
|
||||
|
||||
public static ImplementationFactory getInstance() {
|
||||
if (FACTORY_IMPLEMENTATION == null) {
|
||||
FACTORY_IMPLEMENTATION = new BcImplementationFactory();
|
||||
}
|
||||
return FACTORY_IMPLEMENTATION;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue