Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Maximum call stack size exceeded error #19

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/depgraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ export class MavenDependencyGraph {
if (!dependencyPkg) {
throw new Error(`Failed to find a dependency package for '${dependencyId}'`);
}
pkg.dependsOn(dependencyPkg);
if (pkg.packageURL.namespace != dependencyPkg.packageURL.namespace || pkg.packageURL.name != dependencyPkg.packageURL.name ) {
pkg.dependsOn(dependencyPkg);
}
});
}
});
Expand Down Expand Up @@ -208,4 +210,4 @@ function dependencyMap(dependencies: DepgraphDependency[]): Map<string, string[]
function getDirectDependencies(rootPackageNumericId: number, dependencies: DepgraphDependency[]): string[] {
const topLevel = dependencies.filter(dependency => { return dependency.numericFrom === rootPackageNumericId; });
return topLevel.map(dep => { return dep.to; });
}
}
4 changes: 2 additions & 2 deletions src/snapshot-generator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('snapshot-generator', () => {
it('should generate a snapshot for a simple project', async () => {
const projectDir = getMavenProjectDirectory('simple');
const depGraph = await generateDependencyGraph(projectDir);
expect(depGraph.dependencies.length).toBe(20);
expect(depGraph.dependencies.length).toBe(27);
});
});

Expand All @@ -30,4 +30,4 @@ describe('snapshot-generator', () => {

function getMavenProjectDirectory(name: string): string {
return path.join(__dirname, '..', 'test-data', 'maven', name);
}
}
9 changes: 8 additions & 1 deletion test-data/maven/simple/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@
<version>4.13</version>
<scope>test</scope>
</dependency>

<!-- dependency triggering Maximum call stack size exceeded -->
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>2.0.54.Final</version>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -136,4 +143,4 @@
</plugins>
</pluginManagement>
</build>
</project>
</project>