RFR: 8299502: Usage of constructors of primitive wrapper classes should be avoided in javax.xml API docs

Joe Wang joehw at openjdk.org
Fri Jan 6 21:23:55 UTC 2023


On Fri, 6 Jan 2023 19:56:20 GMT, Justin Lu <duke at openjdk.org> wrote:

>> Removed constructors of primitive wrapper classes (deprecated for removal) in _javax.xml.stream.XMLOutputFactory_ 
>> 
>> Replaced with Boolean static fields: Boolean.TRUE and Boolean.FALSE
>
> src/java.xml/share/classes/javax/xml/stream/XMLOutputFactory.java line 59:
> 
>> 57:  *
>> 58:  * <p>The property can be set with the following code line:
>> 59:  * {@code setProperty("javax.xml.stream.isRepairingNamespaces", Boolean.TRUE|Boolean.FALSE);}
> 
> From a code standpoint I don't see why the OR operation is needed (Also, shouldn't a Conditional OR be used over a Bitwise OR). Is it to emphasize that true _or_ false can be passed as a parameter?

I think the later, that the value can be true or false. As an example, one value is fine, e.g.
  {@code setProperty("javax.xml.stream.isRepairingNamespaces", Boolean.TRUE);} 
  or 
  {@code setProperty("javax.xml.stream.isRepairingNamespaces", true);}
  let autoboxing handle it.

-------------

PR: https://git.openjdk.org/jdk/pull/11872


More information about the core-libs-dev mailing list