Skip to content

Commit 92966e8

Browse files
pcdavidsbegaudeau
authored andcommitted
[cleanup] Remove dead code
Signed-off-by: Pierre-Charles David <[email protected]>
1 parent 7441367 commit 92966e8

File tree

34 files changed

+63
-169
lines changed

34 files changed

+63
-169
lines changed

packages/diagrams/backend/sirius-components-collaborative-diagrams/src/main/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/GetNodeDescriptionsEventHandler.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
import java.util.Objects;
1818
import java.util.Optional;
1919

20-
import io.micrometer.core.instrument.Counter;
21-
import io.micrometer.core.instrument.MeterRegistry;
2220
import org.eclipse.sirius.components.collaborative.api.ChangeDescription;
2321
import org.eclipse.sirius.components.collaborative.api.ChangeKind;
2422
import org.eclipse.sirius.components.collaborative.api.Monitoring;
@@ -38,6 +36,9 @@
3836
import org.eclipse.sirius.components.diagrams.description.DiagramDescription;
3937
import org.eclipse.sirius.components.diagrams.description.NodeDescription;
4038
import org.springframework.stereotype.Service;
39+
40+
import io.micrometer.core.instrument.Counter;
41+
import io.micrometer.core.instrument.MeterRegistry;
4142
import reactor.core.publisher.Sinks;
4243

