【发布时间】:2014-12-10 08:56:28
【问题描述】:
我在使用 Jenkins property.jelly propertyDescriptor 字段时遇到了一些问题。研究了一下,发现propertyDescriptor属性的实现比较混乱。
代码如下:
看到这一行:
<j:set var="descriptor" value="${attrs.propertyDescriptor ?: app.getDescriptorOrDie(descriptor.getPropertyTypeOrDie(instance,field).clazz)}" />
我假设 ?: 是 Jelly 中的三元运算符吗?然而,它本质上说: 如果设置了 ${attrs.propertyDescriptor},则将“descriptor”设置为空,否则 将“描述符”设置为 app.getDescriptorOrDie( ... )
不应该是:
<j:set var="descriptor" value="${attrs.propertyDescriptor ? ${attrs.propertyDescriptor : app.getDescriptorOrDie(descriptor.getPropertyTypeOrDie(instance,field).clazz)}" />
这是 property.jelly 中的错误吗?
【问题讨论】:
标签: jenkins jelly propertydescriptor