acesseonline / pyreportjasper

Python Reporting with JasperReports
https://pyreportjasper.readthedocs.io/en/latest/
GNU General Public License v3.0
127 stars 75 forks source link

report.py lines 61 and 63 seem to have a problem #175

Open massimiliano-della-rovere opened 2 months ago

massimiliano-della-rovere commented 2 months ago

I'm not sure if this is a bug, but seems strange code.

The file is report.py, class Report, method __init__, inside the if not jpype.isJVMStarted() there are 2 ifs, one in line 61 and one in line 63. The combined logic of their evaluation seems... strange to me: if the condition of the if at line 61 is True, then the classpath list is updated, but the condition of the if at line 63 will automatically eval to False, so the updated classpath won't be used and will be thrashed since it's not used anywhere else in the __init__ method.

Am I missing something?

immagine

jadsonbr commented 2 months ago

Yes, you are correct. There is a mistake there.

massimiliano-della-rovere commented 2 months ago

My recent pull request https://github.com/acesseonline/pyreportjasper/pull/176 modifies the code inside the second if, i.e. the block starting from line 64.

So it could be convenient to examine the pull request before refactoring the 2 ifs.