Skip to content

Conversation

@ypiel-talend
Copy link
Contributor

Requirements

  • Any code change adding any logic MUST be tested through a unit test executed with the default build
  • Any API addition MUST be done with a documentation update if relevant

Why this PR is needed?

What does this PR adds (design/code thoughts)?

@sonar-eks
Copy link

sonar-eks bot commented Jan 9, 2026

Failed Quality Gate failed

  • 0.00% Coverage on New Code (is less than 80.00%)
  • 11.51% Duplicated Lines (%) on New Code (is greater than 3.00%)
  • 55 New Issues (is greater than 0)

Project ID: org.talend.sdk.component:component-runtime

View in SonarQube

Copy link
Contributor Author

@ypiel-talend ypiel-talend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may have misled you with the code generation for Schema/ Entry. We should simplify hem more. I think we need a builder etc... Simply need to be able to deserialize json->instance.


<build>
<plugins>
<plugin>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this configuration has been added ?

@Getter
private final Object internalDefaultValue;

@ConstructorProperties({"name", "rawName", "type", "nullable", "metadata", "errorCapable",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that needed ?

if (this.name.equals(newValue)) {
return this;
}
return new Entry(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that really needed ? Maybe just simple setter ? what do you think ?

if (this.rawName.equals(newValue)) {
return this;
}
return new Entry(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that really needed ? Maybe just simple setter ? what do you think ?

if (this.type == newValue) {
return this;
}
return new Entry(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idem...

}

@Override
public String toString() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can use lombok @DaTa it will automaticall y getter/setter/toString/hashCode et...

.build();
}

public static Builder builder() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is need. The goal is just to have a simple java POJO to desrialize a json to a java instance


@Test
void deserializeEntryFromJson() throws Exception {
String json = """
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add component-runtime-impl in scope test, create entry/schema instances, then serialize them to json, and deserialize to the new class. We have to check it is compatible with Entry/Schema defined in component-runtime-impl at test test.

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.

3 participants