diff --git a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/api/Runtime.java b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/api/Runtime.java index 39d687885bbd..520287913612 100644 --- a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/api/Runtime.java +++ b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/api/Runtime.java @@ -96,9 +96,10 @@ public static Runtime from(Module module) { * This method needs to be called if object.getType().isIsolated() or * object.getType().isIsolated(methodName) returns false. */ - public abstract BFuture invokeMethodAsyncSequentially(BObject object, String methodName, @Nullable String strandName, - @Nullable StrandMetadata metadata, Callback callback, @Nullable Map properties, - Type returnType, Object... args); + public abstract BFuture invokeMethodAsyncSequentially( + BObject object, String methodName, @Nullable String strandName, + @Nullable StrandMetadata metadata, Callback callback, @Nullable Map properties, + Type returnType, Object... args); /** * Invoke Object method asynchronously and concurrently. Caller needs to ensure that no data race is possible for @@ -119,9 +120,10 @@ public abstract BFuture invokeMethodAsyncSequentially(BObject object, String met * This method needs to be called if both object.getType().isIsolated() and * object.getType().isIsolated(methodName) returns true. */ - public abstract BFuture invokeMethodAsyncConcurrently(BObject object, String methodName, @Nullable String strandName, - @Nullable StrandMetadata metadata, @Nullable Callback callback, @Nullable Map properties, - Type returnType, Object... args); + public abstract BFuture invokeMethodAsyncConcurrently( + BObject object, String methodName, @Nullable String strandName, + @Nullable StrandMetadata metadata, @Nullable Callback callback, @Nullable Map properties, + Type returnType, Object... args); /** * Invoke Object method asynchronously. This will schedule the function and block the strand. diff --git a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/api/creators/TypeCreator.java b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/api/creators/TypeCreator.java index b331430fe9d5..88a2b9a63d99 100644 --- a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/api/creators/TypeCreator.java +++ b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/api/creators/TypeCreator.java @@ -133,7 +133,8 @@ public static TupleType createTupleType(List typeList, int typeFlags) { * @param readonly whether immutable * @return the new tuple type */ - public static TupleType createTupleType(List typeList, @Nullable Type restType, int typeFlags, boolean readonly) { + public static TupleType createTupleType( + List typeList, @Nullable Type restType, int typeFlags, boolean readonly) { return new BTupleType(typeList, restType, typeFlags, readonly); } @@ -240,9 +241,9 @@ public static RecordType createRecordType(String typeName, Module module, long f * @param typeFlags flags associated with the type * @return the new record type */ - public static RecordType createRecordType(String typeName, @Nullable Module module, long flags, Map fields, - @Nullable Type restFieldType, - boolean sealed, int typeFlags) { + public static RecordType createRecordType( + String typeName, @Nullable Module module, long flags, Map fields, + @Nullable Type restFieldType, boolean sealed, int typeFlags) { return new BRecordType(typeName, module, flags, fields, restFieldType, sealed, typeFlags); } diff --git a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/TypeChecker.java b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/TypeChecker.java index 80ba80fa79c4..8714eae10d92 100644 --- a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/TypeChecker.java +++ b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/TypeChecker.java @@ -292,7 +292,8 @@ public static boolean checkIsType(@Nullable Object sourceVal, Type targetType) { * @param targetType type to be test against * @return true if the value belongs to the given type, false otherwise */ - public static boolean checkIsType(@Nullable List errors, Object sourceVal, Type sourceType, Type targetType) { + public static boolean checkIsType( + @Nullable List errors, Object sourceVal, Type sourceType, Type targetType) { if (checkIsType(sourceVal, sourceType, targetType, null)) { return true; } @@ -2177,9 +2178,10 @@ private static boolean checkIsLikeType(@Nullable List errors, Object sou * @param varName variable name to identify the parent of a record field * @return True if the value confirms to the provided type. False, otherwise. */ - private static boolean checkIsLikeOnValue(@Nullable List errors, Object sourceValue, Type sourceType, Type targetType, - List unresolvedValues, boolean allowNumericConversion, - @Nullable String varName) { + private static boolean checkIsLikeOnValue( + @Nullable List errors, Object sourceValue, Type sourceType, Type targetType, + List unresolvedValues, boolean allowNumericConversion, + @Nullable String varName) { int sourceTypeTag = sourceType.getTag(); int targetTypeTag = targetType.getTag(); diff --git a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/XmlFactory.java b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/XmlFactory.java index 812fee10cf88..1e186107ff09 100644 --- a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/XmlFactory.java +++ b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/XmlFactory.java @@ -241,7 +241,8 @@ public static BXml tableToXML(TableValueImpl table) { * @return XMLValue Element type XMLValue */ @Deprecated - public static XmlValue createXMLElement(BXmlQName startTagName, BXmlQName endTagName, @Nullable String defaultNsUri) { + public static XmlValue createXMLElement( + BXmlQName startTagName, BXmlQName endTagName, @Nullable String defaultNsUri) { if (!isEqual(startTagName.getLocalName(), endTagName.getLocalName()) || !isEqual(startTagName.getUri(), endTagName.getUri()) || !isEqual(startTagName.getPrefix(), endTagName.getPrefix())) { diff --git a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/scheduling/Scheduler.java b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/scheduling/Scheduler.java index c3bbc3d5c15c..5b1583ac1f97 100644 --- a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/scheduling/Scheduler.java +++ b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/scheduling/Scheduler.java @@ -205,9 +205,10 @@ public FutureValue scheduleToObjectGroup(Object[] params, Function function, Fut * @param metadata meta data of new strand * @return Reference to the scheduled task */ - public FutureValue schedule(Object[] params, Function function, @Nullable Strand parent, @Nullable Callback callback, - @Nullable Map properties, @Nullable Type returnType, @Nullable String strandName, - @Nullable StrandMetadata metadata) { + public FutureValue schedule( + Object[] params, Function function, @Nullable Strand parent, @Nullable Callback callback, + @Nullable Map properties, @Nullable Type returnType, @Nullable String strandName, + @Nullable StrandMetadata metadata) { FutureValue future = createFuture(parent, callback, properties, returnType, strandName, metadata); return schedule(params, function, future); } @@ -504,8 +505,9 @@ private void addToRunnableList(SchedulerItem item, ItemGroup group) { group.unlock(); } - public FutureValue createFuture(@Nullable Strand parent, @Nullable Callback callback, @Nullable Map properties, - @Nullable Type constraint, @Nullable String name, @Nullable StrandMetadata metadata) { + public FutureValue createFuture( + @Nullable Strand parent, @Nullable Callback callback, @Nullable Map properties, + @Nullable Type constraint, @Nullable String name, @Nullable StrandMetadata metadata) { Strand newStrand = new Strand(name, metadata, this, parent, properties, parent != null ? parent.currentTrxContext : null); currentStrands.put(newStrand.getId(), newStrand); diff --git a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/scheduling/WDChannels.java b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/scheduling/WDChannels.java index f9d399bbddbd..b71759124438 100644 --- a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/scheduling/WDChannels.java +++ b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/scheduling/WDChannels.java @@ -150,7 +150,8 @@ private static Object getResultValue(@Nullable Object result) { } @Nullable - private Object processResulAndError(Strand strand, String[] channels, @Nullable Object result, boolean allChannelsClosed) { + private Object processResulAndError( + Strand strand, String[] channels, @Nullable Object result, boolean allChannelsClosed) { if (result == null) { if (errors.size() == channels.length) { result = errors.get(errors.size() - 1); diff --git a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/types/BRecordType.java b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/types/BRecordType.java index 5fb276c8ccbf..87798b5657b8 100644 --- a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/types/BRecordType.java +++ b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/types/BRecordType.java @@ -89,8 +89,8 @@ public BRecordType(String typeName, String internalName, Module pkg, long flags, * @param sealed flag to indicate whether the record is sealed * @param typeFlags flags associated with the type */ - public BRecordType(String typeName, @Nullable Module pkg, long flags, Map fields, @Nullable Type restFieldType, - boolean sealed, int typeFlags) { + public BRecordType(String typeName, @Nullable Module pkg, long flags, Map fields, + @Nullable Type restFieldType, boolean sealed, int typeFlags) { super(typeName, pkg, flags, MapValueImpl.class); this.sealed = sealed; this.typeFlags = typeFlags; diff --git a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/values/ArrayValueImpl.java b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/values/ArrayValueImpl.java index aec397cf51ae..8b6130b6b710 100644 --- a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/values/ArrayValueImpl.java +++ b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/values/ArrayValueImpl.java @@ -272,7 +272,8 @@ public ArrayValueImpl(Type type, BListInitialValueEntry[] initialValues, Typedes this(type, ((ArrayType) TypeUtils.getImpliedType(type)).getSize(), initialValues, typedescValue); } - public ArrayValueImpl(Type type, long size, BListInitialValueEntry[] initialValues, @Nullable TypedescValue typedescValue) { + public ArrayValueImpl(Type type, long size, BListInitialValueEntry[] initialValues, + @Nullable TypedescValue typedescValue) { this.type = type; this.arrayType = (ArrayType) TypeUtils.getImpliedType(type); this.elementType = arrayType.getElementType(); diff --git a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/values/ValueCreator.java b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/values/ValueCreator.java index 6e85fd8ecc94..8cb2f702ddbb 100644 --- a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/values/ValueCreator.java +++ b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/values/ValueCreator.java @@ -103,8 +103,9 @@ public static boolean containsValueCreator(String key) { public abstract MapValue createRecordValue(String recordTypeName) throws BError; - public abstract BObject createObjectValue(String objectTypeName, @Nullable Scheduler scheduler, @Nullable Strand parent, - @Nullable Map properties, Object[] args) throws BError; + public abstract BObject createObjectValue( + String objectTypeName, @Nullable Scheduler scheduler, @Nullable Strand parent, + @Nullable Map properties, Object[] args) throws BError; public abstract BError createErrorValue(String errorTypeName, BString message, BError cause, Object details) throws BError; diff --git a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/values/XmlItem.java b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/values/XmlItem.java index 9ec5faa77498..303582c8272f 100644 --- a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/values/XmlItem.java +++ b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/internal/values/XmlItem.java @@ -562,7 +562,8 @@ protected void setAttributesOnInitialization(BMap attributes) } @Override - protected void setAttributeOnInitialization(String localName, @Nullable String namespace, @Nullable String prefix, String value) { + protected void setAttributeOnInitialization( + String localName, @Nullable String namespace, @Nullable String prefix, String value) { attributes.setAttribute(localName, namespace, prefix, value, true); } diff --git a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/transactions/TransactionLocalContext.java b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/transactions/TransactionLocalContext.java index 4b670b128271..156b9127e189 100644 --- a/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/transactions/TransactionLocalContext.java +++ b/bvm/ballerina-runtime/src/main/java/io/ballerina/runtime/transactions/TransactionLocalContext.java @@ -53,7 +53,8 @@ public class TransactionLocalContext { private BArray transactionId; private boolean isTransactional; - private TransactionLocalContext(String globalTransactionId, String url, String protocol, @Nullable Object infoRecord) { + private TransactionLocalContext(String globalTransactionId, String url, String protocol, + @Nullable Object infoRecord) { this.globalTransactionId = globalTransactionId; this.url = url; this.protocol = protocol; diff --git a/cli/ballerina-cli/src/main/java/io/ballerina/cli/cmd/CommandUtil.java b/cli/ballerina-cli/src/main/java/io/ballerina/cli/cmd/CommandUtil.java index 507a46e0dd5c..0d81035aa482 100644 --- a/cli/ballerina-cli/src/main/java/io/ballerina/cli/cmd/CommandUtil.java +++ b/cli/ballerina-cli/src/main/java/io/ballerina/cli/cmd/CommandUtil.java @@ -449,8 +449,8 @@ public static void initPackageFromCentral(Path balaCache, Path projectPath, Stri applyTemplate(orgName, templatePackageName, version, packageName, projectPath, balaCache, filesInDir); } - private static void pullPackageFromRemote(String orgName, String packageName, @Nullable String version, Path destination) - throws CentralClientException { + private static void pullPackageFromRemote(String orgName, String packageName, @Nullable String version, + Path destination) throws CentralClientException { String supportedPlatform = Arrays.stream(JvmTarget.values()) .map(JvmTarget::code) .collect(Collectors.joining(",")); diff --git a/cli/ballerina-cli/src/main/java/io/ballerina/cli/task/CreateExecutableTask.java b/cli/ballerina-cli/src/main/java/io/ballerina/cli/task/CreateExecutableTask.java index 973ced223aca..5d04b0c6bcb9 100644 --- a/cli/ballerina-cli/src/main/java/io/ballerina/cli/task/CreateExecutableTask.java +++ b/cli/ballerina-cli/src/main/java/io/ballerina/cli/task/CreateExecutableTask.java @@ -56,7 +56,8 @@ public class CreateExecutableTask implements Task { private Target target; private final boolean isHideTaskOutput; - public CreateExecutableTask(PrintStream out, @Nullable String output, @Nullable Target target, boolean isHideTaskOutput) { + public CreateExecutableTask(PrintStream out, @Nullable String output, @Nullable Target target, + boolean isHideTaskOutput) { this.out = out; this.target = target; this.isHideTaskOutput = isHideTaskOutput; diff --git a/cli/central-client/src/main/java/org/ballerinalang/central/client/CentralAPIClient.java b/cli/central-client/src/main/java/org/ballerinalang/central/client/CentralAPIClient.java index 67fc94661d72..354fa77361fb 100644 --- a/cli/central-client/src/main/java/org/ballerinalang/central/client/CentralAPIClient.java +++ b/cli/central-client/src/main/java/org/ballerinalang/central/client/CentralAPIClient.java @@ -180,8 +180,8 @@ public CentralAPIClient(String baseUrl, Proxy proxy, String accessToken) { this.maxRetries = MAX_RETRY; } - public CentralAPIClient(String baseUrl, @Nullable Proxy proxy, String accessToken, boolean verboseEnabled, int maxRetries, - PrintStream outStream) { + public CentralAPIClient(String baseUrl, @Nullable Proxy proxy, String accessToken, boolean verboseEnabled, + int maxRetries, PrintStream outStream) { this.outStream = outStream; this.baseUrl = baseUrl; this.proxy = proxy; @@ -1958,7 +1958,8 @@ public Response intercept(Chain chain) throws IOException { return response; } - private void logRetryVerbose(Response response, @Nullable String bodyContent, Request request, int retryCount) { + private void logRetryVerbose(Response response, @Nullable String bodyContent, Request request, + int retryCount) { if (verboseEnabled) { Optional body = Optional.ofNullable(response.body()); outStream.println("< HTTP " + response.code() + " " + response.message()); diff --git a/cli/central-client/src/main/java/org/ballerinalang/central/client/model/PackageNameResolutionResponse.java b/cli/central-client/src/main/java/org/ballerinalang/central/client/model/PackageNameResolutionResponse.java index db467cb650ae..7794c47e1574 100644 --- a/cli/central-client/src/main/java/org/ballerinalang/central/client/model/PackageNameResolutionResponse.java +++ b/cli/central-client/src/main/java/org/ballerinalang/central/client/model/PackageNameResolutionResponse.java @@ -88,7 +88,8 @@ public void setReason(String reason) { this.reason = reason; } - public Module(String organization, String moduleName, String version, @Nullable String packageName, @Nullable String reason) { + public Module(String organization, String moduleName, String version, @Nullable String packageName, + @Nullable String reason) { this.organization = organization; this.moduleName = moduleName; this.version = version; diff --git a/compiler/ballerina-lang/src/main/java/io/ballerina/compiler/api/impl/symbols/BallerinaParameterSymbol.java b/compiler/ballerina-lang/src/main/java/io/ballerina/compiler/api/impl/symbols/BallerinaParameterSymbol.java index dea15561b77c..63650a1d15d1 100644 --- a/compiler/ballerina-lang/src/main/java/io/ballerina/compiler/api/impl/symbols/BallerinaParameterSymbol.java +++ b/compiler/ballerina-lang/src/main/java/io/ballerina/compiler/api/impl/symbols/BallerinaParameterSymbol.java @@ -48,9 +48,10 @@ public class BallerinaParameterSymbol extends BallerinaSymbol implements Paramet private final TypeSymbol typeDescriptor; private final ParameterKind paramKind; - public BallerinaParameterSymbol(@Nullable String parameterName, TypeSymbol typeDescriptor, List qualifiers, - List annots, List annotAttachments, - ParameterKind paramKind, BVarSymbol symbol, CompilerContext context) { + public BallerinaParameterSymbol(@Nullable String parameterName, TypeSymbol typeDescriptor, + List qualifiers, List annots, + List annotAttachments, ParameterKind paramKind, + BVarSymbol symbol, CompilerContext context) { super(parameterName, PARAMETER, symbol, context); // TODO: Add the metadata this.typeDescriptor = typeDescriptor; diff --git a/compiler/ballerina-lang/src/main/java/io/ballerina/compiler/api/impl/symbols/TypesFactory.java b/compiler/ballerina-lang/src/main/java/io/ballerina/compiler/api/impl/symbols/TypesFactory.java index 3ac528f5eac1..6a0d973879bc 100644 --- a/compiler/ballerina-lang/src/main/java/io/ballerina/compiler/api/impl/symbols/TypesFactory.java +++ b/compiler/ballerina-lang/src/main/java/io/ballerina/compiler/api/impl/symbols/TypesFactory.java @@ -153,8 +153,8 @@ public TypeSymbol getTypeDescriptor(BType bType, @Nullable BSymbol tSymbol, bool return getTypeDescriptor(bType, tSymbol, rawTypeOnly, true, false); } - @Nullable TypeSymbol getTypeDescriptor(BType bType, @Nullable BSymbol tSymbol, boolean rawTypeOnly, boolean getOriginalType, - boolean typeRefFromIntersectType) { + @Nullable TypeSymbol getTypeDescriptor(BType bType, @Nullable BSymbol tSymbol, boolean rawTypeOnly, + boolean getOriginalType, boolean typeRefFromIntersectType) { if (bType == null) { return null; } diff --git a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/BalToolsManifest.java b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/BalToolsManifest.java index c67499bb2986..ea2c6251a949 100644 --- a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/BalToolsManifest.java +++ b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/BalToolsManifest.java @@ -47,7 +47,8 @@ public Map>> tools() { return tools; } - public void addTool(String id, String org, String name, String version, Boolean active, @Nullable String repository) { + public void addTool(String id, String org, String name, String version, Boolean active, + @Nullable String repository) { if (!tools.containsKey(id)) { tools.put(id, new HashMap<>()); } diff --git a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/BalaFiles.java b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/BalaFiles.java index 591fdb16b33e..4ff23fe4ec9b 100644 --- a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/BalaFiles.java +++ b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/BalaFiles.java @@ -464,9 +464,9 @@ private static void setBalToolDependencyPaths(BalToolJson balToolJson, Path bala balToolJson.setDependencyPaths(dependencyLibPaths); } - private static PackageManifest getPackageManifest(PackageJson packageJson, - Optional compilerPluginJson, - Optional balToolJson, @Nullable String deprecationMsg) { + private static PackageManifest getPackageManifest( + PackageJson packageJson, Optional compilerPluginJson, Optional balToolJson, + @Nullable String deprecationMsg) { PackageDescriptor pkgDesc; if (deprecationMsg != null) { pkgDesc = PackageDescriptor.from(PackageOrg.from(packageJson.getOrganization()), diff --git a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/ManifestBuilder.java b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/ManifestBuilder.java index 1b7e68dbbe77..de1138435313 100644 --- a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/ManifestBuilder.java +++ b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/ManifestBuilder.java @@ -920,7 +920,8 @@ private Toml getToml(TomlTableNode toolNode, String key) { return new Toml(optionsNode); } - private boolean providedPlatformDependencyIsValid(@Nullable String artifactId, @Nullable String groupId, @Nullable String version) { + private boolean providedPlatformDependencyIsValid( + @Nullable String artifactId, @Nullable String groupId, @Nullable String version) { return artifactId != null && !artifactId.isEmpty() && groupId != null && !groupId.isEmpty() && version != null && !version.isEmpty(); } diff --git a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/repositories/FileSystemRepository.java b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/repositories/FileSystemRepository.java index 10fc3f60cc35..eead26303cb3 100644 --- a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/repositories/FileSystemRepository.java +++ b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/repositories/FileSystemRepository.java @@ -209,7 +209,8 @@ public Map> getPackages() { } @Override - protected List getPackageVersions(PackageOrg org, PackageName name, @Nullable PackageVersion version) { + protected List getPackageVersions(PackageOrg org, PackageName name, + @Nullable PackageVersion version) { List versions = new ArrayList<>(); try { Path balaPackagePath = bala.resolve(org.value()).resolve(name.value()); diff --git a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/repositories/MavenPackageRepository.java b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/repositories/MavenPackageRepository.java index 6e0c27bc2e76..3b1bad3411f4 100644 --- a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/repositories/MavenPackageRepository.java +++ b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/internal/repositories/MavenPackageRepository.java @@ -146,7 +146,8 @@ public boolean isPackageExists(PackageOrg org, } @Override - protected List getPackageVersions(PackageOrg org, PackageName name, @Nullable PackageVersion version) { + protected List getPackageVersions( + PackageOrg org, PackageName name, @Nullable PackageVersion version) { if (version == null) { return Collections.emptyList(); } diff --git a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/plugins/codeaction/CodeActionExecutionContextImpl.java b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/plugins/codeaction/CodeActionExecutionContextImpl.java index e8d52d35dd50..a10a0827a4b4 100644 --- a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/plugins/codeaction/CodeActionExecutionContextImpl.java +++ b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/plugins/codeaction/CodeActionExecutionContextImpl.java @@ -44,9 +44,9 @@ public List arguments() { return this.arguments; } - public static CodeActionExecutionContextImpl from(String fileUri, Path filePath, @Nullable LinePosition cursorPosition, - Document document, SemanticModel semanticModel, - List arguments) { + public static CodeActionExecutionContextImpl from( + String fileUri, Path filePath, @Nullable LinePosition cursorPosition, Document document, + SemanticModel semanticModel, List arguments) { return new CodeActionExecutionContextImpl(fileUri, filePath, cursorPosition, document, semanticModel, arguments); } diff --git a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/util/BuildToolUtils.java b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/util/BuildToolUtils.java index 51c56a5cb1fc..32718d3df574 100644 --- a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/util/BuildToolUtils.java +++ b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/util/BuildToolUtils.java @@ -82,7 +82,8 @@ public static TomlDiagnostic getBuildToolCommandNotFoundDiagnostic(String comman * @param toolId tool id of the build tool * @return diagnostic */ - public static TomlDiagnostic getCannotResolveBuildToolDiagnostic(String toolId, @Nullable TomlNodeLocation location) { + public static TomlDiagnostic getCannotResolveBuildToolDiagnostic(String toolId, + @Nullable TomlNodeLocation location) { String message = "Build tool '" + toolId + "' cannot be resolved"; DiagnosticInfo diagnosticInfo = new DiagnosticInfo( ProjectDiagnosticErrorCode.BUILD_TOOL_NOT_FOUND.diagnosticId(), diff --git a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/util/ProjectUtils.java b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/util/ProjectUtils.java index a745678023a1..5dcaa78b88ff 100644 --- a/compiler/ballerina-lang/src/main/java/io/ballerina/projects/util/ProjectUtils.java +++ b/compiler/ballerina-lang/src/main/java/io/ballerina/projects/util/ProjectUtils.java @@ -1368,7 +1368,8 @@ public static List getVersionsInCompatibleRange( * @param packageLockingMode locking mode of the project * @return compatible range */ - public static CompatibleRange getCompatibleRange(@Nullable SemanticVersion version, PackageLockingMode packageLockingMode) { + public static CompatibleRange getCompatibleRange(@Nullable SemanticVersion version, + PackageLockingMode packageLockingMode) { if (version == null) { return CompatibleRange.LATEST; } diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/codegen/JvmObservabilityGen.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/codegen/JvmObservabilityGen.java index aae32af429e0..c2c0040ffca0 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/codegen/JvmObservabilityGen.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/codegen/JvmObservabilityGen.java @@ -324,7 +324,8 @@ private void populatePredecessorMap(List basicBlocks) { * @param attachedTypeDef The type definition to which the function was attached to or null * @param pkg The package containing the function */ - private void rewriteAsyncInvocations(BIRFunction func, @Nullable BIRTypeDefinition attachedTypeDef, BIRPackage pkg) { + private void rewriteAsyncInvocations( + BIRFunction func, @Nullable BIRTypeDefinition attachedTypeDef, BIRPackage pkg) { PackageID packageID = pkg.packageID; Name org = new Name(Utils.decodeIdentifier(packageID.orgName.getValue())); Name module = new Name(Utils.decodeIdentifier(packageID.name.getValue())); @@ -452,9 +453,10 @@ private void rewriteAsyncInvocations(BIRFunction func, @Nullable BIRTypeDefiniti * @param isMainEntryPoint True if the function is the main entry point * @param isWorker True if the function was a worker */ - private void rewriteObservableFunctionBody(BIRFunction func, BIRPackage pkg, @Nullable BIRTypeDefinition attachedTypeDef, - String functionName, @Nullable String serviceName, boolean isResource, - boolean isRemote, boolean isMainEntryPoint, boolean isWorker) { + private void rewriteObservableFunctionBody( + BIRFunction func, BIRPackage pkg, @Nullable BIRTypeDefinition attachedTypeDef, + String functionName, @Nullable String serviceName, boolean isResource, + boolean isRemote, boolean isMainEntryPoint, boolean isWorker) { // Injecting observe start call at the start of the function body { BIRBasicBlock startBB = func.basicBlocks.get(0); // Every non-abstract function should have function body @@ -845,8 +847,9 @@ private void injectStopObservationCall(BIRBasicBlock observeEndBB, @Nullable Loc * @param errorOperand Operand for passing the error * @param uniqueId A unique ID to identify the check error call */ - private void injectStopObservationWithErrorCall(BIRFunction func, BIRBasicBlock observeEndBB, @Nullable Location pos, - BIROperand errorOperand, String uniqueId) { + private void injectStopObservationWithErrorCall( + BIRFunction func, BIRBasicBlock observeEndBB, @Nullable Location pos, + BIROperand errorOperand, String uniqueId) { BIROperand castedErrorOperand = tempLocalVarsMap.get(uniqueId + "$castedError"); addLocalVarIfAbsent(func, castedErrorOperand.variableDcl); TypeCast errorCastInstruction = new TypeCast(pos, castedErrorOperand, errorOperand, symbolTable.errorType, @@ -870,7 +873,8 @@ private void injectStopObservationWithErrorCall(BIRFunction func, BIRBasicBlock * @param constantValue The constant value which should end up being passed in the operand * @return The generated operand which will pass the constant */ - private BIROperand generateGlobalConstantOperand(BIRPackage pkg, BType constantType, @Nullable Object constantValue) { + private BIROperand generateGlobalConstantOperand( + BIRPackage pkg, BType constantType, @Nullable Object constantValue) { return compileTimeConstants.computeIfAbsent(constantValue, k -> { PackageID pkgId = pkg.packageID; Name name = new Name("$observabilityConst" + constantIndex++); diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/codegen/methodgen/MethodGen.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/codegen/methodgen/MethodGen.java index 3b85ba99ce7c..92d6ceec70d2 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/codegen/methodgen/MethodGen.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/codegen/methodgen/MethodGen.java @@ -607,7 +607,8 @@ private int[] toIntArray(List states) { void generateBasicBlocks(MethodVisitor mv, LabelGenerator labelGen, JvmErrorGen errorGen, JvmInstructionGen instGen, JvmTerminatorGen termGen, BIRFunction func, int returnVarRefIndex, int stateVarIndex, int yieldLocationVarIndex, int yieldStatusVarIndex, int loopVarIndex, - int invocationVarIndex, int localVarOffset, BIRPackage module, @Nullable BType attachedType, + int invocationVarIndex, int localVarOffset, BIRPackage module, + @Nullable BType attachedType, String moduleClassName, Label loopLabel) { String funcName = func.name.value; diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/model/BIRNode.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/model/BIRNode.java index 4521524876cb..41dad4017b90 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/model/BIRNode.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/model/BIRNode.java @@ -220,8 +220,9 @@ public static class BIRGlobalVariableDcl extends BIRVariableDcl { public SymbolOrigin origin; public List annotAttachments; - public BIRGlobalVariableDcl(@Nullable Location pos, long flags, BType type, @Nullable PackageID pkgId, Name name, Name originalName, - VarScope scope, VarKind kind, String metaVarName, SymbolOrigin origin) { + public BIRGlobalVariableDcl(@Nullable Location pos, long flags, BType type, @Nullable PackageID pkgId, + Name name, Name originalName, VarScope scope, VarKind kind, String metaVarName, + SymbolOrigin origin) { super(pos, type, name, originalName, scope, kind, metaVarName); this.flags = flags; this.pkgId = pkgId; @@ -414,8 +415,8 @@ public BIRFunction(Location pos, Name name, Name originalName, long flags, Symbo this.dependentGlobalVars = dependentGlobalVars; } - public BIRFunction(@Nullable Location pos, Name name, Name originalName, long flags, BInvokableType type, Name workerName, - int sendInsCount, SymbolOrigin origin) { + public BIRFunction(@Nullable Location pos, Name name, Name originalName, long flags, BInvokableType type, + Name workerName, int sendInsCount, SymbolOrigin origin) { super(pos); this.name = name; this.originalName = originalName; @@ -433,8 +434,8 @@ public BIRFunction(@Nullable Location pos, Name name, Name originalName, long fl this.origin = origin; } - public BIRFunction(@Nullable Location pos, Name name, long flags, BInvokableType type, @Nullable Name workerName, - int sendInsCount, SymbolOrigin origin) { + public BIRFunction(@Nullable Location pos, Name name, long flags, BInvokableType type, + @Nullable Name workerName, int sendInsCount, SymbolOrigin origin) { this(pos, name, name, flags, type, workerName, sendInsCount, origin); } @@ -959,9 +960,9 @@ public static class BIRServiceDeclaration extends BIRDocumentableNode { public SymbolOrigin origin; public long flags; - public BIRServiceDeclaration(@Nullable List attachPoint, @Nullable String attachPointLiteral, List listenerTypes, - Name generatedName, Name associatedClassName, BType type, SymbolOrigin origin, - long flags, Location location) { + public BIRServiceDeclaration(@Nullable List attachPoint, @Nullable String attachPointLiteral, + List listenerTypes, Name generatedName, Name associatedClassName, + BType type, SymbolOrigin origin, long flags, Location location) { super(location); this.attachPoint = attachPoint; this.attachPointLiteral = attachPointLiteral; diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/model/BIRNonTerminator.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/model/BIRNonTerminator.java index 6edb95dc9b59..38d436613dc6 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/model/BIRNonTerminator.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/model/BIRNonTerminator.java @@ -339,8 +339,8 @@ public NewArray(Location location, BType type, BIROperand lhsOp, BIROperand size this.values = values; } - public NewArray(Location location, BType type, BIROperand lhsOp, @Nullable BIROperand typedescOp, BIROperand sizeOp, - List values) { + public NewArray(Location location, BType type, BIROperand lhsOp, @Nullable BIROperand typedescOp, + BIROperand sizeOp, List values) { this(location, type, lhsOp, sizeOp, values); this.typedescOp = typedescOp; } diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/ASTBuilderUtil.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/ASTBuilderUtil.java index ffc029d6ac76..bf434c6b1422 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/ASTBuilderUtil.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/ASTBuilderUtil.java @@ -491,7 +491,8 @@ public static BLangInvocation createLangLibInvocationNode(String name, ArrayList } static BLangInvocation createInvocationExprForMethod(Location pos, @Nullable BInvokableSymbol invokableSymbol, - List requiredArgs, SymbolResolver symResolver) { + List requiredArgs, + SymbolResolver symResolver) { return createInvocationExprMethod(pos, invokableSymbol, requiredArgs, new ArrayList<>(), symResolver); } diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/Desugar.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/Desugar.java index 30e732076466..39c975d3f8b6 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/Desugar.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/Desugar.java @@ -1869,7 +1869,8 @@ private void createVarDefStmts(BLangRecordVariable parentRecordVariable, BLangBl * The var def statements are created by creating the reason() and detail() builtin methods. */ private void createVarDefStmts(BLangErrorVariable parentErrorVariable, BLangBlockStmt parentBlockStmt, - BVarSymbol errorVariableSymbol, @Nullable BLangIndexBasedAccess parentIndexBasedAccess) { + BVarSymbol errorVariableSymbol, + @Nullable BLangIndexBasedAccess parentIndexBasedAccess) { BVarSymbol convertedErrorVarSymbol; if (parentIndexBasedAccess != null) { @@ -2253,9 +2254,9 @@ private BLangInvocation generateErrorDetailBuiltinFunction(Location pos, BVarSym return createLangLibInvocationNode(ERROR_DETAIL_FUNCTION_NAME, onExpr, new ArrayList<>(), null, pos); } - private BLangInvocation generateErrorMessageBuiltinFunction(Location pos, BType reasonType, - BVarSymbol errorVarSymbol, - @Nullable BLangIndexBasedAccess parentIndexBasedAccess) { + private BLangInvocation generateErrorMessageBuiltinFunction( + Location pos, BType reasonType, BVarSymbol errorVarSymbol, + @Nullable BLangIndexBasedAccess parentIndexBasedAccess) { BLangExpression onExpr; if (parentIndexBasedAccess != null) { onExpr = parentIndexBasedAccess; @@ -2665,7 +2666,8 @@ private BLangInvocation createLengthInvocation(Location pos, BLangExpression col * */ private void createVarRefAssignmentStmts(BLangTupleVarRef parentTupleVariable, BLangBlockStmt parentBlockStmt, - BVarSymbol tupleVarSymbol, @Nullable BLangIndexBasedAccess parentIndexAccessExpr) { + BVarSymbol tupleVarSymbol, + @Nullable BLangIndexBasedAccess parentIndexAccessExpr) { final List expressions = parentTupleVariable.expressions; for (int index = 0; index < expressions.size(); index++) { @@ -2828,7 +2830,8 @@ public void visit(BLangErrorDestructure errorDestructure) { } private void createVarRefAssignmentStmts(BLangRecordVarRef parentRecordVarRef, BLangBlockStmt parentBlockStmt, - BVarSymbol recordVarSymbol, @Nullable BLangIndexBasedAccess parentIndexAccessExpr) { + BVarSymbol recordVarSymbol, + @Nullable BLangIndexBasedAccess parentIndexAccessExpr) { final List variableRefList = parentRecordVarRef.recordRefFields; for (BLangRecordVarRefKeyValue varRefKeyValue : variableRefList) { BLangExpression expression = varRefKeyValue.variableReference; @@ -2923,7 +2926,8 @@ private void createVarRefAssignmentStmts(BLangRecordVarRef parentRecordVarRef, B } private void createVarRefAssignmentStmts(BLangErrorVarRef parentErrorVarRef, BLangBlockStmt parentBlockStmt, - BVarSymbol errorVarySymbol, @Nullable BLangIndexBasedAccess parentIndexAccessExpr) { + BVarSymbol errorVarySymbol, + @Nullable BLangIndexBasedAccess parentIndexAccessExpr) { if (parentErrorVarRef.message != null && names.fromIdNode(((BLangSimpleVarRef) parentErrorVarRef.message).variableName) != Names.IGNORE) { BLangAssignment message = ASTBuilderUtil.createAssignmentStmt(parentBlockStmt.pos, parentBlockStmt); @@ -7348,7 +7352,8 @@ private BLangSimpleVariableDef createSimpleVarDef(String name, BType type, BLang return simpleVariableDef; } - private BLangSimpleVariableDef createVarDef(String name, BType type, @Nullable BLangExpression expr, Location location) { + private BLangSimpleVariableDef createVarDef(String name, BType type, @Nullable BLangExpression expr, + Location location) { BSymbol objSym = symResolver.lookupSymbolInMainSpace(env, Names.fromString(name)); // todo: check and remove this bit here if (objSym == null || objSym == symTable.notFoundSymbol) { @@ -9653,7 +9658,8 @@ private void reorderArguments(BLangInvocation iExpr) { iExpr.restArgs = new ArrayList(1) {{ add(stmtExpression); }}; } - private void reorderNamedArgs(BLangInvocation iExpr, BInvokableSymbol invokableSymbol, @Nullable BLangExpression varargRef) { + private void reorderNamedArgs(BLangInvocation iExpr, BInvokableSymbol invokableSymbol, + @Nullable BLangExpression varargRef) { List args = new ArrayList<>(); Map namedArgs = new LinkedHashMap<>(); iExpr.requiredArgs.stream() diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/diagnostic/BLangDiagnosticLocation.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/diagnostic/BLangDiagnosticLocation.java index c2760fdd86b9..5ae57c8d512b 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/diagnostic/BLangDiagnosticLocation.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/diagnostic/BLangDiagnosticLocation.java @@ -42,8 +42,8 @@ public BLangDiagnosticLocation(String filePath, int startLine, int endLine, int this(filePath, startLine, endLine, startColumn, endColumn, 0, 0); } - public BLangDiagnosticLocation(@Nullable String filePath, int startLine, int endLine, int startColumn, int endColumn, - int startOffset, int length) { + public BLangDiagnosticLocation(@Nullable String filePath, int startLine, int endLine, int startColumn, + int endColumn, int startOffset, int length) { this.filePath = filePath; this.startLine = startLine; this.endLine = endLine; diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/diagnostic/BLangDiagnosticLog.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/diagnostic/BLangDiagnosticLog.java index 2698c9a3c09e..a9e17f61dd0a 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/diagnostic/BLangDiagnosticLog.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/diagnostic/BLangDiagnosticLog.java @@ -220,8 +220,8 @@ private String formatMessage(String prefix, DiagnosticCode code, Object[] args) return MessageFormat.format(msgKey, args); } - private void reportDiagnostic(@Nullable ModuleDescriptor moduleDescriptor, @Nullable DiagnosticCode diagnosticCode, Location location, - String msg, DiagnosticSeverity severity, Object[] args) { + private void reportDiagnostic(@Nullable ModuleDescriptor moduleDescriptor, @Nullable DiagnosticCode diagnosticCode, + Location location, String msg, DiagnosticSeverity severity, Object[] args) { PackageID pkgId = null; if (moduleDescriptor != null) { pkgId = new PackageID(new Name(moduleDescriptor.org().value()), @@ -231,8 +231,8 @@ private void reportDiagnostic(@Nullable ModuleDescriptor moduleDescriptor, @Null reportDiagnostic(pkgId, diagnosticCode, location, msg, severity, args); } - private void reportDiagnostic(@Nullable PackageID packageID, @Nullable DiagnosticCode diagnosticCode, Location location, - String msg, DiagnosticSeverity severity, Object[] args) { + private void reportDiagnostic(@Nullable PackageID packageID, @Nullable DiagnosticCode diagnosticCode, + Location location, String msg, DiagnosticSeverity severity, Object[] args) { if (severity == DiagnosticSeverity.ERROR) { this.errorCount++; } diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangNodeBuilder.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangNodeBuilder.java index a0d0bc94e170..67a4fb83c688 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangNodeBuilder.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangNodeBuilder.java @@ -1569,8 +1569,9 @@ public BLangNode transform(FunctionDefinitionNode funcDefNode) { return bLFunction; } - private BLangFunction createFunctionNode(IdentifierToken funcName, NodeList qualifierList, - FunctionSignatureNode functionSignature, @Nullable FunctionBodyNode functionBody) { + private BLangFunction createFunctionNode( + IdentifierToken funcName, NodeList qualifierList, + FunctionSignatureNode functionSignature, @Nullable FunctionBodyNode functionBody) { BLangFunction bLFunction = (BLangFunction) TreeBuilder.createFunctionNode(); @@ -6013,8 +6014,9 @@ private BLangSimpleVariable createSimpleVar(Token name, Node type, NodeList annotations) { + private BLangSimpleVariable createSimpleVar( + @Nullable Token name, Node typeName, @Nullable Node initializer, + @Nullable Token visibilityQualifier, NodeList annotations) { BLangSimpleVariable bLSimpleVar = (BLangSimpleVariable) TreeBuilder.createSimpleVariableNode(); bLSimpleVar.setName(this.createIdentifier(name)); bLSimpleVar.name.pos = getPosition(name); diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/ConstantValueResolver.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/ConstantValueResolver.java index 30385b63c30e..1a815b05cfab 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/ConstantValueResolver.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/ConstantValueResolver.java @@ -310,7 +310,8 @@ public void visit(BLangUnaryExpr unaryExpr) { this.result = evaluateUnaryOperator(value, unaryExpr.operator); } - private BLangConstantValue calculateConstValue(@Nullable BLangConstantValue lhs, @Nullable BLangConstantValue rhs, OperatorKind kind) { + private BLangConstantValue calculateConstValue(@Nullable BLangConstantValue lhs, @Nullable BLangConstantValue rhs, + OperatorKind kind) { if (lhs == null || rhs == null || lhs.value == null || rhs.value == null) { // This is a compilation error. // This is to avoid NPE exceptions in sub-sequent validations. diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/DataflowAnalyzer.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/DataflowAnalyzer.java index b5796a64dd09..76d74447e66a 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/DataflowAnalyzer.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/DataflowAnalyzer.java @@ -2958,7 +2958,8 @@ private static class BranchResult { boolean possibleFailureReached; - BranchResult(Map uninitializedVars, @Nullable Map possibleFailureUnInitVars, + BranchResult(Map uninitializedVars, + @Nullable Map possibleFailureUnInitVars, boolean flowTerminated, boolean possibleFailureReached, boolean definiteFailureReached) { this.uninitializedVars = uninitializedVars; this.possibleFailureUnInitVars = possibleFailureUnInitVars; diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/DocumentationAnalyzer.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/DocumentationAnalyzer.java index e291b0e7b43a..3b9c164b9bec 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/DocumentationAnalyzer.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/DocumentationAnalyzer.java @@ -504,7 +504,8 @@ private void validateNoParameters(DocumentableNode documentableNode) { DiagnosticWarningCode.NO_SUCH_DOCUMENTABLE_PARAMETER, parameter)); } - private void validateReturnParameter(DocumentableNode documentableNode, @Nullable BLangNode node, boolean isExpected) { + private void validateReturnParameter(DocumentableNode documentableNode, @Nullable BLangNode node, + boolean isExpected) { BLangMarkdownDocumentation documentationAttachment = documentableNode.getMarkdownDocumentationAttachment(); if (documentationAttachment == null) { return; diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/IsolationAnalyzer.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/IsolationAnalyzer.java index 0a5792557168..6bd2f4a5567f 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/IsolationAnalyzer.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/IsolationAnalyzer.java @@ -2523,8 +2523,9 @@ private void analyzeVarArgIsolatedness(BLangInvocation invocationExpr, BLangRest } } - private void handleNonExplicitlyIsolatedArgForIsolatedParam(BLangInvocation invocationExpr, @Nullable BLangExpression expr, - boolean expectsIsolation, BType type, Location pos) { + private void handleNonExplicitlyIsolatedArgForIsolatedParam( + BLangInvocation invocationExpr, @Nullable BLangExpression expr, boolean expectsIsolation, BType type, + Location pos) { if (Symbols.isFlagOn(type.flags, Flags.ISOLATED)) { return; } @@ -3529,9 +3530,9 @@ private void markDependsOnIsolationNonInferableConstructs() { this.isolationInferenceInfoMap.get(enclInvokableSymbol).dependsOnlyOnInferableConstructs = false; } - private void analyzeFunctionInStartActionForInference(SymbolEnv env, List requiredArgs, - List restArgs, @Nullable BLangExpression expr, - BInvokableSymbol symbol) { + private void analyzeFunctionInStartActionForInference( + SymbolEnv env, List requiredArgs, List restArgs, + @Nullable BLangExpression expr, BInvokableSymbol symbol) { Set argsList = new HashSet<>(requiredArgs); argsList.addAll(restArgs); if (expr != null) { diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/MainFunctionValidator.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/MainFunctionValidator.java index a54e5f1fa6a0..79903e7799e3 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/MainFunctionValidator.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/MainFunctionValidator.java @@ -99,8 +99,9 @@ private void detectArrayRelatedErrors(List requiredParams) } @Nullable - private BLangSimpleVariable handleSuccessfulVisit(MainParameterVisitor mainParameterVisitor, - @Nullable BLangSimpleVariable foundOperand, BLangSimpleVariable param) { + private BLangSimpleVariable handleSuccessfulVisit( + MainParameterVisitor mainParameterVisitor, @Nullable BLangSimpleVariable foundOperand, + BLangSimpleVariable param) { BType paramType = param.getBType(); BType referredParamType = Types.getImpliedType(paramType); if (mainParameterVisitor.isOperandType(paramType) && param.expr == null && foundOperand != null) { diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java index ad3a3a62c730..299352a359dd 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java @@ -599,8 +599,9 @@ public void visit(BLangBlockFunctionBody body, AnalyzerData data) { resetNotCompletedNormally(data); } - private boolean analyzeBlockStmtFollowingIfWithoutElse(BLangStatement currentStmt, @Nullable BLangStatement prevStatement, - SymbolEnv currentEnv, AnalyzerData data) { + private boolean analyzeBlockStmtFollowingIfWithoutElse( + BLangStatement currentStmt, @Nullable BLangStatement prevStatement, SymbolEnv currentEnv, + AnalyzerData data) { if (currentStmt.getKind() == NodeKind.BLOCK && prevStatement != null && prevStatement.getKind() == NodeKind.IF && ((BLangIf) prevStatement).elseStmt == null && data.notCompletedNormally) { BLangIf ifStmt = (BLangIf) prevStatement; diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SymbolResolver.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SymbolResolver.java index 8abe1b0ec58c..11d18a293017 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SymbolResolver.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SymbolResolver.java @@ -2468,7 +2468,8 @@ public BType getPotentialIntersection(Types.IntersectionContext intersectionCont return types.getTypeIntersection(intersectionContext, lhsType, rhsType, env); } - boolean validateInferTypedescParams(Location pos, List parameters, @Nullable BType retType) { + boolean validateInferTypedescParams( + Location pos, List parameters, @Nullable BType retType) { int inferTypedescParamCount = 0; BVarSymbol paramWithInferredTypedescDefault = null; Location inferDefaultLocation = null; diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/TypeChecker.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/TypeChecker.java index e990b6df5695..8e6e55993ffa 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/TypeChecker.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/TypeChecker.java @@ -6928,8 +6928,9 @@ private boolean searchClosureVariableInExpressions(BSymbol symbol, Location pos, return false; } - private void updateObjectCtorClosureSymbols(Location pos, @Nullable BLangFunction currentFunction, BSymbol resolvedSymbol, - BLangClassDefinition classDef, AnalyzerData data) { + private void updateObjectCtorClosureSymbols( + Location pos, @Nullable BLangFunction currentFunction, BSymbol resolvedSymbol, + BLangClassDefinition classDef, AnalyzerData data) { classDef.hasClosureVars = true; resolvedSymbol.closure = true; if (currentFunction != null) { diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/TypeParamAnalyzer.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/TypeParamAnalyzer.java index 2dc68b1c4c3c..7c44c3c78499 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/TypeParamAnalyzer.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/TypeParamAnalyzer.java @@ -364,8 +364,9 @@ private void findTypeParam(BLangExpression expr, Location loc, BType expType, BT findTypeParam(expr, loc, expType, actualType, env, resolvedTypes, result, false); } - private void findTypeParam(@Nullable BLangExpression expr, Location loc, BType expType, BType actualType, SymbolEnv env, - HashSet resolvedTypes, FindTypeParamResult result, boolean checkContravariance) { + private void findTypeParam( + @Nullable BLangExpression expr, Location loc, BType expType, BType actualType, SymbolEnv env, + HashSet resolvedTypes, FindTypeParamResult result, boolean checkContravariance) { if (resolvedTypes.contains(expType)) { return; } diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/Types.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/Types.java index 0fc6acdf4017..8f0b4d5b8940 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/Types.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/Types.java @@ -6888,7 +6888,8 @@ public static class IntersectionContext { // Try to avoid creating new intersection types. boolean preferNonGenerativeIntersection; - private IntersectionContext(@Nullable BLangDiagnosticLog diaglog, @Nullable Location left, @Nullable Location right) { + private IntersectionContext( + @Nullable BLangDiagnosticLog diaglog, @Nullable Location left, @Nullable Location right) { this.dlog = diaglog; this.lhsPos = left; this.rhsPos = right; @@ -6898,7 +6899,8 @@ private IntersectionContext(@Nullable BLangDiagnosticLog diaglog, @Nullable Loca this.preferNonGenerativeIntersection = false; } - private IntersectionContext(@Nullable BLangDiagnosticLog diaglog, @Nullable Location left, @Nullable Location right, Location pos) { + private IntersectionContext( + @Nullable BLangDiagnosticLog diaglog, @Nullable Location left, @Nullable Location right, Location pos) { this(diaglog, left, right); this.pos = pos; } diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/symbols/BConstantSymbol.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/symbols/BConstantSymbol.java index 314307654d60..3c5b5e7eae15 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/symbols/BConstantSymbol.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/symbols/BConstantSymbol.java @@ -38,13 +38,13 @@ public class BConstantSymbol extends BVarSymbol implements ConstantSymbol { public BLangConstantValue value; public BType literalType; - public BConstantSymbol(long flags, Name name, PackageID pkgID, @Nullable BType literalType, BType type, BSymbol owner, - Location pos, SymbolOrigin origin) { + public BConstantSymbol(long flags, Name name, PackageID pkgID, @Nullable BType literalType, BType type, + BSymbol owner, Location pos, SymbolOrigin origin) { this(flags, name, name, pkgID, literalType, type, owner, pos, origin); } - public BConstantSymbol(long flags, Name name, Name originalName, PackageID pkgID, @Nullable BType literalType, BType type, - BSymbol owner, Location pos, SymbolOrigin origin) { + public BConstantSymbol(long flags, Name name, Name originalName, PackageID pkgID, @Nullable BType literalType, + BType type, BSymbol owner, Location pos, SymbolOrigin origin) { super(flags, name, originalName, pkgID, type, owner, pos, origin); this.tag = CONSTANT; this.literalType = literalType; diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/symbols/BErrorTypeSymbol.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/symbols/BErrorTypeSymbol.java index d1d4e6dd6de0..1f3dd6d76b0c 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/symbols/BErrorTypeSymbol.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/symbols/BErrorTypeSymbol.java @@ -32,8 +32,8 @@ */ public class BErrorTypeSymbol extends BTypeSymbol { - public BErrorTypeSymbol(long symTag, long flags, Name name, PackageID pkgID, @Nullable BType type, @Nullable BSymbol owner, - Location pos, SymbolOrigin origin) { + public BErrorTypeSymbol(long symTag, long flags, Name name, PackageID pkgID, @Nullable BType type, + @Nullable BSymbol owner, Location pos, SymbolOrigin origin) { super(symTag, flags, name, pkgID, type, owner, pos, origin); this.kind = SymbolKind.ERROR; } diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/symbols/BRecordTypeSymbol.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/symbols/BRecordTypeSymbol.java index b47f23c1caa1..d14fcb019916 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/symbols/BRecordTypeSymbol.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/symbols/BRecordTypeSymbol.java @@ -37,8 +37,8 @@ public class BRecordTypeSymbol extends BStructureTypeSymbol { public Map defaultValues; - public BRecordTypeSymbol(long symTag, long flags, Name name, PackageID pkgID, @Nullable BType type, @Nullable BSymbol owner, - Location pos, SymbolOrigin origin) { + public BRecordTypeSymbol(long symTag, long flags, Name name, PackageID pkgID, @Nullable BType type, + @Nullable BSymbol owner, Location pos, SymbolOrigin origin) { super(SymbolKind.RECORD, symTag, flags, name, pkgID, type, owner, pos, origin); this.defaultValues = new HashMap<>(); } diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/symbols/BVarSymbol.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/symbols/BVarSymbol.java index 075f0e748246..099ed31c8e2c 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/symbols/BVarSymbol.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/symbols/BVarSymbol.java @@ -48,15 +48,15 @@ public class BVarSymbol extends BSymbol implements VariableSymbol, Annotatable { @Nullable public BVarSymbol originalSymbol; - public BVarSymbol(long flags, Name name, Name originalName, @Nullable PackageID pkgID, BType type, @Nullable BSymbol owner, - @Nullable Location pos, SymbolOrigin origin) { + public BVarSymbol(long flags, Name name, Name originalName, @Nullable PackageID pkgID, BType type, + @Nullable BSymbol owner, @Nullable Location pos, SymbolOrigin origin) { super(VARIABLE, flags, name, originalName, pkgID, type, owner, pos, origin); this.annotationAttachments = new ArrayList<>(); this.kind = SymbolKind.VARIABLE; } - public BVarSymbol(long flags, @Nullable Name name, @Nullable PackageID pkgID, @Nullable BType type, @Nullable BSymbol owner, @Nullable Location pos, - @Nullable SymbolOrigin origin) { + public BVarSymbol(long flags, @Nullable Name name, @Nullable PackageID pkgID, @Nullable BType type, + @Nullable BSymbol owner, @Nullable Location pos, @Nullable SymbolOrigin origin) { this(flags, name, name, pkgID, type, owner, pos, origin); } diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/symbols/Symbols.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/symbols/Symbols.java index 5ff379b41780..0b3f0a9d8edf 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/symbols/Symbols.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/symbols/Symbols.java @@ -108,14 +108,16 @@ public static BRecordTypeSymbol createRecordSymbol(long flags, return typeSymbol; } - public static BErrorTypeSymbol createErrorSymbol(long flags, Name name, PackageID pkgID, @Nullable BType type, BSymbol owner, - Location pos, SymbolOrigin origin) { + public static BErrorTypeSymbol createErrorSymbol( + long flags, Name name, PackageID pkgID, @Nullable BType type, BSymbol owner, Location pos, + SymbolOrigin origin) { return new BErrorTypeSymbol(SymTag.ERROR, flags, name, pkgID, type, owner, pos, origin); } - public static BAnnotationSymbol createAnnotationSymbol(long flags, Set points, Name name, - Name origName, PackageID pkgID, @Nullable BType type, BSymbol owner, - Location pos, SymbolOrigin origin) { + public static BAnnotationSymbol createAnnotationSymbol( + long flags, Set points, Name name, + Name origName, PackageID pkgID, @Nullable BType type, BSymbol owner, + Location pos, SymbolOrigin origin) { BAnnotationSymbol annotationSymbol = new BAnnotationSymbol(name, origName, flags, points, pkgID, type, owner, pos, origin); annotationSymbol.kind = SymbolKind.ANNOTATION; @@ -223,14 +225,15 @@ public static BXMLNSSymbol createXMLNSSymbol(Name name, return new BXMLNSSymbol(name, nsURI, pkgID, owner, pos, origin, compUnit); } - public static BResourcePathSegmentSymbol createResourcePathSegmentSymbol(Name name, - PackageID pkgID, - BType type, - BSymbol owner, - Location location, - @Nullable BResourcePathSegmentSymbol parentResource, - BResourceFunction resourceMethod, - SymbolOrigin origin) { + public static BResourcePathSegmentSymbol createResourcePathSegmentSymbol( + Name name, + PackageID pkgID, + BType type, + BSymbol owner, + Location location, + @Nullable BResourcePathSegmentSymbol parentResource, + BResourceFunction resourceMethod, + SymbolOrigin origin) { return new BResourcePathSegmentSymbol(name, pkgID, type, owner, location, parentResource, resourceMethod, origin); } diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/types/BInvokableType.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/types/BInvokableType.java index f0dc9a7cdce5..2f584103b225 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/types/BInvokableType.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/types/BInvokableType.java @@ -40,7 +40,8 @@ public class BInvokableType extends BType implements InvokableType { @Nullable public BType retType; - public BInvokableType(@Nullable List paramTypes, @Nullable BType restType, @Nullable BType retType, @Nullable BTypeSymbol tsymbol) { + public BInvokableType(@Nullable List paramTypes, @Nullable BType restType, @Nullable BType retType, + @Nullable BTypeSymbol tsymbol) { super(TypeTags.INVOKABLE, tsymbol, Flags.READONLY); this.paramTypes = paramTypes; this.restType = restType; diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/types/BParameterizedType.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/types/BParameterizedType.java index 7f3d9def0852..0eaf3b09d152 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/types/BParameterizedType.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/types/BParameterizedType.java @@ -38,7 +38,8 @@ public class BParameterizedType extends BType { public BType paramValueType; public int paramIndex; - public BParameterizedType(@Nullable BType valueType, @Nullable BVarSymbol paramSymbol, @Nullable BTypeSymbol tSymbol, Name name, int paramIndex) { + public BParameterizedType(@Nullable BType valueType, @Nullable BVarSymbol paramSymbol, + @Nullable BTypeSymbol tSymbol, Name name, int paramIndex) { super(TypeTags.PARAMETERIZED_TYPE, tSymbol); this.paramSymbol = paramSymbol; this.paramValueType = valueType; diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/types/BStreamType.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/types/BStreamType.java index d676bedc876d..b4b274565322 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/types/BStreamType.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/types/BStreamType.java @@ -35,7 +35,8 @@ public class BStreamType extends BBuiltInRefType implements StreamType { public BType constraint; public BType completionType; - public BStreamType(int tag, @Nullable BType constraint, @Nullable BType completionType, @Nullable BTypeSymbol tsymbol) { + public BStreamType(int tag, @Nullable BType constraint, @Nullable BType completionType, + @Nullable BTypeSymbol tsymbol) { super(tag, tsymbol); this.constraint = constraint; this.completionType = completionType != null ? completionType : new BNilType(); diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/types/BUnionType.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/types/BUnionType.java index 479b6bb14ab9..27b80ac6b85d 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/types/BUnionType.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/model/types/BUnionType.java @@ -61,7 +61,8 @@ public class BUnionType extends BType implements UnionType { private static final Pattern pCloneable = Pattern.compile(INT_CLONEABLE); private static final Pattern pCloneableType = Pattern.compile(CLONEABLE_TYPE); - public BUnionType(@Nullable BTypeSymbol tsymbol, LinkedHashSet memberTypes, boolean nullable, boolean readonly) { + public BUnionType(@Nullable BTypeSymbol tsymbol, LinkedHashSet memberTypes, boolean nullable, + boolean readonly) { this(tsymbol, memberTypes, memberTypes, nullable, readonly); } diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/ImmutableTypeCloner.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/ImmutableTypeCloner.java index 8ff7e9c643cb..465e1cd6fcea 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/ImmutableTypeCloner.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/ImmutableTypeCloner.java @@ -100,20 +100,17 @@ public static BType getEffectiveImmutableType(@Nullable Location pos, Types type new HashSet<>()).effectiveType; } - public static BType getEffectiveImmutableType(@Nullable Location pos, Types types, - BType type, PackageID pkgId, - BSymbol owner, SymbolTable symTable, - @Nullable BLangAnonymousModelHelper anonymousModelHelper, Names names) { + public static BType getEffectiveImmutableType( + @Nullable Location pos, Types types, BType type, PackageID pkgId, BSymbol owner, SymbolTable symTable, + @Nullable BLangAnonymousModelHelper anonymousModelHelper, Names names) { return getImmutableIntersectionType(pos, types, type, null, pkgId, owner, symTable, anonymousModelHelper, names, new HashSet<>(), new HashSet<>()).effectiveType; } - public static BIntersectionType getImmutableIntersectionType(@Nullable Location pos, Types types, - BType type, - SymbolEnv env, SymbolTable symTable, - BLangAnonymousModelHelper anonymousModelHelper, - Names names, @Nullable Set origObjFlagSet) { + public static BIntersectionType getImmutableIntersectionType( + @Nullable Location pos, Types types, BType type, SymbolEnv env, SymbolTable symTable, + BLangAnonymousModelHelper anonymousModelHelper, Names names, @Nullable Set origObjFlagSet) { return getImmutableIntersectionType(pos, types, type, env, env.enclPkg.packageID, env.scope.owner, symTable, anonymousModelHelper, names, origObjFlagSet, new HashSet<>()); } @@ -180,14 +177,10 @@ public static BType getImmutableType(Location pos, Types types, BType type, Symb unresolvedTypes); } - private static BIntersectionType getImmutableIntersectionType(@Nullable Location pos, - Types types, BType bType, - @Nullable SymbolEnv env, PackageID pkgId, - @Nullable BSymbol owner, SymbolTable symTable, - @Nullable BLangAnonymousModelHelper anonymousModelHelper, - Names names, - @Nullable Set origObjFlagSet, - Set unresolvedTypes) { + private static BIntersectionType getImmutableIntersectionType( + @Nullable Location pos, Types types, BType bType, @Nullable SymbolEnv env, PackageID pkgId, + @Nullable BSymbol owner, SymbolTable symTable, @Nullable BLangAnonymousModelHelper anonymousModelHelper, + Names names, @Nullable Set origObjFlagSet, Set unresolvedTypes) { BType refType = Types.getReferredType(bType); SelectivelyImmutableReferenceType type = (SelectivelyImmutableReferenceType) refType; if (refType.tag == TypeTags.INTERSECTION && Symbols.isFlagOn(refType.flags, Flags.READONLY)) { diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/TypeDefBuilderHelper.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/TypeDefBuilderHelper.java index fc1f8f94b198..c57d4b71bd62 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/TypeDefBuilderHelper.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/TypeDefBuilderHelper.java @@ -208,8 +208,8 @@ public static BLangTypeDefinition addTypeDefinition(BType type, BTypeSymbol symb return typeDefinition; } - public static BLangTypeDefinition createTypeDefinitionForTSymbol(@Nullable BType type, BSymbol symbol, BLangType typeNode, - SymbolEnv env) { + public static BLangTypeDefinition createTypeDefinitionForTSymbol( + @Nullable BType type, BSymbol symbol, BLangType typeNode, SymbolEnv env) { BLangTypeDefinition typeDefinition = (BLangTypeDefinition) TreeBuilder.createTypeDefinition(); typeDefinition.typeNode = typeNode; typeDefinition.setBType(type); @@ -295,14 +295,15 @@ public static String getPackageAlias(SymbolEnv env, @Nullable String compUnitNam return ""; // current module } - public static void populateStructureFieldsAndTypeInclusions(Types types, SymbolTable symTable, - @Nullable BLangAnonymousModelHelper anonymousModelHelper, - Names names, BLangStructureTypeNode structureTypeNode, - BStructureType structureType, - BStructureType origStructureType, Location pos, - SymbolEnv env, PackageID pkgID, - @Nullable Set unresolvedTypes, long flag, - boolean isImmutable) { + public static void populateStructureFieldsAndTypeInclusions( + Types types, SymbolTable symTable, + @Nullable BLangAnonymousModelHelper anonymousModelHelper, + Names names, BLangStructureTypeNode structureTypeNode, + BStructureType structureType, + BStructureType origStructureType, Location pos, + SymbolEnv env, PackageID pkgID, + @Nullable Set unresolvedTypes, long flag, + boolean isImmutable) { BTypeSymbol structureSymbol = structureType.tsymbol; LinkedHashMap fields = new LinkedHashMap<>(); structureType.typeInclusions = origStructureType.typeInclusions; diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/Unifier.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/Unifier.java index 2b58a2a565a5..1de7809b9481 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/Unifier.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/Unifier.java @@ -94,7 +94,8 @@ public class Unifier implements BTypeVisitor { private Types types; private BLangDiagnosticLog dlog; - public BType build(BType originalType, @Nullable BType expType, @Nullable BLangInvocation invocation, @Nullable Types types, + public BType build(BType originalType, @Nullable BType expType, + @Nullable BLangInvocation invocation, @Nullable Types types, @Nullable SymbolTable symbolTable, @Nullable BLangDiagnosticLog dlog) { this.isInvocation = invocation != null; if (this.isInvocation) { diff --git a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/internal/parser/AbstractParser.java b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/internal/parser/AbstractParser.java index b182b58094ab..4696a862b05c 100644 --- a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/internal/parser/AbstractParser.java +++ b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/internal/parser/AbstractParser.java @@ -291,7 +291,8 @@ protected STNode addInvalidNodeStackToTrailingMinutiae(STNode node) { * @param diagnosticCode the {@code DiagnosticCode} to be added * @param args additional arguments required to format the diagnostic message */ - protected void addInvalidNodeToNextToken(STNode invalidNode, @Nullable DiagnosticCode diagnosticCode, Object... args) { + protected void addInvalidNodeToNextToken(STNode invalidNode, @Nullable DiagnosticCode diagnosticCode, + Object... args) { invalidNodeInfoStack.push(new InvalidNodeInfo(invalidNode, diagnosticCode, args)); } diff --git a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/internal/parser/BallerinaParser.java b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/internal/parser/BallerinaParser.java index 38adabd1eed2..e3d607470f6c 100644 --- a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/internal/parser/BallerinaParser.java +++ b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/internal/parser/BallerinaParser.java @@ -1849,8 +1849,9 @@ private STNode createFunctionTypeDescriptor(List qualifierList, STNode f } private STNode parseVarDeclWithFunctionType(STNode metadata, STNode visibilityQualifier, List qualifierList, - STNode functionKeyword, @Nullable STNode funcSignature, boolean isObjectMember, - boolean isObjectTypeDesc, boolean hasFuncSignature) { + STNode functionKeyword, @Nullable STNode funcSignature, + boolean isObjectMember, boolean isObjectTypeDesc, + boolean hasFuncSignature) { switchContext(ParserRuleContext.VAR_DECL_STMT); List extractQualifiersList = extractVarDeclOrObjectFieldQualifiers(qualifierList, isObjectMember, isObjectTypeDesc); @@ -2300,8 +2301,8 @@ private STNode parseParameter(SyntaxKind prevParamKind, boolean isParamNameOptio return parseParameter(annots, prevParamKind, isParamNameOptional); } - private STNode parseAfterParamType(SyntaxKind prevParamKind, STNode annots, @Nullable STNode inclusionSymbol, STNode type, - boolean isParamNameOptional) { + private STNode parseAfterParamType(SyntaxKind prevParamKind, STNode annots, + @Nullable STNode inclusionSymbol, STNode type, boolean isParamNameOptional) { STNode paramName; STToken token = peek(); switch (token.kind) { @@ -4227,7 +4228,8 @@ private STNode parseFieldOrRestDescriptorRhs(STNode metadata, STNode type) { * @param fieldName Field name * @return Parsed node */ - private STNode parseFieldDescriptorRhs(STNode metadata, @Nullable STNode readonlyQualifier, STNode type, STNode fieldName) { + private STNode parseFieldDescriptorRhs( + STNode metadata, @Nullable STNode readonlyQualifier, STNode type, STNode fieldName) { STToken nextToken = peek(); switch (nextToken.kind) { case SEMICOLON_TOKEN: @@ -4582,7 +4584,8 @@ private STNode parseVarDeclTypeDescRhs(STNode typeDesc, STNode metadata, List qualifiers, + private STNode parseVarDeclTypeDescRhs(STNode typeDesc, STNode metadata, @Nullable STNode publicQual, + List qualifiers, boolean isTypedBindingPattern, boolean isModuleVar) { startContext(ParserRuleContext.VAR_DECL_STMT); // Check for complex type desc @@ -4697,9 +4700,10 @@ private STNode parseConfigurableVarDeclRhs() { return expr; } - private STNode createModuleVarDeclaration(STNode metadata, STNode publicQualifier, List varDeclQuals, - STNode typedBindingPattern, @Nullable STNode assign, @Nullable STNode expr, STNode semicolon, - boolean isConfigurable, boolean hasVarInit) { + private STNode createModuleVarDeclaration( + STNode metadata, STNode publicQualifier, List varDeclQuals, STNode typedBindingPattern, + @Nullable STNode assign, @Nullable STNode expr, STNode semicolon, boolean isConfigurable, + boolean hasVarInit) { if (hasVarInit || varDeclQuals.isEmpty()) { return createModuleVarDeclaration(metadata, publicQualifier, varDeclQuals, typedBindingPattern, assign, expr, semicolon); @@ -4776,8 +4780,8 @@ private STNode createMissingSimpleVarDecl(@Nullable STNode metadata, boolean isM return createMissingSimpleVarDecl(metadata, publicQualifier, new ArrayList<>(), isModuleVar); } - private STNode createMissingSimpleVarDecl(STNode metadata, @Nullable STNode publicQualifier, List qualifiers, - boolean isModuleVar) { + private STNode createMissingSimpleVarDecl( + STNode metadata, @Nullable STNode publicQualifier, List qualifiers, boolean isModuleVar) { STNode emptyNode = STNodeFactory.createEmptyNode(); STNode simpleTypeDescIdentifier = SyntaxErrors.createMissingTokenWithDiagnostics(SyntaxKind.IDENTIFIER_TOKEN, DiagnosticErrorCode.ERROR_MISSING_TYPE_DESC); @@ -4819,7 +4823,8 @@ private STNode createMissingWhereClause() { return STNodeFactory.createWhereClauseNode(whereKeyword, missingExpr); } - private STNode createMissingSimpleObjectField(@Nullable STNode metadata, List qualifiers, boolean isObjectTypeDesc) { + private STNode createMissingSimpleObjectField(@Nullable STNode metadata, List qualifiers, + boolean isObjectTypeDesc) { STNode emptyNode = STNodeFactory.createEmptyNode(); STNode simpleTypeDescIdentifier = SyntaxErrors.createMissingTokenWithDiagnostics(SyntaxKind.IDENTIFIER_TOKEN, DiagnosticErrorCode.ERROR_MISSING_TYPE_DESC); @@ -6736,7 +6741,8 @@ private boolean isObjectMethodStart(STToken token) { * @param isObjectTypeDesc Whether object type or not * @return Parse object member node */ - private STNode parseObjectMethodOrField(STNode metadata, @Nullable STNode visibilityQualifier, boolean isObjectTypeDesc) { + private STNode parseObjectMethodOrField(STNode metadata, @Nullable STNode visibilityQualifier, + boolean isObjectTypeDesc) { List objectMemberQualifiers = new ArrayList<>(); return parseObjectMethodOrField(metadata, visibilityQualifier, objectMemberQualifiers, isObjectTypeDesc); } @@ -6867,8 +6873,8 @@ private STNode parseObjectFieldRhs(STNode metadata, STNode visibilityQualifier, * @param isObjectTypeDesc Whether object type or not * @return Parsed node */ - private STNode parseObjectMethodOrFuncTypeDesc(STNode metadata, @Nullable STNode visibilityQualifier, List qualifiers, - boolean isObjectTypeDesc) { + private STNode parseObjectMethodOrFuncTypeDesc(STNode metadata, @Nullable STNode visibilityQualifier, + List qualifiers, boolean isObjectTypeDesc) { return parseFuncDefOrFuncTypeDesc(metadata, visibilityQualifier, qualifiers, true, isObjectTypeDesc); } @@ -9506,7 +9512,8 @@ private STNode parseAnnotationDeclRhs(STNode metadata, STNode qualifier, STNode } private STNode parseAnnotationDeclAttachPoints(STNode metadata, STNode qualifier, STNode constKeyword, - STNode annotationKeyword, @Nullable STNode typeDesc, STNode annotTag) { + STNode annotationKeyword, @Nullable STNode typeDesc, + STNode annotTag) { STNode onKeyword; STNode attachPoints; STToken nextToken = peek(); @@ -17156,7 +17163,8 @@ private STNode parseBracketedListMember(boolean isTypedBindingPattern) { * @param member Member * @return Parsed node */ - private STNode parseAsArrayTypeDesc(STNode typeDesc, STNode openBracket, @Nullable STNode member, ParserRuleContext context) { + private STNode parseAsArrayTypeDesc(STNode typeDesc, STNode openBracket, @Nullable STNode member, + ParserRuleContext context) { // In ambiguous scenarios typDesc: T[a] may have parsed as an indexed expression. // Therefore make an array-type-desc out of it. typeDesc = getTypeDescFromExpr(typeDesc); diff --git a/language-server/modules/langserver-commons/src/main/java/org/ballerinalang/langserver/commons/completion/spi/BallerinaCompletionProvider.java b/language-server/modules/langserver-commons/src/main/java/org/ballerinalang/langserver/commons/completion/spi/BallerinaCompletionProvider.java index f2c2717f2ac0..48362bf3c296 100644 --- a/language-server/modules/langserver-commons/src/main/java/org/ballerinalang/langserver/commons/completion/spi/BallerinaCompletionProvider.java +++ b/language-server/modules/langserver-commons/src/main/java/org/ballerinalang/langserver/commons/completion/spi/BallerinaCompletionProvider.java @@ -51,7 +51,8 @@ enum Precedence { * @return {@link List} List of calculated Completion Items * @throws LSCompletionException when completion fails */ - List getCompletions(BallerinaCompletionContext context, @Nullable T node) throws LSCompletionException; + List getCompletions(BallerinaCompletionContext context, + @Nullable T node) throws LSCompletionException; /** * Sort a given list of completion Items. diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/LSClientLogger.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/LSClientLogger.java index f3173917da0f..5981a023062e 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/LSClientLogger.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/LSClientLogger.java @@ -86,8 +86,9 @@ public void notifyUser(String operation, Throwable error) { * @param identifier text document * @param pos pos */ - public void logError(@Nullable LSOperation operation, String message, Throwable error, @Nullable TextDocumentIdentifier identifier, - Position... pos) { + public void logError( + @Nullable LSOperation operation, String message, Throwable error, + @Nullable TextDocumentIdentifier identifier, Position... pos) { if (!this.isInitializedOnce || this.languageClient == null) { return; } diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/codeaction/RangeBasedPositionDetailsImpl.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/codeaction/RangeBasedPositionDetailsImpl.java index 3b6ac29fdf75..f28887e6af39 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/codeaction/RangeBasedPositionDetailsImpl.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/codeaction/RangeBasedPositionDetailsImpl.java @@ -109,7 +109,8 @@ public PositionDetailsBuilder setDocumentableNode(@Nullable NonTerminalNode docu return this; } - public PositionDetailsBuilder setEnclosingDocumentableNode(@Nullable NonTerminalNode enclosingDocumentableNode) { + public PositionDetailsBuilder setEnclosingDocumentableNode( + @Nullable NonTerminalNode enclosingDocumentableNode) { this.enclosingDocumentableNode = enclosingDocumentableNode; return this; } diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/common/ImportsAcceptor.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/common/ImportsAcceptor.java index b1ee1c0ea946..9a976e1707e6 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/common/ImportsAcceptor.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/common/ImportsAcceptor.java @@ -52,7 +52,8 @@ public ImportsAcceptor(DocumentServiceContext context) { this(context, null); } - public ImportsAcceptor(DocumentServiceContext context, @Nullable BiConsumer onExistCallback) { + public ImportsAcceptor(DocumentServiceContext context, + @Nullable BiConsumer onExistCallback) { this.newImports = new HashSet<>(); this.currentModuleImportsMap = context.currentDocImportsMap(); this.onExistCallback = onExistCallback; diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/common/utils/NameUtil.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/common/utils/NameUtil.java index 51724bb1da7b..071aa5ba1706 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/common/utils/NameUtil.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/common/utils/NameUtil.java @@ -134,7 +134,8 @@ public static String generateTypeName(String prefix, Set visibleSymbolNa * @param visibleNames Visible symbol names. * @return */ - public static String generateParameterName(String arg, int position, @Nullable TypeSymbol type, Set visibleNames) { + public static String generateParameterName(String arg, int position, @Nullable TypeSymbol type, + Set visibleNames) { String newName; if (arg.isEmpty() || !SyntaxInfo.isIdentifier(arg)) { String typeName = type != null ? type.typeKind().getName() : ""; diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/completions/builder/FunctionCompletionItemBuilder.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/completions/builder/FunctionCompletionItemBuilder.java index 5bec258eaa1e..a10e3a5dd648 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/completions/builder/FunctionCompletionItemBuilder.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/completions/builder/FunctionCompletionItemBuilder.java @@ -56,6 +56,8 @@ import org.eclipse.lsp4j.InsertTextFormat; import org.eclipse.lsp4j.MarkupContent; import org.eclipse.lsp4j.jsonrpc.messages.Either; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.Arrays; @@ -65,9 +67,6 @@ import java.util.Optional; import java.util.StringJoiner; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - /** * This class is being used to build function type completion item. * @@ -149,7 +148,7 @@ public static CompletionItem build(ClassSymbol typeDesc, InitializerBuildMode mo * @param context LS context * @return {@link CompletionItem} */ - public static CompletionItem buildMethod(@Nonnull FunctionSymbol functionSymbol, + public static CompletionItem buildMethod(@NotNull FunctionSymbol functionSymbol, BallerinaCompletionContext context) { CompletionItem item = new CompletionItem(); setMeta(item, functionSymbol, context); @@ -162,7 +161,8 @@ public static CompletionItem buildMethod(@Nonnull FunctionSymbol functionSymbol, return item; } - protected static void setMeta(CompletionItem item, @org.jetbrains.annotations.Nullable FunctionSymbol functionSymbol, BallerinaCompletionContext ctx) { + protected static void setMeta(CompletionItem item, @Nullable FunctionSymbol functionSymbol, + BallerinaCompletionContext ctx) { item.setInsertTextFormat(InsertTextFormat.Snippet); item.setKind(CompletionItemKind.Function); if (functionSymbol != null) { @@ -309,7 +309,7 @@ private static Either getDocumentation(FunctionSymbol fun * @param ctx Language Server Operation context * @return {@link Pair} of insert text(left-side) and signature label(right-side) */ - private static Pair getFunctionInvocationSignature(@org.jetbrains.annotations.Nullable FunctionSymbol functionSymbol, + private static Pair getFunctionInvocationSignature(@Nullable FunctionSymbol functionSymbol, String functionName, BallerinaCompletionContext ctx) { String escapedFunctionName = CommonUtil.escapeEscapeCharsInIdentifier(functionName); diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/contexts/ContextBuilder.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/contexts/ContextBuilder.java index d14950f0b7fa..d89949d25bdb 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/contexts/ContextBuilder.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/contexts/ContextBuilder.java @@ -69,7 +69,8 @@ private ContextBuilder() { * @param serverContext language server context * @return {@link DocumentServiceContext} base context generated */ - public static DocumentServiceContext buildDocumentServiceContext(@Nullable String uri, WorkspaceManager workspaceManager, + public static DocumentServiceContext buildDocumentServiceContext(@Nullable String uri, + WorkspaceManager workspaceManager, LSContextOperation operation, LanguageServerContext serverContext) { return new BaseContextImpl.BaseContextBuilder(operation, serverContext) diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/telemetry/LSFeatureUsageTelemetryEvent.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/telemetry/LSFeatureUsageTelemetryEvent.java index cfd9c37058f9..cdf9c6536040 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/telemetry/LSFeatureUsageTelemetryEvent.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/telemetry/LSFeatureUsageTelemetryEvent.java @@ -54,7 +54,8 @@ public String getFeatureMessage() { return featureMessage; } - public static LSFeatureUsageTelemetryEvent from(String featureName, @Nullable String featureClass, @Nullable String featureMessage) { + public static LSFeatureUsageTelemetryEvent from( + String featureName, @Nullable String featureClass, @Nullable String featureMessage) { return new LSFeatureUsageTelemetryEvent(LS_TELEMETRY_COMPONENT_NAME, CommonUtil.SDK_VERSION, featureName, featureClass, featureMessage); } diff --git a/misc/ballerina-bindgen/src/main/java/org/ballerinalang/bindgen/utils/BindgenMvnResolver.java b/misc/ballerina-bindgen/src/main/java/org/ballerinalang/bindgen/utils/BindgenMvnResolver.java index 4dc89b80f69a..d722b9cfe680 100644 --- a/misc/ballerina-bindgen/src/main/java/org/ballerinalang/bindgen/utils/BindgenMvnResolver.java +++ b/misc/ballerina-bindgen/src/main/java/org/ballerinalang/bindgen/utils/BindgenMvnResolver.java @@ -106,7 +106,8 @@ private static Dependency resolveDependency(String groupId, String artifactId, S } private void handleDependency(String groupId, String artifactId, String version, String mvnRepository, - @Nullable Path projectRoot, @Nullable String parent, JvmTarget parentJvmTarget) throws BindgenException { + @Nullable Path projectRoot, @Nullable String parent, JvmTarget parentJvmTarget + ) throws BindgenException { Path mvnPath = Paths.get(mvnRepository, getPathFromGroupId(groupId), artifactId, version); this.env.addClasspath(mvnPath.toString()); if (projectRoot != null) { diff --git a/misc/ballerinalang-data-mapper/src/main/java/org/ballerinalang/datamapper/AIDataMapperCodeActionUtil.java b/misc/ballerinalang-data-mapper/src/main/java/org/ballerinalang/datamapper/AIDataMapperCodeActionUtil.java index 9c8e66e570dd..d66fe2ba87b6 100644 --- a/misc/ballerinalang-data-mapper/src/main/java/org/ballerinalang/datamapper/AIDataMapperCodeActionUtil.java +++ b/misc/ballerinalang-data-mapper/src/main/java/org/ballerinalang/datamapper/AIDataMapperCodeActionUtil.java @@ -778,8 +778,8 @@ private String getMappingFromServer(JsonArray dataToSend, * @return - Generated mapping Function */ private String generateMappingFunction(String mappingFromServer, String foundTypeLeft, - String foundTypeRight, @Nullable String leftModule, @Nullable String rightModule, - String rhsSignature, SyntaxTree syntaxTree) { + String foundTypeRight, @Nullable String leftModule, + @Nullable String rightModule, String rhsSignature, SyntaxTree syntaxTree) { String leftType = foundTypeLeft; String rightType; diff --git a/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/completion/util/CompletionUtil.java b/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/completion/util/CompletionUtil.java index a38f7d4c54ed..f2cb65918699 100644 --- a/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/completion/util/CompletionUtil.java +++ b/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/completion/util/CompletionUtil.java @@ -264,9 +264,9 @@ public static NonTerminalNode getNonTerminalNode(CompletionContext completionCon * @param column debug expression column number * @return non terminal node at breakpoint */ - public static NonTerminalNode getNonTerminalNode(CompletionContext completionContext, - String source, String sourcePath, @Nullable NonTerminalNode nonTerminalNode, - int lineNumber, int column) { + public static NonTerminalNode getNonTerminalNode( + CompletionContext completionContext, String source, String sourcePath, + @Nullable NonTerminalNode nonTerminalNode, int lineNumber, int column) { TextDocument document = TextDocuments.from(source); SyntaxTree syntaxTree = SyntaxTree.from(document, sourcePath); diff --git a/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/evaluation/EvaluationImportResolver.java b/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/evaluation/EvaluationImportResolver.java index bcc84117a43c..74da659c89be 100644 --- a/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/evaluation/EvaluationImportResolver.java +++ b/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/evaluation/EvaluationImportResolver.java @@ -84,7 +84,8 @@ public Map detectUsedImports(NonTerminalNode syntaxNode) throws * @param resolvedImports a list of already resolved imports, to avoid redundant processing. * @return a map of detected imports within the given syntax node. */ - public Map detectUsedImports(NonTerminalNode syntaxNode, @Nullable Map resolvedImports) + public Map detectUsedImports(NonTerminalNode syntaxNode, + @Nullable Map resolvedImports) throws EvaluationException { if (resolvedImports == null) { diff --git a/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/evaluation/engine/InvocationArgProcessor.java b/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/evaluation/engine/InvocationArgProcessor.java index 07d93888bdfc..914b31ae6329 100644 --- a/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/evaluation/engine/InvocationArgProcessor.java +++ b/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/evaluation/engine/InvocationArgProcessor.java @@ -90,8 +90,10 @@ protected InvocationArgProcessor(SuspendedContext context, String functionName, */ public abstract List process(List> argEvaluators) throws EvaluationException; - protected List getOrderedArgList(Map namedArgValues, @Nullable FunctionSymbol definitionSymbol, - @Nullable FunctionDefinitionNode definitionNode) throws EvaluationException { + protected List getOrderedArgList( + Map namedArgValues, @Nullable FunctionSymbol definitionSymbol, + @Nullable FunctionDefinitionNode definitionNode + ) throws EvaluationException { try { List argValueList = new ArrayList<>(); List args = jdiMethodReference.arguments(); @@ -145,7 +147,8 @@ protected static Value getRestArgArray(SuspendedContext context, Value arrayType return getRestArgArray.invokeSafely(); } - protected static Value getElementType(SuspendedContext context, @Nullable Value arrayType) throws EvaluationException { + protected static Value getElementType(SuspendedContext context, @Nullable Value arrayType + ) throws EvaluationException { ReferenceType arrayTypeRef = ((ObjectReference) arrayType).referenceType(); List methods = arrayTypeRef.methodsByName(GET_ELEMENT_TYPE_METHOD); if (methods == null || methods.size() != 1) { diff --git a/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/evaluation/engine/expression/NewExpressionEvaluator.java b/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/evaluation/engine/expression/NewExpressionEvaluator.java index 58d7654a24f8..fc0b7b38aeb5 100644 --- a/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/evaluation/engine/expression/NewExpressionEvaluator.java +++ b/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/evaluation/engine/expression/NewExpressionEvaluator.java @@ -67,8 +67,9 @@ public class NewExpressionEvaluator extends Evaluator { private final List> argEvaluators; private static final String OBJECT_INIT_METHOD_NAME = "init"; - public NewExpressionEvaluator(EvaluationContext context, ExpressionNode newExpressionNode, @Nullable List> argEvaluators) { + public NewExpressionEvaluator( + EvaluationContext context, ExpressionNode newExpressionNode, + @Nullable List> argEvaluators) { super(context); this.syntaxNode = newExpressionNode; this.argEvaluators = argEvaluators; diff --git a/misc/diagram-util/src/main/java/org/ballerinalang/diagramutil/connector/models/connector/Function.java b/misc/diagram-util/src/main/java/org/ballerinalang/diagramutil/connector/models/connector/Function.java index 6f2081e43771..e08697632adc 100644 --- a/misc/diagram-util/src/main/java/org/ballerinalang/diagramutil/connector/models/connector/Function.java +++ b/misc/diagram-util/src/main/java/org/ballerinalang/diagramutil/connector/models/connector/Function.java @@ -43,7 +43,8 @@ public class Function { @Expose public Map displayAnnotation; - public Function(String name, List queryParams, Type returnType, @Nullable Map displayAnnotation, + public Function(String name, List queryParams, Type returnType, + @Nullable Map displayAnnotation, @Nullable String[] qualifiers, String documentation) { this.name = name; this.parameters = queryParams; diff --git a/misc/docerina/src/main/java/org/ballerinalang/docgen/generator/model/Type.java b/misc/docerina/src/main/java/org/ballerinalang/docgen/generator/model/Type.java index 785519a2a97c..278cec00e722 100644 --- a/misc/docerina/src/main/java/org/ballerinalang/docgen/generator/model/Type.java +++ b/misc/docerina/src/main/java/org/ballerinalang/docgen/generator/model/Type.java @@ -331,9 +331,9 @@ public static Type fromNode(Node node, SemanticModel semanticModel, Module modul return type; } - public static Type fromSemanticSymbol(Symbol symbol, Optional documentation, - @Nullable TypeReferenceTypeSymbol parentTypeRefSymbol, boolean isTypeInclusion, - Module module) { + public static Type fromSemanticSymbol( + Symbol symbol, Optional documentation, + @Nullable TypeReferenceTypeSymbol parentTypeRefSymbol, boolean isTypeInclusion, Module module) { Type type = new Type(); if (symbol instanceof TypeReferenceTypeSymbol typeReferenceTypeSymbol) { Symbol typeDefinition = typeReferenceTypeSymbol.definition(); diff --git a/misc/formatter/modules/formatter-cli/src/main/java/org/ballerinalang/formatter/cli/FormatUtil.java b/misc/formatter/modules/formatter-cli/src/main/java/org/ballerinalang/formatter/cli/FormatUtil.java index 95f042ccd4d2..054f9633d626 100644 --- a/misc/formatter/modules/formatter-cli/src/main/java/org/ballerinalang/formatter/cli/FormatUtil.java +++ b/misc/formatter/modules/formatter-cli/src/main/java/org/ballerinalang/formatter/cli/FormatUtil.java @@ -60,8 +60,8 @@ class FormatUtil { * @param dryRun run the whole formatting * @param sourceRootPath execution path */ - static void execute(@Nullable List argList, boolean helpFlag, @Nullable String moduleName, @Nullable String fileName, boolean dryRun, - @Nullable Path sourceRootPath) { + static void execute(@Nullable List argList, boolean helpFlag, @Nullable String moduleName, + @Nullable String fileName, boolean dryRun, @Nullable Path sourceRootPath) { if (helpFlag) { String commandUsageInfo = BLauncherCmd.getCommandUsageInfo(CMD_NAME); outStream.println(commandUsageInfo); diff --git a/misc/formatter/modules/formatter-core/src/main/java/org/ballerinalang/formatter/core/FormattingTreeModifier.java b/misc/formatter/modules/formatter-core/src/main/java/org/ballerinalang/formatter/core/FormattingTreeModifier.java index cfdb2f89b25b..931afd8813bb 100644 --- a/misc/formatter/modules/formatter-core/src/main/java/org/ballerinalang/formatter/core/FormattingTreeModifier.java +++ b/misc/formatter/modules/formatter-core/src/main/java/org/ballerinalang/formatter/core/FormattingTreeModifier.java @@ -3796,7 +3796,8 @@ public Token transform(Token token) { */ @Nullable @SuppressWarnings("unchecked") - private T formatNode(T node, int trailingWS, int trailingNL, @Nullable Boolean preserveIndentation) { + private T formatNode(T node, int trailingWS, int trailingNL, + @Nullable Boolean preserveIndentation) { try { if (node == null) { return node; @@ -3863,7 +3864,8 @@ private T formatNode(@Nullable T node, int trailingWS, int trai * @return Formatted token */ @Nullable - private T formatToken(T token, int trailingWS, int trailingNL, @Nullable Boolean preserveIndentation) { + private T formatToken(T token, int trailingWS, int trailingNL, + @Nullable Boolean preserveIndentation) { try { if (token == null) { return token; diff --git a/misc/json-to-record-converter/src/main/java/io/ballerina/jsonmapper/JsonToRecordMapper.java b/misc/json-to-record-converter/src/main/java/io/ballerina/jsonmapper/JsonToRecordMapper.java index 93242e317556..1739eda591f0 100644 --- a/misc/json-to-record-converter/src/main/java/io/ballerina/jsonmapper/JsonToRecordMapper.java +++ b/misc/json-to-record-converter/src/main/java/io/ballerina/jsonmapper/JsonToRecordMapper.java @@ -105,9 +105,10 @@ private JsonToRecordMapper() {} * @return {@link JsonToRecordResponse} Ballerina code block or the Diagnostics */ @Deprecated - public static JsonToRecordResponse convert(String jsonString, @Nullable String recordName, boolean isRecordTypeDesc, - boolean isClosed, boolean forceFormatRecordFields, @Nullable String filePathUri, - @Nullable WorkspaceManager workspaceManager) { + public static JsonToRecordResponse convert( + String jsonString, @Nullable String recordName, boolean isRecordTypeDesc, + boolean isClosed, boolean forceFormatRecordFields, @Nullable String filePathUri, + @Nullable WorkspaceManager workspaceManager) { return convert(jsonString, recordName, isRecordTypeDesc, isClosed, forceFormatRecordFields, filePathUri, workspaceManager, false); } @@ -125,9 +126,10 @@ public static JsonToRecordResponse convert(String jsonString, @Nullable String r * @param isNullAsOptional To denote whether the null values in the JSON should be considered as optional fields * @return {@link JsonToRecordResponse} Ballerina code block or the Diagnostics */ - public static JsonToRecordResponse convert(String jsonString, String recordName, boolean isRecordTypeDesc, - boolean isClosed, boolean forceFormatRecordFields, @Nullable String filePathUri, - @Nullable WorkspaceManager workspaceManager, boolean isNullAsOptional) { + public static JsonToRecordResponse convert( + String jsonString, String recordName, boolean isRecordTypeDesc, boolean isClosed, + boolean forceFormatRecordFields, @Nullable String filePathUri, + @Nullable WorkspaceManager workspaceManager, boolean isNullAsOptional) { List existingFieldNames = getExistingTypeNames(workspaceManager, filePathUri); Map updatedFieldNames = new HashMap<>(); Map recordToTypeDescNodes = new LinkedHashMap<>(); diff --git a/misc/ls-extensions/modules/json-to-record-converter/src/main/java/io/ballerina/converters/JsonToRecordRequest.java b/misc/ls-extensions/modules/json-to-record-converter/src/main/java/io/ballerina/converters/JsonToRecordRequest.java index 811217c538a8..1036e7a1c519 100644 --- a/misc/ls-extensions/modules/json-to-record-converter/src/main/java/io/ballerina/converters/JsonToRecordRequest.java +++ b/misc/ls-extensions/modules/json-to-record-converter/src/main/java/io/ballerina/converters/JsonToRecordRequest.java @@ -35,8 +35,9 @@ public class JsonToRecordRequest { private boolean isNullAsOptional; - public JsonToRecordRequest(String jsonString, @Nullable String recordName, boolean isRecordTypeDesc, boolean isClosed, - boolean forceFormatRecordFields, @Nullable String filePathUri, boolean isNullAsOptional) { + public JsonToRecordRequest( + String jsonString, @Nullable String recordName, boolean isRecordTypeDesc, boolean isClosed, + boolean forceFormatRecordFields, @Nullable String filePathUri, boolean isNullAsOptional) { this.jsonString = jsonString; this.recordName = recordName; this.isRecordTypeDesc = isRecordTypeDesc; diff --git a/misc/ls-extensions/modules/performance-analyzer-services/src/main/java/io/ballerina/component/ReturningActionInvocationNode.java b/misc/ls-extensions/modules/performance-analyzer-services/src/main/java/io/ballerina/component/ReturningActionInvocationNode.java index d99480c1afb7..3fd595d43362 100644 --- a/misc/ls-extensions/modules/performance-analyzer-services/src/main/java/io/ballerina/component/ReturningActionInvocationNode.java +++ b/misc/ls-extensions/modules/performance-analyzer-services/src/main/java/io/ballerina/component/ReturningActionInvocationNode.java @@ -29,7 +29,8 @@ public class ReturningActionInvocationNode extends ActionInvocationNode { private boolean hasReturn; - public ReturningActionInvocationNode(String endPointRef, String name, @Nullable String path, String pos, boolean hasReturn) { + public ReturningActionInvocationNode( + String endPointRef, String name, @Nullable String path, String pos, boolean hasReturn) { super(endPointRef, name, path, pos); this.hasReturn = hasReturn; diff --git a/misc/semver-checker/modules/semver-checker-core/src/main/java/io/ballerina/semver/checker/comparator/DumbNodeListComparator.java b/misc/semver-checker/modules/semver-checker-core/src/main/java/io/ballerina/semver/checker/comparator/DumbNodeListComparator.java index 688d78fd5d45..92b06fb33917 100644 --- a/misc/semver-checker/modules/semver-checker-core/src/main/java/io/ballerina/semver/checker/comparator/DumbNodeListComparator.java +++ b/misc/semver-checker/modules/semver-checker-core/src/main/java/io/ballerina/semver/checker/comparator/DumbNodeListComparator.java @@ -59,7 +59,8 @@ public class DumbNodeListComparator implements Comparator { this.nodeKind = nodeKind; } - DumbNodeListComparator(@Nullable NodeList newNodes, @Nullable NodeList oldNodes, @Nullable DiffKind nodeKind) { + DumbNodeListComparator(@Nullable NodeList newNodes, @Nullable NodeList oldNodes, + @Nullable DiffKind nodeKind) { this.newNodes = newNodes != null ? newNodes.stream().collect(Collectors.toList()) : null; this.oldNodes = oldNodes != null ? oldNodes.stream().collect(Collectors.toList()) : null; this.nodeKind = nodeKind; diff --git a/misc/semver-checker/modules/semver-checker-core/src/main/java/io/ballerina/semver/checker/diff/ModuleVarDiff.java b/misc/semver-checker/modules/semver-checker-core/src/main/java/io/ballerina/semver/checker/diff/ModuleVarDiff.java index f969b56b3601..750f315c677c 100644 --- a/misc/semver-checker/modules/semver-checker-core/src/main/java/io/ballerina/semver/checker/diff/ModuleVarDiff.java +++ b/misc/semver-checker/modules/semver-checker-core/src/main/java/io/ballerina/semver/checker/diff/ModuleVarDiff.java @@ -72,7 +72,8 @@ public static class Builder extends NodeDiffImpl.Builder message; private final CompositionSchema compositionSchemas; - public AbstractSchema(Type type, Map message, @Nullable CompositionSchema compositionSchemas, @Nullable String desc) { + public AbstractSchema(Type type, Map message, @Nullable CompositionSchema compositionSchemas, + @Nullable String desc) { this.type = type; this.message = message; this.compositionSchemas = compositionSchemas; diff --git a/misc/toml-parser/src/main/java/io/ballerina/toml/validator/schema/BooleanSchema.java b/misc/toml-parser/src/main/java/io/ballerina/toml/validator/schema/BooleanSchema.java index 56178c69d87e..17dcc1458dee 100644 --- a/misc/toml-parser/src/main/java/io/ballerina/toml/validator/schema/BooleanSchema.java +++ b/misc/toml-parser/src/main/java/io/ballerina/toml/validator/schema/BooleanSchema.java @@ -39,8 +39,8 @@ */ public class BooleanSchema extends PrimitiveValueSchema { - public BooleanSchema(Type type, Map message, Boolean defaultValue, @Nullable CompositionSchema comps, - @Nullable String description) { + public BooleanSchema(Type type, Map message, Boolean defaultValue, + @Nullable CompositionSchema comps, @Nullable String description) { super(type, message, defaultValue, comps, description); } diff --git a/misc/toml-parser/src/main/java/io/ballerina/toml/validator/schema/NumericSchema.java b/misc/toml-parser/src/main/java/io/ballerina/toml/validator/schema/NumericSchema.java index e1f1c01055be..e12b1d492121 100644 --- a/misc/toml-parser/src/main/java/io/ballerina/toml/validator/schema/NumericSchema.java +++ b/misc/toml-parser/src/main/java/io/ballerina/toml/validator/schema/NumericSchema.java @@ -45,7 +45,8 @@ public class NumericSchema extends PrimitiveValueSchema { private final Double minimum; private final Double maximum; - public NumericSchema(Type type, Map message, @Nullable Double minimum, @Nullable Double maximum, @Nullable Double defaultValue, + public NumericSchema(Type type, Map message, + @Nullable Double minimum, @Nullable Double maximum, @Nullable Double defaultValue, CompositionSchema compositionSchemas, @Nullable String description) { super(type, message, defaultValue, compositionSchemas, description); this.minimum = minimum; diff --git a/misc/toml-parser/src/main/java/io/ballerina/toml/validator/schema/Schema.java b/misc/toml-parser/src/main/java/io/ballerina/toml/validator/schema/Schema.java index 9d1964654741..4cafd584644e 100644 --- a/misc/toml-parser/src/main/java/io/ballerina/toml/validator/schema/Schema.java +++ b/misc/toml-parser/src/main/java/io/ballerina/toml/validator/schema/Schema.java @@ -58,9 +58,10 @@ public class Schema extends AbstractSchema { private static final String PROPERTY_HOLDER = "${property}"; - public Schema(@Nullable String schema, @Nullable String title, Type type, Map message, @Nullable String description, - boolean hasAdditionalProperties, Map properties, List required, - CompositionSchema compositionSchemas) { + public Schema( + @Nullable String schema, @Nullable String title, Type type, Map message, + @Nullable String description, boolean hasAdditionalProperties, Map properties, + List required, CompositionSchema compositionSchemas) { super(type, message, compositionSchemas, description); this.schema = schema; this.title = title; diff --git a/misc/toml-parser/src/main/java/io/ballerina/toml/validator/schema/SchemaDeserializer.java b/misc/toml-parser/src/main/java/io/ballerina/toml/validator/schema/SchemaDeserializer.java index 5cb3303661b2..fdf6f9a93c58 100644 --- a/misc/toml-parser/src/main/java/io/ballerina/toml/validator/schema/SchemaDeserializer.java +++ b/misc/toml-parser/src/main/java/io/ballerina/toml/validator/schema/SchemaDeserializer.java @@ -141,7 +141,8 @@ private AbstractSchema getAbstractSchema(JsonDeserializationContext jsonDeserial } } - private Schema getObjectSchema(JsonDeserializationContext context, JsonObject jsonObj, @Nullable CompositionSchema comps) { + private Schema getObjectSchema( + JsonDeserializationContext context, JsonObject jsonObj, @Nullable CompositionSchema comps) { JsonElement titleProp = jsonObj.get(TITLE); String title = titleProp != null ? titleProp.getAsString() : null; JsonElement schemaProp = jsonObj.get(SCHEMA); diff --git a/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/context/BMainInstance.java b/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/context/BMainInstance.java index ce0e15dfa1e5..444b98aa5830 100644 --- a/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/context/BMainInstance.java +++ b/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/context/BMainInstance.java @@ -176,7 +176,8 @@ public void runMain(String sourceRoot, String packagePath, String[] flags, Strin @Override public void runMain(String sourceRoot, String packagePath, String[] flags, String[] args, - @Nullable Map envProperties, @Nullable String[] clientArgs) throws BallerinaTestException { + @Nullable Map envProperties, @Nullable String[] clientArgs + ) throws BallerinaTestException { runMain(sourceRoot, packagePath, flags, args, envProperties, clientArgs, null); } @@ -235,7 +236,8 @@ public String getBalServerHome() { * @param commandDir where to execute the command * @throws BallerinaTestException if starting services failed */ - public void runMain(String command, String[] args, @Nullable Map envProperties, @Nullable String[] clientArgs, + public void runMain(String command, String[] args, @Nullable Map envProperties, + @Nullable String[] clientArgs, @Nullable LogLeecher[] leechers, String commandDir) throws BallerinaTestException { String scriptName = Constant.BALLERINA_SERVER_SCRIPT_NAME; String[] cmdArray; @@ -351,7 +353,8 @@ public void waitForLeechers(List logLeechers, int timeout) throws Ba * @return parent instance process * @throws BallerinaTestException if starting services failed */ - public Process debugMain(String command, String[] args, @Nullable Map envProperties, String[] clientArgs, + public Process debugMain(String command, String[] args, @Nullable Map envProperties, + String[] clientArgs, LogLeecher[] leechers, String commandDir, int timeout, boolean isAttachMode) throws BallerinaTestException { String scriptName = Constant.BALLERINA_SERVER_SCRIPT_NAME; @@ -466,7 +469,8 @@ public Process debugMain(String command, String[] args, @Nullable Map envProperties, @Nullable String[] clientArgs, + public void debugMain(String command, String[] args, @Nullable Map envProperties, + @Nullable String[] clientArgs, LogLeecher[] leechers, String commandDir, int timeout) throws BallerinaTestException { boolean isAttachMode = false; debugMain(command, args, envProperties, clientArgs, leechers, commandDir, timeout, isAttachMode); diff --git a/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/context/BServerInstance.java b/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/context/BServerInstance.java index 8d70c0a65305..2b2119e297f9 100644 --- a/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/context/BServerInstance.java +++ b/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/context/BServerInstance.java @@ -130,13 +130,15 @@ public void startServer(String balFile, String[] buildArgs, @Nullable String[] r } @Override - public void startServer(String balFile, @Nullable String[] buildArgs, @Nullable String[] runtimeArgs, @Nullable Map envProperties, - int[] requiredPorts) throws BallerinaTestException { + public void startServer(String balFile, @Nullable String[] buildArgs, @Nullable String[] runtimeArgs, + @Nullable Map envProperties, int[] requiredPorts + ) throws BallerinaTestException { startServer(balFile, buildArgs, runtimeArgs, envProperties, requiredPorts, false); } @Override - public void startServer(String balFile, String[] buildArgs, @Nullable String[] runtimeArgs, @Nullable Map envProperties, + public void startServer(String balFile, String[] buildArgs, @Nullable String[] runtimeArgs, + @Nullable Map envProperties, int[] requiredPorts, boolean useBallerinaRunCommand) throws BallerinaTestException { if (balFile == null || balFile.isEmpty()) { throw new IllegalArgumentException("Invalid ballerina program file name provided, name - " + balFile); @@ -177,14 +179,16 @@ public void startServer(String sourceRoot, String packagePath, int[] requiredPor } @Override - public void startServer(String sourceRoot, String packagePath, @Nullable String[] buildArgs, @Nullable String[] runtimeArgs, - @Nullable int[] requiredPorts) throws BallerinaTestException { + public void startServer(String sourceRoot, String packagePath, @Nullable String[] buildArgs, + @Nullable String[] runtimeArgs, + int @Nullable [] requiredPorts) throws BallerinaTestException { startServer(sourceRoot, packagePath, buildArgs, runtimeArgs, null, requiredPorts); } @Override public void startServer(String sourceRoot, String packagePath, String[] buildArgs, String[] runtimeArgs, - @Nullable Map envProperties, int[] requiredPorts) throws BallerinaTestException { + @Nullable Map envProperties, int[] requiredPorts + ) throws BallerinaTestException { startServer(sourceRoot, packagePath, buildArgs, runtimeArgs, envProperties, requiredPorts, false); } diff --git a/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/HttpClientRequest.java b/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/HttpClientRequest.java index 597778104519..0c61b4889fd0 100644 --- a/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/HttpClientRequest.java +++ b/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/HttpClientRequest.java @@ -198,9 +198,9 @@ private static HttpResponse executeRequestAndPreserveNewline(String method, Stri } @Nullable - private static HttpResponse executeRequestWithoutRequestBody(String method, String requestUrl, - Map headers, int readTimeout, - CheckedFunction responseBuilder) throws IOException { + private static HttpResponse executeRequestWithoutRequestBody( + String method, String requestUrl, Map headers, int readTimeout, + CheckedFunction responseBuilder) throws IOException { HttpURLConnection conn = null; try { conn = getURLConnection(requestUrl, readTimeout); @@ -215,10 +215,9 @@ private static HttpResponse executeRequestWithoutRequestBody(String method, Stri } @Nullable - private static HttpResponse executeRequestWithoutRequestBody(String method, String requestUrl, - Map headers, int readTimeout, - CheckedFunction responseBuilder, boolean throwError) - throws IOException { + private static HttpResponse executeRequestWithoutRequestBody( + String method, String requestUrl, Map headers, int readTimeout, + CheckedFunction responseBuilder, boolean throwError) throws IOException { HttpURLConnection conn = null; try { conn = getURLConnection(requestUrl, readTimeout); diff --git a/tests/jballerina-debugger-integration-test/src/main/java/org/ballerinalang/debugger/test/utils/BallerinaTestDebugPoint.java b/tests/jballerina-debugger-integration-test/src/main/java/org/ballerinalang/debugger/test/utils/BallerinaTestDebugPoint.java index bffb64096575..8f5b94d67c50 100644 --- a/tests/jballerina-debugger-integration-test/src/main/java/org/ballerinalang/debugger/test/utils/BallerinaTestDebugPoint.java +++ b/tests/jballerina-debugger-integration-test/src/main/java/org/ballerinalang/debugger/test/utils/BallerinaTestDebugPoint.java @@ -59,11 +59,13 @@ public BallerinaTestDebugPoint(Path filePath, int line, @Nullable String conditi this(filePath.toAbsolutePath().toUri(), line, condition, logMessage, false); } - public BallerinaTestDebugPoint(Path filePath, int line, @Nullable String condition, @Nullable String logMessage, boolean verified) { + public BallerinaTestDebugPoint(Path filePath, int line, @Nullable String condition, + @Nullable String logMessage, boolean verified) { this(filePath.toAbsolutePath().toUri(), line, condition, logMessage, verified); } - public BallerinaTestDebugPoint(URI filePathUri, int line, @Nullable String condition, @Nullable String logMessage, boolean verified) { + public BallerinaTestDebugPoint(URI filePathUri, int line, @Nullable String condition, + @Nullable String logMessage, boolean verified) { this.filePathUri = filePathUri; this.line = line; this.condition = condition;