Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make some of the Java classes in module-http proper utility classes #4923

Closed
vil02 opened this issue Oct 13, 2023 · 0 comments · Fixed by ballerina-platform/module-ballerina-http#1790
Assignees

Comments

@vil02
Copy link

vil02 commented Oct 13, 2023

Description:

Some of the Java classes in http module, namely:

appear to be utility classes (i.e. all of the members and methods are static). Generally speaking it is a good practice to:

  • explicitly mark their default constructor as private (like in ModuleUtils) - because it does not make sense to have objects of such classes,
  • mark such classes as final - because it does not make sense to derive any class from them.

There are benefits of doing this:

  • the design is cleaner - e.g. no one will create objects of such classes,
  • the coverage report will show higher/more accurate coverage (currently it is complying that instantiation of these classes is not tested).

Suggested Labels:

module/http,hacktoberfest

Suggested Assignees:

@vil02

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

#4894, #4901, #4902, #4910, #4911, #4918, #4919, #4921.

@ThisaruGuruge ThisaruGuruge moved this to In Progress in Hacktoberfest 2023 Oct 17, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Hacktoberfest 2023 Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants