Skip to content

Commit

Permalink
Merge pull request #106 from OP-TED/bugfix/fix-stackoverflow
Browse files Browse the repository at this point in the history
Revert "ComponentFactory: Improve SymbolResolver creation (TEDEFO-3286)"
  • Loading branch information
bertrand-lorentz authored Apr 19, 2024
2 parents 8a28468 + b5d22aa commit 4059aed
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions src/main/java/eu/europa/ted/eforms/sdk/ComponentFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,30 +86,13 @@ public static SymbolResolver getSymbolResolver(final String sdkVersion, final Pa
*/
public static SymbolResolver getSymbolResolver(final String sdkVersion, final String qualifier,
final Path sdkRootPath) throws InstantiationException {
return getSymbolResolver(sdkVersion, qualifier, sdkRootPath);
}

/**
* Gets the single instance containing the symbols defined in the given version of the eForms SDK.
*
* @param sdkVersion Version of the SDK
* @param qualifier Qualifier to choose between several implementations
* @param parameters Array of objects to be passed as arguments to the constructor of the
* SymbolResolver implementation
* @return The single instance containing the symbols defined in the given version of the eForms
* SDK.
* @throws InstantiationException If the SDK version is not supported.
*/
public static SymbolResolver getSymbolResolver(final String sdkVersion, final String qualifier,
Object... parameters) throws InstantiationException {

VersionQualifier key = ComponentFactory.INSTANCE.new VersionQualifier(sdkVersion, qualifier);

return instances.computeIfAbsent(key, k -> {
try {
return ComponentFactory.INSTANCE.getComponentImpl(sdkVersion,
SdkComponentType.SYMBOL_RESOLVER, qualifier, SymbolResolver.class, sdkVersion,
parameters);
sdkRootPath);
} catch (InstantiationException e) {
throw new RuntimeException(MessageFormat.format(
"Failed to instantiate SDK Symbol Resolver for SDK version [{0}]", sdkVersion), e);
Expand Down

0 comments on commit 4059aed

Please sign in to comment.