4344
/**
@@ -75,7 +76,7 @@ public void handle(Sinks.One<IPayload> payloadSink, Sinks.Many<ChangeDescription
7576
IPayload payload = new ErrorPayload(diagramInput.id(), message);
7677
ChangeDescription changeDescription = new ChangeDescription(ChangeKind.NOTHING, diagramInput.representationId(), diagramInput);
7778

78-
if (diagramInput instanceof GetNodeDescriptionsInput input) {
79+
if (diagramInput instanceof GetNodeDescriptionsInput) {
7980
Diagram diagram = diagramContext.diagram();
8081
var diagramDescription = this.representationDescriptionSearchService.findById(editingContext, diagram.getDescriptionId())
8182
.filter(DiagramDescription.class::isInstance)

packages/diagrams/backend/sirius-components-collaborative-diagrams/src/test/java/org/eclipse/sirius/components/collaborative/diagrams/handlers/InvokeSingleClickOnDiagramElementToolEventHandlerTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ public Optional<Object> getObject(IEditingContext editingContext, String objectI
346346
}
347347
};
348348

349-
var edgeDescription = this.createEdgeDescription(EDGE_DESCRIPTION_ID);
350349
var edge1 = this.createEdge(EDGE_1_ID, EDGE_DESCRIPTION_ID, LINK_1_ID);
351350

352351
var diagramQueryService = new IDiagramQueryService.NoOp() {
@@ -360,7 +359,6 @@ public Optional<Edge> findEdgeById(Diagram diagram, String edgeId) {
360359
};
361360

362361
String selectionEntryId = "entryId";
363-
String selectionEntryLabel = "entry label";
364362
String selectionEntryKind = "entryKind";
365363
var expectedSelectionEntry = new WorkbenchSelectionEntry(selectionEntryId, selectionEntryKind);
366364
var expectedWorkbenchSelection = new WorkbenchSelection(List.of(expectedSelectionEntry));

packages/diagrams/backend/sirius-components-diagrams-tests/src/main/java/org/eclipse/sirius/components/diagrams/tests/NodeAssert.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2019, 2024 Obeo.
2+
* Copyright (c) 2019, 2025 Obeo.
33
* This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v2.0
55
* which accompanies this distribution, and is available at
@@ -86,14 +86,4 @@ public NodeAssert matches(Node node, IdPolicy idPolicy, LayoutPolicy layoutPolic
8686
return this;
8787
}
8888

89-
private boolean compareDimensions(double parentStart, double parentDimension, double childStart, double childDimension) {
90-
double parentEnd = parentStart + parentDimension;
91-
double childEnd = childStart + childDimension;
92-
if (childEnd <= childStart) {
93-
return !(parentEnd >= parentStart || childEnd > parentEnd);
94-
} else {
95-
return !(parentEnd >= parentStart && childEnd > parentEnd);
96-
}
97-
}
98-
9989
}

packages/diagrams/backend/sirius-components-diagrams-tests/src/main/java/org/eclipse/sirius/components/diagrams/tests/builder/edge/EdgeBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ public EdgeBuilder(TestLayoutDiagramBuilder diagramBuilder, String edgeCenterLab
5353
}
5454

5555
public EdgeEndBuilder from(String sourceTargetObjectLabel) {
56-
this.sourceEdgeBuilder = EdgeEnd.newEdgeEnd(this, sourceTargetObjectLabel);
56+
this.sourceEdgeBuilder = EdgeEnd.newEdgeEnd(sourceTargetObjectLabel);
5757
return this.sourceEdgeBuilder;
5858
}
5959

6060
public EdgeEndBuilder to(String targetTargetObjectLabel) {
61-
this.targetEdgeBuilder = EdgeEnd.newEdgeEnd(this, targetTargetObjectLabel);
61+
this.targetEdgeBuilder = EdgeEnd.newEdgeEnd(targetTargetObjectLabel);
6262
return this.targetEdgeBuilder;
6363
}
6464

packages/diagrams/backend/sirius-components-diagrams-tests/src/main/java/org/eclipse/sirius/components/diagrams/tests/builder/edge/EdgeEnd.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2022, 2024 Obeo.
2+
* Copyright (c) 2022, 2025 Obeo.
33
* This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v2.0
55
* which accompanies this distribution, and is available at
@@ -26,8 +26,8 @@ private EdgeEnd() {
2626
// Prevent instantiation
2727
}
2828

29-
public static EdgeEndBuilder newEdgeEnd(EdgeBuilder edgeBuilder, String targetObjectLabel) {
30-
return new EdgeEndBuilder(edgeBuilder, targetObjectLabel);
29+
public static EdgeEndBuilder newEdgeEnd(String targetObjectLabel) {
30+
return new EdgeEndBuilder(targetObjectLabel);
3131
}
3232

3333
public String getEndId() {
@@ -40,12 +40,9 @@ public String getEndId() {
4040
* @author gcoutable
4141
*/
4242
public static final class EdgeEndBuilder {
43-
private EdgeBuilder edgeBuilder;
44-
4543
private String endId;
4644

47-
private EdgeEndBuilder(EdgeBuilder edgeBuilder, String targetObjectLabel) {
48-
this.edgeBuilder = Objects.requireNonNull(edgeBuilder);
45+
private EdgeEndBuilder(String targetObjectLabel) {
4946
this.endId = targetObjectLabel;
5047
}
5148

packages/diagrams/backend/sirius-components-diagrams-tests/src/main/java/org/eclipse/sirius/components/diagrams/tests/builder/node/RectangleNodeBuilder.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import java.util.UUID;
2121

2222
import org.eclipse.sirius.components.diagrams.CollapsingState;
23-
import org.eclipse.sirius.components.diagrams.ILayoutStrategy;
2423
import org.eclipse.sirius.components.diagrams.INodeStyle;
2524
import org.eclipse.sirius.components.diagrams.InsideLabel;
2625
import org.eclipse.sirius.components.diagrams.LineStyle;
@@ -50,8 +49,6 @@ public final class RectangleNodeBuilder<T> implements NodeBuilder<T> {
5049

5150
private CollapsingState collapsingState = CollapsingState.EXPANDED;
5251

53-
private ILayoutStrategy childrenLayoutStrategy;
54-
5552
private NodesBuilder<RectangleNodeBuilder<T>> borderNodesBuilder;
5653

5754
private NodesBuilder<RectangleNodeBuilder<T>> childNodesBuilder;
@@ -76,8 +73,7 @@ public NodesBuilder<RectangleNodeBuilder<T>> borderNodes() {
7673
return this.borderNodesBuilder;
7774
}
7875

79-
public NodesBuilder<RectangleNodeBuilder<T>> childNodes(ILayoutStrategy layoutStrategy) {
80-
this.childrenLayoutStrategy = Objects.requireNonNull(layoutStrategy);
76+
public NodesBuilder<RectangleNodeBuilder<T>> childNodes() {
8177
this.childNodesBuilder = new NodesBuilder<>(this, false);
8278
return this.childNodesBuilder;
8379
}

packages/diagrams/backend/sirius-components-diagrams/src/test/java/org/eclipse/sirius/components/diagrams/renderer/DiagramElementChangeVisibilityTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ public class DiagramElementChangeVisibilityTests {
6969

7070
private static final String LABEL_TEXT = "Node";
7171

72-
private static final String INSIDE_LABEL_ID = "insideLabelId";
73-
7472
private static final int LABEL_FONT_SIZE = 40;
7573

7674
private static final String COLOR = "#AFAFAF";

packages/diagrams/backend/sirius-components-diagrams/src/test/java/org/eclipse/sirius/components/diagrams/renderer/DiagramRendererNodeTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ public class DiagramRendererNodeTests {
5959

6060
private static final String LABEL_TEXT = "Node";
6161

62-
private static final String INSIDE_LABEL_ID = "insideLabelId";
63-
6462
private static final int LABEL_FONT_SIZE = 40;
6563

6664
private static final String LABEL_COLOR = "#AFAFAF";

packages/forms/backend/sirius-components-collaborative-widget-reference/src/test/java/org/eclipse/sirius/components/collaborative/widget/reference/handlers/ReferenceValueOptionsEventHandlerTests.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2023, 2024 Obeo.
2+
* Copyright (c) 2023, 2025 Obeo.
33
* This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v2.0
55
* which accompanies this distribution, and is available at
@@ -19,12 +19,7 @@
1919
import java.util.Optional;
2020
import java.util.UUID;
2121

22-
import org.eclipse.emf.ecore.EObject;
23-
import org.eclipse.emf.ecore.EStructuralFeature;
24-
import org.eclipse.emf.ecore.EcorePackage;
25-
import org.eclipse.emf.ecore.InternalEObject;
2622
import org.eclipse.sirius.components.collaborative.api.ChangeDescription;
27-
import org.eclipse.sirius.components.collaborative.api.ChangeKind;
2823
import org.eclipse.sirius.components.collaborative.forms.api.IFormQueryService;
2924
import org.eclipse.sirius.components.collaborative.forms.messages.ICollaborativeFormMessageService;
3025
import org.eclipse.sirius.components.collaborative.widget.reference.dto.ReferenceValueOptionsQueryInput;
@@ -53,12 +48,9 @@ public class ReferenceValueOptionsEventHandlerTests {
5348

5449
private static final String REF_WIDGET_ID = "RefWidget id";
5550

56-
private static final String CHANGE_DESCRIPTION_PARAMETER_KEY = "change_description_parameter_key";
57-
5851
@Test
5952
public void testGetReferenceValueOptions() {
6053
String referenceValueId = "ReferenceValue Id";
61-
String changeKind = ChangeKind.NOTHING;
6254

6355
var input = new ReferenceValueOptionsQueryInput(UUID.randomUUID(), FORM_ID.toString(), UUID.randomUUID()
6456
.toString(), REF_WIDGET_ID);
@@ -68,9 +60,6 @@ public void testGetReferenceValueOptions() {
6860
.kind("")
6961
.build();
7062

71-
EObject owner = EcorePackage.Literals.ECLASS;
72-
EStructuralFeature.Setting setting = ((InternalEObject) owner).eSetting(EcorePackage.Literals.ECLASS__EALL_STRUCTURAL_FEATURES);
73-
7463
ReferenceWidget referenceWidget = ReferenceWidget.newReferenceWidget(referenceValueId)
7564
.diagnostics(Collections.emptyList())
7665
.referenceValues(List.of())

packages/forms/backend/sirius-components-forms/src/test/java/org/eclipse/sirius/components/forms/render/RenderSplitButtonTest.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2024 Obeo.
2+
* Copyright (c) 2024, 2025 Obeo.
33
* This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v2.0
55
* which accompanies this distribution, and is available at
@@ -49,12 +49,8 @@ public class RenderSplitButtonTest {
4949

5050
private static final String BUTTON_DESCRIPTION_ID = "buttonDescriptionId";
5151

52-
private static final String BUTTON_ID = "buttonId";
53-
5452
private static final String BUTTON_DESCRIPTION_ID2 = "buttonDescriptionId2";
5553

56-
private static final String BUTTON_ID2 = "buttonId2";
57-
5854
private static final String LABEL = "label";
5955

6056
private static final String BACKGROUNDCOLOR = "value";
@@ -103,8 +99,8 @@ public void testRenderSplitButtonWithoutActions() {
10399

104100
@Test
105101
public void testRenderSplitButtonWithActions() {
106-
ButtonDescription buttonDescription = createButtonDescription(BUTTON_DESCRIPTION_ID, BUTTON_DESCRIPTION_ID, LABEL);
107-
ButtonDescription buttonDescription2 = createButtonDescription(BUTTON_DESCRIPTION_ID2, BUTTON_DESCRIPTION_ID2, LABEL);
102+
ButtonDescription buttonDescription = this.createButtonDescription(BUTTON_DESCRIPTION_ID, BUTTON_DESCRIPTION_ID, LABEL);
103+
ButtonDescription buttonDescription2 = this.createButtonDescription(BUTTON_DESCRIPTION_ID2, BUTTON_DESCRIPTION_ID2, LABEL);
108104

109105
SplitButtonDescription splitButtonDescription = SplitButtonDescription.newSplitButtonDescription(SPLITBUTTON_DESCRIPTION_ID)
110106
.targetObjectIdProvider(this.constantProvider(SPLITBUTTON_DESCRIPTION_ID))
@@ -147,7 +143,7 @@ private ButtonDescription createButtonDescription(String descriptionId, String i
147143
.imageURLProvider(variableManager -> "")
148144
.buttonLabelProvider((variableManager) -> LABEL)
149145
.pushButtonHandler((variableManager) -> new Success())
150-
.styleProvider((variableManager) -> style)
146+
.styleProvider((variableManager) -> this.style)
151147
.build();
152148
}
153149

0 commit comments

Comments
 (0)