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

Improve code organization and restructuring code #59

Merged
merged 10 commits into from
Jul 16, 2023
Merged

Improve code organization and restructuring code #59

merged 10 commits into from
Jul 16, 2023

Conversation

mitsuki31
Copy link
Owner

@mitsuki31 mitsuki31 commented Jul 16, 2023

What's Changed

  • b5f3c88 - Moved all exception classes to a new directory named exception.
  • 09f14d6 - Relocated the MatrixUtils class to the core directory.
  • 5949e85...944fe65 - Fixed import statements in several classes after the relocation of certain classes.
  • d88ffc7 - Removed the public modifier for all methods inside the MatrixUtils interface to avoid confusion.

    In "Java Language Specification" (JLS) 11:

    Every field declaration in the body of an interface is implicitly public, static, and final.
    It is permitted to redundantly specify any or all of these modifiers for such fields.

    Therefore, the access modifier was removed, but the static modifier was retained for code clarity and to avoid confusion.
    For more details, refer to https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-9.3.

Summary

In this set of changes, several modifications were made to improve the code organization and clarity of the project. The key changes include:

  • The exception classes were moved to a separate directory named exception. This restructuring enhances the project's structure and makes it easier to locate and manage exception-related code.

  • The MatrixUtils class was relocated to the core directory. This move ensures that both either utility and core (core classes would be added as feature soon) classes are grouped together, promoting better organization and maintainability.

  • Import statements in various classes were fixed after the relocation of certain classes. This ensures that all necessary dependencies are correctly referenced and resolves any compilation errors related to import statements.

  • The public modifier was removed for all methods inside the MatrixUtils interface. According to the "Java Language Specification" (JLS) 11, interface fields are implicitly public, static, and final. The removal of the access modifier aligns with this specification, preventing confusion and redundant declaration of access modifiers.

These changes contribute to a more organized and streamlined codebase, improving code clarity, maintainability, and adherence to Java language standards.

...after moved the exception classes.
This also changed its package name.
This also fixed error during tests (e6c04f6)
This update make user know that `MatrixUtils` is an interface with all
methods has their own default implementation.
In "Java Language Specification" (JLS) 11:
> Every field declaration in the body of an interface is implicitly public, static, and final.
> It is permitted to redundantly specify any or all of these modifiers for such fields.

So here only removed the access modifier, but leave the `static` declared for code clarity and to avoid confusion.
For more details, refer to <https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-9.3>
@mitsuki31 mitsuki31 added the enhancement Enhancing existing features label Jul 16, 2023
@mitsuki31 mitsuki31 self-assigned this Jul 16, 2023
In "Java Language Specification" (JLS) 11:
> Every field declaration in the body of an interface is implicitly public, static, and final.
> It is permitted to redundantly specify any or all of these modifiers for such fields.

Therefore, the access modifier was removed, but the `static` modifier was retained for code clarity and to avoid confusion.
For more details, refer to <https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-9.3>.
@mitsuki31 mitsuki31 marked this pull request as ready for review July 16, 2023 16:06
@mitsuki31 mitsuki31 changed the title Move several classes to specific directory Improve code organization and restructuring code Jul 16, 2023
@mitsuki31 mitsuki31 merged commit 3d877f0 into master Jul 16, 2023
@mitsuki31 mitsuki31 deleted the feature branch July 16, 2023 16:14
@mitsuki31 mitsuki31 added lang:java Some changes on Java code patch Patch update labels Jul 16, 2023
@mitsuki31 mitsuki31 mentioned this pull request Aug 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancing existing features lang:java Some changes on Java code patch Patch update
Projects
No open projects
Status: Done 🏁
Development

Successfully merging this pull request may close these issues.

1 participant