Skip to content

Commit 950ff5f

Browse files
authored
[Bug Fix] Common transitive dependencies marked as duplicates (#522)
2 parents 6389c2a + ffa882b commit 950ff5f

18 files changed

Lines changed: 379 additions & 15 deletions

File tree

‎validation/core/integration_test/class_design_implementation/BUILD‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ filegroup(
2020
"//validation/core/integration_test/class_design_implementation/negative_class_missing:case_data",
2121
"//validation/core/integration_test/class_design_implementation/negative_class_missing_with_suggestion:case_data",
2222
"//validation/core/integration_test/class_design_implementation/negative_class_missing_without_suggestion:case_data",
23+
"//validation/core/integration_test/class_design_implementation/negative_duplicate_class_entity_implementation_input:case_data",
2324
"//validation/core/integration_test/class_design_implementation/negative_duplicate_class_entity_input:case_data",
2425
"//validation/core/integration_test/class_design_implementation/negative_entity_type_mismatch:case_data",
2526
"//validation/core/integration_test/class_design_implementation/negative_enum_literal_mismatch:case_data",
@@ -61,6 +62,7 @@ filegroup(
6162
"//validation/core/integration_test/class_design_implementation/positive_method_inheritance_features:case_data",
6263
"//validation/core/integration_test/class_design_implementation/positive_method_template_pack_features:case_data",
6364
"//validation/core/integration_test/class_design_implementation/positive_relationship_features:case_data",
65+
"//validation/core/integration_test/class_design_implementation/positive_shared_implementation_dependency:case_data",
6466
"//validation/core/integration_test/class_design_implementation/positive_unresolved_type_not_int:case_data",
6567
"//validation/core/integration_test/class_design_implementation/positive_variable_features:case_data",
6668
],

‎validation/core/integration_test/class_design_implementation/class_design_implementation_suite.rs‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ fn positive_free_function_features() {
6767
assert_case("positive_free_function_features");
6868
}
6969

70+
#[test]
71+
fn positive_shared_implementation_dependency() {
72+
assert_case("positive_shared_implementation_dependency");
73+
}
74+
7075
#[test]
7176
fn positive_method_features() {
7277
assert_case("positive_method_features");
@@ -152,6 +157,11 @@ fn negative_duplicate_class_entity_input() {
152157
assert_case("negative_duplicate_class_entity_input");
153158
}
154159

160+
#[test]
161+
fn negative_duplicate_class_entity_implementation_input() {
162+
assert_case("negative_duplicate_class_entity_implementation_input");
163+
}
164+
155165
#[test]
156166
fn negative_entity_type_mismatch() {
157167
assert_case("negative_entity_type_mismatch");
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
load("//bazel/rules/rules_score:rules_score.bzl", "unit", "unit_design")
15+
load("//validation/core/integration_test:puml_fixture.bzl", "provider_fbs_fixture_bundle")
16+
17+
unit_design(
18+
name = "unit_design",
19+
static = ["class_diagram.puml"],
20+
visibility = ["//visibility:private"],
21+
)
22+
23+
cc_library(
24+
name = "implementation_one",
25+
srcs = ["implementation_one.cpp"],
26+
)
27+
28+
cc_library(
29+
name = "implementation_two",
30+
srcs = ["implementation_two.cpp"],
31+
)
32+
33+
unit(
34+
name = "unit",
35+
testonly = False,
36+
maturity = "development",
37+
tests = [],
38+
unit_design = [":unit_design"],
39+
visibility = ["//visibility:private"],
40+
implementation = [
41+
":implementation_one",
42+
":implementation_two",
43+
],
44+
)
45+
46+
provider_fbs_fixture_bundle(
47+
name = "fbs",
48+
visibility = ["//visibility:private"],
49+
deps = [
50+
":unit",
51+
":unit_design",
52+
],
53+
)
54+
55+
filegroup(
56+
name = "case_data",
57+
srcs = [
58+
"expected.yaml",
59+
":fbs",
60+
],
61+
visibility = ["//validation/core/integration_test:__subpackages__"],
62+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
' *******************************************************************************
2+
' Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
'
4+
' See the NOTICE file(s) distributed with this work for additional
5+
' information regarding copyright ownership.
6+
'
7+
' This program and the accompanying materials are made available under the
8+
' terms of the Apache License Version 2.0 which is available at
9+
' https://www.apache.org/licenses/LICENSE-2.0
10+
'
11+
' SPDX-License-Identifier: Apache-2.0
12+
' *******************************************************************************
13+
14+
@startuml
15+
16+
class Engine
17+
18+
@enduml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
should_pass: false
14+
error_contains: |
15+
[Class] Class "Engine" is defined more than once in the class implementation.
16+
Class : "Engine"
17+
Implementation source file : "validation/core/integration_test/class_design_implementation/negative_duplicate_class_entity_implementation_input/implementation_one.cpp"
18+
Implementation source line : 14
19+
Duplicate source file : "validation/core/integration_test/class_design_implementation/negative_duplicate_class_entity_implementation_input/implementation_two.cpp"
20+
Duplicate source line : 14
21+
Fix : Remove or rename one of the duplicate class "Engine" declarations in the class implementation.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/********************************************************************************
2+
* Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Apache License Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* SPDX-License-Identifier: Apache-2.0
12+
********************************************************************************/
13+
14+
class Engine
15+
{
16+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/********************************************************************************
2+
* Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Apache License Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* SPDX-License-Identifier: Apache-2.0
12+
********************************************************************************/
13+
14+
class engine
15+
{
16+
};

‎validation/core/integration_test/class_design_implementation/negative_duplicate_class_entity_input/expected.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
# *******************************************************************************
1313
should_pass: false
1414
error_contains: |
15-
[Class] Class "Engine" is defined more than once in the class diagram.
15+
[Class] Class "Engine" is defined more than once in the class design.
1616
Class : "Engine"
1717
Design source file : "validation/core/integration_test/class_design_implementation/negative_duplicate_class_entity_input/class_diagram_part1.puml"
1818
Design source line : 18
1919
Duplicate source file : "validation/core/integration_test/class_design_implementation/negative_duplicate_class_entity_input/class_diagram_part2.puml"
2020
Duplicate source line : 18
21-
Fix : Remove or rename one of the duplicate class "Engine" declarations in the class diagram.
21+
Fix : Remove or rename one of the duplicate class "Engine" declarations in the class design.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
load("//bazel/rules/rules_score:rules_score.bzl", "unit", "unit_design")
15+
load("//validation/core/integration_test:puml_fixture.bzl", "provider_fbs_fixture_bundle")
16+
17+
unit_design(
18+
name = "unit_design",
19+
static = ["class_diagram.puml"],
20+
visibility = ["//visibility:private"],
21+
)
22+
23+
cc_library(
24+
name = "shared_types",
25+
hdrs = ["shared.h"],
26+
)
27+
28+
cc_library(
29+
name = "implementation_one",
30+
srcs = ["implementation_one.cpp"],
31+
deps = [":shared_types"],
32+
)
33+
34+
cc_library(
35+
name = "implementation_two",
36+
srcs = ["implementation_two.cpp"],
37+
deps = [":shared_types"],
38+
)
39+
40+
unit(
41+
name = "unit",
42+
testonly = False,
43+
maturity = "development",
44+
tests = [],
45+
unit_design = [":unit_design"],
46+
visibility = ["//visibility:private"],
47+
implementation = [
48+
":implementation_one",
49+
":implementation_two",
50+
],
51+
)
52+
53+
provider_fbs_fixture_bundle(
54+
name = "fbs",
55+
visibility = ["//visibility:private"],
56+
deps = [
57+
":unit",
58+
":unit_design",
59+
],
60+
)
61+
62+
filegroup(
63+
name = "case_data",
64+
srcs = [
65+
"expected.yaml",
66+
":fbs",
67+
],
68+
visibility = ["//validation/core/integration_test:__subpackages__"],
69+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
' *******************************************************************************
2+
' Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
'
4+
' See the NOTICE file(s) distributed with this work for additional
5+
' information regarding copyright ownership.
6+
'
7+
' This program and the accompanying materials are made available under the
8+
' terms of the Apache License Version 2.0 which is available at
9+
' https://www.apache.org/licenses/LICENSE-2.0
10+
'
11+
' SPDX-License-Identifier: Apache-2.0
12+
' *******************************************************************************
13+
14+
@startuml
15+
16+
package shared {
17+
class Shared
18+
}
19+
20+
@enduml

0 commit comments

Comments
 (0)