• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Changes to Data

 
Samantha O'Neill
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone
I have been taking a closer look at the Data file and have noticed a couple of inconsistencies with the Java coding standards and with the text and format for the exceptions thrown.
In Sun's coding standards doc says that long lines should be divided up after a comma or before an operator but in the Data file this hasn't been done.
e.g
According to the standards I would expect a line to be broken up like this:

In the Data file lines have the + operator as
the last character on the line so lines are split AFTER an operator, should I copy the format of the Data file elsewhere and ignore the coding standards or should I correct the Data file to match the standards?
Also there should be a space after the text
denoted by the constant UNEXPECTED otherwise
the text following it runs into it. Plus the
use of capitals in the exceptions is inconsistent - is it okay to alter this?
Finally Sun's coding standards state that all static variables should be declared first in the class but this hasn't been done in Data either.
Have people just ignored it or made changes. I am concerned about making any changes to anything other than lock,unlock and criteriaFind due to the assertion that this class is in all other ways complete and functional.
Anyone's views on this greatly appreciated. Many thanks
Sam
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sam,
Running checkstyle agains the Data classes shows lots of little errors.
I have fixed the errors which affect generated Javadoc, but I have not yet got around to fixing the other errors (I will though).
Raffe asked the same question in this post a couple of days ago (I think most people would have missed it because the thread is way to long - the actual comment about style is about the 3rd last message on the second page!). Anyway, Raffe asked:
Oftopic: I have run checkstyle with ant on the supplied classes from sun and get a lot of warnings. Should i change the style in them or just leave them?
to which Max Habibi replied:
As for the style: sure, I would review the suggestions, and see which ones made sense.
.
My personal view is that we were asked to fix deprecation errors in the provided classes, and to create the lock / unlock code. I have taken that to mean that we have ownership of the code, and when we hand it back to FBNS they will replace their existing code with what we give them. (I used this as my argument for modifying the Data class rather than extending it).
As such, I feel that we should (within reason) make the code in the Data class (and the other provided classes) match the required code style.
Regards, Andrew
 
Samantha O'Neill
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many thanks for that Andrew - I was umming and ahhing about it all day and certainly didn't much fancy changing all my existing code to match Data.
I was just worried that so few people had mentioned it before.
I will stick with my initial feeling and update the Data class to fall in line with everything else.
Kindest regards
Sam
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic