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

Classes with over 256 parameters throw a runtime exception #293

Open
jplewa opened this issue Aug 25, 2023 · 0 comments
Open

Classes with over 256 parameters throw a runtime exception #293

jplewa opened this issue Aug 25, 2023 · 0 comments

Comments

@jplewa
Copy link
Member

jplewa commented Aug 25, 2023

The resource aws:index/ProviderEndpoint:ProviderEndpoint has 384 parameters. JVM allows only 256 parameters. In Kotlin there's no compilation exception, but there is a runtime exception when trying to call its constructor in build:

Exception in thread "main" java.lang.ClassFormatError: Too many arguments in method signature in class file org/virtuslab/pulumikotlin/codegen/ProviderEndpointArgs
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1013)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	at org.virtuslab.pulumikotlin.codegen.MainKt.main(Main.kt:404)

Possible solutions:

  • using a mutable class,
  • replacing this class with a type alias over a map and creating extension methods for getters (I simply cannot take credit for this one, @prolativ).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant