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 proper utility classes #4894

Closed
vil02 opened this issue Oct 9, 2023 · 0 comments · Fixed by ballerina-platform/module-ballerina-url#484
Closed
Assignees
Labels
good first issue Good for newcomers Hacktoberfest module/url Team/PCM Protocol connector packages related issues Type/Improvement

Comments

@vil02
Copy link

vil02 commented Oct 9, 2023

Description:

Some of the Java classes in url module, namely:

  • UrlUtils,
  • Constants,
  • Decode,
  • Encode.
    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/true coverage (currently it is complying that instantiation of these classes is not tested).

Suggested Labels:

module/url,hacktoberfest

Suggested Assignees:

@vil02

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

@ThisaruGuruge ThisaruGuruge added Type/Improvement good first issue Good for newcomers module/url Team/PCM Protocol connector packages related issues Hacktoberfest labels Oct 9, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in Hacktoberfest 2023 Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers Hacktoberfest module/url Team/PCM Protocol connector packages related issues Type/Improvement
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants