Charj: nicer formatting for stringified symbols
authorAaron Becker <akbecker@gmail.com>
Thu, 16 Sep 2010 23:13:12 +0000 (18:13 -0500)
committerAaron Becker <akbecker@gmail.com>
Thu, 16 Sep 2010 23:13:12 +0000 (18:13 -0500)
src/langs/charj/src/charj/translator/ClassSymbol.java
src/langs/charj/src/charj/translator/MethodSymbol.java

index c4aac8de1aeeb19976b3188ce9cbe304c8b9d9b4..a2830d068acb98461b6cdf114ca9f88a70cfc683 100644 (file)
@@ -224,7 +224,7 @@ public class ClassSymbol extends SymbolWithScope implements Scope, Type {
 
     public String toString() {
         if (isPrimitive) return name;
-        else return getFullyQualifiedName() + members + templateArgs;
+        else return getFullyQualifiedName() + members + (templateArgs != null ? templateArgs : "");
     }
 
     public String getFullyQualifiedName() {
index f238c072473367d0e263ac421bb4d886fc19fc87..3e20ea25959bf475a9df998aeb14568639eccb3d 100644 (file)
@@ -118,10 +118,10 @@ public class MethodSymbol
                 "<if(locals)>{<locals; separator=\",\">}<endif>",
                 AngleBracketTemplateLexer.class);
         st.setAttribute("entry", isEntry);
-        st.setAttribute("parent", enclosingScope.getScopeName());
+        st.setAttribute("parent", enclosingScope != null ? enclosingScope.getScopeName() : null);
         st.setAttribute("name", name);
         st.setAttribute("args", orderedArgs);
-        st.setAttribute("locals", locals!=null?locals.getMembers():null);
+        st.setAttribute("locals", locals != null ? locals.getMembers() : null);
         return st.toString();
     }