Feat: allow args filtering#313
Conversation
|
Hi @ab-schneider. First of all, really big thanks for putting this together. I already like it. I am just not sure about one thing - if it is wise to load all demos inside I would rather keep a file for each JDK version. But I am not 100% convinced. What is your reasoning for putting everything in one file? |
|
Thanks for the feedback @AloisSeckar My intention was to keep things a bit cleaner — I didn’t really like the idea of having multiple almost-empty classes that only fill the map and don’t do anything else. Following the single responsibility principle, I thought it made sense to have one class responsible for initializing both demos and their metadata. But I didn’t fully consider the merge-conflict angle, and you’re right — a single growing file could easily become a hotspot. I’ll quickly change it back to multiple classes. |
AloisSeckar
left a comment
There was a problem hiding this comment.
Thank you for the changes. I know it also have cons, like having more files to look for, but on the other hand they are rather short and once completed, they shouldn't change much, unless we redesign whole structure again.
I just think we're now missing Java13DemoLoader.java. Although no JEPs so far, it can be already prepared.
Plus I put 3 other remarks in comments to think about, please, have a look.
b1c17b0 to
c6d12b8
Compare
|
Lets merge and see how it turns out :) Big thanks for this contribution ❤️ |
🧩 Summary
Refactored demo list initialization: replaced demo set with Map<Integer, IDemo> (JEP_DEMO), allowing future filtering by arguments.
Added ArgFilterUtil class containing all argument parsing and filtering logic.
In Main, demos are now filtered and sorted by JDK and JEP number before execution.
🔧 Remaining tasks
Update older JEPs (from java11 and java12 folders) to fit the new structure — currently commented out.
Update documentation and contribution guide to align with the new structure and filtering logic.
Add unit tests — filters were tested manually and work correctly, but bunch of unit tests would be valuable to check different filter scenarios and have a base for future extension.
💬 Note
If you agree with the new structure, I suggest merging this PR and handle the remaining points in a follow-up issue (or several smaller ones). Otherwise continue in this PR will lead to more merge conflicts.
Closes #268 #270 #271