Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Why do we need to put {@inheritDoc} since it is implicitly added

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a thought, javadocs for methods that inherits or overrides will automatically be generated even if {@inheritDoc} is not specified. Of course in cases where you want to append onto parent's javadocs, {@inheritDoc} is the way to go.

Having said that, has anyone failed SCJD for not explicitly using {@inheritDoc} in methods that 100% retains the parent's javadocs?


The safe way of course is to manually add {@inheritDoc} in those places... just wondering if it is strictly necessary in SUN's terms.
 
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 Ad,

I didn't know that it is implicitly added, so I added them each time. And to be really honest: it was my IDE (Eclipse) who added this javadoc comment each time I implemented a method

Kind regards,
Roel

 
Ad Tan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Roel De Nijs wrote:I didn't know that it is implicitly added, so I added them each time. And to be really honest: it was my IDE (Eclipse) who added this javadoc comment each time I implemented a method


That's very kind for Eclipse to do that... netbeans doesn't

I'm not too sure what goes behind the scene... but when using javadoc utility in the most basic way, parent's javadoc (if present) will be generated if the method does not have it's own javadoc.

The only difference is the inclusion of an additional line:
--- Description copied from interface: XXX

I guess i'd prob add it to all relevant methods to be safe.
 
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

Ad Tan wrote:I guess i'd prob add it to all relevant methods to be safe.


Better safe than sorry You certainly won't fail for it, but might lose some points in the section "Documentation".

Kind regards,
Roel
 
Bartender
Posts: 3648
16
Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ad,

I used netbeans for my projects. And for SCJD, better to explicitly add {@inheritDoc} to those methods. And you will get full marks for documentation.
 
I once met a man from Nantucket. He had a tiny ad
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic