Permalink
Browse files

Refactoring - no functional change.

FactoryFinder.find() will always throw RuntimeException
if factory implementation cannot be found or instantiated.
  • Loading branch information...
1 parent 0455132 commit b6028c4896b28dd38ba916000f57e1c5eca2159b @ropalka ropalka committed Oct 25, 2017
@@ -41,14 +41,7 @@
*/
public abstract class JsonValueFactory {
- private static final JsonValueFactory FACTORY;
-
- static {
- FACTORY = FactoryFinder.find( JsonValueFactory.class );
- if ( FACTORY == null ) {
- throw new IllegalStateException( "Factory not configured: " + JsonValueFactory.class.getName() );
- }
- }
+ private static final JsonValueFactory FACTORY = FactoryFinder.find( JsonValueFactory.class );
/**
* All implementations must provide public default constructor overriding this one.
@@ -36,14 +36,7 @@
*/
public abstract class JsonStreamFactory {
- private static final JsonStreamFactory FACTORY;
-
- static {
- FACTORY = FactoryFinder.find( JsonStreamFactory.class );
- if ( FACTORY == null ) {
- throw new IllegalStateException( "Factory not configured: " + JsonStreamFactory.class.getName() );
- }
- }
+ private static final JsonStreamFactory FACTORY = FactoryFinder.find( JsonStreamFactory.class );
/**
* All implementations must provide public default constructor overriding this one.

0 comments on commit b6028c4

Please sign in to comment.