chore(QTDI-2897): [Refactoring] S1068 / S1481 Unused declarations#1232
Open
undx wants to merge 8 commits into
Open
chore(QTDI-2897): [Refactoring] S1068 / S1481 Unused declarations#1232undx wants to merge 8 commits into
undx wants to merge 8 commits into
Conversation
Contributor
There was a problem hiding this comment.
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.
Contributor
There was a problem hiding this comment.
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 explicitforEachover 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>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

https://qlik-dev.atlassian.net/browse/QTDI-2897