A collection of experimental Eclipse JDT (Java Development Tools) cleanup plugins and tools. This repository demonstrates how to build custom JDT cleanups, quick fixes, and related tooling for Eclipse-based Java development.
Main Technologies: Eclipse JDT, Java 21, Maven/Tycho 5.0.2
Status: Work in Progress β All plugins are experimental and intended for testing purposes.
π Test Results | π Code Coverage | β‘ Performance Charts
This project provides:
- Custom JDT Cleanup Plugins: Automated code transformations for encoding, JUnit migration, functional programming patterns, and more
- Eclipse Product Build: A complete Eclipse product with bundled features
- P2 Update Site: Installable plugins via Eclipse update mechanism
- Test Infrastructure: JUnit 5-based tests for all cleanup implementations
- GitHub Actions Integration: Automated code cleanup for pull requests (See GITHUB_ACTIONS.md)
All plugins are work-in-progress and intended for experimentation and learning.
Add one of the following update sites to your Eclipse installation:
https://carstenartur.github.io/sandbox/releases/
Use this for stable, tested versions suitable for production use.
https://carstenartur.github.io/sandbox/snapshots/latest/
Use this to test the latest features. Updated automatically on every commit to main. May be unstable.
- Open Eclipse IDE
- Go to Help β Install New Software...
- Click Add... button
- Enter:
- Name:
Sandbox(or any name you prefer) - Location: One of the update site URLs above
- Name:
- Select the features you want to install from the available list
- Click Next and follow the installation wizard
- Restart Eclipse when prompted
β οΈ Warning: These plugins are experimental. Test them in a development environment before using in production.
For Maintainers: See Release Process in CONTRIBUTING.md for instructions on creating and publishing releases.
- π CI Status & Resources
- Overview
- π Installation
- π¦ Release Process
- GitHub Actions Integration
- Building from Source
- Quickstart
- What's Included
- Projects
- Documentation
- Contributing
- License
This repository includes a composite GitHub Action for automated code cleanup on pull requests. The action uses the sandbox cleanup application to apply Eclipse JDT cleanups directly in your GitHub workflows.
- Automatic PR Cleanup: Already configured! Opens/updates to PRs with Java files trigger cleanup automatically
- Manual Cleanup: Go to Actions β Manual Cleanup β Run workflow
- Custom Integration: Use
./.github/actions/cleanup-actionin your workflows
β
Automated cleanup on pull requests
β
Configurable profiles (minimal/standard/aggressive)
β
All sandbox + Eclipse JDT cleanups included
β
Auto-commit changes to PR branch
β
Manual trigger with customizable options
π Full Documentation | Workflows Guide | Action Details
For Contributors/Developers: Want to build the project locally? See Building from Source in CONTRIBUTING.md for complete build instructions.
Quick Start:
- Requires: Java 21 or later
- Quick Build:
mvn -T 1C verify - Full Build:
mvn -Pproduct,repo -T 1C verify
Note: Building with Java 17 or earlier will fail. This project requires Java 21.
- Install the plugins via Eclipse update site (see Installation above)
- Open Eclipse and navigate to Source β Clean Up... or use Preferences β Java β Code Style β Clean Up
- Configure cleanups: Select the sandbox cleanup profiles you want to enable
- Apply cleanups: Run cleanup on your Java files
Want to build and run the Eclipse product with bundled plugins? See the Building from Source section in CONTRIBUTING.md for:
- Building the Eclipse product locally
- Running the built Eclipse product
- Using command-line cleanup tools
| Branch | Java Version | Tycho Version |
|---|---|---|
main (2025-12) |
Java 21 | 5.0.2 |
Legacy branches: Older branches (2022-06, 2022-09, 2022-12) use Java 11-17 with Tycho 3.x-4.x.
Note: Tycho 5.x requires Java 21+ at build time. Attempting to build with Java 17 will result in UnsupportedClassVersionError.
All projects are considered work in progress unless otherwise noted.
Placeholder for a CLI-based cleanup application, similar to the Java code formatting tool:
eclipse -nosplash -consolelog -debug -application org.eclipse.jdt.core.JavaCodeFormatter -verbose -config MyCodingStandards.ini MyClassToBeFormatted.javaSee: https://bugs.eclipse.org/bugs/show_bug.cgi?id=75333
Replaces platform-dependent or implicit encoding usage with explicit, safe alternatives using StandardCharsets.UTF_8 or equivalent constants. Improves code portability and prevents encoding-related bugs across different platforms. Supports three cleanup strategies with Java version-aware transformations for FileReader, FileWriter, Files methods, Scanner, PrintWriter, and more.
π Full Documentation: Plugin README | Architecture | TODO
Experimental search tool for identifying critical classes when upgrading Eclipse or Java versions.
Provides a table view of code objects, sorted by name, to detect inconsistent naming that could confuse developers.
Simplifies Eclipse Platform Status object creation by replacing verbose new Status(...) constructor calls with cleaner factory methods (Java 11+ / Eclipse 4.20+) or StatusHelper pattern (Java 8). Reduces boilerplate and provides more readable code through automatic selection between StatusHelper or factory methods based on Java version.
π Full Documentation: Plugin README | Architecture | TODO
While-to-For loop converter β already merged into Eclipse JDT.
Automates migration from deprecated SubProgressMonitor to modern SubMonitor API. Transforms beginTask() + SubProgressMonitor to SubMonitor.convert() + split() with automatic handling of style flags, multiple monitor instances, and variable name collision resolution. The cleanup is idempotent and safe to run multiple times.
π Full Documentation: Plugin README | Architecture | TODO
Transforms imperative Java loops into functional Java 8 Stream equivalents (forEach, map, filter, reduce, anyMatch, allMatch, etc.). Supports 25+ tested transformation patterns including max/min reductions, nested filters, and compound operations. Maintains semantic safety by excluding complex patterns with labeled breaks, throws, or multiple mutable accumulators.
π Full Documentation: Plugin README | Architecture | TODO
Automates migration of legacy tests from JUnit 3 and JUnit 4 to JUnit 5 (Jupiter). Transforms test classes, methods, annotations, assertions, and lifecycle hooks to use the modern JUnit 5 API. Handles removing extends TestCase, converting naming conventions to annotations, assertion parameter reordering, rule migration, and test suite conversion.
π Full Documentation: Plugin README | Architecture | TODO | Testing Guide
Identifies opportunities to reuse existing methods instead of duplicating logic. Uses token-based and AST-based analysis to find code duplication, suggests method calls to replace repeated patterns, and promotes DRY principles. Currently under development with initial focus on method similarity detection and Eclipse cleanup integration.
π Full Documentation: Plugin README | Architecture | TODO
Optimizes Eclipse PDE XML files (plugin.xml, feature.xml, etc.) by reducing whitespace and optionally converting leading spaces to tabs. Uses secure XSLT transformation, normalizes excessive empty lines, and only processes PDE-relevant files in project root, OSGI-INF, or META-INF locations. Idempotent and preserves semantic integrity.
π Full Documentation: Plugin README | Architecture | TODO
Eclipse plugin for CSS validation and formatting using Prettier and Stylelint. Provides automatic formatting, linting, right-click menu integration for .css, .scss, and .less files, and a preferences page for configuration with graceful fallback when npm tools are not installed.
π Full Documentation: Plugin README | Architecture | TODO
Provides shared utilities, constants, and base classes used across all sandbox cleanup plugins. Serves as the foundation for the entire sandbox ecosystem with AST manipulation utilities, central cleanup constants repository (MYCleanUpConstants), reusable base classes, and Eclipse JDT compatibility structure for easy porting.
π Full Documentation: Plugin README | Architecture | TODO
Provides a powerful pattern matching engine for code transformations in Eclipse. Allows defining code patterns using simple syntax with placeholder support ($x for any expression), annotation-based hints using @TriggerPattern and @Hint, and automatic integration with Eclipse Quick Assist for creating custom hints and quick fixes with minimal boilerplate.
π Full Documentation: Plugin README | Architecture | TODO
Fluent, type-safe AST wrapper API using Java 21 features. Pure Maven module with no Eclipse dependencies, enabling reuse outside Eclipse context. Replaces verbose instanceof checks and nested visitor patterns with modern, readable fluent API for AST operations.
π Full Documentation: Plugin README
JMH (Java Microbenchmark Harness) performance benchmarks for the Sandbox project. Provides continuous performance tracking and visualization through GitHub Actions and GitHub Pages. Includes benchmarks for AST parsing, pattern matching, and loop transformation performance.
π Full Documentation: Plugin README
Plain Java core module providing AST-independent representation of loop structures for transformation into functional/stream-based equivalents. Part of the Unified Loop Representation (ULR) implementation. No Eclipse/JDT dependencies - pure Java module reusable in any context.
π Full Documentation: Plugin README
Relationship: This core module is used by sandbox_functional_converter (#8) to provide the underlying loop transformation logic without Eclipse dependencies.
Provides Eclipse Oomph setup configurations for automated workspace configuration. Enables one-click setup with pre-configured Eclipse settings, automatic installation of required plugins, Git repository cloning and branch setup, and seamless integration with Eclipse Installer.
π Full Documentation: Plugin README | Architecture | TODO
This repository contains extensive documentation organized at multiple levels to help you understand, use, and contribute to the project.
π For a complete documentation index covering all plugins, architecture guides, and contributing information, see DOCUMENTATION_INVENTORY.md.
- Installation - How to install plugins in Eclipse
- Building from Source - How to build the project with Maven/Tycho
- Projects - Descriptions and documentation for all plugins
- Contributing - How to contribute to this project
- Release Process - Maintainer guide for creating releases
- Eclipse Version Configuration - Maintainer guide for updating Eclipse versions
Contributions are welcome! This is an experimental sandbox project for testing Eclipse JDT cleanup implementations.
π For full contribution guidelines, building instructions, reporting issues, release process, and Eclipse version configuration, see CONTRIBUTING.md.
- Fork the repository and create a feature branch from
main - Make your changes following existing code structure
- Test thoroughly with
mvn -Pjacoco verify - Submit a Pull Request with clear description
Note: This project primarily serves as an experimental playground. Features that prove stable and useful may be contributed upstream to Eclipse JDT.
This project is licensed under the Eclipse Public License 2.0 (EPL-2.0).
See the LICENSE.txt file for the full license text.
The Eclipse Public License (EPL) is a free and open-source software license maintained by the Eclipse Foundation. Key points:
- β Commercial use allowed
- β Modification allowed
- β Distribution allowed
- β Patent grant included
β οΈ Disclose source for modificationsβ οΈ License and copyright notice required
For more information, visit: https://www.eclipse.org/legal/epl-2.0/
Copyright Β© 2021-2025 Carsten Hammer and contributors