Estimating Indirect Interface Implementation in Java

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods struggle to accurately determine whether a Java class indirectly implements an interface based on its byte-code, as the interface and its methods are not explicitly listed in the class's byte-code, making it difficult to instrument the class before load time.

Innovation Solution

A system that estimates indirect interface implementation by identifying directly implemented methods, determining method signatures, assigning weights based on occurrence frequency, and comparing these to interface method signatures to calculate a class score, which decides whether to instrument the class if the score exceeds a threshold.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If a class extends another class that directly implements an interface, then the extending class indirectly implements the interface, but the interface and its methods are not explicitly listed in the extending class's byte-code

Engineering Contradiction:
Improveinterface implementation capabilityVSAvoidinterface method information
Core Design Contradiction:
Adaptability or versatilityVSLoss of information

Solution Approach 1:

The patent performs preliminary analysis of class byte-code before Java class loading to identify indirect interface implementation. By examining the extends declaration and analyzing the parent class structure in advance, the system determines which classes indirectly implement interfaces before they are loaded into the JVM, enabling proactive instrumentation decisions.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces an intermediary analysis layer between the class byte-code and the Java class loader. This intermediary component analyzes the byte-code structure, identifies extends declarations, and determines indirect interface implementation relationships, bridging the gap between the implicit inheritance structure and the explicit interface requirements.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Ease of operation

If interface implementation is determined through byte-code inspection, then instrumentation can be performed, but the interface methods are not explicitly visible in the byte-code

Engineering Contradiction:
Improveinstrumentation capabilityVSAvoidinterface method detection
Core Design Contradiction:
Ease of operationVSDifficulty of detecting and measuring

Solution Approach 1:

The system performs preliminary byte-code analysis before class loading to identify indirect interface implementation. By examining the extends declaration and analyzing the parent class structure in advance, the system determines which classes indirectly implement interfaces before they are loaded into the JVM, enabling proactive instrumentation decisions.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces an intermediary analysis layer between the class byte-code and the Java class loader. This intermediary component analyzes the byte-code structure, identifies extends declarations, and determines indirect interface implementation relationships, bridging the gap between the implicit inheritance structure and the explicit interface requirements.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Reliability

If all extending classes are instrumented, then interface method monitoring is ensured, but unnecessary instrumentation increases loading time

Engineering Contradiction:
Improveinterface method monitoring accuracyVSAvoidclass loading time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent applies partial action by selectively instrumenting only those classes that indirectly implement interfaces, rather than instrumenting all extending classes. The system calculates an indirect implementation score based on method signature matching and instruments only classes above a threshold, avoiding unnecessary instrumentation overhead while ensuring reliable monitoring of actual interface implementations.

Inventive Principle:
Principle #16Partial or excessive action

Solution Approach 2:

The system changes the parameter of instrumentation applicability from a binary decision (instrument/not instrument) to a scored decision based on indirect implementation probability. By calculating scores based on method signature matching and using thresholds, the system dynamically adjusts which classes receive instrumentation, optimizing both reliability and loading time.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS11513794B2Estimating indirect interface implementation before load time based on directly implemented methods
Publication Date: 2022.11.29 BMC HELIX ISRAEL LTD
  • US11513794B2 patent drawing
  • US11513794B2 patent drawing
  • US11513794B2 patent drawing

AI summary

According to an example implementation, a computer-readable storage medium, computer-implemented method and a system are provided to receive a first class, the first class indirectly implementing a first interface, wherein the first class extends a second class that directly implements the first interface, identify one or more directly implemented methods within the first class, determine a method signature for one or more of the directly implemented methods, estimate that the first class indirectly implements the first interface based on the method signatures for the one or more directly implemented methods, and instrument the first class based on the estimating that the first class indirectly implements the first interface.