• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What about line wrap?

 
Seetharaman Iyer
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need a help regarding line wrap. I use 65 characters / some cases max 80 characters as a limit. I have some scenarios like

1)
} catch (FileNotFoundException e) {
...
throw new ServiceStartFailureException(MsgConstants.DBPATH_NOT_EXIST);
}


2)
} catch (ServiceNotRunningException e) {
...
return ErrorResponse.prepareErrorResponse(MsgConstants.SERVICE_UNAVAILABLE);
}

Please tell me how to break these lines.

Your help is much appreciated!
Seetha...
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Seetharaman,

I just used the formatter of Eclipse which I tweaked a bit (80 characters per line for example) and used just this formatter in every source file.

Kind regards,
Roel
 
Martin Krischik
Greenhorn
Posts: 23
Android Scala VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Seetharaman,

Seetharaman Iyer wrote:Please tell me how to break these lines.


Any way you like. I used Allman style instead of the Sun Style and still passed. I did describe my style choices in the first chapter of choices.txt .

And just like Roel I let Eclipse do all the work.

Martin
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy, Martin!

Champ, one curiosity, when did you pass the exam? Did you have access to your detailed score? I suspect that, if you don't follow Sun's code conventions, then you can lose points in the "General Considerations" criteria. I'm not sure, though.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roberto Perillo wrote:when did you pass the exam?

August 18, based on this thread so no detailed score anymore
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roel De Nijs wrote:August 18, based on this thread so no detailed score anymore


So congrats there and here, Martin!
 
Martin Krischik
Greenhorn
Posts: 23
Android Scala VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Roberto,

Roberto Perillo wrote:Did you have access to your detailed score?


As I said no access to detailed scores for passes. I guess it is another measurement against fraught. On the other hand it makes the whole SCJD a guesswork. If you are concerned: Code the way you like it best (after all you have to read your own code most of the time) and at the end run the code through a carefully set up Eclipse cleanup/format at the end.

Martin
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Martin Krischik wrote:Code the way you like it best (after all you have to read your own code most of the time) and at the end run the code through a carefully set up Eclipse cleanup/format at the end.


Agreed. One good tip is to prepare Eclipse's formatter to follow Sun's code conventions (as described here).
 
Martin Krischik
Greenhorn
Posts: 23
Android Scala VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roberto Perillo wrote:(as described here).


»The Code Conventions for the Java Programming Language document was revised and updated on April 20, 1999.«

Gosh, that has not been updated in 11 years.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Martin Krischik wrote:Gosh, that has not been updated in 11 years.

Never change a winning team
 
Martin Krischik
Greenhorn
Posts: 23
Android Scala VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roel De Nijs wrote:Never change a winning team


But Team has changed: It now has generics!
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Martin Krischik wrote:It now has generics!

Hm, generics you say That's new to me, I'll have to do some investigation about these generics
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic