使用不同空格来标记表达式会创建重复的 Label 实例;加载统计信息只会更新其中一个实例
作者: hjhafner创建于 2026年9月18日更新于 2026年9月23日
Description
Jenkins.getLabel(String) indexes labels by the raw expression string, while Label.parseExpression() builds a canonical Label.name without insignificant whitespace (e.g. &&! vs && !).
Result: several ConcurrentHashMap entries can share the same canonical name but are different object instances, each with its own LoadStatistics.
Jenkins.getLabels() returns a TreeSet ordered by Label.compareTo / name, so only one of those instances is retained. LoadStatistics.LoadStatisticsUpdater iterates getLabels() and therefore updates only that survivor.
内容来源: jenkinsci/jenkins