Java Source Code Modeling With SDL to Preserve Language Constructs

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing Java reflection techniques are insufficient for preserving language constructs such as lambda expressions, try/catch/finally blocks, and loops during compilation to bytecode, limiting the ability to generate transformed or optimized programs.

Innovation Solution

Generate a symbolic description language (SDL) representation of Java source code that preserves structural and type information, allowing for more comprehensive reflection operations and enabling transformations without ad-hoc solutions.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If Java source code is compiled to bytecode, then execution efficiency is improved, but language constructs such as lambda expressions, try/catch/finally blocks, and loops are lost

Engineering Contradiction:
Improveexecution efficiencyVSAvoidlanguage constructs
Core Design Contradiction:
SpeedVSLoss of information

Solution Approach 1:

The patent introduces an intermediary representation called Symbolic Description Language (SDL) that sits between Java source code and bytecode. This SDL representation preserves language constructs while enabling runtime access through reflection, thus mediating between the need for compilation efficiency and the need to preserve source code information.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent creates a symbolic copy of the source code structure in SDL format that preserves language constructs. This symbolic representation is generated during compilation and stored alongside the bytecode, allowing runtime access to preserved constructs without affecting the compiled execution path.

Inventive Principle:
Principle #26Copying

2Ease of operation

If reflection is used to inspect code at runtime, then surface details such as type names and method declarations are obtainable, but method body code remains opaque

Engineering Contradiction:
Improveruntime inspection capabilityVSAvoidmethod body code
Core Design Contradiction:
Ease of operationVSLoss of information

Solution Approach 1:

The SDL representation acts as an intermediary layer that bridges the gap between bytecode and source code. It provides a runtime interface through which method body information can be inspected while maintaining the efficiency of compiled execution, thus mediating between runtime inspection needs and information preservation.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Measurement precision

If ad-hoc solutions are implemented to access bytecode information, then some information can be obtained, but the solutions are platform dependent and not generalizable

Engineering Contradiction:
Improveinformation retrieval capabilityVSAvoidplatform independence
Core Design Contradiction:
Measurement precisionVSAdaptability or versatility

Solution Approach 1:

The SDL representation provides a universal interface for accessing source code information that works across different platforms and Java implementations. By standardizing the symbolic representation format and reflection interface, it enables platform-independent access to language constructs without requiring ad-hoc platform-specific solutions.

Inventive Principle:
Principle #6Universality (Multi-functionality)

4Loss of information

If the Java compiler is modified to preserve source code information, then more information is available, but the complexity of the compiler increases

Engineering Contradiction:
Improvesource code information preservationVSAvoidcompiler complexity
Core Design Contradiction:
Loss of informationVSDevice complexity

Solution Approach 1:

The patent separates the information preservation function from the compilation function. Instead of modifying the compiler to preserve all source code information, it segments the process by generating a separate SDL representation that captures language constructs, while the compiler itself remains focused on generating efficient bytecode.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS12450045B2Modeling java source code in a symbolic description language
Publication Date: 2025.10.21 ORACLE INT CORP
  • US12450045B2 patent drawing
  • US12450045B2 patent drawing
  • US12450045B2 patent drawing

AI summary

Techniques for modeling Java source code in a symbolic description language are disclosed, including: obtaining a set of Java source code; determining that the set of Java source code includes a user-defined type; determining that the set of Java source code includes a loop; generating, based on the set of Java source code, a symbolic description language (SDL) model including an SDL representation of the user-defined type and an SDL representation of the loop.