Repository navigation
XmlGraph: build nodes only for the requested class - #586
Open
amalsaidov wants to merge 1 commit into
Open
amalsaidov wants to merge 1 commit into
amalsaidov wants to merge 1 commit into
Conversation
XmlGraph.build selected methods with an unscoped '//methods/method' XPath, so it collected methods from every class in the skeleton, not just the requested package/class. With more than one class the graph ended up with extra nodes. Scope the query to the target package and class. Fixes cqfn#556 Signed-off-by: karma <inskarma0101@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While looking at #556 I noticed that
XmlGraph.buildselected methods with an unscoped//methods/methodXPath, which walks the whole skeleton. When the skeleton holds more than one class, the graph for one class ends up with nodes for other classes' methods too (the reporter saw 5 nodes instead of 2).This scopes the method query to the requested package and class, so only the target class's methods become nodes.
Added a regression test
buildsNodesOnlyForTheRequestedClassthat builds a skeleton with two classes (MethodMethodCallsandBar) and asserts the graph for one of them has exactly its 5 methods. Before the change it failed with "collection size was <8>"; after it passes.Tested with
mvn clean install -Pqulice -Denforcer.skip=true(BUILD SUCCESS, qulice clean).Fixes #556