Hello fans of IDEs doing the repetitive work for us
Eclipse has Save Actions where you can configure Eclipse to format your java classes according to your formatter settings on every save!! You might say, why do I care we use the maven formatter plugin which does that for me when I build openmrs. Hold your horses! The maven formatter plugin formats the java classes but does not organize your imports and does not remove unused imports! And thatâs just one of the niceties!
Please try it and report back! Tell us if this is something you think is useful or if its just interfering with your dev workflow! Also you might have an idea on how to improve the settings I showed in the docs. Help us make the OpenMRS development journey easier. Lets get the boring stuff out of the way
Thatâs weird. If you remove the use of the group variable, Eclipse will either remove the variable or the whole assignment.
If the assignment has collateral effects (like forcing Hibernate to hydrate the object) then removing the sentence is dangerous. We should just remove the variable, not the assignment.
I just found that saving RequiredDataAdviceTest removes getters from inner classes and tests fail.
The problem is that these methods are called by reflection, and Eclipse thinks theyâre not used.
Not sure how to get around that
Making the inner classes public perhaps? The inner class is private but its getters are public, itâs just weird.
i got it disabled on trial when it was adding two empty lines between my class declarations and their first line of class blocks as well as some formats i disliked personally
in the latest posts we were not talking about formatting but cleanups like removing unused local variables.
I think what you mention is the formatting we defined in our openmrs formatter.xml. if you disable formatting means that you write code that doesnt comply with the formatter. which when someone else changes files formerly touched by you and uses the formatter will have this in his diff.