Skip to content

OpenHands/java-refactor-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Java Refactor Example

This is a simple Java project used to demonstrate the Large Codebase SDK refactoring capabilities.

Project Structure

com/example/app/
├── Main.java                    # Main application entry point
├── processor/
│   └── DataProcessor.java       # Data processing logic
├── util/
│   └── Utils.java              # Utility functions
└── validator/
    └── Validator.java          # Data validation logic

What This Project Demonstrates

This example Java project has a simple structure with:

  • Dependencies between files: Main.java imports and uses classes from processor, util, and validator packages
  • Cross-module references: Multiple files import and use Utils.java
  • Typical Java package structure: Standard package hierarchy with related functionality grouped together

This makes it perfect for demonstrating how the Large Codebase SDK can:

  1. Analyze file dependencies
  2. Create batches of files that can be refactored in parallel
  3. Apply refactorings while respecting dependency order
  4. Verify changes across the codebase

Using This Project with Large Codebase SDK

See the main SDK README for a complete walkthrough of using this example project.

About the Code

The code implements a simple data processing application:

  • Main.java: Loads sample data and processes it
  • DataProcessor.java: Separates and processes strings vs. numbers
  • Utils.java: Provides string formatting and sum calculation
  • Validator.java: Validates data format and email addresses

The code has intentional dependencies between files to demonstrate the SDK's ability to handle complex refactoring scenarios.

About

Example of refactoring Java code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages