Commit 3c4c715
committed
Remove reflective validation from ReplaceStringLiteralWithConstant
The validate() method used Class.forName() to reflectively verify that
the target constant exists when literalValue was not provided. This
fails when the target class is not on the recipe classpath, which is
the common case (e.g. org.springframework.http.MediaType is not a
dependency of rewrite-spring), producing errors like:
fullyQualifiedConstantName was
'org.springframework.http.MediaType.TEXT_HTML_VALUE' but it
No class for specified name was found.
The reflective fallback in getLiteralValue() already handles this
gracefully by returning null, causing getVisitor() to return a noop.
Validation should not reject the recipe for a condition that the
runtime already handles.1 parent a72ba76 commit 3c4c715
1 file changed
Lines changed: 0 additions & 19 deletions
Lines changed: 0 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | 72 | | |
92 | 73 | | |
93 | 74 | | |
| |||
0 commit comments