-
Notifications
You must be signed in to change notification settings - Fork 38.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve names of classes generated by the SpEL compiler
Prior to this commit, the SpEL compiler generated classes in a package named "spel" with names following the pattern "Ex#", where # was an index starting with 2. This resulted in class names such as: - spel.Ex2 - spel.Ex3 This commit improves the names of classes created by the SpEL compiler by generating classes in a package named "org.springframework.expression.spel.generated" with names following the pattern "CompiledExpression#####", where ##### is a 0-padded counter starting with 00001. This results in class names such as: - org.springframework.expression.spel.generated.CompiledExpression00001 - org.springframework.expression.spel.generated.CompiledExpression00002 This commit also moves the saveGeneratedClassFile() method from SpelCompilationCoverageTests to SpelCompiler and enhances it to: - Save classes in a "build/generated-classes" directory. - Convert package names to directories. - Create missing parent directories. - Use logging instead of System.out.println(). Running a test with saveGeneratedClassFile() enabled now logs something similar to the following. DEBUG o.s.e.s.s.SpelCompiler - Saving compiled SpEL expression [(#root.empty ? 0 : #root.size)] to [/Users/<username>/spring-framework/spring-expression/build/generated-classes/org/springframework/expression/spel/generated/CompiledExpression00001.class] Closes gh-32497
- Loading branch information
Showing
2 changed files
with
29 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters