You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: detectable/src/main/java/com/blackduck/integration/detectable/detectables/gradle/inspection/GradleInspectorExtractor.java
Copy file name to clipboardexpand all lines: detectable/src/main/java/com/blackduck/integration/detectable/detectables/gradle/inspection/parse/GradleReportLineParser.java
projectPath = metadata.getOrDefault(PROJECT_PATH_PREFIX, ""); // get project path Eg: :sub:foo
137
+
135
138
136
-
addRelation();
139
+
// To avoid a bug caused by an edge case where child and parent modules have the same name causing the loop for checking rich version to stuck
140
+
// in an infinite state, we are going to suffix the name of the project with the depth number
141
+
ints = fileName.lastIndexOf("depth") + 5; // File name is like project__projectname__depth3_dependencyGraph.txt, we extract the number after depth
142
+
inte = fileName.indexOf("_dependencyGraph");
143
+
depthNumber = fileName.substring(s, e);
144
+
projectName = projectName+"_"+depthNumber;
145
+
146
+
// Example of dependency using rich version:
147
+
// --- com.graphql-java:graphql-java:{strictly [21.2, 21.3]; prefer 21.3; reject [20.6, 19.5, 18.2]} -> 21.3 direct depenendency, will be stored in rich versions, richVersionProject value will be current project
148
+
// +--- com.graphql-java:java-dataloader:3.2.1 transitive needs to be stored
149
+
// | \--- org.slf4j:slf4j-api:1.7.30 -> 2.0.4 transitive needs to be stored
// this condition is checking for rich version use for current direct dependency in one of the parent submodule of the current module and updates the current version
157
172
if (checkParentRichVersion(dependencyGroupName)) {
// this method checks all the parent modules for the current submodule upto rootProject for the use of the rich version for the current dependency
190
+
// if the rich version is used return true and update the richVersionProject
191
+
// We will check if rich version was declared in root project, if yes immediately apply it, otherwise parse the whole project path for the current submodule
192
+
// path will start from level 1 Eg: :sub:foo, we will check dependency in :sub_1 first foo_2 next where the name is similar to project name we put in the gradle Rich versions map.
193
+
//Eg: if sub declares rich version and foo is child of both sub and subtwo, we change version if :sub:foo is the path we are parsing and do not change if we are parsing :subtwo:foo
if (gradleRichVersions.containsKey(currentProject) && gradleRichVersions.get(currentProject).containsKey(dependencyGroupName)) {
184
-
richVersionProject = currentProject;
200
+
String[] pathParts = projectPath.split(":");
201
+
for(intdepth = 1; depth < pathParts.length; depth++) { // Since path is like :sub:foo we start at the first index which will be the parent at first level
Copy file name to clipboardexpand all lines: detectable/src/main/java/com/blackduck/integration/detectable/detectables/gradle/inspection/parse/GradleReportParser.java
+10-6
Original file line number
Diff line number
Diff line change
@@ -26,13 +26,13 @@ public class GradleReportParser {
Copy file name to clipboardexpand all lines: documentation/src/main/markdown/currentreleasenotes.md
+1
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,7 @@
23
23
### Resolved issues
24
24
25
25
* (IDETECT-4447) - ID strings of detected Yarn project dependencies are now correctly formed. Related warning messages have been improved to identify entries in the yarn.lock file that have not been resolved through package.json files and could not be resolved with any standard NPM packages.
26
+
* (IDETECT-4533) - Resolved an issue with [detect_product_short] Gradle Native Inspector causing scans to hang indefinitely when submodule has the same name as the parent module.
0 commit comments