[Nice-commit] Nice/src/nice/tools/code Types.java,1.61,1.62
Brought to you by:
bonniot
From: Arjan B. <ar...@us...> - 2004-11-22 23:21:14
|
Update of /cvsroot/nice/Nice/src/nice/tools/code In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23666/F:/nice/src/nice/tools/code Modified Files: Types.java Log Message: Java methods/fields with parametric types get type parameters with UnknownType instead of being ignored. Index: Types.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/code/Types.java,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** Types.java 22 Nov 2004 14:40:58 -0000 1.61 --- Types.java 22 Nov 2004 23:21:04 -0000 1.62 *************** *** 412,416 **** return TopMonotype.instance; ! return getMonotype(javaType.getName()); } --- 412,433 ---- return TopMonotype.instance; ! TypeConstructor tc = bossa.syntax.Node.getGlobalTypeScope(). ! globalLookup(javaType.getName(), null); ! ! if (tc == null) ! { ! Internal.warning(javaType.getName() + " is not known"); ! throw new NotIntroducedClassException(tc); ! } ! ! if (tc.getId() == -1) ! throw new NotIntroducedClassException(tc); ! ! try { ! return nice.tools.typing.Types.unknownArgsMonotype(tc); ! } ! catch (BadSizeEx ex) { ! throw new ParametricClassException(tc.toString()); ! } } *************** *** 444,478 **** } - private static Monotype getMonotype(String name) - throws ParametricClassException, NotIntroducedClassException - { - if(name.endsWith("[]")) - { - name=name.substring(0,name.length()-2); - return new MonotypeConstructor - (PrimitiveType.arrayTC, - new Monotype[]{ getMonotype(name) }); - } - - TypeConstructor tc = bossa.syntax.Node.getGlobalTypeScope(). - globalLookup(name, null); - - if (tc == null) - { - Internal.warning(name + " is not known"); - throw new NotIntroducedClassException(tc); - } - - if (tc.getId() == -1) - throw new NotIntroducedClassException(tc); - - try { - return nice.tools.typing.Types.zeroArgMonotype(tc); - } - catch (BadSizeEx ex) { - throw new ParametricClassException(tc.toString()); - } - } - /**************************************************************** * Converting string to gnu.bytecode.Type --- 461,464 ---- |