Skip to content

Conversation

@github-classroom
Copy link

@github-classroom github-classroom bot commented Oct 6, 2025

👋! GitHub Classroom created this pull request as a place for your teacher to leave feedback on your work. It will update automatically. Don’t close or merge this pull request, unless you’re instructed to do so by your teacher.
In this pull request, your teacher can leave comments and feedback on your code. Click the Subscribe button to be notified if that happens.
Click the Files changed or Commits tab to see all of the changes pushed to the default branch since the assignment started. Your teacher can see this too.

Notes for teachers

Use this PR to leave feedback. Here are some tips:

  • Click the Files changed tab to see all of the changes pushed to the default branch since the assignment started. To leave comments on specific lines of code, put your cursor over a line of code and click the blue + (plus sign). To learn more about comments, read “Commenting on a pull request”.
  • Click the Commits tab to see the commits pushed to the default branch. Click a commit to see specific changes.
  • If you turned on autograding, then click the Checks tab to see the results.
  • This page is an overview. It shows commits, line comments, and general comments. You can leave a general comment below.
    For more information about this pull request, read “Leaving assignment feedback in GitHub”.

Subscribed: @SandraNelj

@github-actions
Copy link

github-actions bot commented Oct 6, 2025

🤖 AI Feedback

🕒 Posted on 2025-10-20T12:44:20.046Z

Overall Feedback

The solution has critical flaws in the WarehouseAnalyzer implementation, causing multiple advanced tests to fail. Key issues include incorrect date handling, statistical miscalculations, and flawed business logic. Core functionality works but lacks test-driven validation.


What's Working Well

  • Warehouse correctly implements singleton behavior and basic product management.
  • Category correctly uses flyweight caching with normalized names.
  • Basic test suite passes successfully.

Areas for Improvement

