Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Code review required for converting dateformat  RSS feed

Rob Spoor
Posts: 21048
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No it's not. At least not quite. There is (at least) one flaw in your code: i will never be equal to array.length inside the loop. You should check against array.length - 1.
And I would move the check against empty input to before the loop. Sure, your loop will end after the first iteration, but it still looks odd.

I also see you ignored my advice on using the other parse method to prevent having to catch parse exceptions.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!