Skip to content

Commit

Permalink
Fix checkstyle violations
Browse files Browse the repository at this point in the history
  • Loading branch information
heshanpadmasiri committed Jul 29, 2024
1 parent c45fd0f commit 631b762
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import io.ballerina.runtime.internal.values.AbstractObjectValue;
import io.ballerina.runtime.internal.values.DecimalValue;
import io.ballerina.runtime.internal.values.FPValue;
import io.ballerina.runtime.internal.values.ObjectValue;

import java.math.BigDecimal;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ private void initilizeEnv() {
cellAtomicInnerRO();
}

private static PredefinedTypeEnv INSTANCE;
private static PredefinedTypeEnv instance;

public synchronized static PredefinedTypeEnv getInstance() {
if (INSTANCE == null) {
INSTANCE = new PredefinedTypeEnv();
INSTANCE.initilizeEnv();
public static synchronized PredefinedTypeEnv getInstance() {
if (instance == null) {
instance = new PredefinedTypeEnv();
instance.initilizeEnv();
}
return INSTANCE;
return instance;
}

private final List<InitializedTypeAtom<CellAtomicType>> initializedCellAtoms = new ArrayList<>();
Expand All @@ -74,7 +74,6 @@ public synchronized static PredefinedTypeEnv getInstance() {
private final List<MappingAtomicType> initializedRecMappingAtoms = new ArrayList<>();
private final AtomicInteger nextAtomIndex = new AtomicInteger(0);

// FIXME: instead use enums and enum map
// This is to avoid passing down env argument when doing cell type operations.
// Please refer to the cellSubtypeDataEnsureProper() in cell.bal
private CellAtomicType cellAtomicVal;
Expand Down Expand Up @@ -529,7 +528,7 @@ private int reservedRecAtomCount() {
return Integer.max(initializedRecListAtoms.size(), initializedRecMappingAtoms.size());
}

// FIXME: avoid creating these multiple times
// TODO: avoid creating these multiple times
private SemType cellSemTypeObjectMemberKind() {
return Builder.basicSubType(
BT_CELL, BCellSubType.createDelegate(bddAtom(atomCellObjectMemberKind()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ public long getFlags() {
private static SemType createIsolatedTop(Env env) {
FunctionDefinition fd = new FunctionDefinition();
SemType ret = Builder.valType();
// FIXME: add a comment explaining why we are using neverType here
return fd.define(env, Builder.neverType(), ret, FunctionQualifiers.create(true, false));
}

Expand Down Expand Up @@ -303,7 +302,7 @@ public FunctionQualifiers getQualifiers() {
SymbolFlags.isFlagOn(flags, SymbolFlags.TRANSACTIONAL));
}

// FIXME: consider moving this to builder
// TODO: consider moving this to builder
private static SemTypeResult getSemType(Context cx, Type type) {
SemType semType = Builder.from(cx, type);
if (!Core.isNever(Core.intersect(semType, Core.B_TYPE_TOP))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.stream.Stream;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
import java.util.StringJoiner;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Supplier;
import java.util.stream.Stream;

import static io.ballerina.runtime.api.TypeTags.SERVICE_TAG;

Expand All @@ -88,7 +87,7 @@ public class BObjectType extends BStructureType implements ObjectType, PartialSe
private boolean resolving;
private ObjectDefinition od;
private final Env env = Env.getInstance();
// FIXME: better name
// TODO: better name
private SemType softSemTypeCache;
private final DistinctIdSupplier distinctIdSupplier;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

public final class FunctionQualifiers {

private final static FunctionQualifiers DEFAULT = new FunctionQualifiers(false, false);
private static final FunctionQualifiers DEFAULT = new FunctionQualifiers(false, false);
private final boolean isolated;
private final boolean transactional;
private SemType semType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import io.ballerina.runtime.api.types.semtype.Core;
import io.ballerina.runtime.api.types.semtype.SemType;

import static io.ballerina.runtime.api.types.semtype.Builder.booleanConst;
import static io.ballerina.runtime.api.types.semtype.Builder.stringConst;

public record Member(String name, SemType valueTy, Kind kind, Visibility visibility, boolean immutable) {
Expand Down

0 comments on commit 631b762

Please sign in to comment.