kieker-monitoring / kieker

Kieker's main repository
Apache License 2.0
70 stars 41 forks source link

[KIEKER-599] Unconnected repository port can result in NullPointerException #916

Open rju opened 2 weeks ago

rju commented 2 weeks ago

JIRA Issue: KIEKER-599 Unconnected repository port can result in NullPointerException Original Reporter: Nils Christian Ehmke


Using a plugin with repository port but without any connected repository can result in a NullPointerException. Assume following plugin in a valid KAX file:

<plugins xsi:type="Filter" name="TraceColoringFilter" classname="kieker.tools.traceAnalysis.filter.visualization.traceColoring.TraceColoringFilter" id="15">
  <repositories name="colorRepository"/>
  <outputPorts name="graphs" id="25"/>
  <inputPorts name="graphs" id="26"/>
</plugins>

Following code is executed during loading in the AC:

public final void connect(final AbstractPlugin plugin, final String repositoryPort, final AbstractRepository repository)
            throws IllegalStateException, AnalysisConfigurationException {
  ...
  // Make sure that the repository is registered.
  if (!this.repos.contains(repository)) {
    throw new AnalysisConfigurationException("The repository '" + repository.getName() + "' (" + repository.getRepositoryName() + ") is not registered.");
  }
  ...
}

The call repository.getName() results in a NullPointerException. This should rather be an AnalysisConfigurationException (repository port not connected).

Checklist:

rju commented 2 weeks ago

author nils-christian -- Thu, 12 Sep 2013 12:57:40 +0200

Solved in 809103454e7c9ed3d20830598e392ad015013364.