Eclipse-independent common core module for sandbox utilities.
sandbox_common_core is a plain Maven JAR (no OSGi/Eclipse dependencies beyond JDT Core) that contains the core utility classes extracted from sandbox_common. This separation enables:
- Standalone usage: Use HelperVisitor, TriggerPattern API, and mining utilities without an Eclipse runtime
- Fast testing: Tests can run without Xvfb or target platform resolution
- CLI tools: Build refactoring-mining tools without Eclipse dependencies
- Lightweight dependency: Only requires
org.eclipse.jdt:org.eclipse.jdt.core
| Package | Description |
|---|---|
org.sandbox.jdt.internal.common |
HelperVisitor API, LambdaASTVisitor, builders, and visitor utilities |
org.sandbox.jdt.triggerpattern.api |
TriggerPattern engine, pattern matching, guard expressions, fix utilities |
org.sandbox.jdt.triggerpattern.internal |
Pattern/hint file parsers, placeholder matching, BuiltInGuards, HintFileStore |
sandbox_common_core (JAR, only JDT Core)
↑
├── sandbox_common (OSGi bundle, re-exports core)
│ ↑
│ ├── sandbox_junit_cleanup
│ ├── sandbox_encoding_quickfix
│ ├── sandbox_triggerpattern
│ └── ... (all existing plugins)
│
└── sandbox_common_test (plain Maven JAR, tests core + common)
Tests that only depend on sandbox_common_core classes live in src/test/java/. These
run as plain JUnit 5 tests without Xvfb, Eclipse runtime, or target platform resolution:
# Run all core tests (~324 tests, finishes in seconds)
mvn test -pl sandbox_common_coreTests that require OSGi, Eclipse Platform, or classes from sandbox_common (mining,
registries, HintContext, corext utilities) remain in sandbox_common_test.
# Build standalone (no Eclipse target platform needed)
mvn clean verify -pl sandbox_common_core
# Install to local repository
mvn install -pl sandbox_common_core -DskipTests<dependency>
<groupId>org.sandbox</groupId>
<artifactId>sandbox_common_core</artifactId>
<version>${project.version}</version>
</dependency>The JAR includes OSGi manifest headers (generated by bnd-maven-plugin) with:
Bundle-SymbolicName: sandbox_common_core- Exported packages for all three packages
Existing Eclipse plugins should continue to depend on sandbox_common which re-exports sandbox_common_core with visibility:=reexport.
When a traversal needs no shared reference holder, register a typed action:
AstProcessing.independent()
.visit(SimpleName.class, name -> names.add(name.getIdentifier()))
.build(root);visit always continues into descendants. Use on(Class, BiPredicate) when
traversal decisions or shared state are needed. Each independent stage traverses
the root separately; adding two stages does not create a nested query.
excluding(nodes) skips callbacks for those exact AST nodes, not their children.
Callback exceptions propagate; builders remain reusable. The functional
converter's LoopVariableNames is a production consumer, with collision and
repeated-preview characterization tests.