• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

What about line wrap?

 
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...
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • 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
 
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
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • 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: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • 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: 2292
3
Eclipse IDE Spring Java
  • 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: 2292
3
Eclipse IDE Spring Java
  • 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: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • 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: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • 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
 
Roses are red, violets are blue. Some poems rhyme and some don't. And some poems are a tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic