Skip to content

Make Java implementation more idiomatic#110

Closed
ghubstan wants to merge 362 commits intoeclipse-biscuit:masterfrom
ghubstan:master
Closed

Make Java implementation more idiomatic#110
ghubstan wants to merge 362 commits intoeclipse-biscuit:masterfrom
ghubstan:master

Conversation

@ghubstan
Copy link

@ghubstan ghubstan commented Jan 9, 2025

I am interested in using Biscuit in my Java project, and I went through the entire Biscuit Java implementation to make it more comfortable to the eyes of experienced Java developers.

There are many aspects of this project that attract me, and all the work I have done in this PR is evidence of the respect I have for the authors' work. But as it is now, I think many Java devs might be shying away from the existing Java implementation when they see all the snake_case method and variable names. To them, the existing implementation is not idiomatic to the Java language. So I fixed (most) of that in this PR. (TODO: protobuf enums should be all caps.)

A new release based on this PR would break existing systems using the current Java implementation, but migration would be mostly changing Biscuit API method names from snake_case to camelCase.

I did do some refactoring too:

  • Refactoring a small block of duplicated code.
  • Changing variable names to indicate their type, e.g., SymbolTable symbolTable, instead of SymbolTable symbols).
  • Auto-reformatting of classes to conform to the Intellij IDE code style defaults.

If you are interested in looking at this PR, I suggest inspecting the commits in order of oldest to newest -- you will quickly see the pattern of changes I made in each class.

Thanks,
Stan

-- Below class level field declarations
-- Above method declarations
-- Class level fields go above constructors
-- Instance methods go below contructors
-- Static members should never be prefixed (reference) via 'this'
-- Merge duplicated switch statement branches into one
-- Use less verbose method references with implicit args when possible
-- Use static imports to reduce verbose lines when possible (very subjective)
Adjust affected classes.
This change affects many files, but only varlable and parameter
names have been changed.

From the perspective of a Biscuit newbie, the ambiguity is confusing.
Make Java implementation more idiomatic
@ghubstan
Copy link
Author

Closing due to expected file conflicts after merging #108

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant