Solutions: An Extra Team Member

Here are the solutions to the exercises in Chapter 10, An Extra Team Member: Predictive and Proactive Analyses.

Early Warnings in Legacy Code

The top hotspots at the function level, unlockAccept and addSslHostConfig, are both rather complex. One way to counter the complexity accumulation would be to introduce chunks as discussed in Turn Hotspot Methods into Brain-Friendly Chunks.

The recent changes in AbstractEndpoint.java seems to have been an extension of addSslHostConfig that gives the method the additional responsibility of replacing an existing host configuration. This also introduces some control coupling, as shown in the next code snippet:

 public​ ​void​ ​addSslHostConfig​(
  SSLHostConfig sslHostConfig, ...

Get Software Design X-Rays now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.