• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

eclipse-aascw / aas-core-codegen / 35267724995
90%

Build:
DEFAULT BRANCH: main
Ran 17 Sep 2026 07:59PM UTC
Jobs 3
Files 264
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

17 Sep 2026 07:55PM UTC coverage: 85.686% (+0.04%) from 85.65%
35267724995

push

github

web-flow
Compose the Java JSON serialization (#710)

A list-typed property used to compose its serialization at the call
site, into a named temporary which the next line then handed over:

    if (that.getSupplementalSemanticIds().isPresent()) {
      final ArrayNode arraySupplementalSemanticIds = serializeArray(
        that.getSupplementalSemanticIds().get(),
        this::transform);
      result.set("supplementalSemanticIds", arraySupplementalSemanticIds);
    }

while every other property was a single statement:

    if (that.getSemanticId().isPresent()) {
      result.set("semanticId", transform(
        that.getSemanticId().get()));
    }

A list and a tuple are now named just like everything else, so all of
them are the same statement -- a key, and the value serialized by the
function of its kind:

    if (that.getSupplementalSemanticIds().isPresent()) {
      result.set("supplementalSemanticIds", serializeListOf_IClass(
        that.getSupplementalSemanticIds().get()));
    }

    if (that.getSemanticId().isPresent()) {
      result.set("semanticId", transformClass(that.getSemanticId().get()));
    }

``this::transform`` was the cost of composing at the call site. It is a
bound method reference, so it captures its receiver, and the JVM can not
cache it: it allocates a fresh instance on every evaluation, exactly as
much as the ``this``-capturing lambda it would have replaced. Measured
per call with ``getThreadAllocatedBytes``: a bound method reference and
a capturing lambda both cost 16 bytes, a static method reference and a
non-capturing lambda nothing. ``JsonNodeFactory.instance::textNode`` is
bound as well, so a list of primitives paid the same.

The transformer is therefore entered through ``transformClass``, a
static shim over a single stateless instance, which a composed
serializer -- static as well -- can reach:

    private static final _Transformer INSTANCE = new _Transformer();

    static JsonNode transformClass(IClass that) {
      return I... (continued)

156 of 156 new or added lines in 1 file covered. (100.0%)

1 existing line in 1 file now uncovered.

34366 of 40107 relevant lines covered (85.69%)

2.57 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
95.04
1.86% aas_core_codegen/java/lib/_generate_jsonization.py
Jobs
ID Job ID Ran Files Coverage
1 3.11 - 35267724995.1 17 Sep 2026 08:02PM UTC 264
85.69
GitHub Action Run
2 3.10 - 35267724995.2 17 Sep 2026 08:02PM UTC 264
85.69
GitHub Action Run
3 3.12 - 35267724995.3 17 Sep 2026 08:02PM UTC 264
85.69
GitHub Action Run
Source Files on build 35267724995
  • Tree
  • List 264
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 242387be on github
  • Prev Build on main (#35266621951)
  • Next Build on main (#35287206928)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc