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.
π Project Dashboard | π 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
- Refactoring Mining Infrastructure: AI-assisted commit analysis, DSL rule inference from Git diffs, standalone CLI and Eclipse-integrated mining tools
- Standalone Tooling: Maven plugin, CLI distributions, Docker packaging, JGit storage backend, and web interface modules
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.
The repository includes CI workflows for building, testing, and code quality analysis. A cleanup action for applying Eclipse JDT cleanups via GitHub Actions exists (see GITHUB_ACTIONS.md) but is currently not active for automatic PR cleanup β it can only be triggered manually via workflow_dispatch.
π 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.
It is a fully functional Equinox CLI application for running Eclipse JDT cleanup operations on Java files from the command line. It supports recursive directory processing, configurable cleanup profiles via properties files, verbose/quiet modes, and uses the full Eclipse cleanup registry including all sandbox-specific cleanups. Requires a valid Eclipse workspace (-data parameter).
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
Specialized search view for identifying deprecated and critical API usage during Eclipse or Java version upgrades. Integrates with Eclipse JDT SearchEngine for workspace-wide type, method, and field reference searches. Includes a pre-populated list of commonly deprecated classes (Observable, Hashtable, SecurityManager, Applet, etc.) with jump-to-definition navigation and sortable results table.
π Full Documentation: Plugin README | Architecture | TODO
Eclipse view plugin that detects naming conflicts in Java code β variables with the same name but different types (e.g., String userId vs int userId). Uses AST-based analysis with full binding resolution via AstProcessorBuilder from sandbox_common. Features a sortable table with columns for Name, Qualified Name, Package, Deprecated status, and Declaring Method. Automatically updates when switching between editors (IPartListener2), supports filtering for naming conflicts only (NamingConflictFilter), provides type-aware variable name suggestions (VariableNameSuggester), and can optionally auto-show at Eclipse startup via preferences.
π Full Documentation: Plugin README | Architecture | TODO
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 34 tested transformation patterns including max/min reductions, nested filters, compound operations, and Math.max/Math.min method references. Automatically preserves comments (line, block, Javadoc) during transformations. Supports bidirectional loop conversions (Enhanced-For β Iterator-While) with comment preservation. Includes target format selection UI (Stream/For/While). Maintains semantic safety with variable scope validation, labeled continue detection, and side-effect analysis.
π 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. Also hosts the TriggerPattern DSL engine for pattern matching, batch processing, and .sandbox-hint file support, along with mining infrastructure for git-based refactoring analysis.
π 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), .sandbox-hint DSL file format for rule definitions with match/replace blocks and guard expressions, annotation-based hints using @TriggerPattern and @Hint, batch processing of rules against compilation units, 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 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
Eclipse cleanup plugin that suggests replacing specific types with more general supertypes (e.g., ArrayList β List, HashMap β Map). Uses the TriggerPattern DSL for rule definitions and promotes programming to interfaces.
π Full Documentation: Plugin README
Experimental Eclipse cleanup plugin for converting integer constants to Java enum types. Identifies groups of related static final int constants that represent enumerated values and suggests migration to type-safe enums.
Bridge module between Eclipse JDT AST nodes and the sandbox-ast-api fluent types. Provides JDTConverter for converting JDT expressions, statements, and bindings to fluent wrapper types. Enables sandbox plugins to use the fluent API without changing their existing JDT-based infrastructure.
Eclipse-independent common core module. A plain Maven JAR with no Eclipse Platform/UI dependencies (relies on JDT Core plus non-Eclipse libraries such as JGit, Gson, and SLF4J) containing HelperVisitor API, TriggerPattern engine, pattern matching, guard expressions, hint file parsing (HintFileStore, BuiltInGuards), and LambdaASTVisitor. Enables standalone usage, fast testing without Xvfb, and CLI tool development. Existing Eclipse plugins continue to depend on sandbox_common which re-exports this module with visibility:=reexport.
π Full Documentation: Module README
Shared JUnit 5 test infrastructure for Eclipse JDTβbased tests. Provides the AbstractEclipseJava JUnit 5 extension and version-specific subclasses (for example, EclipseJava17) under org.sandbox.jdt.ui.tests.quickfix.rules to configure Eclipse/Java environments for tests. Consumed by other sandbox_*_test modules to ensure consistent setup of the Eclipse Java tooling across different Java versions.
π Full Documentation: Module README
AI-assisted commit analysis engine for inferring DSL rules from Git diffs. Provides LLM-based rule inference (supports multiple providers), state management with deferred commits, keyword filtering, comparison mode, and automatic HintFile generation.
Standalone CLI tool for refactoring mining: clones Git repositories, scans source code against .sandbox-hint rules, and generates JSON/Markdown reports.
Hibernate/Lucene-based JGit storage backend for persistent Git object storage.
REST API server for JGit operations, providing web-based access to Git repositories.
The following directories provide supplementary tooling and distribution packaging:
sandbox-maven-pluginβ Maven plugin with goals for running Sandbox cleanups in CI/CD pipelinessandbox_cleanup_cli_distβ Distribution packaging for the cleanup CLIsandbox_cleanup_dockerβ Docker container for the cleanup CLI
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-2026 Carsten Hammer and contributors