From: Shigeru C. <ch...@us...> - 2004-05-05 17:17:51
|
User: chiba Date: 04/05/05 10:17:43 Modified: src/main/javassist/compiler/ast Declarator.java Log: Now, the compiler accepts a method that accesses a private field declared in an enclosing class. Revision Changes Path 1.6 +12 -3 javassist/src/main/javassist/compiler/ast/Declarator.java Index: Declarator.java =================================================================== RCS file: /cvsroot/jboss/javassist/src/main/javassist/compiler/ast/Declarator.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Declarator.java 8 Jan 2004 17:22:26 -0000 1.5 +++ Declarator.java 5 May 2004 17:17:43 -0000 1.6 @@ -104,15 +104,24 @@ return null; StringBuffer sbuf = new StringBuffer(); + astToClassName(sbuf, name, sep); + return sbuf.toString(); + } + + private static void astToClassName(StringBuffer sbuf, ASTList name, + char sep) { for (;;) { - sbuf.append(((Symbol)name.head()).get()); + ASTree h = name.head(); + if (h instanceof Symbol) + sbuf.append(((Symbol)h).get()); + else if (h instanceof ASTList) + astToClassName(sbuf, (ASTList)h, sep); + name = name.tail(); if (name == null) break; sbuf.append(sep); } - - return sbuf.toString(); } } |