Skip to content

Commit

Permalink
Fix failures on top of java21 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lochana-chathura committed Nov 19, 2024
1 parent c144139 commit f205b24
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 8 deletions.
12 changes: 12 additions & 0 deletions semtypes/spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,16 @@
</Method>
</Class>
</Match>
<Match>
<Or>
<Package name="io.ballerina.types"/>
<Package name="io.ballerina.types.definition"/>
<Package name="io.ballerina.types.subtypedata"/>
</Or>
<Bug pattern="AA_ASSERTION_OF_ARGUMENTS"/>
</Match>
<Match>
<Class name="io.ballerina.types.CellSemType"/>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>
</FindBugsFilter>
2 changes: 1 addition & 1 deletion semtypes/src/main/java/io/ballerina/types/BddMemo.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
public class BddMemo {

public MemoStatus isEmpty;
protected MemoStatus isEmpty;

public BddMemo() {
this.isEmpty = MemoStatus.NULL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public class FieldPairs implements Iterable<FieldPair> {

MappingAtomicType m1;
MappingAtomicType m2;
public MappingPairIterator itr;

public FieldPairs(MappingAtomicType m1, MappingAtomicType m2) {
this.m1 = m1;
Expand All @@ -40,7 +39,6 @@ public FieldPairs(MappingAtomicType m1, MappingAtomicType m2) {

@Override
public Iterator<FieldPair> iterator() {
itr = new MappingPairIterator(m1, m2);
return itr;
return new MappingPairIterator(m1, m2);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f205b24

Please sign in to comment.