From: Tuukka Lehtonen Date: Sat, 27 Oct 2018 14:42:14 +0000 (+0300) Subject: OpenJ9 compatibility for SCL compiler's naming of ontology modules X-Git-Tag: v1.43.0~136^2~313 X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=commitdiff_plain;h=refs%2Fchanges%2F67%2F2367%2F1 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 --- 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