Update of /cvsroot/nice/Nice/src/bossa/syntax
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27438/src/bossa/syntax
Modified Files:
Pattern.java
Log Message:
Perform exact matching on the first argument of methods declared in Java
when needed (fixes #888229).
Index: Pattern.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Pattern.java,v
retrieving revision 1.77
retrieving revision 1.78
diff -C2 -d -r1.77 -r1.78
*** Pattern.java 23 Dec 2003 11:30:58 -0000 1.77
--- Pattern.java 2 Feb 2004 13:08:33 -0000 1.78
***************
*** 769,781 ****
/**
Returns code that tests if the parameter is matched.
*/
! public gnu.expr.Expression matchTest(gnu.expr.Expression parameter)
{
if (atNull())
return Gen.isNullExp(parameter);
- if (atAny())
- return QuoteExp.trueExp;
-
if (atBool())
{
--- 769,785 ----
/**
Returns code that tests if the parameter is matched.
+
+ @param dispatchMade indicates that dispatch has already occured. It is
+ still necessary to check for exact matching if applicable.
*/
! public gnu.expr.Expression matchTest(gnu.expr.Expression parameter,
! boolean dispatchMade)
{
+ if (atAny() || (dispatchMade && ! exactlyAt))
+ return QuoteExp.trueExp;
+
if (atNull())
return Gen.isNullExp(parameter);
if (atBool())
{
|