Update of /cvsroot/nice/Nice/src/bossa/link
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32031/link
Modified Files:
ImportedAlternative.java
Log Message:
Do not fail when a pattern loaded from a compiled package is not found.
This can happen because that class does not exist in the version of the JDK
used to load the package.
Index: ImportedAlternative.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/link/ImportedAlternative.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** ImportedAlternative.java 28 Feb 2004 14:23:43 -0000 1.8
--- ImportedAlternative.java 9 Jun 2004 17:02:11 -0000 1.9
***************
*** 59,87 ****
ArrayList patterns = new ArrayList(5);
! Pattern p;
! while ((p = Pattern.read(rep, at, fullName)) != null)
! {
! if (p.getTC() == bossa.syntax.PrimitiveType.arrayTC)
! /* Special treatment for arrays:
! they are compiled into Object,
! but we want a SpecialArray in the method bytecode type.
! */
! {
! int argnum = patterns.size();
! if (method.arg_types[argnum] == Type.pointer_type)
! method.arg_types[argnum] = SpecialArray.unknownTypeArray();
! }
! patterns.add(p);
! }
!
! Alternative alt =
! new ImportedAlternative(method.getName(), (Pattern[])
! patterns.toArray(new Pattern[patterns.size()]),
! new QuoteExp(new PrimProcedure(method)),
! location);
! alt.add(nice.tools.util.System.split
! (fullName, MethodDeclaration.methodListSeparator));
}
--- 59,93 ----
ArrayList patterns = new ArrayList(5);
! try {
! Pattern p;
! while ((p = Pattern.read(rep, at, fullName)) != null)
! {
! if (p.getTC() == bossa.syntax.PrimitiveType.arrayTC)
! /* Special treatment for arrays:
! they are compiled into Object,
! but we want a SpecialArray in the method bytecode type.
! */
! {
! int argnum = patterns.size();
! if (method.arg_types[argnum] == Type.pointer_type)
! method.arg_types[argnum] = SpecialArray.unknownTypeArray();
! }
! patterns.add(p);
! }
! Alternative alt =
! new ImportedAlternative(method.getName(), (Pattern[])
! patterns.toArray(new Pattern[patterns.size()]),
! new QuoteExp(new PrimProcedure(method)),
! location);
!
! alt.add(nice.tools.util.System.split
! (fullName, MethodDeclaration.methodListSeparator));
! }
! catch(Pattern.Unknown ex) {
! // This can happen if the class exists only in a later version
! // of the JDK. We just ignore this alternative.
! }
}
|