Skip to content

feat: CtPackageDeclaration#2707

Merged
monperrus merged 3 commits intoINRIA:masterfrom
pvojtechovsky:feaPackDecl
Oct 23, 2018
Merged

feat: CtPackageDeclaration#2707
monperrus merged 3 commits intoINRIA:masterfrom
pvojtechovsky:feaPackDecl

Conversation

@pvojtechovsky
Copy link
Copy Markdown
Collaborator

This is new Spoon model element, which represents package declaration - the line at top of compilation unit. Example:

package your.nice.package.name;
...

It is needed to complete #2702 ... and at the sniper mode of compilation unit header.

Actually it is not used in CompilationUnit. I plan to add it to compilation unit in PR #2702, which changes CompilationUnit a lot so it makes no sense to add it now.

@spoon-bot
Copy link
Copy Markdown
Collaborator

API changes: 4 (Detected by Revapi)

Old API: fr.inria.gforge.spoon:spoon-core:jar:7.2.0-20181020.225215-41 / New API: fr.inria.gforge.spoon:spoon-core:jar:7.2.0-SNAPSHOT

Method was added to an interface.
Old none
New method CoreFactory#createPackageDeclaration()
Breaking binary: non_breaking,
Method was added to an interface.
Old none
New method Factory#createPackageDeclaration(String)
Breaking binary: non_breaking,
Method was added to an interface.
Old none
New method Factory#createPackageDeclaration(CtPackageReference)
Breaking binary: non_breaking,
Method was added to an interface.
Old none
New method CtVisitor#visitCtPackageDeclaration(CtPackageDeclaration)
Breaking binary: non_breaking,

@pvojtechovsky
Copy link
Copy Markdown
Collaborator Author

needs merge of #2706 first to pass tests

@pvojtechovsky
Copy link
Copy Markdown
Collaborator Author

I rebased on master. Now the test should pass. It is ready for review.

@monperrus
Copy link
Copy Markdown
Collaborator

LGTM. We need the corresponding tests to specify this new metamodel concept.

@pvojtechovsky
Copy link
Copy Markdown
Collaborator Author

This metamodel concept is used nowhere yet. It will be used in new CtCompilationUnit (PR #2702). So till then it is hard to test it.
It already pass all existing general API tests about parent/child and collection handling, etc.

I have no idea actually what else we should test here.

@pvojtechovsky
Copy link
Copy Markdown
Collaborator Author

I made this PR as a minimal baby step, which adds new metamodel element, which is needed by already big enough #2702

@monperrus
Copy link
Copy Markdown
Collaborator

monperrus commented Oct 23, 2018 via email

@pvojtechovsky
Copy link
Copy Markdown
Collaborator Author

It makes this PR more complicated ... (less baby)

  • I have to modify CompilationUnit and to add there code, which will be again removed in feat: CtPackageDeclaration #2707 ... so it is wasting of effort.
  • I have to learn and modify JDTTreeBuilder (so I would need more time for that) - I would like to have it as the last step - first we need a model and then we can fill it in and use it.

... therefore less compatible with #2707, which is the main purpose of this PR.

@monperrus monperrus merged commit 0a013ac into INRIA:master Oct 23, 2018
@monperrus
Copy link
Copy Markdown
Collaborator

I understand.

48 of 66 new or added lines in 13 files covered. (72.73%)

We can live with that :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants