#23 RequestCtx.encode not respecting environment tag

open
nobody
None
5
2007-06-28
2007-06-28
No

Suppose the set of environment attributes passed to the RequestCtx are empty, the encode method should print an empty <Environment/> tag.

The code that is now:

// finally the environment, if there are any attrs
if (environment.size() != 0) {
out.println(indent + "<Environment>");
encodeAttributes(environment, out, indenter);
out.println(indent + "</Environment>");
}
==========

Change it to

out.println(indent + "<Environment>");
if (environment.size() != 0) {
encodeAttributes(environment, out, indenter);

}
out.println(indent + "</Environment>");

The reason is that the schema mandates the Environment tag.

Discussion


Log in to post a comment.