diff --git a/Doc/Sd1/objectsClasses.xml b/Doc/Sd1/objectsClasses.xml index e70dfb4a9e046fa572c099f6179e3d5beaacfc14..a46a923f9cfaade4eb1bc0c267f4f66a04f70717 100644 --- a/Doc/Sd1/objectsClasses.xml +++ b/Doc/Sd1/objectsClasses.xml @@ -4467,10 +4467,11 @@ public Timeperiod(final Timeperiod timeperiod) { ... }</programlisting> }</programlisting> <para>This solution provides the desired result. However if - being called repeatedly it causes a performance penalty. We thus - refine it by a lazy initialization mechanism. In the first step - we simply rename our method having just <code - language="java">private</code> one:</para> + being called repeatedly it causes a performance penalty + recalculating an identical value time and again. We thus refine + it by using a lazy initialization mechanism. In the first step + we rename our current method implementation having just <code + language="java">private</code> access:</para> <programlisting language="java">private String toStringImplement() { final int largestNonZeroComponent; @@ -4489,7 +4490,7 @@ public Timeperiod(final Timeperiod timeperiod) { ... }</programlisting> <programlisting language="java">public class Timeperiod { - // Tedious calculation, will only be initialized on-demand + // Tedious calculation, will be be initialized on-demand only private String toStringValue = null; ... diff --git a/P/Sd1/Timeperiod/src/main/java/de/hdm_stuttgart/mi/sd1/Timeperiod.java b/P/Sd1/Timeperiod/src/main/java/de/hdm_stuttgart/mi/sd1/Timeperiod.java index 6afdb8aa45f4116ced7cd56e1adedda1ac3fcd09..b27208afdde2d20e21e2e4c6239aa6a23a035195 100644 --- a/P/Sd1/Timeperiod/src/main/java/de/hdm_stuttgart/mi/sd1/Timeperiod.java +++ b/P/Sd1/Timeperiod/src/main/java/de/hdm_stuttgart/mi/sd1/Timeperiod.java @@ -14,7 +14,7 @@ public class Timeperiod { SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR, // 86400 seconds per day SECONDS_PER_WEEK = 7 * SECONDS_PER_DAY; // 604800 seconds per week - // Tedious calculation, will only be initialized on-demand + // Tedious calculation, will be be initialized on-demand only private String toStringValue = null; private String toStringImplement() {