Skip to content

Provide a debug option for generated code #191

@raner

Description

@raner

Occasionally, there are problems with the runtime-generated bytecode that Projo produces, for example, one might see an error message like this:

java.util.ServiceConfigurationError: bootstrap.Bootstrap: Provider natives.bootstrap.Bootstrap could not be instantiated
	at natives.IntegerTest.installBootstrap(IntegerTest.java:19)
Caused by: com.google.inject.CreationException: 
Unable to create injector, see the following errors:

1) [Guice/ErrorInjectingConstructor]: IncompatibleClassChangeError: Interface method reference: 'Id Something.id()', is in an indirect superinterface of False$Projo
  at False$Projo.<init>(Unknown Source)
  while locating False$Projo
  at Bootstrap$1.configure(Bootstrap.java:69)
  at Provider.booleanFalse(Provider.java:30)
      \_ for field booleanFalse
  at Bootstrap._addBinding(Bootstrap.java:122)

This vaguely suggests that there is something wrong with the implementation of the constructor for False$Projo, but the exact nature of the problem is hard to diagnose because there is no "source code" per se, and no .class file either. The generated bytecode only exists within the JVM.

It would be nice if there were a way to easily get hold of the class file for a generated type (e.g., by saving a copy in /tmp or some other specified location).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions