Tag: java
All the articles with the tag "java".
-
Implementing the New FSM Transition Design with Regression Testing
Translating existing States, Glides, and Transitions into the simplified Transition-first FSM design, introducing ActionEnum.NOOP for free transitions, and manually regression testing the results through CLI automation scripts.
-
Simplifying the FSM by Removing Glides and Adopting ActionEnum.NOOP
Redesigning the Finite State Machine to eliminate Glides and StateBase, representing free transitions with ActionEnum.NOOP, and adopting a strategy-pattern ActionEnum that delegates to concrete action implementations.
-
Printing the FSM Definition at Startup and Discovering a Design Code Smell
Adding startup logging to print all FSM transitions for visibility, then uncovering a design smell where Glides duplicate information from parent Actions—motivating a refactor that removes StateBase and replaces Glides with enriched Transitions.
-
Improving CatanGraph Test Coverage and Catching a HashMap Overwrite Bug
Expanding CatanGraph unit tests to cover all branches, overriding equals and hashCode on ResourceBundle for readable assertions, and discovering a real bug where Road adjacency entries were silently overwritten by Hexagon entries in a HashMap.
-
Introducing ResourceBundle for Player Resources and Expanding Unit Test Coverage
Creating a ResourceBundle class to encapsulate each player's resource cards, using Jackson's @JsonUnwrapped for clean JSON serialization, and mocking random roll results in unit tests with Mockito's MockedStatic.
-
Refactoring Graph Data Structures and Loading Board Layout from Files
Updating CatanGraph to use full GraphNode objects as HashMap keys, adding Hexagons into the graph structure for easier adjacency lookups, and reading hardcoded board adjacency data from JSON resource files instead.
-
Full-Stack Road Placement and Builder Pattern for the FSM
Adding road placement to the Angular frontend by reusing and refactoring existing settlement placement code, while reworking the FSM data structures in Java with a step-based Builder pattern for safer initialization.
-
Implementing Place Road Action and Cleaning Up API Call Logic
Retroactive entry: implementing the 'place road' player action in the backend, refactoring API call logic for reuse across actions, and cleaning up FSM data structures with the builder pattern.