Fix .compareTo() calculation in Size and Weight classes.
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 11 Jan 2019 14:13:59 +0000 (15:13 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 11 Jan 2019 14:13:59 +0000 (15:13 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
.idea/compiler.xml
.idea/kotlinc.xml
src/EyeView.java
src/Size.java
src/Weight.java

index 217af471a9e60576e8c36373fa22c50a63a00b2c..586e00a13b6567cb6a7be5676b01d62a8df78b65 100644 (file)
@@ -1,8 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="CompilerConfiguration">
-    <option name="DEFAULT_COMPILER" value="Javac" />
-    <resourceExtensions />
     <wildcardResourcePatterns>
       <entry name="!?*.java" />
       <entry name="!?*.form" />
       <entry name="!?*.clj" />
     </wildcardResourcePatterns>
     <annotationProcessing>
-      <profile default="true" name="Default" enabled="false">
-        <processorPath useClasspath="true" />
-      </profile>
+      <profile default="true" name="Default" enabled="true" />
     </annotationProcessing>
   </component>
-</project>
-
+</project>
\ No newline at end of file
index 0dd4b354636ab01a5a9aee4a507c42898cb5b291..ae8a33732e01304a016a133a99c2ebbef732a3ab 100644 (file)
@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
+  <component name="Kotlin2JsCompilerArguments">
+    <option name="sourceMapEmbedSources" />
+  </component>
   <component name="Kotlin2JvmCompilerArguments">
     <option name="jvmTarget" value="1.8" />
   </component>
index ad0c2fa81fd22f50313e121369e9e1330885ca1f..bf047c729fd2e72cace6cb27255c92104cfaa252 100644 (file)
@@ -12,7 +12,7 @@ public class EyeView extends JComponent {
         setEyeObj(eyeObj);
         this.label = new JLabel();
         this.label.setText("Eyes color");
-        this.colorsList = new JList(getEyeObj().getColorsList());
+        this.colorsList = new JList(this.getEyeObj().getColorsList());
         this.colorsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
         this.colorsList.setLayoutOrientation(JList.VERTICAL);
         add(label);
index e665140b9f83c020a1f23ea1dc973ea45ccdbd22..6946e5a8967e2358072fccd1fb7fa13e619e9f9d 100644 (file)
@@ -28,7 +28,7 @@ public class Size implements Comparable<Size> {
 
     @Override
     public int compareTo(Size size) {
-        int distance = size.size - this.getSize();
+        int distance = size.getSize() - this.getSize();
         if (distance >= 0)
             return distance;
         else
index 47547ba4f524711c42a3bc1c3e561fec0be48853..5e33327fac7ec77eac23a14ec0aa46a6b4e65342 100644 (file)
@@ -26,7 +26,7 @@ public class Weight implements Comparable<Weight> {
 
     @Override
     public int compareTo(Weight weight) {
-        int distance = weight.weight - this.getWeight();
+        int distance = weight.getWeight() - this.getWeight();
         if (distance >= 0)
             return distance;
         else