Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Commit

Permalink
HCOLL-24 Fix issue with £ in Native and Heap class ( effects mac OS )
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Austin committed Mar 22, 2014
1 parent 39ad66b commit 1ca4e51
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static String generateHeapObject(DataValueModel<?> dvmodel) {
sb.append("import ").append(normalize(aClass)).append(";\n");
}
sb.append("\npublic class ").append(simpleName(dvmodel.type()))
.append("£heap implements ").append(dvmodel.type().getSimpleName())
.append("$$Heap implements ").append(dvmodel.type().getSimpleName())
.append(", BytesMarshallable, Copyable<").append(normalize(dvmodel.type())).append("> {\n");
sb.append(fieldDeclarations).append('\n');
sb.append(getterSetters);
Expand Down Expand Up @@ -407,7 +407,7 @@ private static void heapFieldDeclarations(StringBuilder fieldDeclarations, Class
.append(" _").append(name).append("[i] = new ").append(type.getName());

if (type.isInterface()) {
fieldDeclarations.append("£heap();\n");
fieldDeclarations.append("$$Heap();\n");
} else {
fieldDeclarations.append("();\n");
}
Expand Down Expand Up @@ -435,7 +435,7 @@ public <T> Class acquireHeapClass(Class<T> tClass) {
if (heapClass != null)
return heapClass;
ClassLoader classLoader = tClass.getClassLoader();
String className = tClass.getName() + "£heap";
String className = tClass.getName() + "$$Heap";
try {
heapClass = classLoader.loadClass(className);
} catch (ClassNotFoundException ignored) {
Expand Down Expand Up @@ -483,7 +483,7 @@ public <T> Class acquireNativeClass(Class<T> tClass) {
if (dumpCode)
LOGGER.info(actual);
ClassLoader classLoader = tClass.getClassLoader();
String className = tClass.getName() + "£native";
String className = tClass.getName() + "$$Native";
try {
nativeClass = classLoader.loadClass(className);
} catch (ClassNotFoundException ignored) {
Expand Down Expand Up @@ -624,7 +624,7 @@ public String generateNativeObject(DataValueModel<?> dvmodel) {
sb.append("import ").append(aClass.getName().replace('$', '.')).append(";\n");
}
sb.append("\npublic class ").append(simpleName(dvmodel.type()))
.append("£native implements ").append(simpleName(dvmodel.type()).replace('$', '.'))
.append("$$Native implements ").append(simpleName(dvmodel.type()).replace('$', '.'))
.append(", BytesMarshallable, Byteable, Copyable<").append(normalize(dvmodel.type())).append("> {\n");
sb.append(staticFieldDeclarations).append('\n');
sb.append(fieldDeclarations).append('\n');
Expand Down Expand Up @@ -750,14 +750,14 @@ private int computeOffset(int offset, FieldModel model) {
}

private void nonScalarFieldDeclaration(StringBuilder fieldDeclarations, Class type, String name, FieldModel model) {
fieldDeclarations.append(" private final ").append(type.getName()).append("£native _").append(name);
fieldDeclarations.append(" private final ").append(type.getName()).append("$$Native _").append(name);
if (!model.isArray()) {
fieldDeclarations.append(" = new ").append(type.getName()).append("£native();\n");
fieldDeclarations.append(" = new ").append(type.getName()).append("$$Native();\n");
} else {
fieldDeclarations.append("[] = new ").append(type.getName()).append("£native[").append(model.indexSize().value()).append("];\n");
fieldDeclarations.append("[] = new ").append(type.getName()).append("$$Native[").append(model.indexSize().value()).append("];\n");
fieldDeclarations.append(" {\n")
.append(" for (int i = 0; i < ").append(model.indexSize().value()).append("; i++)\n")
.append(" _").append(name).append("[i] = new ").append(type.getName()).append("£native();\n")
.append(" _").append(name).append("[i] = new ").append(type.getName()).append("$$Native();\n")
.append(" }\n");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void testGenerateNative() throws Exception {
String actual = new DataValueGenerator().generateNativeObject(JavaBeanInterface.class);
// System.out.println(actual);
CachedCompiler cc = new CachedCompiler(null, null);
Class aClass = cc.loadFromJava(JavaBeanInterface.class.getName() + "£native", actual);
Class aClass = cc.loadFromJava(JavaBeanInterface.class.getName() + "$$Native", actual);
JavaBeanInterface jbi = (JavaBeanInterface) aClass.asSubclass(JavaBeanInterface.class).newInstance();
Bytes bytes = new ByteBufferBytes(ByteBuffer.allocate(64));
((Byteable) jbi).bytes(bytes, 0L);
Expand Down

0 comments on commit 1ca4e51

Please sign in to comment.