About Java 7 support

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

About Java 7 support

Freddy Mallet
Hi Oliver,

We would be happy to contribute to the support of java 7 [1]. Upgrading the current Antlr grammar should not be too complex (even if not simple) in order to support new java language enhancements : 
  • Strings in switch statements
  • try-with-resources statements
  • improved type inference for generic instance creation ("diamond")
  • better integral literals
  • and improved exception handling (multi-catch)
In ticket 3328367 [1], you mention the option to fully rewrite the Antlr grammar instead of simply updating the existing one. In few words, could you explain what would be the advantages of this solution and why you seem to prefer this second solution ?

Thanks
Freddy

[1] - http://sourceforge.net/tracker/?func=detail&aid=3328367&group_id=29721&atid=397078 you seem to be 
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: About Java 7 support

Oliver Burn
Hi Freddy,

Thanks for your kind offer.

My preference for a new grammar is motivated by the following thoughts:
  • Upgrade from ANTLRv2 to ANTLRv3 - there a numerous benefits to not being left behind, including newer features and the awesome ANTLRworks
  • The existing grammar has evolved along with the language - a fresh implementation maybe cleaner
  • Hoping to find a ANTLR grammar out there that somebody is maintaining. Bare in mind that when Java 8 comes out, where will be a series of changes to the grammar required.
That all said, it would be easier to patch the existing grammar. I would happily take a patch that does that. :-)

Regards,
Oliver

On Tue, Aug 16, 2011 at 01:57, Freddy Mallet <[hidden email]> wrote:
Hi Oliver,

We would be happy to contribute to the support of java 7 [1]. Upgrading the current Antlr grammar should not be too complex (even if not simple) in order to support new java language enhancements : 
  • Strings in switch statements
  • try-with-resources statements
  • improved type inference for generic instance creation ("diamond")
  • better integral literals
  • and improved exception handling (multi-catch)
In ticket 3328367 [1], you mention the option to fully rewrite the Antlr grammar instead of simply updating the existing one. In few words, could you explain what would be the advantages of this solution and why you seem to prefer this second solution ?

Thanks
Freddy

[1] - http://sourceforge.net/tracker/?func=detail&aid=3328367&group_id=29721&atid=397078 you seem to be 
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: About Java 7 support

Freddy Mallet-3
Thanks for your answer Oliver ! So we'll start with the first baby step to patch the current Antlr grammar. We should get back to you during the upcoming weeks. 

Kind regards,
Freddy
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Tue, Aug 16, 2011 at 4:34 AM, Oliver Burn <[hidden email]> wrote:
Hi Freddy,

Thanks for your kind offer.

My preference for a new grammar is motivated by the following thoughts:
  • Upgrade from ANTLRv2 to ANTLRv3 - there a numerous benefits to not being left behind, including newer features and the awesome ANTLRworks
  • The existing grammar has evolved along with the language - a fresh implementation maybe cleaner
  • Hoping to find a ANTLR grammar out there that somebody is maintaining. Bare in mind that when Java 8 comes out, where will be a series of changes to the grammar required.
That all said, it would be easier to patch the existing grammar. I would happily take a patch that does that. :-)

Regards,
Oliver

On Tue, Aug 16, 2011 at 01:57, Freddy Mallet <[hidden email]> wrote:
Hi Oliver,

We would be happy to contribute to the support of java 7 [1]. Upgrading the current Antlr grammar should not be too complex (even if not simple) in order to support new java language enhancements : 
  • Strings in switch statements
  • try-with-resources statements
  • improved type inference for generic instance creation ("diamond")
  • better integral literals
  • and improved exception handling (multi-catch)
In ticket 3328367 [1], you mention the option to fully rewrite the Antlr grammar instead of simply updating the existing one. In few words, could you explain what would be the advantages of this solution and why you seem to prefer this second solution ?

Thanks
Freddy

[1] - http://sourceforge.net/tracker/?func=detail&aid=3328367&group_id=29721&atid=397078 you seem to be 
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Re: About Java 7 support

Dinesh Bolkensteyn
Dear Olivier,

The patch is provided here: https://sourceforge.net/tracker/?func=detail&aid=3403265&group_id=29721&atid=397080

Note that, because SourceForge does not preserve spaces in the comment, the AST part is messed up, which is why I post the comment hereunder again.

*** Original comment attached to the patch ***

This patch adds the support for Java 7 to Checkstyle's ANTLR grammar.
It comes with 1 unit test for each new Java 7 language feature.

This patch should be backwards-compatible: AST for files which do not use Java 7 features should be left unchanged.

Impact by Java 7 language feature:

 1) String in switch: None, the grammar already supported this.

 2) Simplified variable arguments: None, the grammar should not be impacted by this feature.
 
 3) Binary integer literals and underscores in numerical literals: The tokens value in the AST will be identical as the one written in the source code.

 4) Diamond Generics: In presence of a diamond, the AST looks like:

+--TYPE_ARGUMENTS
    |
    +--GENERIC_START
    +--GENERIC_END

 5) try-with-resources: In presence of a try-with-resources, the AST looks like:

+--try
    |
    +--LPAREN (new node containing the "resource")
        |
        +--MODIFIERS
        +--TYPE
            |
            ...
        +--IDENT
        +--ASSIGN
        +--EXPR
            |
            ...
        +--RPAREN
    +--SLIST (list of statements of the try block, just like a try/catch)
        |
        ...
    +--LITERAL_CATCH (optionnally, if there was a catch, just like a try/catch)
    +… (unchanged, just like a try/catch)

 6) Multi-catch and more precise rethrow: In presence of a multi-catch, the AST looks like:
 
+--try
    |
    +--SLIST (list of statements of the try block)
        |
        ...
    +--LITERAL_CATCH
        |
        +--LPAREN
        +--PARAMETER_DEF
            |
            +--MODIFIERS
            +--TYPE
                |
                +--IDENT (containing the first exception to catch, or a DOT node if it is a fully qualified type)
                +--IDENT (containing the second exception to catch, or a DOT node if it is a fully qualified type)
                +--...
            +--IDENT (name of the exception variable)
        +--RPAREN
        +--SLIST (list of statements of the catch block)
            |
            ...

Kind regards,
 Dinesh Bolkensteyn

On Tue, Aug 16, 2011 at 10:07 AM, Freddy Mallet <[hidden email]> wrote:
Thanks for your answer Oliver ! So we'll start with the first baby step to patch the current Antlr grammar. We should get back to you during the upcoming weeks. 

Kind regards,
Freddy
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Tue, Aug 16, 2011 at 4:34 AM, Oliver Burn <[hidden email]> wrote:
Hi Freddy,

Thanks for your kind offer.

My preference for a new grammar is motivated by the following thoughts:
  • Upgrade from ANTLRv2 to ANTLRv3 - there a numerous benefits to not being left behind, including newer features and the awesome ANTLRworks
  • The existing grammar has evolved along with the language - a fresh implementation maybe cleaner
  • Hoping to find a ANTLR grammar out there that somebody is maintaining. Bare in mind that when Java 8 comes out, where will be a series of changes to the grammar required.
That all said, it would be easier to patch the existing grammar. I would happily take a patch that does that. :-)

Regards,
Oliver

On Tue, Aug 16, 2011 at 01:57, Freddy Mallet <[hidden email]> wrote:
Hi Oliver,

We would be happy to contribute to the support of java 7 [1]. Upgrading the current Antlr grammar should not be too complex (even if not simple) in order to support new java language enhancements : 
  • Strings in switch statements
  • try-with-resources statements
  • improved type inference for generic instance creation ("diamond")
  • better integral literals
  • and improved exception handling (multi-catch)
In ticket 3328367 [1], you mention the option to fully rewrite the Antlr grammar instead of simply updating the existing one. In few words, could you explain what would be the advantages of this solution and why you seem to prefer this second solution ?

Thanks
Freddy

[1] - http://sourceforge.net/tracker/?func=detail&aid=3328367&group_id=29721&atid=397078 you seem to be 
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user




------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Re: About Java 7 support

Oliver Burn
Thanks - I will look at the patch this week.

On Fri, Sep 2, 2011 at 23:42, Dinesh Bolkensteyn <[hidden email]> wrote:
Dear Olivier,

The patch is provided here: https://sourceforge.net/tracker/?func=detail&aid=3403265&group_id=29721&atid=397080

Note that, because SourceForge does not preserve spaces in the comment, the AST part is messed up, which is why I post the comment hereunder again.

*** Original comment attached to the patch ***

This patch adds the support for Java 7 to Checkstyle's ANTLR grammar.
It comes with 1 unit test for each new Java 7 language feature.

This patch should be backwards-compatible: AST for files which do not use Java 7 features should be left unchanged.

Impact by Java 7 language feature:

 1) String in switch: None, the grammar already supported this.

 2) Simplified variable arguments: None, the grammar should not be impacted by this feature.
 
 3) Binary integer literals and underscores in numerical literals: The tokens value in the AST will be identical as the one written in the source code.

 4) Diamond Generics: In presence of a diamond, the AST looks like:

+--TYPE_ARGUMENTS
    |
    +--GENERIC_START
    +--GENERIC_END

 5) try-with-resources: In presence of a try-with-resources, the AST looks like:

+--try
    |
    +--LPAREN (new node containing the "resource")
        |
        +--MODIFIERS
        +--TYPE
            |
            ...
        +--IDENT
        +--ASSIGN
        +--EXPR
            |
            ...
        +--RPAREN
    +--SLIST (list of statements of the try block, just like a try/catch)
        |
        ...
    +--LITERAL_CATCH (optionnally, if there was a catch, just like a try/catch)
    +… (unchanged, just like a try/catch)

 6) Multi-catch and more precise rethrow: In presence of a multi-catch, the AST looks like:
 
+--try
    |
    +--SLIST (list of statements of the try block)
        |
        ...
    +--LITERAL_CATCH
        |
        +--LPAREN
        +--PARAMETER_DEF
            |
            +--MODIFIERS
            +--TYPE
                |
                +--IDENT (containing the first exception to catch, or a DOT node if it is a fully qualified type)
                +--IDENT (containing the second exception to catch, or a DOT node if it is a fully qualified type)
                +--...
            +--IDENT (name of the exception variable)
        +--RPAREN
        +--SLIST (list of statements of the catch block)
            |
            ...

Kind regards,
 Dinesh Bolkensteyn

On Tue, Aug 16, 2011 at 10:07 AM, Freddy Mallet <[hidden email]> wrote:
Thanks for your answer Oliver ! So we'll start with the first baby step to patch the current Antlr grammar. We should get back to you during the upcoming weeks. 

Kind regards,
Freddy
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Tue, Aug 16, 2011 at 4:34 AM, Oliver Burn <[hidden email]> wrote:
Hi Freddy,

Thanks for your kind offer.

My preference for a new grammar is motivated by the following thoughts:
  • Upgrade from ANTLRv2 to ANTLRv3 - there a numerous benefits to not being left behind, including newer features and the awesome ANTLRworks
  • The existing grammar has evolved along with the language - a fresh implementation maybe cleaner
  • Hoping to find a ANTLR grammar out there that somebody is maintaining. Bare in mind that when Java 8 comes out, where will be a series of changes to the grammar required.
That all said, it would be easier to patch the existing grammar. I would happily take a patch that does that. :-)

Regards,
Oliver

On Tue, Aug 16, 2011 at 01:57, Freddy Mallet <[hidden email]> wrote:
Hi Oliver,

We would be happy to contribute to the support of java 7 [1]. Upgrading the current Antlr grammar should not be too complex (even if not simple) in order to support new java language enhancements : 
  • Strings in switch statements
  • try-with-resources statements
  • improved type inference for generic instance creation ("diamond")
  • better integral literals
  • and improved exception handling (multi-catch)
In ticket 3328367 [1], you mention the option to fully rewrite the Antlr grammar instead of simply updating the existing one. In few words, could you explain what would be the advantages of this solution and why you seem to prefer this second solution ?

Thanks
Freddy

[1] - http://sourceforge.net/tracker/?func=detail&aid=3328367&group_id=29721&atid=397078 you seem to be 
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user




------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Re: About Java 7 support

Freddy Mallet-3
In reply to this post by Dinesh Bolkensteyn
Hi Evgeny,

In fact Dinesh already tried to fix the java grammar to handle this use case but that's a bit tricky so we decided to postpone this investigation.

Freddy  

----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Mon, Sep 5, 2011 at 10:30 PM, Evgeny Mandrikov <[hidden email]> wrote:
Dinesh FYI another interesting open issue is about analysis of Java 1.4 code, where enum can be used as an identifier : http://jira.codehaus.org/browse/SONAR-1653


On Mon, Sep 5, 2011 at 19:56, Evgeny Mandrikov <[hidden email]> wrote:
Hi all,

FYI: I tested this patch by applying it locally on Checkstyle 5.5-SNAPSHOT and using this version in Sonar.
And it works like a charm for simple project, which uses all language features of Java 7 ( https://github.com/Godin/sonar-experiments/tree/master/java7-language-features ).
Congratulations Dinesh!

However Dinesh, could you please also take a look on another parsing issue, which is still present in 5.5-SNAPSHOT : http://sourceforge.net/tracker/?func=detail&atid=397078&aid=1667137&group_id=29721
Currently in Sonar we have a workaround - we simply ignore this error, but IMO would be better to fix it, if you can ;)

On Fri, Sep 2, 2011 at 17:42, Dinesh Bolkensteyn <[hidden email]> wrote:
Dear Olivier,

The patch is provided here: https://sourceforge.net/tracker/?func=detail&aid=3403265&group_id=29721&atid=397080

Note that, because SourceForge does not preserve spaces in the comment, the AST part is messed up, which is why I post the comment hereunder again.

*** Original comment attached to the patch ***

This patch adds the support for Java 7 to Checkstyle's ANTLR grammar.
It comes with 1 unit test for each new Java 7 language feature.

This patch should be backwards-compatible: AST for files which do not use Java 7 features should be left unchanged.

Impact by Java 7 language feature:

 1) String in switch: None, the grammar already supported this.

 2) Simplified variable arguments: None, the grammar should not be impacted by this feature.
 
 3) Binary integer literals and underscores in numerical literals: The tokens value in the AST will be identical as the one written in the source code.

 4) Diamond Generics: In presence of a diamond, the AST looks like:

+--TYPE_ARGUMENTS
    |
    +--GENERIC_START
    +--GENERIC_END

 5) try-with-resources: In presence of a try-with-resources, the AST looks like:

+--try
    |
    +--LPAREN (new node containing the "resource")
        |
        +--MODIFIERS
        +--TYPE
            |
            ...
        +--IDENT
        +--ASSIGN
        +--EXPR
            |
            ...
        +--RPAREN
    +--SLIST (list of statements of the try block, just like a try/catch)
        |
        ...
    +--LITERAL_CATCH (optionnally, if there was a catch, just like a try/catch)
    +… (unchanged, just like a try/catch)

 6) Multi-catch and more precise rethrow: In presence of a multi-catch, the AST looks like:
 
+--try
    |
    +--SLIST (list of statements of the try block)
        |
        ...
    +--LITERAL_CATCH
        |
        +--LPAREN
        +--PARAMETER_DEF
            |
            +--MODIFIERS
            +--TYPE
                |
                +--IDENT (containing the first exception to catch, or a DOT node if it is a fully qualified type)
                +--IDENT (containing the second exception to catch, or a DOT node if it is a fully qualified type)
                +--...
            +--IDENT (name of the exception variable)
        +--RPAREN
        +--SLIST (list of statements of the catch block)
            |
            ...

Kind regards,
 Dinesh Bolkensteyn


On Tue, Aug 16, 2011 at 10:07 AM, Freddy Mallet <[hidden email]> wrote:
Thanks for your answer Oliver ! So we'll start with the first baby step to patch the current Antlr grammar. We should get back to you during the upcoming weeks. 

Kind regards,
Freddy
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Tue, Aug 16, 2011 at 4:34 AM, Oliver Burn <[hidden email]> wrote:
Hi Freddy,

Thanks for your kind offer.

My preference for a new grammar is motivated by the following thoughts:
  • Upgrade from ANTLRv2 to ANTLRv3 - there a numerous benefits to not being left behind, including newer features and the awesome ANTLRworks
  • The existing grammar has evolved along with the language - a fresh implementation maybe cleaner
  • Hoping to find a ANTLR grammar out there that somebody is maintaining. Bare in mind that when Java 8 comes out, where will be a series of changes to the grammar required.
That all said, it would be easier to patch the existing grammar. I would happily take a patch that does that. :-)

Regards,
Oliver

On Tue, Aug 16, 2011 at 01:57, Freddy Mallet <[hidden email]> wrote:
Hi Oliver,

We would be happy to contribute to the support of java 7 [1]. Upgrading the current Antlr grammar should not be too complex (even if not simple) in order to support new java language enhancements : 
  • Strings in switch statements
  • try-with-resources statements
  • improved type inference for generic instance creation ("diamond")
  • better integral literals
  • and improved exception handling (multi-catch)
In ticket 3328367 [1], you mention the option to fully rewrite the Antlr grammar instead of simply updating the existing one. In few words, could you explain what would be the advantages of this solution and why you seem to prefer this second solution ?

Thanks
Freddy

[1] - http://sourceforge.net/tracker/?func=detail&aid=3328367&group_id=29721&atid=397078 you seem to be 
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user






--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_



--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_


------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Re: About Java 7 support

Dinesh Bolkensteyn
There is already a proposed patch for the EOF issue from Lukas Platinsky @ https://sourceforge.net/tracker/?func=detail&aid=3393810&group_id=29721&atid=397080
(which I did not try)

Indeed the support for "enum" as an identifier (Java 4) is still an open issue.

--
Dinesh Bolkensteyn
Tweeting? http://twitter.com/DBolkensteyn

www.SonarSource.org
www.SonarSource.com




On Mon, Sep 5, 2011 at 10:49 PM, Freddy Mallet <[hidden email]> wrote:
Hi Evgeny,

In fact Dinesh already tried to fix the java grammar to handle this use case but that's a bit tricky so we decided to postpone this investigation.

Freddy  

----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Mon, Sep 5, 2011 at 10:30 PM, Evgeny Mandrikov <[hidden email]> wrote:
Dinesh FYI another interesting open issue is about analysis of Java 1.4 code, where enum can be used as an identifier : http://jira.codehaus.org/browse/SONAR-1653


On Mon, Sep 5, 2011 at 19:56, Evgeny Mandrikov <[hidden email]> wrote:
Hi all,

FYI: I tested this patch by applying it locally on Checkstyle 5.5-SNAPSHOT and using this version in Sonar.
And it works like a charm for simple project, which uses all language features of Java 7 ( https://github.com/Godin/sonar-experiments/tree/master/java7-language-features ).
Congratulations Dinesh!

However Dinesh, could you please also take a look on another parsing issue, which is still present in 5.5-SNAPSHOT : http://sourceforge.net/tracker/?func=detail&atid=397078&aid=1667137&group_id=29721
Currently in Sonar we have a workaround - we simply ignore this error, but IMO would be better to fix it, if you can ;)

On Fri, Sep 2, 2011 at 17:42, Dinesh Bolkensteyn <[hidden email]> wrote:
Dear Olivier,

The patch is provided here: https://sourceforge.net/tracker/?func=detail&aid=3403265&group_id=29721&atid=397080

Note that, because SourceForge does not preserve spaces in the comment, the AST part is messed up, which is why I post the comment hereunder again.

*** Original comment attached to the patch ***

This patch adds the support for Java 7 to Checkstyle's ANTLR grammar.
It comes with 1 unit test for each new Java 7 language feature.

This patch should be backwards-compatible: AST for files which do not use Java 7 features should be left unchanged.

Impact by Java 7 language feature:

 1) String in switch: None, the grammar already supported this.

 2) Simplified variable arguments: None, the grammar should not be impacted by this feature.
 
 3) Binary integer literals and underscores in numerical literals: The tokens value in the AST will be identical as the one written in the source code.

 4) Diamond Generics: In presence of a diamond, the AST looks like:

+--TYPE_ARGUMENTS
    |
    +--GENERIC_START
    +--GENERIC_END

 5) try-with-resources: In presence of a try-with-resources, the AST looks like:

+--try
    |
    +--LPAREN (new node containing the "resource")
        |
        +--MODIFIERS
        +--TYPE
            |
            ...
        +--IDENT
        +--ASSIGN
        +--EXPR
            |
            ...
        +--RPAREN
    +--SLIST (list of statements of the try block, just like a try/catch)
        |
        ...
    +--LITERAL_CATCH (optionnally, if there was a catch, just like a try/catch)
    +… (unchanged, just like a try/catch)

 6) Multi-catch and more precise rethrow: In presence of a multi-catch, the AST looks like:
 
+--try
    |
    +--SLIST (list of statements of the try block)
        |
        ...
    +--LITERAL_CATCH
        |
        +--LPAREN
        +--PARAMETER_DEF
            |
            +--MODIFIERS
            +--TYPE
                |
                +--IDENT (containing the first exception to catch, or a DOT node if it is a fully qualified type)
                +--IDENT (containing the second exception to catch, or a DOT node if it is a fully qualified type)
                +--...
            +--IDENT (name of the exception variable)
        +--RPAREN
        +--SLIST (list of statements of the catch block)
            |
            ...

Kind regards,
 Dinesh Bolkensteyn


On Tue, Aug 16, 2011 at 10:07 AM, Freddy Mallet <[hidden email]> wrote:
Thanks for your answer Oliver ! So we'll start with the first baby step to patch the current Antlr grammar. We should get back to you during the upcoming weeks. 

Kind regards,
Freddy
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Tue, Aug 16, 2011 at 4:34 AM, Oliver Burn <[hidden email]> wrote:
Hi Freddy,

Thanks for your kind offer.

My preference for a new grammar is motivated by the following thoughts:
  • Upgrade from ANTLRv2 to ANTLRv3 - there a numerous benefits to not being left behind, including newer features and the awesome ANTLRworks
  • The existing grammar has evolved along with the language - a fresh implementation maybe cleaner
  • Hoping to find a ANTLR grammar out there that somebody is maintaining. Bare in mind that when Java 8 comes out, where will be a series of changes to the grammar required.
That all said, it would be easier to patch the existing grammar. I would happily take a patch that does that. :-)

Regards,
Oliver

On Tue, Aug 16, 2011 at 01:57, Freddy Mallet <[hidden email]> wrote:
Hi Oliver,

We would be happy to contribute to the support of java 7 [1]. Upgrading the current Antlr grammar should not be too complex (even if not simple) in order to support new java language enhancements : 
  • Strings in switch statements
  • try-with-resources statements
  • improved type inference for generic instance creation ("diamond")
  • better integral literals
  • and improved exception handling (multi-catch)
In ticket 3328367 [1], you mention the option to fully rewrite the Antlr grammar instead of simply updating the existing one. In few words, could you explain what would be the advantages of this solution and why you seem to prefer this second solution ?

Thanks
Freddy

[1] - http://sourceforge.net/tracker/?func=detail&aid=3328367&group_id=29721&atid=397078 you seem to be 
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user






--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_



--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_



------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Re: About Java 7 support

Oliver Burn
The patch has been applied to Checkstyle.

Thanks!

On Tue, Sep 6, 2011 at 18:15, Dinesh Bolkensteyn <[hidden email]> wrote:
There is already a proposed patch for the EOF issue from Lukas Platinsky @ https://sourceforge.net/tracker/?func=detail&aid=3393810&group_id=29721&atid=397080
(which I did not try)

Indeed the support for "enum" as an identifier (Java 4) is still an open issue.

--
Dinesh Bolkensteyn
Tweeting? http://twitter.com/DBolkensteyn
On Mon, Sep 5, 2011 at 10:49 PM, Freddy Mallet <[hidden email]> wrote:
Hi Evgeny,

In fact Dinesh already tried to fix the java grammar to handle this use case but that's a bit tricky so we decided to postpone this investigation.

Freddy  

----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Mon, Sep 5, 2011 at 10:30 PM, Evgeny Mandrikov <[hidden email]> wrote:
Dinesh FYI another interesting open issue is about analysis of Java 1.4 code, where enum can be used as an identifier : http://jira.codehaus.org/browse/SONAR-1653


On Mon, Sep 5, 2011 at 19:56, Evgeny Mandrikov <[hidden email]> wrote:
Hi all,

FYI: I tested this patch by applying it locally on Checkstyle 5.5-SNAPSHOT and using this version in Sonar.
And it works like a charm for simple project, which uses all language features of Java 7 ( https://github.com/Godin/sonar-experiments/tree/master/java7-language-features ).
Congratulations Dinesh!

However Dinesh, could you please also take a look on another parsing issue, which is still present in 5.5-SNAPSHOT : http://sourceforge.net/tracker/?func=detail&atid=397078&aid=1667137&group_id=29721
Currently in Sonar we have a workaround - we simply ignore this error, but IMO would be better to fix it, if you can ;)

On Fri, Sep 2, 2011 at 17:42, Dinesh Bolkensteyn <[hidden email]> wrote:
Dear Olivier,

The patch is provided here: https://sourceforge.net/tracker/?func=detail&aid=3403265&group_id=29721&atid=397080

Note that, because SourceForge does not preserve spaces in the comment, the AST part is messed up, which is why I post the comment hereunder again.

*** Original comment attached to the patch ***

This patch adds the support for Java 7 to Checkstyle's ANTLR grammar.
It comes with 1 unit test for each new Java 7 language feature.

This patch should be backwards-compatible: AST for files which do not use Java 7 features should be left unchanged.

Impact by Java 7 language feature:

 1) String in switch: None, the grammar already supported this.

 2) Simplified variable arguments: None, the grammar should not be impacted by this feature.
 
 3) Binary integer literals and underscores in numerical literals: The tokens value in the AST will be identical as the one written in the source code.

 4) Diamond Generics: In presence of a diamond, the AST looks like:

+--TYPE_ARGUMENTS
    |
    +--GENERIC_START
    +--GENERIC_END

 5) try-with-resources: In presence of a try-with-resources, the AST looks like:

+--try
    |
    +--LPAREN (new node containing the "resource")
        |
        +--MODIFIERS
        +--TYPE
            |
            ...
        +--IDENT
        +--ASSIGN
        +--EXPR
            |
            ...
        +--RPAREN
    +--SLIST (list of statements of the try block, just like a try/catch)
        |
        ...
    +--LITERAL_CATCH (optionnally, if there was a catch, just like a try/catch)
    +… (unchanged, just like a try/catch)

 6) Multi-catch and more precise rethrow: In presence of a multi-catch, the AST looks like:
 
+--try
    |
    +--SLIST (list of statements of the try block)
        |
        ...
    +--LITERAL_CATCH
        |
        +--LPAREN
        +--PARAMETER_DEF
            |
            +--MODIFIERS
            +--TYPE
                |
                +--IDENT (containing the first exception to catch, or a DOT node if it is a fully qualified type)
                +--IDENT (containing the second exception to catch, or a DOT node if it is a fully qualified type)
                +--...
            +--IDENT (name of the exception variable)
        +--RPAREN
        +--SLIST (list of statements of the catch block)
            |
            ...

Kind regards,
 Dinesh Bolkensteyn


On Tue, Aug 16, 2011 at 10:07 AM, Freddy Mallet <[hidden email]> wrote:
Thanks for your answer Oliver ! So we'll start with the first baby step to patch the current Antlr grammar. We should get back to you during the upcoming weeks. 

Kind regards,
Freddy
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Tue, Aug 16, 2011 at 4:34 AM, Oliver Burn <[hidden email]> wrote:
Hi Freddy,

Thanks for your kind offer.

My preference for a new grammar is motivated by the following thoughts:
  • Upgrade from ANTLRv2 to ANTLRv3 - there a numerous benefits to not being left behind, including newer features and the awesome ANTLRworks
  • The existing grammar has evolved along with the language - a fresh implementation maybe cleaner
  • Hoping to find a ANTLR grammar out there that somebody is maintaining. Bare in mind that when Java 8 comes out, where will be a series of changes to the grammar required.
That all said, it would be easier to patch the existing grammar. I would happily take a patch that does that. :-)

Regards,
Oliver

On Tue, Aug 16, 2011 at 01:57, Freddy Mallet <[hidden email]> wrote:
Hi Oliver,

We would be happy to contribute to the support of java 7 [1]. Upgrading the current Antlr grammar should not be too complex (even if not simple) in order to support new java language enhancements : 
  • Strings in switch statements
  • try-with-resources statements
  • improved type inference for generic instance creation ("diamond")
  • better integral literals
  • and improved exception handling (multi-catch)
