Skip to content

Instantly share code, notes, and snippets.

@ajoydevs
ajoydevs / cloneSheet_ai_refactored.java
Created April 10, 2026 20:38
Workflow 2 – AI-Assisted Refactored Code
/*
* AI-assisted refactorSE 4900 Sprint 3, Arnold Joy
* Based on XSSFWorkbook.cloneSheet at Apache POI REL_4_1_1
*
* COMPLETE PROMPT CHAIN (Claude / ChatGPT session)
*
* PROMPT 1
* "Here is the cloneSheet(int, String) method from Apache POI's XSSFWorkbook
* class at tag REL_4_1_1. Please refactor it according to the following
* constraints:
@ajoydevs
ajoydevs / cloneSheet_manual_refactored.java
Created April 10, 2026 20:36
Workflow 1 – Manual Refactored Code
/*
* Manual refactor (no AI) — SE 4900 Sprint 3, Arnold Joy
* Based on XSSFWorkbook.cloneSheet at Apache POI REL_4_1_1
*
* Why I split it up: the original did way too much in one method, reused the same
* error string everywhere, and mixed low-level byte streaming with high-level sheet calls.
* I pulled out helpers for each step and dropped the extra createDrawingPatriarch() call
* on the clone (POI only needs it once here).
*/