That one certainly looks like a bug to me.
I believe that should read if (!result) { ... }
--Keith
[EMAIL PROTECTED] wrote:
Here is the first example from org.exolab.castor.xml.schema.Schema.java,
lines 1807 - 1822
public boolean removeElement(ElementDecl element) {
boolean result = false;
if (_elements.contains(element)) {
_elements.remove(element.getName());
result = true;
}
if (result = false) {
//--check the cached included schemas
Enumeration cacheIncluded =
_cachedincludedSchemas.elements();
while (cacheIncluded.hasMoreElements() &&!result) {
Schema temp =
(Schema)cacheIncluded.nextElement();
result = temp.removeElement(element);
}
}
return result;
} //-- removeElement
Does this one look intentional?
The other 3 examples in Schema.java are virtually the same pattern for
methods removeAttribute, removeAttributeGroup, removeSimpleType.
They all have the same pattern of
if (result = false) {
The other files I have not personally checked.
Thanks,
DaVe.
.-.
/v\
// \\
/( )\
^^-^^
LAMP Rules David Buschman, SCJP
Web Developer
LEOPARD
Marketing. Communications. In that order.
http://www.leopard.com
303.527.5143 tel 303.530.3480 fax
*Henk van Voorthuijsen <[EMAIL PROTECTED]>*
04/07/2006 05:42 AM
Please respond to
[email protected]
To
[email protected]
cc
Subject
Re: [castor-dev] Possible problem in Castor XML
Yep, that seems intentional. Perhaps just breaking out the
assignments would make the code clearer?
Henk
On 07/04/2006, at 06:28, Keith Visco wrote:
>
> If you're refering to the following from XMLClassDescriptorImpl:
>
> if (added = _elements.add(descriptor)) {
>
> It looks intentional to me, and not a typo.
>
> --Keith
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------
_____________________________________________________________________________
Scanned by IBM Email Security Management Services powered by
MessageLabs. For more information please visit http://www.ers.ibm.com
_____________________________________________________________________________
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------