BATCH-1139: Add requirement that standalone <tasklet/> be abstract. Otherwise users might think that they can use <step tasklet="?"/> to refer to it. They must always use <tasklet parent="?"/>.
This commit is contained in:
@@ -34,6 +34,11 @@ public class TopLevelTaskletElementParser extends AbstractBeanDefinitionParser {
|
||||
@Override
|
||||
protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {
|
||||
|
||||
if (!Boolean.valueOf(element.getAttribute("abstract"))) {
|
||||
parserContext.getReaderContext().error(
|
||||
"The <tasklet/> element, when not contained with a <step/>, must be abstract", element);
|
||||
}
|
||||
|
||||
return taskletElementParser.parse(element, parserContext);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user