Skip to content

[Task]: Visibility of ValueMetaBase Constructors #6988

@fskorgen

Description

@fskorgen

What needs to happen?

During migration of legacy PDI transformations to HOP, some code paths use the public constructor:

public ValueMetaBase(String name, int type, int length, int precision)

Using these public constructors can lead to issues in transformations that rely on inherited members in subclasses of ValueMetaBase.

This makes it harder to ensure correct usage and can introduce subtle bugs.

Recommendation

Change the following constructors from public to protected:

protected ValueMetaBase(String name)
protected ValueMetaBase(String name, int type)
protected ValueMetaBase(String name, int type, Comparator<Object> comparator)
protected ValueMetaBase(String name, int type, int length, int precision)
protected ValueMetaBase(String name, int type, int length, int precision, Comparator<Object> comparator)

Expected Outcome

  • Encourage use of ValueMetaFactory.createValueMeta(...)
  • Prevent incorrect direct instantiation
  • Clarify intended usage patterns

Additional Context

The ValueMetaFactory should be the preferred way to create instances, as it ensures consistent initialization and better compatibility across transformations.

Issue Priority

Priority: 3

Issue Component

Component: API

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions