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

Interface to Exclude Compilation Units From CtModel. #1037

Merged
merged 9 commits into from
Dec 16, 2016

Conversation

msteinbeck
Copy link
Contributor

fixes #985

Copy link
Collaborator

@monperrus monperrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks quite interesting, but there is an encapsulation issue.

* @return {@code true} if and only if {@code cud} should be excluded,
* {@code false} otherwise.
*/
boolean exclude(final CompilationUnitDeclaration cud, final String path);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a JDT interface. Ideally, all Spoon interfaces only depend on other Spoon interfaces (good encapsulation). What about changing to CompilationUnit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's why I stored this file in support/compiler/jdt rather than support/compiler/. Changing the parameter cud from CompilationUnitDeclaration to CompilationUnit should be feasible, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the other hand, doesn't JDTBasedSpoonCompiler.java have to traverse a compilation unit in order to produce a CompilationUnit. That's exactly what I want to avoid here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think removing the first parameter might be the best solution here.

@@ -413,7 +414,15 @@ protected boolean buildUnitsAndModel(JDTBuilder jdtBuilder, SpoonFolder sourcesF

protected void buildModel(CompilationUnitDeclaration[] units) {
JDTTreeBuilder builder = new JDTTreeBuilder(factory);
units:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change the name of the label because it is the same as the parameter. It is confusing.

Ex: unitLoop

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@msteinbeck
Copy link
Contributor Author

Is this PR ready to merge or do I miss something?

@surli surli merged commit 995aadf into INRIA:master Dec 16, 2016
@msteinbeck
Copy link
Contributor Author

Thank you for merging.

@monperrus
Copy link
Collaborator

monperrus commented Dec 16, 2016 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SpoonModelBuilder] Create a Model for Subset of Input
4 participants