Java SDL Model for Reflection and Program Transformation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Java bytecode does not preserve language constructs such as lambda expressions, try/catch/finally blocks, loops, patterns, etc., leading to insufficient information for reflection and limiting the generation of transformed programs.
Innovation Solution
Generate a symbolic description language (SDL) representation of Java source code that preserves these lost constructs, allowing for more comprehensive reflection operations and transformation of programs without ad-hoc solutions.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If Java source code is compiled to bytecode, then the program can be executed by the Java Virtual Machine, but language constructs such as lambda expressions, try/catch/finally blocks, loops, and patterns are lost
Solution Approach 1:
The patent introduces an intermediary representation called a symbolic description language (SDL) model that sits between the Java source code and bytecode. This SDL model preserves language constructs while being convertible to bytecode for execution, thus mediating between the need for execution compatibility and the need to preserve source code information
Solution Approach 2:
The patent creates a symbolic copy of the Java source code in SDL format that preserves the structure and semantics of the original code including language constructs. This symbolic copy can be manipulated and transformed while maintaining fidelity to the original source, unlike bytecode which loses this information
2Ease of operation
If reflection operations are performed on bytecode, then runtime information can be obtained, but the code of method bodies remains opaque and insufficient information is available for generating transformed programs
Solution Approach 1:
The SDL model serves as an intermediary representation that enables enhanced reflection operations. Instead of reflecting on opaque bytecode, the system reflects on the SDL model which preserves method body structure, language constructs, and semantic information, thus providing sufficient information for generating transformed programs while maintaining runtime inspection capabilities
3Ease of operation
If ad-hoc solutions are used to access bytecode information, then some runtime information can be obtained, but the solutions are platform dependent and not generalizable to other situations
Solution Approach 1:
The patent creates a universal SDL representation that can serve multiple purposes: it preserves source code information for reflection, can be transformed into bytecode for execution, and provides a standardized interface for accessing code information. This universal representation eliminates the need for platform-dependent ad-hoc solutions and enables generalizable program transformation across different situations
Data Source
AI summary
Techniques for transforming Java source code using a symbolic description language are disclosed, including: obtaining a set of Java source code corresponding to a Java program; generating a symbolic description language (SDL) model of the set of Java source code; generating, based on the SDL model, a transformed program including at least one transformation relative to the Java program.


