Composite Stages can lead to NPE
Granted, the composite stages are marked as deprecated, but the following analysis throws a NullPointerException. This is a behaviour that hasn't been there some days ago and is a major blocker for my tool.
class TestConfiguration extends AnalysisConfiguration {
public TestConfiguration() {
final ReadingComposite reader = new ReadingComposite(new File("."));
final Printer<IMonitoringRecord> printer = new Printer<>();
super.connectIntraThreads(reader.getOutputPort(), printer.getInputPort());
super.addThreadableStage(reader);
}
}
@SuppressWarnings("deprecation")
class ReadingComposite extends AbstractCompositeStage {
private final InitialElementProducer<File> producer;
private final Dir2RecordsFilter reader;
public ReadingComposite(final File importDirectory) {
this.producer = new InitialElementProducer<>(importDirectory);
this.reader = new Dir2RecordsFilter(new ClassNameRegistryRepository());
super.connectPorts(this.producer.getOutputPort(), this.reader.getInputPort());
}
public OutputPort<IMonitoringRecord> getOutputPort() {
return this.reader.getOutputPort();
}
@Override
protected Stage getFirstStage() {
return this.producer;
}
}