We managed to get master to compile and run against java8, apparently our CI plan that generates the javadocs is broken because in java 8 they added very strict rules to validate the javadocs, Some can be suppressed but it seems like some we need to fix, if you know how to suppress all please let us know otherwise we are looking for someone to help us clean up our javadocs so that they conform to the strict rules. Below is what you need to execute from the root of the openmrs project to generate the javadocs:
Umm⊠I think I may have misunderstood, but as I read your email, you have two specific wants⊠is that right?
(a) Someone needs to figure out how to suppress validation for java8
Or if that fails,
(b) volunteers need to go over each failure and edit the java docs in the master so that they work.
@raff from my posts here, i did mention that i already set that but it doesnât turn of all validation, it only suppressed the one for self enclosing tags
I looked into that and after adding -Xdoclint:none the validation produces warnings instead of errors, which is ok.
The build failed due to a different error:
javadoc: error - com.sun.tools.doclets.internal.toolkit.util.DocletAbortException: com.sun.tools.javac.code.Symbol$CompletionFailure: class file for com.fasterxml.jackson.databind.cfg.HandlerInstantiator not found
I noticed that the javadoc plugin included for analysis some packages from org.springframework that lead to that error. Iâm not sure why it did that, but I excluded them and the build went green. See https://ci.openmrs.org/browse/JAVADOC-TRUNK-484
I have been working on TRUNK-4711 and thought I should bring my findings to a wider attention.
In a nutshell, I have fixed most of the javadoc issues but there are still over 30 issues I feel should be looked at by a more experienced developer. Basically most of these issues seem to be related to refactorings, where an implementation has been renamed or removed but javadocs referencing said implementation have not been updated. Here is the list:
Cohort.java:36: warning - Tag @link: reference not found: ReportService#evaluate(org.openmrs.report.ReportSchema, Cohort, EvaluationContext)
Cohort.java:36: warning - Tag @see: reference not found: org.openmrs.cohort.CohortDefinition
Hl7InArchivesMigrateThread.java:29: warning - Tag @see: can't find startHl7ArchiveMigration() in org.openmrs.hl7.HL7Service
HL7Service.java:574: warning - Tag @see: can't find processHL7String(String) in org.openmrs.hl7.HL7Service
HL7ServiceImpl.java:254: warning - Tag @see: can't find getHL7InQueueBatch(int, int, java.lang.String) in org.openmrs.hl7.HL7Service
CustomDatatypeUtil.java:144: warning - Tag @link: reference not found: AttributeHandler
CustomDatatypeUtil.java:122: warning - Tag @link: reference not found: AttributeHandler
CustomDatatypeUtil.java:144: warning - Tag @link: reference not found: AttributeHandler
Attribute.java:31: warning - Tag @see: reference not found: AttributeHandler
AttributeType.java:26: warning - Tag @see: reference not found: AttributeHandler
Operand.java:27: warning - Tag @link: reference not found: OperandDate
Operand.java:27: warning - Tag @link: reference not found: OperandConcept
Operand.java:27: warning - Tag @link: reference not found: OperandDate
Operand.java:27: warning - Tag @link: reference not found: OperandConcept
DatabaseUpdater.java:93: warning - Tag @see: can't find update(Map) in org.openmrs.util.DatabaseUpdater
ConceptInUseException.java:19: warning - Tag @see: can't find checkIfConceptIsAttachedToAnObservation() in org.openmrs.api.ConceptService
ObsService.java:50: warning - Tag @see: reference not found: org.openmrs.ComplexObs
Context.java:828: warning - Tag @link: can't find update(Map) in org.openmrs.util.DatabaseUpdater
Context.java:874: warning - Tag @link: can't find update(Map) in org.openmrs.util.DatabaseUpdater
EncounterVisitHandler.java:27: warning - Tag @see: can't find getVisitAssignmentHandlers() in org.openmrs.api.EncounterService
FormEntryHandler.java:34: warning - Tag @link: can't find getFormList(FormEntryContext) in org.openmrs.module.web.extension.FormEntryHandler
StaticDispatcherServlet.java:29: warning - Tag @see: can't find reInitFrameworkServlet() in org.openmrs.web.StaticDispatcherServlet
DateFieldGenDatatypeHandler.java:30: warning - Tag @link: reference not found: DateAttributeHandler
ShortPatientFormValidator.java:39: warning - Tag @link: reference not found: NewPatientFormController
WebBinaryDataHandler.java:54: warning - Tag @see: can't find getComplexData(org.openmrs.Obs, java.lang.String) in org.openmrs.obs.handler.BinaryDataHandler
WebBinaryStreamHandler.java:54: warning - Tag @see: can't find getComplexData(org.openmrs.Obs, java.lang.String) in org.openmrs.obs.handler.BinaryStreamHandler
WebImageHandler.java:57: warning - Tag @see: can't find getComplexData(org.openmrs.Obs, java.lang.String) in org.openmrs.obs.handler.ImageHandler
WebTextHandler.java:56: warning - Tag @see: can't find getComplexData(org.openmrs.Obs, java.lang.String) in org.openmrs.obs.handler.TextHandler
DateFieldGenDatatypeHandler.java:30: warning - Tag @link: reference not found: DateAttributeHandler
ShortPatientFormValidator.java:39: warning - Tag @link: reference not found: NewPatientFormController
DateFieldGenDatatypeHandler.java:30: warning - Tag @link: reference not found: DateAttributeHandler
DateFieldGenDatatypeHandler.java:30: warning - Tag @link: reference not found: DateAttributeHandler
DateFieldGenDatatypeHandler.java:30: warning - Tag @link: reference not found: DateAttributeHandler
DateFieldGenDatatypeHandler.java:30: warning - Tag @link: reference not found: DateAttributeHandler
CustomDatatypeUtil.java:144: warning - Tag @link: reference not found: AttributeHandler
ShortPatientFormValidator.java:39: warning - Tag @link: reference not found: NewPatientFormController
While fixing the existing javadoc comments, I started wondering how are we going to arrange things so that developers get all the support they need for writing valid javadocs? Maybe this problem has already been solved but I just wanted to ask to be sure.
Iâm not yet very familiar with the CI process here and was wondering what is the visibility of javadoc compilation errors to your average OpenMRS developer? For example, if a developer implements some changes, does the pull request etc, when and how will said committer get notified that her modifications caused a javadoc compilation error?
Ideally the developer should see javadoc errors a) immediately in the IDE or b) latest at âmvn installâ. Regarding a), I gave Eclipseâs javadoc validation a try (see Preferences, Java, Compiler, Javadoc) but could not get it to use the same validation logic as âjavadoc:aggregate-jarâ does. Regarding b), I guess âmvn installâ is not hooked up to javadoc validation at the moment but maybe it should?
To give you some perspective, based on the number and type of javadoc errors I have been fixing in TRUNK-4711, I would be as bold as to say there is not a single person on this project who can write valid javadocs without feedback from the validator. And that also includes yours truly!
I agree with you that it would be nice to have the javadoc validation done when building the project. I think one of the reasons it isnât currently is to keep the build time low.