cqframework / cqframework/cqf-tooling

Items in bundles shift with each run of the refresh operation

Open
#353 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
22
Forks
26
PR merge metrics
No merged PRs in 30d

Description

Subsequent runs of the refresh operation create phantom/false diffs in diff tools because location within the file has changed even thought the content/value hasn't.

Steps to reproduce the behavior:

  1. run the refresh operation
  2. save the resulting bundle somehow (commit to repo)
  3. run the refresh operation again, without changing anything
  4. compare the resulting file with the previous file
  5. you will see a difference even though nothing has changed because the item has shifted positions

Expected behavior
If nothing has changed the diff should not show anything has changed, i.e., the content/value should not change locations in the bundle.

Desktop (please complete the following information):

  • OS: Windows
  • Java Version: 1.8.0_311

Additional context
This can be accomplished by using ordered hashsets in java (instead of non-ordered hashsets), i.e. hashsets that guarantee the same ordering given the same hash.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the refresh operation and the code that collects or writes items in the bundle. Reproduce the issue by running refresh twice on an unchanged bundle and compare the files; done means the second run preserves item locations and produces no diff.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.