Skip to content

build: consume jevio from code.jlab.org - #1543

Open
c-dilks wants to merge 1 commit into
developmentfrom
jevio-599
Open

c-dilks wants to merge 1 commit into
developmentfrom
jevio-599

Conversation

@c-dilks

@c-dilks c-dilks commented Oct 28, 2026

Copy link
Copy Markdown
Member

We expect to see no change here. Note that 6.2-SNAPSHOT is a different major version 6 than the one upstream. I call the version on code.jlab.org as 5.99.0, and it is effectively the same as our 6.2-SNAPHOT from clasweb.

The details get confusing, but this PR should cause no change here!

For redundancy and hopefully clarity, here is a copy of those details below:

What is 5.99.0??

It's an attempt to reproduce 6.2-SNAPSHOT from clasweb/clas12maven
from our forked evio repo source code.

Based on comparing the decompiled 6.2-SNAPSHOT JAR and the source code history, I find that:

  • the 6.2-SNAPSHOT JAR was deployed on 23 December 2020
  • looking at the commit DAG in this region, and comparing to the decompiled 6.2-SNAPSHOT JAR, I find that this JAR must have been:
    • produced from commit d5694f57 or sometime later, since this commit added CompactReaderTest.java method main333
    • produced from commit b72af6e4 or sometime earlier, since this is the last commit where RecordViewer.java was present
  • there are no relevant changes to the Java code between these commits (d5694f57..b72af6e4), other than minor changes such as @Deprecated decorators
  • therefore, I've branched off the latest commit in this range, b72af6e4 and added a CI config, updated the POM file, and added a settings.xml file, all for package-registry deployment
  • I named this version as 5.99.0, since:
    • the first tag after b72af6e4 is v6.0.0 (and it's even a number that's semantically later than that of the 6.2-SNAPSHOT JAR)
    • there are no versions on clasweb of jevio with major version 5 (skips from 4.4 to 6.2-SNAPSHOT, the 6.2-SNAPSHOT JAR)
    • let's avoid simply calling it 6.2, since the current latest tag in the source code repo is 6.2.1, which includes about 5 years of changes beyond the 6.2-SNAPSHOT JAR version

Differences between 6.2-SNAPSHOT and 5.99.0

In summary:

  • The only real difference is the Java version used to build:
    • 6.2-SNAPSHOT used Java 7
    • 5.99.0 uses Java 8 (since OpenJDK 21 dropped support for Java 7)
  • The decompiled JAR files appear to be consistent

Detailed details are given in the following sections.

Java Versions

Looking at the manifests, we have:

>>> unzip -p jevio-6.2-SNAPSHOT.jar META-INF/MANIFEST.MF
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Built-By: baltzell
Created-By: Apache Maven 3.5.0
Build-Jdk: 1.8.0_31
>>> unzip -p jevio-5.99.0.jar META-INF/MANIFEST.MF
Manifest-Version: 1.0
Created-By: Maven JAR Plugin 3.5.1
Java-Version: 8
Build-Jdk-Spec: 21

Inspecting a class within, we have:

>>> javap -v -cp jevio-6.2-SNAPSHOT.jar org.jlab.coda.jevio.CompositeData | grep "major version"
  major version: 51
>>> javap -v -cp jevio-5.99.0.jar org.jlab.coda.jevio.CompositeData | grep "major version"
  major version: 52

So, 6.2-SNAPSHOT was built with Java 7, whereas 5.99.0 was built with Java 8.

JAR file contents

jar tf of the 6.2-SNAPSHOT JAR includes the following line, which the 5.99.0 JAR does not have:

org/jlab/coda/jevio/DataType$1.class

CFR Decompilation

To compare decompilations, clone this repo and run

git diff 6.2-SNAPSHOT..5.99.0

These are tags for the 6.2-SNAPSHOT and 5.99.0 JAR decompilations, respectively.

  • the only differences between the uber jars are scoped to jevio only, so the dependencies in the uber JAR are exactly the same between 6.2-SNAPSHOT and 5.99.0.
  • in hipo/WriterMT.java
    • version 6.2-SNAPSHOT:
      WriterMT.this.writerBytesWritten = WriterMT.this.writerBytesWritten + (long)bytesToWrite;
    • version 5.99.0:
      WriterMT.this.writerBytesWritten += bytesToWrite;
    • bytesToWrite is an int, and the cast to long is gone; since writerBytesWritten is long, and long is wider than int, these should behave the same
  • in jevio/BaseStructure.java:
    • version 6.2-SNAPSHOT:
      public Enumeration<?> children() {
    • version 5.99.0:
      @Override
      public Enumeration<? extends TreeNode> children() {
    • this was a necessary fix for Java 8
  • jevio/CompositeData.java shows what appear to be non-trivial differences
    • the 6.2-SNAPSHOT has CFR placeholders (e.g., void var9_16)
    • Claude says the differences are purely cosmetic and both decompiled versions follow the logic of the original source code
    • it is highly likely that these cosmetic differences are a result from the 6.2-SNAPSHOT version being built with major version 51 (i.e., Java 7)
      and the 5.99.0 version being built with major version 52 (Java 8)
    • I tried rebuilding 5.99.0 with Java 7 (and OpenJDK 11), and decompiling that, but I get the same thing I get with Java 8
  • jevio/DataType.java seems to show differences in some switch statements, but they are indeed the same; details:
    • the 6.2-SNAPSHOT version uses enumerator names, whereas the 5.99.0 version uses enumerator numbers (ordinals)
    • version 6.2-SNAPSHOT, with the enumerator ordinal numbers added by me as comments (note: CFR strips comments); case statements are sorted by ordinal number:
      public boolean isStructure() {
          switch (this) {
              case TAGSEGMENT:  // 12
              case ALSOSEGMENT: // 13
              case ALSOBANK:    // 14
              case BANK:        // 16
              case SEGMENT:     // 17 // NOTE: the enum value itself is 32 (0x20), but it's the 18th enum constant declared, i.e., ordinal 17
              {
                  return true;
              }
          }
          return false;
      }
      
      public boolean isInteger() {
          switch (this) {
              case UINT32:   // 1
              case SHORT16:  // 4
              case USHORT16: // 5
              case CHAR8:    // 6
              case UCHAR8:   // 7
              case LONG64:   // 9
              case ULONG64:  // 10
              case INT32:    // 11
              {
                  return true;
              }
          }
          return false;
      }
    • version 5.99.0, with the enumerator names added by me as comments:
      public boolean isStructure() {
          switch (this.ordinal()) {
              case 12: // TAGSEGMENT
              case 13: // ALSOSEGMENT
              case 14: // ALSOBANK
              case 16: // BANK
              case 17: // SEGMENT // NOTE: the enum value itself is 32 (0x20)
              {
                  return true;
              }
          }
          return false;
      }
      
      public boolean isInteger() {
          switch (this.ordinal()) {
              case 1:  // UINT32
              case 4:  // SHORT16
              case 5:  // USHORT16
              case 6:  // CHAR8
              case 7:  // UCHAR8
              case 9:  // LONG64
              case 10: // ULONG64
              case 11: // INT32
              {
                  return true;
              }
          }
          return false;
      }
  • inconsequential differences:
    • several added @Deprecated decorators
    • exception variables are named differently
    • string concatenation

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants