[Nice-commit] Nice/src/bossa/syntax TypeScope.java,1.43,1.44
Brought to you by:
bonniot
From: Artem Gr K. <ar...@us...> - 2005-04-18 19:05:09
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20098/src/bossa/syntax Modified Files: TypeScope.java Log Message: A workaround for the situation when a class with a '$' in its name is searched for with '.' instead of '$'. Index: TypeScope.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/TypeScope.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** TypeScope.java 6 Mar 2005 01:34:26 -0000 1.43 --- TypeScope.java 18 Apr 2005 19:04:58 -0000 1.44 *************** *** 106,110 **** TypeSymbol get(String name) { ! return (TypeSymbol) map.get(name); } --- 106,122 ---- TypeSymbol get(String name) { ! TypeSymbol typeSymbol = (TypeSymbol) map.get(name); ! if (typeSymbol != null) return typeSymbol; ! // A workaround required to find Nice classes having a '$' in the name. ! // Such classes are placed into the scope with their correct name, ! // but when looked up from the bytecode, the '$' is replaced with a '.'. ! // Therefore we'll try to replace '.' back into '$'. ! int dot; while (true) { ! dot = name.lastIndexOf('.'); ! if (-1 == dot) return null; ! name = name.substring(0,dot) + '$' + name.substring(dot+1); ! typeSymbol = (TypeSymbol) map.get(name); ! if (typeSymbol != null) return typeSymbol; ! } } |