Dries Van Autreve created CXFXJC-49:
---------------------------------------
Summary: cxf-xjc-dv should not generate deprecated code
Key: CXFXJC-49
URL: https://issues.apache.org/jira/browse/CXFXJC-49
Project: CXF XJC Utils
Issue Type: Improvement
Components: DV Plugin
Affects Versions: 4.0.2
Reporter: Dries Van Autreve
Given the XMLSchema:
{code:xml}
<xs:element name="myInt" type="xs:int" default="1" minOccurs="0"></xs:element>
{code}
the plugin generates:
{code:java}
public Integer getMyInt() {
if (null == myInt) {
return new Integer(1);
}
return myInt;
}
{code}
which is deprecated.
For example compiling with Java 21 gives following warning:
{noformat}
Integer(int) in java.lang.Integer has been deprecated and marked for removal
{noformat}
The plugin should instead generate:
{code:java}
Integer.valueOf(1);
{code}
The same goes for Long, Double, ...
I'll try to provide a PR to change this.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)