Skip to content

chore(QTDI-2897): [Refactoring] S1068 / S1481 Unused declarations#1232

Open
undx wants to merge 8 commits into
masterfrom
ouf/QTDI-2897-remove-unused-decl
Open

chore(QTDI-2897): [Refactoring] S1068 / S1481 Unused declarations#1232
undx wants to merge 8 commits into
masterfrom
ouf/QTDI-2897-remove-unused-decl

Conversation

@undx
Copy link
Copy Markdown
Member

@undx undx commented May 28, 2026

@undx undx changed the title chore(QTDI-2897): fix S1068 chore(QTDI-2897): [Refactoring] S1068 / S1481 Unused declarations May 28, 2026
@undx undx requested a review from Copilot May 28, 2026 13:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses Sonar unused declaration findings by either suppressing intentional unused private fields or removing unused fields/imports/local declarations across runtime, server, starter, tooling, and test fixtures.

Changes:

  • Adds @SuppressWarnings("java:S1068") to fields kept for framework wiring, reflection, samples, or tests.
  • Removes unused private fields, imports, and constants from several test/runtime classes.
  • Updates one generated starter-server golden resource with a suppression annotation.

Reviewed changes

Copilot reviewed 27 out of 28 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
sample-parent/sample/src/main/java/org/talend/sdk/component/sample/other/ComplexComponent.java Suppresses unused dataset field warning.
documentation/src/main/java/org/talend/runtime/documentation/component/source/MockTableSource.java Suppresses unused i18n field warning.
component-tools/src/test/java/org/talend/test/valid/structure/MyComponentWithStructure.java Suppresses unused schema fixture fields.
component-tools/src/test/java/org/talend/test/valid/checkpoint/InputCheckpoint.java Suppresses unused checkpoint fixture field.
component-tools/src/test/java/org/talend/test/failure/proposal/enumconfig/ComponentConfiguredWithEnum.java Suppresses unused failure-fixture field.
component-tools/src/test/java/org/talend/test/failure/action/dynamicvalues/MissingDynamicValues.java Suppresses unused failure-fixture field.
component-tools/src/test/java/org/talend/sdk/component/tools/validator/ExceptionValidatorTest.java Suppresses unused test field.
component-tools/src/test/java/org/talend/sdk/component/tools/validator/ActionValidatorTest.java Suppresses unused validator fixture field.
component-tools/src/main/java/org/talend/sdk/component/tools/SvgValidator.java Suppresses unused legacy field warning.
component-studio/component-runtime-di/src/test/java/org/talend/sdk/component/runtime/di/studio/ParameterSetterTest.java Removes unused synchronized map field.
component-studio/component-runtime-di/src/test/java/org/talend/sdk/component/runtime/di/schema/TaCoKitGuessSchemaTest.java Removes unused regex pattern.
component-studio/component-runtime-di/src/test/java/org/talend/sdk/component/runtime/di/beam/components/DIBulkAutoChunkTest.java Removes unused no-op output factory.
component-studio/component-runtime-di/src/main/java/org/talend/sdk/component/runtime/di/OutputsHandler.java Removes unused JSON provider/builder fields and imports.
component-starter-server/src/test/resources/generated/ComponentGeneratorTest/genericStreamMapper/MycompSource.java Adds suppression to generated expected source.
component-starter-server/src/test/java/org/talend/sdk/component/starter/server/front/apidemo/component/source/MockTableSource.java Suppresses unused i18n field warning.
component-starter-server/src/main/java/org/talend/sdk/component/starter/server/front/ApiDemoEndpoints.java Suppresses unused preloaded response fields.
component-server-parent/component-server/src/test/java/org/talend/sdk/component/server/test/jdbc/JdbcOutput.java Suppresses unused injected dataset field.
component-server-parent/component-server/src/main/java/org/talend/sdk/component/server/front/EnvironmentResourceImpl.java Removes unused cached environment reference.
component-server-parent/component-server/src/main/java/org/talend/sdk/component/server/front/BulkReadResourceImpl.java Suppresses unused forbidden response field.
component-server-parent/component-server-api/src/main/java/org/talend/sdk/component/server/api/ComponentResource.java Suppresses unused sample error fields.
component-runtime-manager/src/test/java/org/talend/test/ResumeableInput.java Suppresses unused injected Jsonb field.
component-runtime-manager/src/test/java/org/talend/test/MapperWithCheckpoint.java Suppresses unused bookmark flag.
component-runtime-manager/src/test/java/org/talend/test/DataInput.java Suppresses unused i18n service field.
component-runtime-manager/src/test/java/org/talend/sdk/component/runtime/manager/service/MavenRepositoryResolverTest.java Removes unused path handler field.
component-runtime-manager/src/test/java/org/talend/sdk/component/runtime/manager/checkpoint/CheckpointInputTest.java Removes unused JSON builder factory and suppresses provider field.
component-runtime-manager/src/main/java/org/talend/sdk/component/runtime/manager/builtinparams/StreamingLongParamBuilder.java Suppresses unused component class name field.
component-runtime-beam/src/test/java/org/talend/test/wrapped/JdbcSource.java Suppresses unused Beam workaround collection field.
component-form/component-form-model/src/test/java/org/talend/sdk/component/form/model/jsonschema/PojoJsonSchemaBuilderTest.java Suppresses unused reflection fixture fields.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 46 out of 47 changed files in this pull request and generated 5 comments.

Comment thread component-tools/src/main/java/org/talend/sdk/component/tools/SvgValidator.java Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 49 out of 50 changed files in this pull request and generated 2 comments.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 49 out of 50 changed files in this pull request and generated 1 comment.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 48 out of 49 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

component-server-parent/component-server/src/main/java/org/talend/sdk/component/server/front/ComponentResourceImpl.java:560

  • This stream still builds a map and immediately discards it, only relying on the lambda side effect to mutate config. Rewriting this as an explicit forEach over the entries would avoid the unnecessary temporary map and make the mutation that migration depends on clear.
        config.entrySet().stream().map(e -> {
            if (e.getValue().startsWith(BASE64_PREFIX)) {
                final String value = new String(Base64
                        .getUrlDecoder()
                        .decode(e.getValue().substring(BASE64_PREFIX.length()).getBytes(StandardCharsets.UTF_8)));
                e.setValue(value);
            }
            return e;
        }).collect(toMap(Entry::getKey, Entry::getValue));

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 48 out of 49 changed files in this pull request and generated 3 comments.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 48 out of 49 changed files in this pull request and generated 2 comments.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 48 out of 49 changed files in this pull request and generated no new comments.

@undx undx requested a review from ozhelezniak-talend May 28, 2026 17:15
@sonar-rnd
Copy link
Copy Markdown

sonar-rnd Bot commented May 28, 2026

Failed Quality Gate failed

  • 0.00% Coverage on New Code (is less than 80.00%)
  • 1 New Issues (is greater than 0)

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

View in SonarQube

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.

4 participants