Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nested generics no more supported in 2.0.0 #248

Closed
toschder opened this issue May 2, 2022 · 1 comment
Closed

nested generics no more supported in 2.0.0 #248

toschder opened this issue May 2, 2022 · 1 comment
Labels

Comments

@toschder
Copy link

toschder commented May 2, 2022

DSL classes having nested generics like in this testcase:

    def 'getElementType with nested generics'() {
        given:
        createClass('''
            class Dummy {
                Map<String, List<String>> authorizationRoles
            }

        ''')

        when:
        def dummy = getClass("Dummy")
        def value = DslHelper.getElementType(dummy, "authorizationRoles")

        then:
        noExceptionThrown()
    }

cant be used.

Models will fail with something like:

Caused by: java.lang.IllegalArgumentException: ElementType java.util.List<java.lang.String> is neither class nor Wildcard
	at com.blackbuild.klum.ast.util.DslHelper.getElementType(DslHelper.java:103)
	at com.blackbuild.klum.ast.util.KlumInstanceProxy.doAddElementToMap(KlumInstanceProxy.java:422)
	at com.blackbuild.klum.ast.util.KlumInstanceProxy.addElementToMap(KlumInstanceProxy.java:414)
	at com.blackbuild.klum.ast.util.KlumInstanceProxy.lambda$addElementsToMap$13(KlumInstanceProxy.java:396)
	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
	at com.blackbuild.klum.ast.util.KlumInstanceProxy.addElementsToMap(KlumInstanceProxy.java:396)
	at com.blackbuild.klum.ast.util.KlumInstanceProxy.lambda$applyNamedParameters$2(KlumInstanceProxy.java:181)
	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
	at com.blackbuild.klum.ast.util.KlumInstanceProxy.applyNamedParameters(KlumInstanceProxy.java:181)
	at com.blackbuild.klum.ast.util.KlumInstanceProxy.apply(KlumInstanceProxy.java:165)
	at com.blackbuild.klum.ast.util.FactoryHelper.createAsTemplate(FactoryHelper.java:163)
	at com.blackbuild.klum.ast.util.TemplateManager.withTemplate(TemplateManager.java:62)
	at com.bmw.devci.jenkins.groups.DemoApp.run(DemoApp.groovy:26)
@pauxus pauxus added the bug label May 2, 2022
@pauxus
Copy link
Member

pauxus commented May 2, 2022

related to #243

@pauxus pauxus closed this as completed in 9c32a4c May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants