Commit 126dbbe3 authored by Johannes Mey's avatar Johannes Mey
Browse files

improve resolve all and do not call it automatically

parent 3159c7b7
...@@ -957,7 +957,7 @@ aspect NameResolutionHelper { ...@@ -957,7 +957,7 @@ aspect NameResolutionHelper {
sb.append(ind(1) + "// enforce resolving in the entire subtree\n"); sb.append(ind(1) + "// enforce resolving in the entire subtree\n");
sb.append(ind(1) + "public void ASTNode.treeResolveAll() {\n"); sb.append(ind(1) + "public void ASTNode.treeResolveAll() {\n");
sb.append(ind(2) + "if (children != null) {\n"); sb.append(ind(2) + "if (children != null) {\n");
sb.append(ind(3) + "for (int i = 0; i < children.length; ++i) {\n"); sb.append(ind(3) + "for (int i = 0; i < numChildren; ++i) {\n");
sb.append(ind(4) + "ASTNode child = children[i];\n"); sb.append(ind(4) + "ASTNode child = children[i];\n");
sb.append(ind(4) + "if (child != null) {\n"); sb.append(ind(4) + "if (child != null) {\n");
sb.append(ind(5) + "child.treeResolveAll();\n"); sb.append(ind(5) + "child.treeResolveAll();\n");
...@@ -1212,7 +1212,6 @@ aspect Serializer { ...@@ -1212,7 +1212,6 @@ aspect Serializer {
sb.append(ind(3) + "com.fasterxml.jackson.core.JsonFactory factory = mapper.getFactory();\n"); sb.append(ind(3) + "com.fasterxml.jackson.core.JsonFactory factory = mapper.getFactory();\n");
sb.append(ind(3) + "com.fasterxml.jackson.core.JsonParser parser = factory.createParser(file);\n"); sb.append(ind(3) + "com.fasterxml.jackson.core.JsonParser parser = factory.createParser(file);\n");
sb.append(ind(3) + getID() + " result = deserialize((com.fasterxml.jackson.databind.JsonNode)mapper.readTree(parser));\n"); sb.append(ind(3) + getID() + " result = deserialize((com.fasterxml.jackson.databind.JsonNode)mapper.readTree(parser));\n");
sb.append(ind(3) + "result.treeResolveAll();\n");
sb.append(ind(3) + "return result;\n"); sb.append(ind(3) + "return result;\n");
sb.append(ind(2) + "} catch (java.io.IOException e) {\n"); sb.append(ind(2) + "} catch (java.io.IOException e) {\n");
sb.append(ind(3) + "throw new DeserializationException(\"unable to deserialize \" + file.getAbsolutePath(), e);\n"); sb.append(ind(3) + "throw new DeserializationException(\"unable to deserialize \" + file.getAbsolutePath(), e);\n");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment