Skip to content

Commit

Permalink
With AOT, the storage class of the parent shape is not loaded by a `G…
Browse files Browse the repository at this point in the history
…eneratorClassLoader`.
  • Loading branch information
ansalond committed May 17, 2021
1 parent d1fa8c7 commit c1492ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ abstract class ShapeGenerator<T> {

abstract StaticShape<T> generateShape(StaticShape<T> parentShape, Collection<StaticProperty> staticProperties);

static <T> ShapeGenerator<T> getShapeGenerator(StaticShape<T> parentShape) {
static <T> ShapeGenerator<T> getShapeGenerator(GeneratorClassLoader gcl, StaticShape<T> parentShape) {
Class<?> parentStorageClass = parentShape.getStorageClass();
Class<?> storageSuperclass = ARRAY_BASED_STORAGE ? parentStorageClass.getSuperclass() : parentStorageClass;
GeneratorClassLoader gcl = (GeneratorClassLoader) parentStorageClass.getClassLoader();
return getShapeGenerator(gcl, storageSuperclass, parentShape.getFactoryInterface());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ public StaticShape<DefaultStaticObject.Factory> build() {

public <T> StaticShape<T> build(StaticShape<T> parentShape) {
Objects.requireNonNull(parentShape);
ShapeGenerator<T> sg = ShapeGenerator.getShapeGenerator(parentShape);
GeneratorClassLoader gcl = getOrCreateClassLoader(parentShape.getStorageClass());
ShapeGenerator<T> sg = ShapeGenerator.getShapeGenerator(gcl, parentShape);
return build(sg, parentShape);
}

Expand Down

0 comments on commit c1492ad

Please sign in to comment.