sigmah
sigmah copied to clipboard
0000635: Indicators values not in order in long period project exports
Hi @manishvishnoi2, thank you for this PR.
I am skeptical about the way you fixed the issue because you broke the immutability on the PivotTableData.Axis
class. Can you try again to fix the issue, keeping the class immutable (keeping the setter declared private
)?
You will have to pass label
parameter to the Axis
constructor, so you will have to find where the Axis is instantiated earlier in the generation process.
@numero-six Hello sir,I will look at the code again and try to fix this.
@numero-six Plz look at the latest fix.It is done by working on Axis class creating a new function thus not breaking immutability.
@manishvishnoi2 your second commit has the same problem, immutability is still broken. You just added another setter.
You should try to solve the problem just like if the label
field was declared final. You will see that your only way become to change the label by passing it to the existing Axis
constructor with 4 parameters. If you do a find usages in your IDE, you may find that the constructor is called only by PivotTableData.Axis#addChild
and I guess that you have to find the call to addChild that should be fixed.
I see that one of them is in org.sigmah.server.report.model.generator.PivotGenerator.Populator#addMonths
add that method compute a label by calling a method renderMonthLabel
. I don't know if it is the exact place to fix but in my opinion but the fix should occur somewhere around there. It would make more sense that the Populator
would be modified and the Axis
not.
Please, look at the issue again, there should be a way.
@manishvishnoi2 : Just checking if you had time to fix the issue with the immutability on the PivotTableData.Axis
class, as pointed out by @numero-six
@spMohanty Yes i am working on it.I will look at reduntant spaces and indentation.
@numero-six Hello sir, I looked at the problem again.I found out that populator is just filling by applying all the label parameter.Also, rather than using a constructor which has other parameters also , i think using a new method as i did is better.The reason i modified axis is because, to populate cells its using Month-Name string which repeats every 12th time.So we have to change the label which cannot be done at populator but at axis. To my thoughts my method is best suitable but if you feel otherwise one more method i can suggest is to make a new constructor with only label parameter.
Yeah, if you remove the setter and add a constructor with a label parameter, it would be a better option.