In ticket 3328367 [1], you mention the option to fully rewrite the Antlr grammar instead of simply updating the existing one. In few words, could you explain what would be the advantages of this solution and why you seem to prefer this second solution ?

Thanks
Freddy

[1] - http://sourceforge.net/tracker/?func=detail&aid=3328367&group_id=29721&atid=397078 you seem to be 
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user






--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_



--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_



------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Re: About Java 7 support

Freddy Mallet
Thanks Oliver !

Just in case, do you have any idea when the release of Checkstyle 5.5 might occur ?

----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Tue, Sep 6, 2011 at 1:37 PM, Oliver Burn <[hidden email]> wrote:
The patch has been applied to Checkstyle.

Thanks!

On Tue, Sep 6, 2011 at 18:15, Dinesh Bolkensteyn <[hidden email]> wrote:
There is already a proposed patch for the EOF issue from Lukas Platinsky @ https://sourceforge.net/tracker/?func=detail&aid=3393810&group_id=29721&atid=397080
(which I did not try)

Indeed the support for "enum" as an identifier (Java 4) is still an open issue.

--
Dinesh Bolkensteyn
Tweeting? http://twitter.com/DBolkensteyn
On Mon, Sep 5, 2011 at 10:49 PM, Freddy Mallet <[hidden email]> wrote:
Hi Evgeny,

In fact Dinesh already tried to fix the java grammar to handle this use case but that's a bit tricky so we decided to postpone this investigation.

Freddy  

----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Mon, Sep 5, 2011 at 10:30 PM, Evgeny Mandrikov <[hidden email]> wrote:
Dinesh FYI another interesting open issue is about analysis of Java 1.4 code, where enum can be used as an identifier : http://jira.codehaus.org/browse/SONAR-1653


On Mon, Sep 5, 2011 at 19:56, Evgeny Mandrikov <[hidden email]> wrote:
Hi all,

FYI: I tested this patch by applying it locally on Checkstyle 5.5-SNAPSHOT and using this version in Sonar.
And it works like a charm for simple project, which uses all language features of Java 7 ( https://github.com/Godin/sonar-experiments/tree/master/java7-language-features ).
Congratulations Dinesh!

However Dinesh, could you please also take a look on another parsing issue, which is still present in 5.5-SNAPSHOT : http://sourceforge.net/tracker/?func=detail&atid=397078&aid=1667137&group_id=29721
Currently in Sonar we have a workaround - we simply ignore this error, but IMO would be better to fix it, if you can ;)

On Fri, Sep 2, 2011 at 17:42, Dinesh Bolkensteyn <[hidden email]> wrote:
Dear Olivier,

The patch is provided here: https://sourceforge.net/tracker/?func=detail&aid=3403265&group_id=29721&atid=397080

Note that, because SourceForge does not preserve spaces in the comment, the AST part is messed up, which is why I post the comment hereunder again.

*** Original comment attached to the patch ***

This patch adds the support for Java 7 to Checkstyle's ANTLR grammar.
It comes with 1 unit test for each new Java 7 language feature.

This patch should be backwards-compatible: AST for files which do not use Java 7 features should be left unchanged.

Impact by Java 7 language feature:

 1) String in switch: None, the grammar already supported this.

 2) Simplified variable arguments: None, the grammar should not be impacted by this feature.
 
 3) Binary integer literals and underscores in numerical literals: The tokens value in the AST will be identical as the one written in the source code.

 4) Diamond Generics: In presence of a diamond, the AST looks like:

+--TYPE_ARGUMENTS
    |
    +--GENERIC_START
    +--GENERIC_END

 5) try-with-resources: In presence of a try-with-resources, the AST looks like:

+--try
    |
    +--LPAREN (new node containing the "resource")
        |
        +--MODIFIERS
        +--TYPE
            |
            ...
        +--IDENT
        +--ASSIGN
        +--EXPR
            |
            ...
        +--RPAREN
    +--SLIST (list of statements of the try block, just like a try/catch)
        |
        ...
    +--LITERAL_CATCH (optionnally, if there was a catch, just like a try/catch)
    +… (unchanged, just like a try/catch)

 6) Multi-catch and more precise rethrow: In presence of a multi-catch, the AST looks like:
 
+--try
    |
    +--SLIST (list of statements of the try block)
        |
        ...
    +--LITERAL_CATCH
        |
        +--LPAREN
        +--PARAMETER_DEF
            |
            +--MODIFIERS
            +--TYPE
                |
                +--IDENT (containing the first exception to catch, or a DOT node if it is a fully qualified type)
                +--IDENT (containing the second exception to catch, or a DOT node if it is a fully qualified type)
                +--...
            +--IDENT (name of the exception variable)
        +--RPAREN
        +--SLIST (list of statements of the catch block)
            |
            ...

Kind regards,
 Dinesh Bolkensteyn


On Tue, Aug 16, 2011 at 10:07 AM, Freddy Mallet <[hidden email]> wrote:
Thanks for your answer Oliver ! So we'll start with the first baby step to patch the current Antlr grammar. We should get back to you during the upcoming weeks. 

Kind regards,
Freddy
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Tue, Aug 16, 2011 at 4:34 AM, Oliver Burn <[hidden email]> wrote:
Hi Freddy,

Thanks for your kind offer.

My preference for a new grammar is motivated by the following thoughts:
  • Upgrade from ANTLRv2 to ANTLRv3 - there a numerous benefits to not being left behind, including newer features and the awesome ANTLRworks
  • The existing grammar has evolved along with the language - a fresh implementation maybe cleaner
  • Hoping to find a ANTLR grammar out there that somebody is maintaining. Bare in mind that when Java 8 comes out, where will be a series of changes to the grammar required.
That all said, it would be easier to patch the existing grammar. I would happily take a patch that does that. :-)

Regards,
Oliver

On Tue, Aug 16, 2011 at 01:57, Freddy Mallet <[hidden email]> wrote:
Hi Oliver,

We would be happy to contribute to the support of java 7 [1]. Upgrading the current Antlr grammar should not be too complex (even if not simple) in order to support new java language enhancements : 
  • Strings in switch statements
  • try-with-resources statements
  • improved type inference for generic instance creation ("diamond")
  • better integral literals
  • and improved exception handling (multi-catch)
In ticket 3328367 [1], you mention the option to fully rewrite the Antlr grammar instead of simply updating the existing one. In few words, could you explain what would be the advantages of this solution and why you seem to prefer this second solution ?

Thanks
Freddy

[1] - http://sourceforge.net/tracker/?func=detail&aid=3328367&group_id=29721&atid=397078 you seem to be 
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user






--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_



--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_



------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Re: About Java 7 support

Oliver Burn
Hopefully in the next month.

I'd like to test it out first for bit.

On Wed, Sep 7, 2011 at 18:14, Freddy Mallet <[hidden email]> wrote:
Thanks Oliver !

Just in case, do you have any idea when the release of Checkstyle 5.5 might occur ?

----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Tue, Sep 6, 2011 at 1:37 PM, Oliver Burn <[hidden email]> wrote:
The patch has been applied to Checkstyle.

Thanks!

On Tue, Sep 6, 2011 at 18:15, Dinesh Bolkensteyn <[hidden email]> wrote:
There is already a proposed patch for the EOF issue from Lukas Platinsky @ https://sourceforge.net/tracker/?func=detail&aid=3393810&group_id=29721&atid=397080
(which I did not try)

Indeed the support for "enum" as an identifier (Java 4) is still an open issue.

--
Dinesh Bolkensteyn
Tweeting? http://twitter.com/DBolkensteyn
On Mon, Sep 5, 2011 at 10:49 PM, Freddy Mallet <[hidden email]> wrote:
Hi Evgeny,

In fact Dinesh already tried to fix the java grammar to handle this use case but that's a bit tricky so we decided to postpone this investigation.

Freddy  

----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Mon, Sep 5, 2011 at 10:30 PM, Evgeny Mandrikov <[hidden email]> wrote:
Dinesh FYI another interesting open issue is about analysis of Java 1.4 code, where enum can be used as an identifier : http://jira.codehaus.org/browse/SONAR-1653


On Mon, Sep 5, 2011 at 19:56, Evgeny Mandrikov <[hidden email]> wrote:
Hi all,

FYI: I tested this patch by applying it locally on Checkstyle 5.5-SNAPSHOT and using this version in Sonar.
And it works like a charm for simple project, which uses all language features of Java 7 ( https://github.com/Godin/sonar-experiments/tree/master/java7-language-features ).
Congratulations Dinesh!

However Dinesh, could you please also take a look on another parsing issue, which is still present in 5.5-SNAPSHOT : http://sourceforge.net/tracker/?func=detail&atid=397078&aid=1667137&group_id=29721
Currently in Sonar we have a workaround - we simply ignore this error, but IMO would be better to fix it, if you can ;)

On Fri, Sep 2, 2011 at 17:42, Dinesh Bolkensteyn <[hidden email]> wrote:
Dear Olivier,

The patch is provided here: https://sourceforge.net/tracker/?func=detail&aid=3403265&group_id=29721&atid=397080

Note that, because SourceForge does not preserve spaces in the comment, the AST part is messed up, which is why I post the comment hereunder again.

*** Original comment attached to the patch ***

This patch adds the support for Java 7 to Checkstyle's ANTLR grammar.
It comes with 1 unit test for each new Java 7 language feature.

This patch should be backwards-compatible: AST for files which do not use Java 7 features should be left unchanged.

Impact by Java 7 language feature:

 1) String in switch: None, the grammar already supported this.

 2) Simplified variable arguments: None, the grammar should not be impacted by this feature.
 
 3) Binary integer literals and underscores in numerical literals: The tokens value in the AST will be identical as the one written in the source code.

 4) Diamond Generics: In presence of a diamond, the AST looks like:

+--TYPE_ARGUMENTS
    |
    +--GENERIC_START
    +--GENERIC_END

 5) try-with-resources: In presence of a try-with-resources, the AST looks like:

+--try
    |
    +--LPAREN (new node containing the "resource")
        |
        +--MODIFIERS
        +--TYPE
            |
            ...
        +--IDENT
        +--ASSIGN
        +--EXPR
            |
            ...
        +--RPAREN
    +--SLIST (list of statements of the try block, just like a try/catch)
        |
        ...
    +--LITERAL_CATCH (optionnally, if there was a catch, just like a try/catch)
    +… (unchanged, just like a try/catch)

 6) Multi-catch and more precise rethrow: In presence of a multi-catch, the AST looks like:
 
+--try
    |
    +--SLIST (list of statements of the try block)
        |
        ...
    +--LITERAL_CATCH
        |
        +--LPAREN
        +--PARAMETER_DEF
            |
            +--MODIFIERS
            +--TYPE
                |
                +--IDENT (containing the first exception to catch, or a DOT node if it is a fully qualified type)
                +--IDENT (containing the second exception to catch, or a DOT node if it is a fully qualified type)
                +--...
            +--IDENT (name of the exception variable)
        +--RPAREN
        +--SLIST (list of statements of the catch block)
            |
            ...

Kind regards,
 Dinesh Bolkensteyn


On Tue, Aug 16, 2011 at 10:07 AM, Freddy Mallet <[hidden email]> wrote:
Thanks for your answer Oliver ! So we'll start with the first baby step to patch the current Antlr grammar. We should get back to you during the upcoming weeks. 

Kind regards,
Freddy
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Tue, Aug 16, 2011 at 4:34 AM, Oliver Burn <[hidden email]> wrote:
Hi Freddy,

Thanks for your kind offer.

My preference for a new grammar is motivated by the following thoughts:
  • Upgrade from ANTLRv2 to ANTLRv3 - there a numerous benefits to not being left behind, including newer features and the awesome ANTLRworks
  • The existing grammar has evolved along with the language - a fresh implementation maybe cleaner
  • Hoping to find a ANTLR grammar out there that somebody is maintaining. Bare in mind that when Java 8 comes out, where will be a series of changes to the grammar required.
That all said, it would be easier to patch the existing grammar. I would happily take a patch that does that. :-)

Regards,
Oliver

On Tue, Aug 16, 2011 at 01:57, Freddy Mallet <[hidden email]> wrote:
Hi Oliver,

We would be happy to contribute to the support of java 7 [1]. Upgrading the current Antlr grammar should not be too complex (even if not simple) in order to support new java language enhancements : 
  • Strings in switch statements
  • try-with-resources statements
  • improved type inference for generic instance creation ("diamond")
  • better integral literals
  • and improved exception handling (multi-catch)
In ticket 3328367 [1], you mention the option to fully rewrite the Antlr grammar instead of simply updating the existing one. In few words, could you explain what would be the advantages of this solution and why you seem to prefer this second solution ?

Thanks
Freddy

[1] - http://sourceforge.net/tracker/?func=detail&aid=3328367&group_id=29721&atid=397078 you seem to be 
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user






--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_



--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_



------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Re: About Java 7 support

Oliver Burn
Hi Freddy,

Prior to the release I have been testing against Java 7 code base and I found an error. I have re-opened https://sourceforge.net/tracker/index.php?func=detail&aid=3403265&group_id=29721&atid=397080 with the details.

It would be great if Dinesh has a look at it.

Thanks,
Oliver

On Wed, Sep 7, 2011 at 22:50, Oliver Burn <[hidden email]> wrote:
Hopefully in the next month.

I'd like to test it out first for bit.

On Wed, Sep 7, 2011 at 18:14, Freddy Mallet <[hidden email]> wrote:
Thanks Oliver !

Just in case, do you have any idea when the release of Checkstyle 5.5 might occur ?

----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Tue, Sep 6, 2011 at 1:37 PM, Oliver Burn <[hidden email]> wrote:
The patch has been applied to Checkstyle.

Thanks!

On Tue, Sep 6, 2011 at 18:15, Dinesh Bolkensteyn <[hidden email]> wrote:
There is already a proposed patch for the EOF issue from Lukas Platinsky @ https://sourceforge.net/tracker/?func=detail&aid=3393810&group_id=29721&atid=397080
(which I did not try)

Indeed the support for "enum" as an identifier (Java 4) is still an open issue.

--
Dinesh Bolkensteyn
Tweeting? http://twitter.com/DBolkensteyn
On Mon, Sep 5, 2011 at 10:49 PM, Freddy Mallet <[hidden email]> wrote:
Hi Evgeny,

In fact Dinesh already tried to fix the java grammar to handle this use case but that's a bit tricky so we decided to postpone this investigation.

Freddy  

----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Mon, Sep 5, 2011 at 10:30 PM, Evgeny Mandrikov <[hidden email]> wrote:
Dinesh FYI another interesting open issue is about analysis of Java 1.4 code, where enum can be used as an identifier : http://jira.codehaus.org/browse/SONAR-1653


On Mon, Sep 5, 2011 at 19:56, Evgeny Mandrikov <[hidden email]> wrote:
Hi all,

FYI: I tested this patch by applying it locally on Checkstyle 5.5-SNAPSHOT and using this version in Sonar.
And it works like a charm for simple project, which uses all language features of Java 7 ( https://github.com/Godin/sonar-experiments/tree/master/java7-language-features ).
Congratulations Dinesh!

However Dinesh, could you please also take a look on another parsing issue, which is still present in 5.5-SNAPSHOT : http://sourceforge.net/tracker/?func=detail&atid=397078&aid=1667137&group_id=29721
Currently in Sonar we have a workaround - we simply ignore this error, but IMO would be better to fix it, if you can ;)

On Fri, Sep 2, 2011 at 17:42, Dinesh Bolkensteyn <[hidden email]> wrote:
Dear Olivier,

The patch is provided here: https://sourceforge.net/tracker/?func=detail&aid=3403265&group_id=29721&atid=397080

Note that, because SourceForge does not preserve spaces in the comment, the AST part is messed up, which is why I post the comment hereunder again.

*** Original comment attached to the patch ***

This patch adds the support for Java 7 to Checkstyle's ANTLR grammar.
It comes with 1 unit test for each new Java 7 language feature.

This patch should be backwards-compatible: AST for files which do not use Java 7 features should be left unchanged.

Impact by Java 7 language feature:

 1) String in switch: None, the grammar already supported this.

 2) Simplified variable arguments: None, the grammar should not be impacted by this feature.
 
 3) Binary integer literals and underscores in numerical literals: The tokens value in the AST will be identical as the one written in the source code.

 4) Diamond Generics: In presence of a diamond, the AST looks like:

+--TYPE_ARGUMENTS
    |
    +--GENERIC_START
    +--GENERIC_END

 5) try-with-resources: In presence of a try-with-resources, the AST looks like:

+--try
    |
    +--LPAREN (new node containing the "resource")
        |
        +--MODIFIERS
        +--TYPE
            |
            ...
        +--IDENT
        +--ASSIGN
        +--EXPR
            |
            ...
        +--RPAREN
    +--SLIST (list of statements of the try block, just like a try/catch)
        |
        ...
    +--LITERAL_CATCH (optionnally, if there was a catch, just like a try/catch)
    +… (unchanged, just like a try/catch)

 6) Multi-catch and more precise rethrow: In presence of a multi-catch, the AST looks like:
 
+--try
    |
    +--SLIST (list of statements of the try block)
        |
        ...
    +--LITERAL_CATCH
        |
        +--LPAREN
        +--PARAMETER_DEF
            |
            +--MODIFIERS
            +--TYPE
                |
                +--IDENT (containing the first exception to catch, or a DOT node if it is a fully qualified type)
                +--IDENT (containing the second exception to catch, or a DOT node if it is a fully qualified type)
                +--...
            +--IDENT (name of the exception variable)
        +--RPAREN
        +--SLIST (list of statements of the catch block)
            |
            ...

Kind regards,
 Dinesh Bolkensteyn


On Tue, Aug 16, 2011 at 10:07 AM, Freddy Mallet <[hidden email]> wrote:
Thanks for your answer Oliver ! So we'll start with the first baby step to patch the current Antlr grammar. We should get back to you during the upcoming weeks. 

Kind regards,
Freddy
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Tue, Aug 16, 2011 at 4:34 AM, Oliver Burn <[hidden email]> wrote:
Hi Freddy,

Thanks for your kind offer.

My preference for a new grammar is motivated by the following thoughts:
  • Upgrade from ANTLRv2 to ANTLRv3 - there a numerous benefits to not being left behind, including newer features and the awesome ANTLRworks
  • The existing grammar has evolved along with the language - a fresh implementation maybe cleaner
  • Hoping to find a ANTLR grammar out there that somebody is maintaining. Bare in mind that when Java 8 comes out, where will be a series of changes to the grammar required.
That all said, it would be easier to patch the existing grammar. I would happily take a patch that does that. :-)

Regards,
Oliver

On Tue, Aug 16, 2011 at 01:57, Freddy Mallet <[hidden email]> wrote:
Hi Oliver,

We would be happy to contribute to the support of java 7 [1]. Upgrading the current Antlr grammar should not be too complex (even if not simple) in order to support new java language enhancements : 
  • Strings in switch statements
  • try-with-resources statements
  • improved type inference for generic instance creation ("diamond")
  • better integral literals
  • and improved exception handling (multi-catch)
In ticket 3328367 [1], you mention the option to fully rewrite the Antlr grammar instead of simply updating the existing one. In few words, could you explain what would be the advantages of this solution and why you seem to prefer this second solution ?

Thanks
Freddy

[1] - http://sourceforge.net/tracker/?func=detail&aid=3328367&group_id=29721&atid=397078 you seem to be 
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user






--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_



--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_



------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user




------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Re: [sonar-dev] Re: About Java 7 support

Dinesh Bolkensteyn
Thanks Evgeny! I couldn't find the updated version of the JLS the other day.


On Fri, Sep 16, 2011 at 10:39 AM, Evgeny Mandrikov <[hidden email]> wrote:
Hi Dinesh,

I saw your comment :
The least to say is that the JSR 334 is a mess and hard to understand.

So might be helpful to read Java SE Specification instead of JSR - http://download.oracle.com/javase/cmn/spec_index.html ( only PDF version for Java 7 available for the moment ), interesting parts are :
3.10 Literals
14.11 The switch Statement
14.20 The try statement
14.20.3 try-with-resources
15.9 Class Instance Creation Expressions

And I did an update in examples ( https://github.com/Godin/sonar-experiments/tree/master/java7-language-features ) and indeed as Oliver said - now parsing fails, but I hope that now examples are complete.

On Fri, Sep 16, 2011 at 11:28, Dinesh Bolkensteyn <[hidden email]> wrote:
Thanks for the feedback, the issue will be investigated next week.

On Thu, Sep 15, 2011 at 2:16 PM, Oliver Burn <[hidden email]> wrote:
Hi Freddy,

Prior to the release I have been testing against Java 7 code base and I found an error. I have re-opened https://sourceforge.net/tracker/index.php?func=detail&aid=3403265&group_id=29721&atid=397080 with the details.

It would be great if Dinesh has a look at it.

Thanks,
Oliver


On Wed, Sep 7, 2011 at 22:50, Oliver Burn <[hidden email]> wrote:
Hopefully in the next month.

I'd like to test it out first for bit.

On Wed, Sep 7, 2011 at 18:14, Freddy Mallet <[hidden email]> wrote:
Thanks Oliver !

Just in case, do you have any idea when the release of Checkstyle 5.5 might occur ?

----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Tue, Sep 6, 2011 at 1:37 PM, Oliver Burn <[hidden email]> wrote:
The patch has been applied to Checkstyle.

Thanks!

On Tue, Sep 6, 2011 at 18:15, Dinesh Bolkensteyn <[hidden email]> wrote:
There is already a proposed patch for the EOF issue from Lukas Platinsky @ https://sourceforge.net/tracker/?func=detail&aid=3393810&group_id=29721&atid=397080
(which I did not try)

Indeed the support for "enum" as an identifier (Java 4) is still an open issue.

--
Dinesh Bolkensteyn
Tweeting? http://twitter.com/DBolkensteyn
On Mon, Sep 5, 2011 at 10:49 PM, Freddy Mallet <[hidden email]> wrote:
Hi Evgeny,

In fact Dinesh already tried to fix the java grammar to handle this use case but that's a bit tricky so we decided to postpone this investigation.

Freddy  

----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Mon, Sep 5, 2011 at 10:30 PM, Evgeny Mandrikov <[hidden email]> wrote:
Dinesh FYI another interesting open issue is about analysis of Java 1.4 code, where enum can be used as an identifier : http://jira.codehaus.org/browse/SONAR-1653


On Mon, Sep 5, 2011 at 19:56, Evgeny Mandrikov <[hidden email]> wrote:
Hi all,

FYI: I tested this patch by applying it locally on Checkstyle 5.5-SNAPSHOT and using this version in Sonar.
And it works like a charm for simple project, which uses all language features of Java 7 ( https://github.com/Godin/sonar-experiments/tree/master/java7-language-features ).
Congratulations Dinesh!

However Dinesh, could you please also take a look on another parsing issue, which is still present in 5.5-SNAPSHOT : http://sourceforge.net/tracker/?func=detail&atid=397078&aid=1667137&group_id=29721
Currently in Sonar we have a workaround - we simply ignore this error, but IMO would be better to fix it, if you can ;)

On Fri, Sep 2, 2011 at 17:42, Dinesh Bolkensteyn <[hidden email]> wrote:
Dear Olivier,

The patch is provided here: https://sourceforge.net/tracker/?func=detail&aid=3403265&group_id=29721&atid=397080

Note that, because SourceForge does not preserve spaces in the comment, the AST part is messed up, which is why I post the comment hereunder again.

*** Original comment attached to the patch ***

This patch adds the support for Java 7 to Checkstyle's ANTLR grammar.
It comes with 1 unit test for each new Java 7 language feature.

This patch should be backwards-compatible: AST for files which do not use Java 7 features should be left unchanged.

Impact by Java 7 language feature:

 1) String in switch: None, the grammar already supported this.

 2) Simplified variable arguments: None, the grammar should not be impacted by this feature.
 
 3) Binary integer literals and underscores in numerical literals: The tokens value in the AST will be identical as the one written in the source code.

 4) Diamond Generics: In presence of a diamond, the AST looks like:

+--TYPE_ARGUMENTS
    |
    +--GENERIC_START
    +--GENERIC_END

 5) try-with-resources: In presence of a try-with-resources, the AST looks like:

+--try
    |
    +--LPAREN (new node containing the "resource")
        |
        +--MODIFIERS
        +--TYPE
            |
            ...
        +--IDENT
        +--ASSIGN
        +--EXPR
            |
            ...
        +--RPAREN
    +--SLIST (list of statements of the try block, just like a try/catch)
        |
        ...
    +--LITERAL_CATCH (optionnally, if there was a catch, just like a try/catch)
    +… (unchanged, just like a try/catch)

 6) Multi-catch and more precise rethrow: In presence of a multi-catch, the AST looks like:
 
+--try
    |
    +--SLIST (list of statements of the try block)
        |
        ...
    +--LITERAL_CATCH
        |
        +--LPAREN
        +--PARAMETER_DEF
            |
            +--MODIFIERS
            +--TYPE
                |
                +--IDENT (containing the first exception to catch, or a DOT node if it is a fully qualified type)
                +--IDENT (containing the second exception to catch, or a DOT node if it is a fully qualified type)
                +--...
            +--IDENT (name of the exception variable)
        +--RPAREN
        +--SLIST (list of statements of the catch block)
            |
            ...

Kind regards,
 Dinesh Bolkensteyn


On Tue, Aug 16, 2011 at 10:07 AM, Freddy Mallet <[hidden email]> wrote:
Thanks for your answer Oliver ! So we'll start with the first baby step to patch the current Antlr grammar. We should get back to you during the upcoming weeks. 

Kind regards,
Freddy
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Tue, Aug 16, 2011 at 4:34 AM, Oliver Burn <[hidden email]> wrote:
Hi Freddy,

Thanks for your kind offer.

My preference for a new grammar is motivated by the following thoughts:
  • Upgrade from ANTLRv2 to ANTLRv3 - there a numerous benefits to not being left behind, including newer features and the awesome ANTLRworks
  • The existing grammar has evolved along with the language - a fresh implementation maybe cleaner
  • Hoping to find a ANTLR grammar out there that somebody is maintaining. Bare in mind that when Java 8 comes out, where will be a series of changes to the grammar required.
That all said, it would be easier to patch the existing grammar. I would happily take a patch that does that. :-)

Regards,
Oliver

On Tue, Aug 16, 2011 at 01:57, Freddy Mallet <[hidden email]> wrote:
Hi Oliver,

We would be happy to contribute to the support of java 7 [1]. Upgrading the current Antlr grammar should not be too complex (even if not simple) in order to support new java language enhancements : 
  • Strings in switch statements
  • try-with-resources statements
  • improved type inference for generic instance creation ("diamond")
  • better integral literals
  • and improved exception handling (multi-catch)
In ticket 3328367 [1], you mention the option to fully rewrite the Antlr grammar instead of simply updating the existing one. In few words, could you explain what would be the advantages of this solution and why you seem to prefer this second solution ?

Thanks
Freddy

[1] - http://sourceforge.net/tracker/?func=detail&aid=3328367&group_id=29721&atid=397078 you seem to be 
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user






--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_



--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_



------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user



------------------------------------------------------------------------------
Using storage to extend the benefits of virtualization and iSCSI
Virtualization increases hardware utilization and delivers a new level of
agility. Learn what those decisions are and how to modernize your storage
and backup environments for virtualization.
http://www.accelacomm.com/jaw/sfnl/114/51434361/

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user




------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/

_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user





--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_


------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

[sonar-dev] Re: About Java 7 support

Dinesh Bolkensteyn
Thanks again for the feedback on the first attempt to this patch ;-)

I've just uploaded an update which should fix the issue you reported.Thank you

Kind regards,

Dinesh Bolkensteyn
www.SonarSource.com
twitter.com/DBolkensteyn

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Re: [sonar-dev] Re: About Java 7 support

Dinesh Bolkensteyn
In reply to this post by Dinesh Bolkensteyn
(sorry for the duplicate mail, the previous one did not display properly, seemed like the max mail size was reached)

Thanks again for the feedback on the first attempt to this patch ;-)

I've just uploaded an update which should fix the issue you reported.
Thank you

Kind regards,

--
Dinesh Bolkensteyn
www.SonarSource.com
twitter.com/DBolkensteyn


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user