I am not sure what the following piece of code from class ModelViewEntity is
trying to acheive, but as "operator" and "EntityOperator.IN" are both objects
and not primitives the "==" as far as I know test if those two variables
reference the same object and not if the values are equal.
// If IN or BETWEEN operator, see if value is a literal list and split it
if ((operator == EntityOperator.IN || operator ==
EntityOperator.BETWEEN)
&& value instanceof String) {
String delim = null;
if (((String)value).indexOf("|") >= 0) {
delim = "|";
} else if (((String)value).indexOf(",") >= 0) {
delim = ",";
}
if (UtilValidate.isNotEmpty(delim)) {
value = StringUtil.split((String) value, delim);
}
Further the equals() method is overridden in class EntityOperator with the
following:
// FIXME: CCE
@Override
public boolean equals(Object obj) {
EntityOperator otherOper = (EntityOperator) obj;
return this.idInt == otherOper.idInt;
}
So if using equals as in: "if ((operator.equals(EntityOperator.IN)" this
method would be called.
Any comments and suggestions will be much appreciated, thanks.
-André
On Wednesday den 29. July 2009 12:55:30 Deyan Tsvetanov wrote:
> Does it work with equals() instead of == ?
>
>
>
> -----Original Message-----
> From: BJ Freeman <[email protected]>
> Reply-to: [email protected]
> To: [email protected]
> Subject: Re: Compilation error on IBM System i (iSeries, AS/400)
> Date: Wed, 29 Jul 2009 03:44:25 -0700
>
>
> Ok then my next suggestion is you try this on he demo trunk and see if
> you can duplicate the problem. If so then create a Jira.
>
> André Herbst sent the following on 7/28/2009 11:26 PM:
> > Thanks BJ,
> >
> > I would prefer to keep up with the latest revisions from the trunk, so I
> > hope David or Scott can help me with this problem.
> >
> > -André
> >
> > On Tuesday den 28. July 2009 15:53:17 BJ Freeman wrote:
> >> David and Scott have done some modification and refactoring on
> >> ModelViewEntity.java
> >> you can wait for their response or revert to before 790472 and see if
> >> you still have the problem.
> >>
> >> André Herbst sent the following on 7/28/2009 2:05 AM:
> >>> Hi All,
> >>>
> >>> I am working on getting OFBiz to run on an IBM System i server, using
> >>> the systems native DB2 database, but have run into problems with
> >>> compling after an upgrade to a newer version of the trunk.
> >>>
> >>> I am using the OFBiz trunk version 793888 and is getting the following
> >>> compile error:
> >>>
> >>> [javac15]
> >>> /ofbiz/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java
> >>>:1 232: incomparable types:
> >>> org.ofbiz.entity.contiontion.EntityOperator<capture of ?> and
> >>> org.ofbiz.entity.condition.EntityComparisonOperator
> >>> [javac15] if ((operator == EntityOperator.IN || operator ==
> >>> EntityOperator.BETWEEN) [javac15] ^
> >>>
> >>> I am using the "IBM Developer Kit for Java - IBM J9 VM (build 2.3, J2RE
> >>> 1.5.0 IBM J9 2.3 OS400 ppc-32 j9vmap3223-20080315 (JIT enabled)". There
> >>> is no similar problem when I am compiling the same source on my Linux
> >>> box.
> >>>
> >>> Any help would be very much appreciated.
> >>>
> >>> -André