Skip to content

refactor: standardize format handling in ProjectPolicy #12

Description

@pleberre

Problem

Format handling in ProjectPolicy needs standardization or completion.

File Location

src/main/java/io/err0/client/core/ProjectPolicy.java:31

// FIXME - formats

Context

Similar to RealmPolicy, this FIXME indicates incomplete or inconsistent format handling.

Investigation Required

  1. Review code around line 31 in ProjectPolicy.java
  2. Compare with RealmPolicy.java format handling
  3. Identify what needs standardization
  4. Check for format validation

Questions to Answer

  1. What formats are being handled?
  2. Is there duplication between RealmPolicy and ProjectPolicy?
  3. Should format handling be extracted to a shared utility?
  4. Are all format edge cases covered?

Implementation Steps

  1. Investigate: Read ProjectPolicy.java lines 20-45 to understand context
  2. Compare: Review RealmPolicy.java format handling for consistency
  3. Refactor: Consider extracting common format handling to utility class
  4. Validate: Add format validation if needed
  5. Document: Add clear comments explaining format handling
  6. Test: Ensure comprehensive test coverage

Potential Refactoring

If both RealmPolicy and ProjectPolicy handle formats similarly:

  • Create FormatUtils class for shared logic
  • Standardize format string patterns
  • Centralize format validation

Reference Files

  • src/main/java/io/err0/client/core/RealmPolicy.java (related FIXME)
  • Policy test files in src/test/

Acceptance Criteria

  • Format handling standardized and consistent
  • Common logic extracted if appropriate
  • FIXME removed from ProjectPolicy.java:31
  • Tests cover all format handling scenarios
  • Documentation updated

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions