Skip to content

Commit 2994837

Browse files
committed
Fixed regression due to usage of wrong APIs
1 parent 106ce6f commit 2994837

File tree

3 files changed

+37
-37
lines changed

3 files changed

+37
-37
lines changed

CodenameOne/src/com/codename1/io/rest/RequestBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
*/
2424
package com.codename1.io.rest;
2525

26+
import com.codename1.compat.java.util.Objects;
2627
import com.codename1.io.ConnectionRequest;
2728
import com.codename1.io.Data;
2829
import com.codename1.io.JSONParser;
@@ -48,7 +49,6 @@
4849
import java.util.HashMap;
4950
import java.util.List;
5051
import java.util.Map;
51-
import java.util.Objects;
5252

5353
/**
5454
* This class is used to build, invoke the http request and to get the http

CodenameOne/src/com/codename1/properties/PropertyXMLElement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323

2424
package com.codename1.properties;
2525

26+
import com.codename1.compat.java.util.Objects;
2627
import com.codename1.io.Util;
2728
import com.codename1.xml.Element;
2829

2930
import java.util.Enumeration;
3031
import java.util.Hashtable;
3132
import java.util.Iterator;
3233
import java.util.NoSuchElementException;
33-
import java.util.Objects;
3434
import java.util.Vector;
3535

3636
/**

CodenameOne/src/com/codename1/ui/layouts/mig/UnitValue.java

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@
3333
* Date: 2006-sep-08
3434
*/
3535

36+
import com.codename1.compat.java.util.Objects;
3637
import com.codename1.util.MathUtil;
3738

38-
import java.util.ArrayList;
39-
import java.util.Arrays;
40-
import java.util.HashMap;
41-
import java.util.Objects;
39+
import java.util.ArrayList;
40+
import java.util.Arrays;
41+
import java.util.HashMap;
4242

4343
public final class UnitValue {
4444
/**
@@ -242,7 +242,7 @@ private UnitValue(float value, String unitStr, int unit, boolean isHor, int oper
242242
if (oper < STATIC || oper > MID)
243243
throw new IllegalArgumentException("Unknown Operation: " + oper);
244244

245-
if (oper > STATIC && (sub1 == null || sub2 == null))
245+
if (oper > STATIC && (sub1 == null || sub2 == null))
246246
throw new IllegalArgumentException(oper + " Operation may not have null sub-UnitValues.");
247247

248248
this.value = value;
@@ -619,33 +619,33 @@ public String getConstraintString() {
619619
return LayoutUtil.getCCString(this);
620620
}
621621

622-
public int hashCode() {
623-
int result = 17;
624-
result = 31 * result + Float.floatToIntBits(value);
625-
result = 31 * result + unit;
626-
result = 31 * result + oper;
627-
result = 31 * result + (isHor ? 1 : 0);
628-
result = 31 * result + (unitStr != null ? unitStr.hashCode() : 0);
629-
result = 31 * result + (linkId != null ? linkId.hashCode() : 0);
630-
result = 31 * result + Arrays.hashCode(subUnits);
631-
return result;
632-
}
633-
634-
@Override
635-
public boolean equals(Object obj) {
636-
if (this == obj) {
637-
return true;
638-
}
639-
if (!(obj instanceof UnitValue)) {
640-
return false;
641-
}
642-
UnitValue other = (UnitValue) obj;
643-
return Float.compare(value, other.value) == 0
644-
&& unit == other.unit
645-
&& oper == other.oper
646-
&& isHor == other.isHor
647-
&& Objects.equals(unitStr, other.unitStr)
648-
&& Objects.equals(linkId, other.linkId)
649-
&& Arrays.equals(subUnits, other.subUnits);
650-
}
651-
}
622+
public int hashCode() {
623+
int result = 17;
624+
result = 31 * result + Float.floatToIntBits(value);
625+
result = 31 * result + unit;
626+
result = 31 * result + oper;
627+
result = 31 * result + (isHor ? 1 : 0);
628+
result = 31 * result + (unitStr != null ? unitStr.hashCode() : 0);
629+
result = 31 * result + (linkId != null ? linkId.hashCode() : 0);
630+
result = 31 * result + Arrays.hashCode(subUnits);
631+
return result;
632+
}
633+
634+
@Override
635+
public boolean equals(Object obj) {
636+
if (this == obj) {
637+
return true;
638+
}
639+
if (!(obj instanceof UnitValue)) {
640+
return false;
641+
}
642+
UnitValue other = (UnitValue) obj;
643+
return Float.compare(value, other.value) == 0
644+
&& unit == other.unit
645+
&& oper == other.oper
646+
&& isHor == other.isHor
647+
&& Objects.equals(unitStr, other.unitStr)
648+
&& Objects.equals(linkId, other.linkId)
649+
&& Arrays.equals(subUnits, other.subUnits);
650+
}
651+
}

0 commit comments

Comments
 (0)