1. WarehouseAnalyzer.findProductsExpiringWithinDays() (EdgeCaseTest#2)

Issue: Includes expired items when days=0

!exp.isBefore(today) // Should exclude already expired items  

Suggestion: Restrict to today <= expirationDate <= today + days

exp.isAfter(today) && !exp.isAfter(end)  

2. WarehouseAnalyzer.findPriceOutliers() (AdvancedAnalyticsTests#2)

Issue: Uses population STDDEV (should be sample)

divide(new BigDecimal(n)) // Should use n-1 for sample SD  

Suggestion: Adjust denominator for sample standard deviation when n>1.

3. WarehouseAnalyzer.optimizeShippingGroups() (AdvancedAnalyticsTests#3)

Issue: Incorrect bin assignment logic (!placed bugs)

double binWeight = ... // Recalculates total weight each time  

Suggestion: Track bin weights separately to avoid redundant calculation.

4. WarehouseAnalyzer.calculateExpirationBasedDiscounts() (BusinessRulesTests)

Issue: Dates use LocalDate.now() (causes failures in tests)
Suggestion: Accept LocalDate as dependency or use injected time.

5. WarehouseAnalyzer.validateInventoryConstraints() (BusinessRulesTests)

Issue: Hardcoded threshold (BigDecimal("1000")) doesn't match test scenario (2000).
Suggestion: Derive threshold dynamically from test data.

6. Warehouse.getProductsGroupedByCategories()

Issue: Returns unmodifiable list (tests expect mutable group structures).
Suggestion: Return Map<Category, List<Product>> with non-unmodifiable lists.


Summary

The WarehouseAnalyzer implementations contain logic errors causing advanced tests to fail. Focus on date handling, statistical calculations, and business rules first. Verify test expectations precisely.


Previous Feedback

🕒 Posted on 2025-10-20T12:18:30.735Z

Overview Feedback

Your implementation covers most requirements for the warehouse domain, including core business logic and object interactions. The solution structurally aligns with the task specifications, with clear separation of concerns between classes and interfaces. However, critical inner class order issues need addressing before compilation succeeds.

What's Working Well

  • Correct implementation of value object patterns (Category: flyweight caching, name normalization).
  • Proper use of BigDecimal with rounding awareness and error handling.
  • Effective polymorphism (FoodProduct/ElectronicsProduct) and singleton (Warehouse) patterns.

Areas for Improvement

  1. WarehouseAnalyzer Inner Class Order (File: WarehouseAnalyzer.java)
    • Issue: ShippingGroup, InventoryValidation, and InventoryStatistics inner classes are defined after methods that use them (e.g., optimizeShippingGroups() returns ShippingGroup).
    • Suggestion: Move inner class definitions to the top of WarehouseAnalyzer before any methods.
      Example fix:
    public class WarehouseAnalyzer {
        // Move inner classes to top
        class ShippingGroup { ... }
        
        private final Warehouse warehouse;
        
        public WarehouseAnalyzer(Warehouse warehouse) {
            this.warehouse = warehouse;
        }
        
        // Now methods can reference ShippingGroup safely
        public List<ShippingGroup> optimizeShippingGroups(...) { ... }
    }

Summary

Correct core logic for warehouse operations, but restructure inner class declarations in WarehouseAnalyzer to fix compilation failures. The most important change is ensuring inner classes are defined before method signatures that reference them.


Previous Feedback

🕒 Posted on 2025-10-16T10:00:18.322Z

Overall Feedback

The solution shows a solid understanding of OOP principles, polymorphism, and validation requirements. The WarehouseAnalyzer methods are comprehensively implemented to meet the advanced test expectations. However, critical details in Warehouse require correction.

What's Working Well:

  • WarehouseAnalyzer completeness: All advanced methods are implemented and pass the corresponding tests.
  • Validation handling: Strategic use of IllegalArgumentException with exact messages (e.g., negative prices, empty names).
  • Polymorphism: Proper interface usage (Shippable, Perishable) and method overrides in FoodProduct/ElectronicsProduct.

Areas for Improvement:

  1. Missing getChangedProducts in Warehouse

    • Issue: The assignment requires tracking changed products via getChangedProducts(), but the method is absent.
    • Suggestion:
      private List<Product> changedProducts = new ArrayList<>();  
      // In updateProductPrice():  
      changedProducts.add(product);  
      public List<Product> getChangedProducts() {  
          return Collections.unmodifiableList(changedProducts);  
      }  
  2. Singleton implementation flaw

    • Issue: Warehouse.getInstance returns a single global instance, ignoring the provided name (e.g., TestWarehouse and AdvancedTestWarehouse would share state).
    • Suggestion:
      private static final Map<String, Warehouse> INSTANCES = new HashMap<>();  
      public static Warehouse getInstance(String name) {  
          return INSTANCES.computeIfAbsent(name, n -> new Warehouse(n));  
      }  
    • Explanation: Store instances per name using a map to ensure isolation.

Summary

Fix the Warehouse singleton and tracking bug. The analyzer logic is strong, meeting advanced test requirements. The most critical takeaway is strict adherence to assignment specs—especially unimplemented core features like getChangedProducts.


Previous Feedback

🕒 Posted on 2025-10-06T06:23:18.906Z

Overall Feedback

Excellent work! Your WarehouseAnalyzer implementation is comprehensive and handles all the advanced requirements correctly. The code is well-structured, follows Java conventions, and demonstrates a solid understanding of the business logic and algorithmic requirements. All the methods are properly implemented with appropriate validation, rounding, and edge case handling.

LGTM! 🚀


Previous Feedback

🕒 Posted on 2025-10-06T06:22:41.688Z

Overall Feedback

Excellent work! Your WarehouseAnalyzer implementation is comprehensive and handles all the advanced requirements correctly. The code is well-structured, follows Java conventions, and demonstrates a solid understanding of the business logic and statistical calculations required. All the methods are properly implemented with appropriate validations, rounding, and edge case handling. This is a high-quality submission that would pass the EdgeCaseTest requirements.

LGTM!


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants