markt-asf commented on issue #242: get a hands on ... URL: https://github.com/apache/tomcat/pull/242#issuecomment-586686517 The issue with refactoring for clean code is that the benefits are subjective and people are going to have different views. Performance numbers are objective and while a refactoring that makes a small piece of code ~3x slower is going to have a negligible impact on performance, the idea of repeating that sort of refactoring - with that sort of impact - across the code base is not something that is likely to be considered acceptable. The caching idea is one that occurred to me - although the TRACE component can't be cached because it is dynamic. There looks to be merit in that idea. This combined with the simpler refactoring I outlined earlier is more likely to get accepted. The issue isn't that you have depended on Java 9+ functionality (as far as I could see from a quick look), but that you have added a compile time dependency on `org.apache.catalina.*`. That is not permitted for the Servlet API classes which cannot have any compile time dependencies other than the JRE. It is also worth noting that, for ease of maintenance and back-ports, we try and keep the code aligned across all the currently supported Tomcat versions. That means a minimum Java version of Java 6. This isn't always practical and there are plenty of places where we don't do this but impact on maintenance is another factor to consider when introducing Java 8 specific code. If refactoring is your area of interest then I'd recommend taking a look at the unit tests. There is a lot of scope there for reducing code duplication and improving code coverage by making much more use of parameterized tests. [Current code coverage stats](https://ci.apache.org/projects/tomcat/tomcat10/coverage/) are available from one of the CI systems we use.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org