diff --git a/src/main/java/net/openhft/chronicle/values/Generators.java b/src/main/java/net/openhft/chronicle/values/Generators.java index 402b08897..6f597af10 100644 --- a/src/main/java/net/openhft/chronicle/values/Generators.java +++ b/src/main/java/net/openhft/chronicle/values/Generators.java @@ -46,7 +46,7 @@ static String generateNativeClass(ValueModel model, String nativeClassName) { valueBuilder.closeConstructorsAndInitializationBlocks(); TypeSpec nativeType = typeBuilder.build(); String result = JavaFile - .builder(model.valueType.getPackage().getName(), nativeType) + .builder(Jvm.getPackageName(model.valueType), nativeType) .build() .toString(); if (Jvm.getBoolean("chronicle.values.dumpCode")) @@ -268,7 +268,7 @@ static String generateHeapClass(ValueModel model, String heapClassName) { valueBuilder.closeConstructorsAndInitializationBlocks(); TypeSpec heapType = typeBuilder.build(); String result = JavaFile - .builder(model.valueType.getPackage().getName(), heapType) + .builder(Jvm.getPackageName(model.valueType), heapType) .build() .toString(); if (Jvm.getBoolean("chronicle.values.dumpCode")) diff --git a/src/main/java/net/openhft/chronicle/values/MyJavaFileManager.java b/src/main/java/net/openhft/chronicle/values/MyJavaFileManager.java index 00d4154d9..13a1333c0 100644 --- a/src/main/java/net/openhft/chronicle/values/MyJavaFileManager.java +++ b/src/main/java/net/openhft/chronicle/values/MyJavaFileManager.java @@ -19,6 +19,7 @@ package net.openhft.chronicle.values; import net.openhft.chronicle.bytes.*; +import net.openhft.chronicle.core.Jvm; import net.openhft.chronicle.core.io.ClosedIllegalStateException; import net.openhft.chronicle.core.io.IORuntimeException; import net.openhft.chronicle.core.io.InvalidMarshallableException; @@ -70,7 +71,7 @@ public MyJavaFileManager(Class valueType, StandardJavaFileManager fileManager } private static void addFileObjects(Map> fileObjects, Class c) { - fileObjects.compute(c.getPackage().getName(), (p, objects) -> { + fileObjects.compute(Jvm.getPackageName(c), (p, objects) -> { if (objects == null) objects = new HashSet<>(); objects.add(classFileObject(c)); diff --git a/src/main/java/net/openhft/chronicle/values/ValueBuilder.java b/src/main/java/net/openhft/chronicle/values/ValueBuilder.java index f9b70b538..c388d38fa 100644 --- a/src/main/java/net/openhft/chronicle/values/ValueBuilder.java +++ b/src/main/java/net/openhft/chronicle/values/ValueBuilder.java @@ -43,7 +43,7 @@ public ValueBuilder(ValueModel model, String className, TypeSpec.Builder typeBui } ClassName className() { - return ClassName.get(model.valueType.getPackage().getName(), className); + return ClassName.get(Jvm.getPackageName(model.valueType), className); } FieldSpec unsafe() { diff --git a/src/main/java/net/openhft/chronicle/values/ValueModel.java b/src/main/java/net/openhft/chronicle/values/ValueModel.java index 99cb752bb..9979d2a8c 100644 --- a/src/main/java/net/openhft/chronicle/values/ValueModel.java +++ b/src/main/java/net/openhft/chronicle/values/ValueModel.java @@ -317,7 +317,7 @@ String simpleName() { private Class createClass( String className, BiFunction generateClass) { - String classNameWithPackage = valueType.getPackage().getName() + "." + className; + String classNameWithPackage = Jvm.getPackageName(valueType) + "." + className; ClassLoader cl = BytecodeGen.getClassLoader(valueType); try { return cl.loadClass(classNameWithPackage);