Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Checkstyle: to ensure ULC classes are not declared as static variables
#1
To whom run into problems with ocasional "statics" for ULC classes:

http://ulc.canoo.com/ulccommunity/Contri...tices.html
"
Static variables
Never keep instances of ULC classes in static variables (ULCIcons neither!). They cannot be shared between different sessions.
"

Checkstyle already have Check to put warning for such cases:
http://sevntu-checkstyle.github.io/sevnt...yle/#1.0.5
AvoidModifiersForTypesCheck

Code: https://github.com/sevntu-checkstyle/sev...Check.java

It might be good to put a link to that resource from GoodPractices.html, as "static" is pain that developers always forget.


Attached Files Thumbnail(s)
   
Reply
#2
Thanks for this. I will include the link.

Btw, you have Premium Support. Did you try posting on Premium Support forum.

Thanks

Janak
Reply
#3
Not yet, but I do believe that this info have to be publicly available as your best practice page, It will be useful for all.
So I did post in public forum intensionally.
Reply
#4
Hello,

I have already made changes to the page as suggested by you. It will go live in couple of days.

Thanks

Janak
Reply


Forum Jump: