Skip to content

carstenartur/sandbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

999 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Sandbox Project

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.


πŸ”— CI Status & Resources

Java CI with Maven
CodeQL Eclipse Marketplace

πŸ“Š Test Results | πŸ“ˆ Code Coverage | ⚑ Performance Charts


Overview

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.

πŸš€ Installation

Update Site URLs

Add one of the following update sites to your Eclipse installation:

Stable Releases (Recommended)

https://carstenartur.github.io/sandbox/releases/

Use this for stable, tested versions suitable for production use.

Latest Snapshot (Development)

https://carstenartur.github.io/sandbox/snapshots/latest/

Use this to test the latest features. Updated automatically on every commit to main. May be unstable.

Installation Steps

  1. Open Eclipse IDE
  2. Go to Help β†’ Install New Software...
  3. Click Add... button
  4. Enter:
    • Name: Sandbox (or any name you prefer)
    • Location: One of the update site URLs above
  5. Select the features you want to install from the available list
  6. Click Next and follow the installation wizard
  7. Restart Eclipse when prompted

⚠️ Warning: These plugins are experimental. Test them in a development environment before using in production.

πŸ“¦ Release Process

For Maintainers: See Release Process in CONTRIBUTING.md for instructions on creating and publishing releases.

Table of Contents

GitHub Actions Integration

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.

Quick Start

  • 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-action in your workflows

Features

βœ… 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

Building from Source

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.


Quickstart

For Users

  1. Install the plugins via Eclipse update site (see Installation above)
  2. Open Eclipse and navigate to Source β†’ Clean Up... or use Preferences β†’ Java β†’ Code Style β†’ Clean Up
  3. Configure cleanups: Select the sandbox cleanup profiles you want to enable
  4. Apply cleanups: Run cleanup on your Java files

For Contributors/Developers

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

What's Included

Java Version Requirements

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.


Projects

All projects are considered work in progress unless otherwise noted.

1. Cleanup CLI Application (sandbox_cleanup_application)

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.java

See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=75333

2. Encoding Cleanup (sandbox_encoding_quickfix)

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

3. Extra Search (sandbox_extra_search)

Experimental search tool for identifying critical classes when upgrading Eclipse or Java versions.

4. Usage View (sandbox_usage_view)

Provides a table view of code objects, sorted by name, to detect inconsistent naming that could confuse developers.

5. Platform Status Helper (sandbox_platform_helper)

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

6. While-to-For Converter (sandbox_tools)

While-to-For loop converter β€” already merged into Eclipse JDT.

7. JFace SubMonitor Migration (sandbox_jface_cleanup)

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

8. Functional Loop Converter (sandbox_functional_converter)

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

9. JUnit 5 Migration Cleanup (sandbox_junit_cleanup)

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


10. Method Reuse Detector (sandbox_method_reuse)

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


11. PDE XML Cleanup (sandbox_xml_cleanup)

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


12. CSS Cleanup (sandbox_css_cleanup)

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


13. Common Utilities (sandbox_common)

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


14. TriggerPattern Engine (sandbox_triggerpattern)

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


15. Fluent AST API (sandbox-ast-api)

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


16. JMH Performance Benchmarks (sandbox-benchmarks)

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


17. Functional Converter Core (sandbox-functional-converter-core)

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.


18. Oomph Workspace Setup (sandbox_oomph)

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


Documentation

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.

Quick Documentation Links


Contributing

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.

Quick Start

  1. Fork the repository and create a feature branch from main
  2. Make your changes following existing code structure
  3. Test thoroughly with mvn -Pjacoco verify
  4. 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.


Legacy Branch CI Status

2022-09

Java CI with Maven
CodeQL

2022-06

Java CI with Maven
CodeQL


License

This project is licensed under the Eclipse Public License 2.0 (EPL-2.0).

See the LICENSE.txt file for the full license text.

Eclipse Public License 2.0

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

About

Sample implementation of Product based on Eclipse.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors 5

Languages