From 85e630f2a9bb3213c331587e3470e639e6b6a482 Mon Sep 17 00:00:00 2001 From: Martin Goik <goik@hdm-stuttgart.de> Date: Wed, 18 Apr 2018 11:35:57 +0200 Subject: [PATCH] Package good/bad coding style --- Doc/Sd1/objectsClasses.xml | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/Doc/Sd1/objectsClasses.xml b/Doc/Sd1/objectsClasses.xml index 260780e0b..ca0118d68 100644 --- a/Doc/Sd1/objectsClasses.xml +++ b/Doc/Sd1/objectsClasses.xml @@ -368,17 +368,34 @@ public class Q {<lineannotation>Class def</lineannotation> <figure xml:id="sd1_fig_importByWildcard"> <title>Don't be too lazy!</title> - <programlisting language="java">//import java.util.Date; -//import java.util.Scanner; + <informaltable border="0"> + <tr> + <th>Bad</th> -import java.util.*; // Bad coding style + <th>Good</th> + </tr> + + <tr> + <td valign="top"><programlisting language="java">import java.util.*; public class Q { - public static void main(String[] args) { + public static void main(String[] args) { Scanner s = new Scanner(System.in); Date today = new Date(); } -}</programlisting> +}</programlisting></td> + + <td valign="top"><programlisting language="java">import java.util.Date; +import java.util.Scanner; + +public class Q { + public static void main(String[] args) { + Scanner s = new Scanner(System.in); + Date today = new Date(); + } +}</programlisting></td> + </tr> + </informaltable> </figure> <figure xml:id="sd1_fig_javaDotLangNoImportRequired"> @@ -4143,7 +4160,9 @@ long sum = (long)a + b;</programlisting> <para>This Maven archive does include a <xref linkend="glo_Junit"/> test currently being disabled by an - <interfacename xlink:href="https://junit.org/junit5/docs/current/api/org/junit/jupiter/api/Disabled.html">@Disabled</interfacename> directive:</para> + <interfacename + xlink:href="https://junit.org/junit5/docs/current/api/org/junit/jupiter/api/Disabled.html">@Disabled</interfacename> + directive:</para> <programlisting language="java">public class FractionTest { /** @@ -4155,7 +4174,9 @@ long sum = (long)a + b;</programlisting> <para>The current skeleton will yield a NullPointerException on test execution. After completing your implementation remove - this <interfacename xlink:href="https://junit.org/junit5/docs/current/api/org/junit/jupiter/api/Disabled.html">@Disabled</interfacename> directive allowing for test execution.</para> + this <interfacename + xlink:href="https://junit.org/junit5/docs/current/api/org/junit/jupiter/api/Disabled.html">@Disabled</interfacename> + directive allowing for test execution.</para> </question> <answer> -- GitLab