diff --git a/semtypes/spotbugs-exclude.xml b/semtypes/spotbugs-exclude.xml index 3c1e663a6eab..599e9236ea20 100644 --- a/semtypes/spotbugs-exclude.xml +++ b/semtypes/spotbugs-exclude.xml @@ -88,4 +88,16 @@ + + + + + + + + + + + + diff --git a/semtypes/src/main/java/io/ballerina/types/BddMemo.java b/semtypes/src/main/java/io/ballerina/types/BddMemo.java index 0c66201ae737..c9b82a59ac3b 100644 --- a/semtypes/src/main/java/io/ballerina/types/BddMemo.java +++ b/semtypes/src/main/java/io/ballerina/types/BddMemo.java @@ -24,7 +24,7 @@ */ public class BddMemo { - public MemoStatus isEmpty; + protected MemoStatus isEmpty; public BddMemo() { this.isEmpty = MemoStatus.NULL; diff --git a/semtypes/src/main/java/io/ballerina/types/subtypedata/AllOrNothingSubtype.java b/semtypes/src/main/java/io/ballerina/types/subtypedata/AllOrNothingSubtype.java index 22ff85fa75d3..40099994dddc 100644 --- a/semtypes/src/main/java/io/ballerina/types/subtypedata/AllOrNothingSubtype.java +++ b/semtypes/src/main/java/io/ballerina/types/subtypedata/AllOrNothingSubtype.java @@ -31,7 +31,7 @@ public class AllOrNothingSubtype implements SubtypeData { private static final AllOrNothingSubtype all = new AllOrNothingSubtype(true); private static final AllOrNothingSubtype nothing = new AllOrNothingSubtype(false); - AllOrNothingSubtype(boolean isAll) { + private AllOrNothingSubtype(boolean isAll) { this.isAll = isAll; } diff --git a/semtypes/src/main/java/io/ballerina/types/subtypedata/DecimalSubtype.java b/semtypes/src/main/java/io/ballerina/types/subtypedata/DecimalSubtype.java index 4a00a0c1fdbf..22b5fb7483c6 100644 --- a/semtypes/src/main/java/io/ballerina/types/subtypedata/DecimalSubtype.java +++ b/semtypes/src/main/java/io/ballerina/types/subtypedata/DecimalSubtype.java @@ -86,7 +86,7 @@ public static boolean decimalSubtypeContains(SubtypeData d, EnumerableDecimal f) public static SubtypeData createDecimalSubtype(boolean allowed, EnumerableDecimal[] values) { if (values.length == 0) { - return new AllOrNothingSubtype(!allowed); + return allowed ? AllOrNothingSubtype.createNothing() : AllOrNothingSubtype.createAll(); } return new DecimalSubtype(allowed, values); } diff --git a/semtypes/src/main/java/io/ballerina/types/subtypedata/FloatSubtype.java b/semtypes/src/main/java/io/ballerina/types/subtypedata/FloatSubtype.java index 4ec45bd2b537..992b47b0030f 100644 --- a/semtypes/src/main/java/io/ballerina/types/subtypedata/FloatSubtype.java +++ b/semtypes/src/main/java/io/ballerina/types/subtypedata/FloatSubtype.java @@ -85,7 +85,7 @@ public static boolean floatSubtypeContains(SubtypeData d, EnumerableFloat f) { public static SubtypeData createFloatSubtype(boolean allowed, EnumerableFloat[] values) { if (values.length == 0) { - return new AllOrNothingSubtype(!allowed); + return allowed ? AllOrNothingSubtype.createNothing() : AllOrNothingSubtype.createAll(); } return new FloatSubtype(allowed, values); } diff --git a/semtypes/src/main/java/io/ballerina/types/typeops/FieldPairs.java b/semtypes/src/main/java/io/ballerina/types/typeops/FieldPairs.java index 9c99f34b9fd3..bd85a0f99082 100644 --- a/semtypes/src/main/java/io/ballerina/types/typeops/FieldPairs.java +++ b/semtypes/src/main/java/io/ballerina/types/typeops/FieldPairs.java @@ -31,7 +31,6 @@ public class FieldPairs implements Iterable { MappingAtomicType m1; MappingAtomicType m2; - public MappingPairIterator itr; public FieldPairs(MappingAtomicType m1, MappingAtomicType m2) { this.m1 = m1; @@ -40,7 +39,6 @@ public FieldPairs(MappingAtomicType m1, MappingAtomicType m2) { @Override public Iterator iterator() { - itr = new MappingPairIterator(m1, m2); - return itr; + return new MappingPairIterator(m1, m2); } } diff --git a/tests/jballerina-semtype-port-test/src/test/java/io/ballerina/semtype/port/test/SemTypeTest.java b/tests/jballerina-semtype-port-test/src/test/java/io/ballerina/semtype/port/test/SemTypeTest.java index 93e9219c176c..50446649f76f 100644 --- a/tests/jballerina-semtype-port-test/src/test/java/io/ballerina/semtype/port/test/SemTypeTest.java +++ b/tests/jballerina-semtype-port-test/src/test/java/io/ballerina/semtype/port/test/SemTypeTest.java @@ -18,7 +18,7 @@ package io.ballerina.semtype.port.test; import io.ballerina.runtime.api.utils.StringUtils; -import io.ballerina.runtime.internal.ValueComparisonUtils; +import io.ballerina.runtime.internal.utils.ValueComparisonUtils; import io.ballerina.tools.diagnostics.Diagnostic; import io.ballerina.tools.diagnostics.DiagnosticSeverity; import io.ballerina.types.Context;