Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Java
  3. Spoon

Spoon

NOASSERTIONJavav11.5.0

A metaprogramming library for analyzing and transforming Java source code via a well-designed AST.

Visit WebsiteGitHubGitHub
1.9k stars388 forks0 contributors

What is Spoon?

Spoon is a metaprogramming library for analyzing and transforming Java source code. It parses Java files to build a complete abstract syntax tree (AST), enabling developers to inspect, modify, and transpile code programmatically. It solves the problem of automating complex code refactoring, analysis, and migration tasks.

Target Audience

Java developers and researchers working on static analysis, code transformation tools, refactoring engines, or academic program analysis projects.

Value Proposition

Developers choose Spoon for its well-designed, sound AST model, powerful and intuitive API, and strong support for modern Java versions. Its focus on semantic equivalence and fast error detection makes it reliable for automated code manipulation.

Overview

Spoon is a metaprogramming library to analyze and transform Java source code. :spoon: is made with :heart:, :beers: and :sparkles:. It parses source files to build a well-designed AST with powerful analysis and transformation API.

Use Cases

Best For

  • Implementing automated Java code refactoring tools
  • Building custom static analysis checks for code quality
  • Developing source-to-source transpilers for Java
  • Academic research in program analysis and transformation
  • Generating code or test assertions from existing codebases
  • Migrating Java codebases between language versions

Not Ideal For

  • Projects needing only simple code formatting or syntax highlighting without deep AST manipulation
  • Real-time IDE plugins or CI tools where parsing overhead must be minimal
  • Teams wanting out-of-the-box refactoring rules without custom implementation

Pros & Cons

Pros

Complete AST Model

Builds a sound and complete abstract syntax tree per design philosophy R2, ensuring accurate representation of Java source code for reliable analysis.

Modern Java Support

Supports Java versions up to 25 for source code analysis, allowing use with latest language features while handling older code, as stated in the key features.

Powerful Transformation API

Provides intuitive operators for code rewriting with validation checks, enabling safe modifications and fast error detection, per the feature list on semantic preservation.

Academic and Industrial Backing

Backed by INRIA and OW2 with academic citations and professional support options, ensuring reliability and community trust, as highlighted in the README.

Cons

JDK Version Constraints

Requires specific JDK versions to run (e.g., JDK 17 for Spoon 11.x), which can complicate setup for teams stuck on older Java environments, as noted in the getting started section.

Performance Overhead

Parsing and building a complete AST for large codebases can be slow and memory-intensive, making it less suitable for real-time or performance-critical applications.

Lacks Pre-built Functionality

Does not include out-of-the-box refactoring tools; developers must build custom transformations from scratch, increasing initial development effort.

Frequently Asked Questions

Quick Stats

Stars1,947
Forks388
Contributors0
Open Issues352
Last commit5 days ago
CreatedSince 2013

Tags

#metaprogramming#java#program-analysis#transpilation#compiler-tools#code-transformation#compile-time-reflection#source-code#code-analysis#ast#abstract-syntax-tree#code-generation#static-analysis

Built With

M
Maven
J
Java

Links & Resources

Website

Included in

Java47.5k
Auto-fetched 19 hours ago

Related Projects

p3cp3c

Alibaba Java Coding Guidelines pmd implements and IDE plugin

Stars30,828
Forks7,976
Last commit1 year ago
inferinfer

A static analyzer for Java, C, C++, and Objective-C

Stars15,661
Forks2,098
Last commit1 day ago
CheckstyleCheckstyle

Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. By default it supports the Google Java Style Guide and Sun Code Conventions, but is highly configurable. It can be invoked with an ANT task and a command line program.

Stars8,978
Forks4,133
Last commit19 hours ago
error-proneerror-prone

Catch common Java mistakes as compile-time errors

Stars7,212
Forks806
Last commit23 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub