Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
ce697d2
chore(QTDI-2893): use pattern matching for instanceof (S6201)
undx May 21, 2026
e6240c6
chore(QTDI-2893): rename pattern match
undx May 21, 2026
ffe2f53
chore(QTDI-2894): S6204 Stream.toList()
undx May 22, 2026
17159c0
chore(QTDI-2894): S6204 Stream.toList() - potential API break
undx May 22, 2026
6d71def
chore(QTDI-2894): S6204 Stream.toList() - restore partials
undx May 22, 2026
3e5d2fa
chore(QTDI-2894): try-with-resources
undx May 22, 2026
9cd070b
chore(QTDI-2894): remove compiler level 1.8
undx May 22, 2026
c96713e
chore(QTDI-2894): fix compiler level 17 tests
undx May 22, 2026
01b1ba4
chore(QTDI-2894): add safe S6204 not detected
undx May 22, 2026
573bcbb
chore(QTDI-2894): add more S6204
undx May 22, 2026
1a8b0cb
chore(QTDI-2894): fix test for non regression
undx May 22, 2026
d0f6301
Merge branch 'master' into ouf/QTDI-2894_stream_tolist
undx May 28, 2026
9d62a6c
chore(QTDI-2894): fix possible api break
undx May 28, 2026
8359900
chore(QTDI-2894): fix possible api break -tests
undx May 28, 2026
773745f
chore(QTDI-2897): fix S1068
undx May 28, 2026
21bd64c
chore(QTDI-2897): fix S1481
undx May 28, 2026
98acc3a
chore(QTDI-2897): fix copilot comments
undx May 28, 2026
625c013
chore(QTDI-2897): fix missing stream
undx May 28, 2026
28688df
chore(QTDI-2897): fix revert refactoring going out of scope
undx May 28, 2026
e3d55e3
Potential fix for pull request finding
undx May 28, 2026
0a37e2d
Potential fix for pull request finding
undx May 28, 2026
33883a3
fix: replace no-op stream collect with entrySet forEach in migrate
Copilot May 28, 2026
e3aab06
chore(QTDI-2895): S6126 Text blocks initial raw commit
undx May 28, 2026
8c91e16
Potential fix for pull request finding
undx May 28, 2026
be97a2e
Fix review comments: XML tag, grammar issues in validator and API docs
Copilot May 28, 2026
823c113
Potential fix for pull request finding
undx May 28, 2026
1583231
Fix remaining review findings
Copilot May 28, 2026
c246b7b
chore(QTDI-2895): S6126 corrected some Text blocks
undx May 29, 2026
05b0c2f
chore(QTDI-2895): S6126 fix EntryTest
undx May 29, 2026
74e6c6d
Potential fix for pull request finding
undx May 29, 2026
a7da378
chore(QTDI-2896): S6208 Switch case merging
undx May 29, 2026
4df421e
Merge branch 'master' into ouf/QTDI-2896-Switch-case-merging
undx May 29, 2026
7808e1e
Merge branch 'master' into ouf/QTDI-2893_pattern_instanceof
undx May 29, 2026
2b470c5
Merge branch 'master' into ouf/QTDI-2894_stream_tolist
undx May 29, 2026
327c350
Merge branch 'master' into ouf/QTDI-2897-remove-unused-decl
undx May 29, 2026
546d080
Merge branch 'master' into ouf/QTDI-2895-sonar-text-blocks
undx May 29, 2026
ca3aa24
chore(QTDI-2898): S1124 Modifier order
undx May 29, 2026
d5b2d6f
fix: address PR review remarks in docs files
Copilot May 29, 2026
7f13466
chore(QTDI-2898): S1124 Modifier order - fix tests
undx May 29, 2026
d704efe
chore(QTDI-2901): S2095 Resource leaks
undx May 29, 2026
7a98da0
Merge branch 'master' into ouf/QTDI-2893_pattern_instanceof
undx Jun 2, 2026
ff76b94
Merge branch 'master' into ouf/QTDI-2893_pattern_instanceof
ozhelezniak-talend Jun 3, 2026
e1417ff
Merge branch 'master' into ouf/QTDI-2898-Modifier-order
ozhelezniak-talend Jun 3, 2026
4a4ba72
chore(QTDI-2893): S6201 changes after rebase
undx Jun 3, 2026
dee61f0
chore(QTDI-2893): S6201 changes after code review
undx Jun 4, 2026
32956b8
chore(QTDI-2893): reset to master
undx Jun 4, 2026
e051e5e
chore(QTDI-2893): S6201 intellij processed
undx Jun 4, 2026
9ef6614
chore(QTDI-2893): S6201 manual processed
undx Jun 4, 2026
f8eae9f
Merge remote-tracking branch 'origin/ouf/QTDI-2893_pattern_instanceof…
undx Jun 26, 2026
5bcbf93
Merge remote-tracking branch 'origin/ouf/QTDI-2894_stream_tolist' int…
undx Jun 26, 2026
7d157ee
Merge remote-tracking branch 'origin/ouf/QTDI-2895-sonar-text-blocks'…
undx Jun 26, 2026
c1aea10
Merge remote-tracking branch 'origin/ouf/QTDI-2896-Switch-case-mergin…
undx Jun 26, 2026
7bc2e49
Merge remote-tracking branch 'origin/ouf/QTDI-2897-remove-unused-decl…
undx Jun 26, 2026
adfd7f5
Merge remote-tracking branch 'origin/ouf/QTDI-2898-Modifier-order' in…
undx Jun 26, 2026
76744fc
Merge remote-tracking branch 'origin/out/QTDI-2901-Resource-leaks' in…
undx Jun 26, 2026
a935837
fix(QTDI-3124): fix merge issues
undx Jun 26, 2026
c64bfbc
fix(QTDI-3124): fix merge issues
undx Jun 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@
import org.talend.sdk.component.api.meta.Documentation;

@Ui
@Documentation("Advanced layout to place properties by row, this is exclusive with `@OptionsOrder`.\n"
+ "\nNOTE: the logic to handle forms (gridlayout names) is to use the only layout if there is only one defined, "
+ "else to check if there are `Main` and `Advanced` and if at least `Main` exists, use them, else "
+ "use all available layouts.")
@Documentation("""
Advanced layout to place properties by row, this is exclusive with `@OptionsOrder`.

NOTE: the logic to handle forms (gridlayout names) is to use the only layout if there is only one defined, \
else to check if there are `Main` and `Advanced` and if at least `Main` exists, use them, else \
use all available layouts.""")
@Target(TYPE)
@Retention(RUNTIME)
@Repeatable(GridLayouts.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ public EntriesOrder(final String fields) {
if (fields == null || fields.isEmpty()) {
fieldsOrder = new OrderedMap<>(Function.identity());
} else {
final List<String> fieldList = Arrays.stream(fields.split(",")).collect(Collectors.toList());
final List<String> fieldList = Arrays.stream(fields.split(",")).toList();
fieldsOrder = new OrderedMap<>(Function.identity(), fieldList);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@
@ActionType(value = "validation", expectedReturnedType = ValidationResult.class)
@Target(METHOD)
@Retention(RUNTIME)
@Documentation("Mark a method as being used to validate a configuration.\n\nIMPORTANT: this is a server validation "
+ "so only use it if you can't use other client side validation to implement it.")
@Documentation("""
Mark a method as being used to validate a configuration.

IMPORTANT: this is a server validation \
so only use it if you can't use other client side validation to implement it.""")
public @interface AsyncValidation {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public DiscoverDatasetResult(final List<DatasetDescription> datasetDescriptionLi
}

@Getter
public final static class DatasetDescription {
public static final class DatasetDescription {

public DatasetDescription(final String name) {
this.name = name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@
import lombok.Data;
import lombok.NoArgsConstructor;

@Partial("This API should support nested schema but the Studio is not yet ready.\n\n"
+ "The cloud platform also doesn't use it yet.\n\nAlso prefer to use "
+ "`org.talend.sdk.component.api.record.Schema` over this partial default implementation.")
@Partial("""
This API should support nested schema but the Studio is not yet ready.

The cloud platform also doesn't use it yet.

Also prefer to use \
`org.talend.sdk.component.api.record.Schema` over this partial default implementation.""")
@Data
@NoArgsConstructor
@AllArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ void orderedMapTest() {

container.addValue(f1);
container.addValue(f2);
List<String> entries = container.streams().collect(Collectors.toList());
List<String> entries = container.streams().toList();
Assertions.assertSame("f1", entries.get(0));
Assertions.assertSame("f2", entries.get(1));

container.swap("f1", "f2");
List<String> entries2 = container.streams().collect(Collectors.toList());
List<String> entries2 = container.streams().toList();
Assertions.assertSame("f2", entries2.get(0));
Assertions.assertSame("f1", entries2.get(1));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package org.talend.sdk.component.form.api;

import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toSet;

import java.util.ArrayList;
Expand Down Expand Up @@ -113,7 +112,7 @@ public CompletionStage<Ui> convert(final String family, final String lang, final
prop.getName(), prop.getDisplayName(), prop.getType(), prop.getDefaultValue(),
prop.getValidation(), prop.getMetadata(), prop.getPlaceholder(),
prop.getProposalDisplayNames()))
.collect(toList());
.toList();
isRootProperty = p -> p.getPath().equals(def.getName());
} else {
props = node.getProperties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package org.talend.sdk.component.form.internal.converter.impl;

import static java.util.Collections.singletonMap;
import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toMap;

import java.util.Collection;
Expand Down Expand Up @@ -115,7 +114,7 @@ public CompletionStage<PropertyContext<?>> convert(final CompletionStage<Propert
.stream()
.filter(prop -> prop.getPath().startsWith(nestedPrefix)
&& prop.getPath().indexOf('.', from) < 0)
.collect(toList());
.toList();
if (!nested.isEmpty()) {
return new ObjectArrayWidgetConverter(schemas, properties, actions, family,
client, gridLayoutFilter, jsonSchema, lang, customConverters, metadata,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package org.talend.sdk.component.form.internal.converter.impl.schema;

import static java.util.Locale.ROOT;
import static java.util.stream.Collectors.toList;

import java.util.Collection;
import java.util.List;
Expand Down Expand Up @@ -50,7 +49,7 @@ public CompletionStage<PropertyContext<?>> convert(final CompletionStage<Propert
jsonSchema.setType(context.getProperty().getType().toLowerCase(ROOT));
final String prefix = context.getProperty().getPath() + "[]";
final List<SimplePropertyDefinition> arrayElements =
properties.stream().filter(child -> child.getPath().startsWith(prefix)).collect(toList());
properties.stream().filter(child -> child.getPath().startsWith(prefix)).toList();

if (arrayElements.stream().anyMatch(e -> e.getPath().startsWith(prefix + '.'))) { // complex object
final JsonSchema items = new JsonSchema();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected <T> CompletionStage<List<UiSchema.NameValue>> loadDynamicValues(final
val.setValue((String) entry.get("id"));
return val;
})
.collect(toList());
.toList();
})
.orElse(emptyList()));
}
Expand Down Expand Up @@ -140,7 +140,7 @@ protected List<UiSchema.Parameter> toParams(final Collection<SimplePropertyDefin
.setPath(path.endsWith("[]") ? path.substring(0, path.length() - "[]".length()) : path);
return parameter;
})
.collect(toList());
.toList();

// if we are empty and there was no "empty" object then fail
if (!propertiesPrefix.startsWith("$") && resolvedParams.isEmpty()
Expand All @@ -149,7 +149,7 @@ protected List<UiSchema.Parameter> toParams(final Collection<SimplePropertyDefin
+ ref.getFamily() + "/" + ref.getType() + "/" + ref.getName());
}
return resolvedParams.stream();
}).collect(toList())).orElse(null);
}).toList()).orElse(null);
}

protected UiSchema newUiSchema(final PropertyContext<?> ctx) {
Expand Down Expand Up @@ -330,7 +330,6 @@ protected Map<String, Collection<Object>> createCondition(final PropertyContext<
.collect(toList());
final Map<String, Collection<Object>> condition = values.size() == 1 ? values.iterator().next()
: new UiSchema.ConditionBuilder().withOperator("or").withValues(values).build();
final UiSchema.ConditionValuesBuilder rootBuilder;
if (!shouldBe) { // no need to add the wrapper if we test true (default)
return new UiSchema.ConditionBuilder()
.withOperator("==")
Expand Down Expand Up @@ -380,8 +379,7 @@ protected Map<String, Collection<Object>> toCondition(final String path, final S
.withVar(path + ".length")
.withValue(value instanceof String ? Integer.parseInt(String.valueOf(value)) : value)
.build();
case "contains":
case "contains(lowercase=true)":
case "contains", "contains(lowercase=true)":
final UiSchema.ConditionValuesBuilder in = new UiSchema.ConditionBuilder().withOperator("in");
final Object val =
strategy.endsWith("(lowercase=true)") ? ((String) value).toLowerCase(ROOT) : value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected CompletionStage<PropertyContext<?>> fillProposalsAndReturn(final Prope
return pairs.thenApply(namedValues -> {
schema.setTitleMap(namedValues);
schema.setRestricted(true);
jsonSchema.setEnumValues(namedValues.stream().map(UiSchema.NameValue::getValue).collect(toList()));
jsonSchema.setEnumValues(namedValues.stream().map(UiSchema.NameValue::getValue).toList());
return context;
});
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
Boolean.parseBoolean(context.getProperty().getMetadata().getOrDefault("ui::datetime::useUTC", "true"));
switch (format) {
case "time": {
schema.setWidget("datetime"); // todo: move to "time" widget when existing

Check failure on line 60 in component-form/component-form-core/src/main/java/org/talend/sdk/component/form/internal/converter/impl/widget/DateTimeConverter.java

View check run for this annotation

sonar-rnd / SonarQube Code Analysis

component-form/component-form-core/src/main/java/org/talend/sdk/component/form/internal/converter/impl/widget/DateTimeConverter.java#L60

Define a constant instead of duplicating this literal "datetime" 3 times.
final Map<String, Object> options = new HashMap<>();
options.put("useSeconds", useSeconds);
schema.setOptions(options);
Expand All @@ -67,8 +67,7 @@
schema.setWidget("date");
schema.setOptions(singletonMap("dateFormat", dateFormat));
break;
case "datetime":
case "zoneddatetime": {
case "datetime", "zoneddatetime": {
schema.setWidget("datetime");
final Map<String, Object> options = new HashMap<>();
options.put("useSeconds", useSeconds);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public CompletionStage<PropertyContext<?>> convert(final CompletionStage<Propert
// if we have multiple tabs, priority is MAIN/ADVANCED pair first
// but if they are not present then we use all layouts in "String" order
final List<String> tabs = (layouts.containsKey("Main") ? Stream.of("Main", "Advanced")
: layouts.keySet().stream().sorted(String::compareToIgnoreCase)).collect(toList());
: layouts.keySet().stream().sorted(String::compareToIgnoreCase)).toList();

final UiSchema schema = newUiSchema(context);
schema.setTitle(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package org.talend.sdk.component.form.internal.converter.impl.widget;

import static java.util.Collections.emptyList;
import static java.util.stream.Collectors.toList;

import java.util.Collection;
import java.util.List;
Expand Down Expand Up @@ -69,7 +68,7 @@ public CompletionStage<PropertyContext<?>> convert(final CompletionStage<Propert
loadDynamicValues(client, family, actionName, context.getRootContext());
return pairs.thenApply(namedValues -> {
schema.setTitleMap(namedValues);
jsonSchema.setEnumValues(namedValues.stream().map(UiSchema.NameValue::getValue).collect(toList()));
jsonSchema.setEnumValues(namedValues.stream().map(UiSchema.NameValue::getValue).toList());
return context;
});
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ public Stream<ValidationResult.ValidationError> apply(final JsonValue obj) {
switch (value.getValueType()) {
case STRING:
return onString((JsonString) value);
case TRUE:
case FALSE:
case TRUE, FALSE:
return onBoolean(JsonValue.TRUE.equals(value));
case NUMBER:
return onNumber((JsonNumber) value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package org.talend.sdk.component.form.internal.validation.spi.ext;

import static java.util.Comparator.comparing;
import static java.util.stream.Collectors.toList;

import java.util.Collection;
import java.util.Optional;
Expand All @@ -38,10 +37,10 @@ public class TypeValidation implements ValidationExtension {
@Override
public Optional<Function<JsonValue, Stream<ValidationError>>> create(final ValidationContext model) {
final JsonValue value = model.getSchema().get("type");
if (value instanceof JsonString) {
if (value instanceof JsonString jsonString) {
return Optional
.of(new Impl(model.toPointer(), model.getValueProvider(),
mapType((JsonString) value).toArray(JsonValue.ValueType[]::new)));
mapType(jsonString).toArray(JsonValue.ValueType[]::new)));
}
if (value instanceof JsonArray) {
return Optional
Expand Down Expand Up @@ -83,7 +82,7 @@ private Impl(final String pointer, final Function<JsonValue, JsonValue> extracto
.concat(Stream.of(types), Stream.of(JsonValue.ValueType.NULL))
.distinct()
.sorted(comparing(JsonValue.ValueType::name))
.collect(toList());
.toList();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import static java.util.Optional.ofNullable;
import static java.util.concurrent.CompletableFuture.completedFuture;
import static java.util.stream.Collectors.joining;
import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toSet;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
Expand All @@ -48,7 +47,6 @@
import java.util.concurrent.CompletionStage;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import javax.json.bind.Jsonb;
Expand Down Expand Up @@ -288,7 +286,7 @@
.getItems()
.stream()
.map(UiSchema::getTitle)
.collect(toList()));
.toList());
}

@Test
Expand All @@ -311,12 +309,6 @@
@Test
void optionsOrder() throws Exception {
final ConfigTypeNode node = load("optionsorder.json", ConfigTypeNode.class);
final SimplePropertyDefinition root = node
.getProperties()
.stream()
.filter(it -> it.getPath().equals("configuration"))
.findFirst()
.orElseThrow(() -> new IllegalArgumentException("bad config"));
final Ui payload = service.convert("FileIO", "en", node, null).toCompletableFuture().get();
final List<String> actualOrder = payload
.getUiSchema()
Expand All @@ -327,7 +319,7 @@
.map(UiSchema::getKey)
.filter(Objects::nonNull)
.map(s -> s.substring(s.lastIndexOf('.') + 1))
.collect(toList());
.toList();
assertEquals(asList("region", "unknownRegion", "bucket", "object", "encryptDataAtRest", "kmsForDataAtRest",
"format", "recordDelimiter", "specificRecordDelimiter", "fieldDelimiter", "specificFieldDelimiter",
"limit"), actualOrder);
Expand Down Expand Up @@ -462,7 +454,7 @@

assertEquals(5, tableDataSetMain.getItems().size());
assertEquals(asList("dataStore", "commonConfig", "Query", "Ordered", "Order"),
tableDataSetMain.getItems().stream().map(UiSchema::getTitle).collect(toList()));
tableDataSetMain.getItems().stream().map(UiSchema::getTitle).toList());

final Iterator<UiSchema> mainIt = tableDataSetMain.getItems().iterator();
final UiSchema dataStore = mainIt.next();
Expand All @@ -471,7 +463,7 @@
final UiSchema credentials = dataStoreIt.next();
assertEquals("columns", credentials.getWidget());
assertEquals(asList("Username", "Password"),
credentials.getItems().stream().map(UiSchema::getTitle).collect(toList()));
credentials.getItems().stream().map(UiSchema::getTitle).toList());

final UiSchema tableDataSetAdvanced = tableDataSetIt.next();
assertEquals("Advanced", tableDataSetAdvanced.getTitle());
Expand Down Expand Up @@ -539,7 +531,7 @@
assertEquals("SuggestionForJdbcDrivers", driverTrigger.getAction());
assertNull(driverTrigger.getRemote());
assertEquals(singletonList("currentValue/configuration.driver"),
driverTrigger.getParameters().stream().map(it -> it.getKey() + '/' + it.getPath()).collect(toList()));
driverTrigger.getParameters().stream().map(it -> it.getKey() + '/' + it.getPath()).toList());

assertEquals("change", triggers.next().getOnEvent());
}
Expand Down Expand Up @@ -625,7 +617,7 @@
}

@Test
void uiSchema() throws Exception {

Check warning on line 620 in component-form/component-form-core/src/test/java/org/talend/sdk/component/form/api/UiSpecServiceTest.java

View check run for this annotation

sonar-rnd / SonarQube Code Analysis

component-form/component-form-core/src/test/java/org/talend/sdk/component/form/api/UiSpecServiceTest.java#L620

Refactor this method to reduce the number of assertions from 32 to less than 25.
final Ui payload = service.convert(load("jdbc.json"), "en", null).toCompletableFuture().get();
final Collection<UiSchema> uiSchema = payload.getUiSchema();
assertNotNull(uiSchema);
Expand Down Expand Up @@ -658,7 +650,7 @@
.getTitleMap()
.stream()
.map(UiSchema.NameValue.class::cast)
.collect(Collectors.toList());
.toList();
assertEquals(1, titleMap.size());
final UiSchema.NameValue firstTitleMap = titleMap.iterator().next();
assertEquals("some.driver.Jdbc", firstTitleMap.getValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package org.talend.sdk.component.form.internal.validation;

import static java.util.stream.Collectors.toList;
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.io.IOException;
Expand Down Expand Up @@ -61,7 +60,7 @@ public CompletionStage<Collection<ValidationError>> validate(final ConfigTypeNod
.getErrors()
.stream()
.map(e -> new ValidationError(e.getField(), e.getMessage()))
.collect(toList()));
.toList());
}

public CompletionStage<JsonSchemaValidator> getValidator(final ConfigTypeNode config) {
Expand Down
Loading
Loading