From 1624c696a48a2ca88c50545bcd57daf2ea51104c Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Sat, 27 Oct 2018 17:42:14 +0300 Subject: [PATCH] OpenJ9 compatibility for SCL compiler's naming of ontology modules The problem was these errors coming from ClassLoader.defineClassImpl when the generated class name contained two '/' characters in a row: java.lang.ClassFormatError: JVMCFRE068 class name is invalid; class=scl/http_58_//Projects/Development_37_20Project/Model/SCLMain, offset=0 More escaping was added to fix this. gitlab #159 Change-Id: I01f8b17b1230cbf06051848b23c805e8d2d61c96 --- .../scl/compiler/internal/codegen/utils/JavaNamingPolicy.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/utils/JavaNamingPolicy.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/utils/JavaNamingPolicy.java index bd0765474..7e9780d4a 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/utils/JavaNamingPolicy.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/utils/JavaNamingPolicy.java @@ -34,11 +34,11 @@ public class JavaNamingPolicy { b.append('_').append((int)c).append('_'); } //System.out.println("m2c " + moduleName + " -> " + b.toString()); - return b.toString().replace("..", "._."); + return b.toString().replace("..", "._.").replace("//", "/_/"); } public static String classNameToModuleName(String className) { - className = className.replace("._.", ".."); + className = className.replace("/_/", "//").replace("._.", ".."); StringBuilder b = new StringBuilder(className.length()); int length = className.length(); for(int i=0;i