Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Checkstyle: to ensure ULC classes are not declared as static variables
01-19-2014, 09:18 PM
Post: #1
Checkstyle: to ensure ULC classes are not declared as static variables
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 File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
01-23-2014, 07:50 AM
Post: #2
RE: Checkstyle: to ensure ULC classes are not declared as static variables
Thanks for this. I will include the link.

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

Thanks

Janak
Find all posts by this user
Quote this message in a reply
01-23-2014, 10:13 PM
Post: #3
RE: Checkstyle: to ensure ULC classes are not declared as static variables
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.
Find all posts by this user
Quote this message in a reply
01-24-2014, 11:51 AM
Post: #4
RE: Checkstyle: to ensure ULC classes are not declared as static variables
Hello,

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

Thanks

Janak
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: