mirror of
https://github.com/HighCapable/SweetProperty.git
synced 2025-09-04 01:35:37 +08:00
Merge pull request #1 from Doddddd/master
fix: 转义属性值中的 $,避免 Javadoc 格式化异常
This commit is contained in:
@@ -203,11 +203,12 @@ internal class PropertiesAccessorsGenerator {
|
||||
addMethod(
|
||||
MethodSpec.methodBuilder("get${getOrCreateUsedSuccessiveMethodName(methodName, className).capitalize()}").apply {
|
||||
val typedValue = value.parseTypedValue(configs.isEnableTypeAutoConversion)
|
||||
addJavadoc("Resolve the \"$accessorsName\" value ${typedValue.second}")
|
||||
val safeValueForJavadoc = typedValue.second.replace("$", "$$")
|
||||
addJavadoc("Resolve the \"$accessorsName\" value $safeValueForJavadoc")
|
||||
addModifiers(Modifier.PUBLIC, Modifier.FINAL)
|
||||
.addAnnotation(Nonnull::class.java)
|
||||
.returns(typedValue.first.java)
|
||||
.addStatement("return ${typedValue.second}")
|
||||
.addStatement("return $safeValueForJavadoc")
|
||||
}.build()
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user