Skip to content

Restore deprecated ValueMetaBase(String, int) constructor for binary compatibility - #9538

Open
rmannibucau wants to merge 1 commit into
apache:mainfrom
rmannibucau:fix/value-meta-base-constructor-compatibility
Open

rmannibucau wants to merge 1 commit into
apache:mainfrom
rmannibucau:fix/value-meta-base-constructor-compatibility

Conversation

@rmannibucau

@rmannibucau rmannibucau commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #9537.

Problem

The visibility change in #7387 prevents existing plugin binaries from invoking the formerly public ValueMetaBase(String, int) constructor.
The JVM raises IllegalAccessError when those plugins reach their metadata-construction paths.
This has been reproduced with unchanged third-party transform and workflow-action JARs through normal Hop plugin loading.

Change

  • Restore public access to the two-argument constructor only.
  • Mark it @Deprecated(since = "2.21"), without marking it for removal.
  • Document its binary-compatibility purpose and link to ValueMetaFactory.createValueMeta(String, int) as the preferred API for new code.
  • Preserve the existing constructor delegation and initialization; leave all other constructor visibilities unchanged.

This is a narrowly scoped compatibility bridge, not a reversal of the recommendation in #6988 to use type-specific value metadata.
No plugin JARs, vendor-specific code, dependencies, classloader rules, or JVM access flags are added to Hop.
It does not address unrelated incompatibilities or make direct base-class construction equivalent to the factory.

Regression coverage

Add ValueMetaBaseCompatibilityTest in a different package from ValueMetaBase, with no subclass or reflective-access bypass.
It directly invokes the constructor for String, Date, and Integer metadata and verifies the field name, type, length, precision, and storage defaults.
It also verifies that the public constructor is deprecated without being marked for removal.

Before the visibility fix, the external-package call was confirmed to fail compilation with The constructor ... ValueMetaBase(java.lang.String, int) is not visible.
With the fix, the regression tests pass.

Specific Validation performed

./mvnw -B -ntp -pl core spotless:apply \
  -Dtest='ValueMeta*Test,RowMeta*Test' package

./mvnw -B -ntp -pl core \
  spotless:check checkstyle:check apache-rat:check
  • 279 metadata/row tests passed, with no failures, errors, or skipped tests.
  • Spotless, Checkstyle, and RAT passed for the core module.
  • ./mvnw -B -ntp apache-rat:check also passed across the reactor on a clean snapshot of the committed branch.
  • git diff --check passed.
  • The freshly source-built branch core was installed into an isolated copy of an existing local 2.21 client assembly and used through hop-run.sh with the two unchanged plugin JARs.
  • The transform and action passed their tested execution paths with unchanged plugin JARs, including output, metadata, resource-lifecycle, and termination assertions.

The private-plugin end-to-end checks are supplemental local evidence, not tests added to the public repository (the transform and action are private).

The complete repository clean install and a fresh full client assembly build were not run (too long - hop(e) it is ok to use the CI ;)).

Checklist

  • Run apache-rat:check across the reactor on a clean snapshot of the committed branch.
  • Run the full repository mvn clean install; the focused build above passed, but a full clean build was not run.
  • Keep the implementation and regression tests focused on the demonstrated constructor signature.
  • Link the issue created before this PR: [Bug]: Existing plugins fail with IllegalAccessError after ValueMetaBase constructor visibility change #9537.
  • I hereby declare this contribution to be licensed under the Apache License Version 2.0, January 2004.

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.

[Bug]: Existing plugins fail with IllegalAccessError after ValueMetaBase constructor visibility change

1 participant