Skip to content

Reuse classes from different compilation units #100

@lburgazzoli

Description

@lburgazzoli

Expected behavior and actual behavior:

Assuming I have some code like:

String data = Files.readString(Path.of("data/MyData.java"));
String route = Files.readString(Path.of("data/MyRoutes.java"));

Reflect.compile("my.example.MyData", data).create().get();
Reflect.compile("my.example.MyRoutes", route).create().get();

Where the class MyData is needed by MyRoutes in this case for unmarshalling from json, then the code above fails with:

org.joor.ReflectException: Compilation error: /my/example/MyRoutes.java:26: error: cannot find symbol
            .marshal().json(JsonLibrary.Jackson, MyData.class)
                                                 ^
  symbol:   class MyData
  location: class MyRoutes

I don't know if this is supported by jOOR.

Steps to reproduce the problem:

  1. clone https://github.com/lburgazzoli/camel-joor-test
  2. mvn compile exec:java

Versions:

  • jOOR: 0.9.12
  • Java: 11

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions