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

Support java 7 #98

Merged
merged 6 commits into from
Dec 1, 2014
Merged

Support java 7 #98

merged 6 commits into from
Dec 1, 2014

Conversation

GerardPaligot
Copy link
Contributor

This PR includes all my contributions about the support of java 7 (for now, only test cases because spoon supports a lot of things about this version of java).

Some questions must to be discuss in the community. These questions are explained in these issues: #96 and #97.

Creates CtTryWithResource/Impl to represent a try-with-resource
and adds posibility to visit it. Improves tests to use the new
interface CtTryWithResource when it used the old one, CtTry.
Creates MultiTypedElement interface and extended by
CtLocalVariable to add the possibility to have multi
types for a local variable. For example, it is used
in multi catch in Java 7: there is one variable and
several types.
@GerardPaligot
Copy link
Contributor Author

This PR is now finished. It supports all java 7 concepts (see below) and all tests run.

Java 7 concepts:

  • Switch statement on a string
  • Rethrows exceptions in try catch
  • Try catch with resources
  • Multi catches with Java 7 syntax

Note: The diamond is supported but it indicates always the type in the diamond.

This PR is now ready to be merged.

@@ -17,6 +17,7 @@

package spoon.reflect.code;

import spoon.reflect.declaration.CtMultiTypedElement;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you remove this import ?

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.

Creates a new concept in the model, CtCatchVariable. This
interface defines an exception variable in a catch and can
be visitable. Now, CtCatch are returning a CtCatchVariable
with getParameter and not CtLocalVariable.
@monperrus monperrus merged commit 9656c63 into INRIA:master Dec 1, 2014
@GerardPaligot GerardPaligot deleted the support_java7 branch February 3, 2015 12:03
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.

None yet

3 participants