TIBCOSoftware / jasperreports

JasperReports® - Free Java Reporting Library
https://community.jaspersoft.com/downloads/community-edition/
GNU Lesser General Public License v3.0
1.07k stars 404 forks source link

Deprication Warnings need to show a potental fix #470

Closed meshpaul closed 3 months ago

meshpaul commented 3 months ago

Hi,

I see the following deprecation warnings

 warning: [removal] Boolean(boolean) in Boolean has been deprecated and marked for removal
                value = new Boolean(((java.lang.Integer)variable_REPORT_COUNT.getEstimatedValue()).intValue()%2==0); //$JR_EXPR_ID=1$

What is new long term fix moving forward?

Thank you

teodord commented 3 months ago

Initially, I thought it is caused by the way we generate expressions when compiling JRXML. But after looking into it, I realised it is not the case. The warning is caused by the use of a deprecated Boolean constructor in one of the expressions inside your JRXML. The solution is to revisit your JRXML and replace it with Boolean.valueOf.

I hope this helps. Teodor

teodord commented 3 months ago

The warning is coming from the Java compiler and is coming from the JDK, which deprecated that Boolean constructor. The long term fix you are looking for is in the Javadoc: https://docs.oracle.com/javase%2F9%2Fdocs%2Fapi%2F%2F/java/lang/Boolean.html#Boolean-boolean-

I hope this helps. Teodor