Add Java Budget Tracker CLI Application#139
Open
devin-ai-integration[bot] wants to merge 9 commits into
Open
Conversation
- Add income entries with description and amount - Add expense entries with category, description, and amount - Display summary with total income, expenses, and net balance - List all transactions in chronological order - Separate functions for each operation - JSON file persistence with reload on startup - Input validation with clear error messages - 95% code coverage with JUnit 5 tests - Checkstyle linting with zero violations
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Reject NaN and Infinity in readAmount() with Double.isFinite check - Add @AfterEach to tearDown() in BudgetTrackerAppTest - Fix System.out restoration in BudgetServiceTest with proper @BeforeEach/@AfterEach lifecycle - Add tests for NaN and Infinity rejection
Prevents NullPointerException when Gson deserializes entries with missing category field.
Check storageService.save() return value in addIncome/addExpense. If save fails, remove the transaction from the in-memory list and throw RuntimeException so the CLI shows an error instead of a false success message.
Use consistent space-separated columns with matching widths in both the printTransactions() header and Transaction.toString().
Reject NaN and Infinity at the BudgetService API level, matching the CLI-layer validation for defense in depth.
JsonIOException is a sibling of JsonSyntaxException (both extend JsonParseException), not caught by IOException. Add explicit catch blocks to prevent uncaught crashes during startup and to ensure save() returns false for BudgetService rollback logic.
- Replace Maven pom.xml with Gradle build.gradle targeting Java 21 - Add Gradle wrapper (8.7) for reproducible builds - Add Checkstyle config and JaCoCo coverage verification - Implement atomic save via temp file + Files.move() to prevent data loss on write failures - Update .gitignore for Gradle build artifacts
- New menu option 5: Filter by Category - Shows available categories, accepts user input, displays matching transactions with case-insensitive matching - BudgetService: getCategories(), filterByCategory(), printFilteredTransactions() - BudgetTrackerApp: handleFilterByCategory() with input validation - Comprehensive tests for service and CLI layers - Exit moved to option 6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a standalone Java command-line budget tracker application in the
budget-tracker/directory. The application supports:budget_data.jsonand reloads on startupTech Stack
Project Structure
Review & Testing Checklist for Human
cd budget-tracker && ./gradlew clean checkto confirm build, tests, coverage, and lint passcd budget-tracker && ./gradlew run --console=plainNotes
budget-tracker/directory and does not affect the existing Spring Boot applicationLink to Devin session: https://partner-workshops.devinenterprise.com/sessions/e3d98600bc714620a973acac2a14135e