|
From: <jom...@us...> - 2008-08-11 09:41:20
|
Revision: 1354
http://jason.svn.sourceforge.net/jason/?rev=1354&view=rev
Author: jomifred
Date: 2008-08-11 09:41:14 +0000 (Mon, 11 Aug 2008)
Log Message:
-----------
fix equals of NumberTermImpl when the arg is Var.
Modified Paths:
--------------
trunk/src/jason/asSyntax/NumberTermImpl.java
trunk/src/jason/asSyntax/VarTerm.java
Modified: trunk/src/jason/asSyntax/NumberTermImpl.java
===================================================================
--- trunk/src/jason/asSyntax/NumberTermImpl.java 2008-08-10 11:06:39 UTC (rev 1353)
+++ trunk/src/jason/asSyntax/NumberTermImpl.java 2008-08-11 09:41:14 UTC (rev 1354)
@@ -77,7 +77,7 @@
public boolean equals(Object o) {
if (o == this) return true;
- if (o != null && o instanceof NumberTerm) {
+ if (o != null && o instanceof Term && ((Term)o).isNumeric()) {
NumberTerm st = (NumberTerm)o;
if (st.isVar() || st.isArithExpr())
return false;
Modified: trunk/src/jason/asSyntax/VarTerm.java
===================================================================
--- trunk/src/jason/asSyntax/VarTerm.java 2008-08-10 11:06:39 UTC (rev 1353)
+++ trunk/src/jason/asSyntax/VarTerm.java 2008-08-11 09:41:14 UTC (rev 1354)
@@ -601,9 +601,9 @@
if (value != null && value.isNumeric())
return ((NumberTerm) value).solve();
else if (hasValue())
- logger.log(Level.SEVERE, "Error getting numerical value of VarTerm " + super.getFunctor() + ", the variable value ("+value+") is not a number.", new Exception());
+ logger.log(Level.SEVERE, getErrorMsg()+" Error getting numerical value of VarTerm " + super.getFunctor() + ", the variable value ("+value+") is not a number.", new Exception());
else
- logger.log(Level.SEVERE, "Error getting numerical value of VarTerm " + super.getFunctor() + ", the variable hasn't a value.", new Exception());
+ logger.log(Level.SEVERE, getErrorMsg()+" Error getting numerical value of VarTerm " + super.getFunctor() + ", the variable hasn't a value.", new Exception());
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|