Re: [sonar-dev] Re: [sonar-dev] Re: About Java 7 support
Dinesh Bolkensteyn <[email protected]> Fri, 16 Sep 2011 10:52:44 +0200
| Newsgroups | gmane.comp.java.audit.checkstyle.user |
|---|---|
| Message-ID | <CAA06TwNSAeZEUYY4c-GhcNOY8YCrnB=viao=OmGpcB3bXJ9zFA__46993.2658634663$1316163642$gmane$org@mail.gmail.com> |
--===============8337857989809312351== Content-Type: multipart/alternative; boundary=90e6ba1efd78dfd8ee04ad0b1d0d --90e6ba1efd78dfd8ee04ad0b1d0d Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 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 <[email protected]>wro= te: > 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-fea= tures ) and > indeed as Oliver said - now parsing fails, but I hope that now examples a= re > complete. > > On Fri, Sep 16, 2011 at 11:28, Dinesh Bolkensteyn < > [email protected]> wrote: > >> Thanks for the feedback, the issue will be investigated next week. >> >> On Thu, Sep 15, 2011 at 2:16 PM, Oliver Burn <[email protected]>wrot= e: >> >>> 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=3Ddetail&aid=3D3403265&g= roup_id=3D29721&atid=3D397080with 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 <[email protected]> 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 <[email protected]>w= rote: >>>> >>>>> 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 <[email protected]>wr= ote: >>>>> >>>>>> The patch has been applied to Checkstyle. >>>>>> >>>>>> Thanks! >>>>>> >>>>>> On Tue, Sep 6, 2011 at 18:15, Dinesh Bolkensteyn < >>>>>> [email protected]> wrote: >>>>>> >>>>>>> There is already a proposed patch for the EOF issue from Lukas >>>>>>> Platinsky @ >>>>>>> https://sourceforge.net/tracker/?func=3Ddetail&aid=3D3393810&group_= id=3D29721&atid=3D397080 >>>>>>> (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 < >>>>>>> [email protected]> wrote: >>>>>>> >>>>>>>> Hi Evgeny, >>>>>>>> >>>>>>>> In fact Dinesh already tried to fix the java grammar to handle thi= s >>>>>>>> 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 < >>>>>>>> [email protected]> wrote: >>>>>>>> >>>>>>>>> Dinesh FYI another interesting open issue is about analysis of Ja= va >>>>>>>>> 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 < >>>>>>>>> [email protected]> 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-lan= guage-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=3Ddetail&atid=3D397078&aid= =3D1667137&group_id=3D29721 >>>>>>>>>> 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 < >>>>>>>>>> [email protected]> wrote: >>>>>>>>>> >>>>>>>>>>> Dear Olivier, >>>>>>>>>>> >>>>>>>>>>> The patch is provided here: >>>>>>>>>>> https://sourceforge.net/tracker/?func=3Ddetail&aid=3D3403265&gr= oup_id=3D29721&atid=3D397080 >>>>>>>>>>> >>>>>>>>>>> Note that, because SourceForge does not preserve spaces in the >>>>>>>>>>> comment, the AST part is messed up, which is why I post the com= ment >>>>>>>>>>> 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, th= e >>>>>>>>>>> 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) >>>>>>>>>>> +=85 (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 < >>>>>>>>>>> [email protected]> wrote: >>>>>>>>>>> >>>>>>>>>>>> Thanks for your answer Oliver ! So we'll start with the first >>>>>>>>>>>> baby step to patch the current Antlr grammar. We should get ba= ck 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 < >>>>>>>>>>>> [email protected]> 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 feature= s 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 i= s >>>>>>>>>>>>> maintaining. Bare in mind that when Java 8 comes out, wher= e 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 < >>>>>>>>>>>>> [email protected]> 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 comple= x (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 rewri= te >>>>>>>>>>>>>> the Antlr grammar instead of simply updating the existing on= e. In few words, >>>>>>>>>>>>>> could you explain what would be the advantages of this solut= ion and why you >>>>>>>>>>>>>> seem to prefer this second solution ? >>>>>>>>>>>>>> >>>>>>>>>>>>>> Thanks >>>>>>>>>>>>>> Freddy >>>>>>>>>>>>>> >>>>>>>>>>>>>> [1] - >>>>>>>>>>>>>> http://sourceforge.net/tracker/?func=3Ddetail&aid=3D3328367&= group_id=3D29721&atid=3D397078you seem to be >>>>>>>>>>>>>> ---------------------------------------- >>>>>>>>>>>>>> Freddy Mallet >>>>>>>>>>>>>> www.SonarSource.org >>>>>>>>>>>>>> www.SonarSource.com >>>>>>>>>>>>>> ---------------------------------------- >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> ------------------------------------------------------------= ------------------ >>>>>>>>>>>>>> uberSVN's rich system and user administration capabilities a= nd >>>>>>>>>>>>>> model >>>>>>>>>>>>>> configuration take the hassle out of deploying and managing >>>>>>>>>>>>>> Subversion and >>>>>>>>>>>>>> the tools developers use with it. Learn more about uberSVN a= nd >>>>>>>>>>>>>> get a free >>>>>>>>>>>>>> download at: http://p.sf.net/sfu/wandisco-dev2dev >>>>>>>>>>>>>> >>>>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>>>> Checkstyle-user mailing list >>>>>>>>>>>>>> [email protected] >>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/checkstyle-user >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> -------------------------------------------------------------= ----------------- >>>>>>>>>>>>> uberSVN's rich system and user administration capabilities an= d >>>>>>>>>>>>> model >>>>>>>>>>>>> configuration take the hassle out of deploying and managing >>>>>>>>>>>>> Subversion and >>>>>>>>>>>>> the tools developers use with it. Learn more about uberSVN an= d >>>>>>>>>>>>> get a free >>>>>>>>>>>>> download at: http://p.sf.net/sfu/wandisco-dev2dev >>>>>>>>>>>>> >>>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>>> Checkstyle-user mailing list >>>>>>>>>>>>> [email protected] >>>>>>>>>>>>> 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 >>>>>>> [email protected] >>>>>>> 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 >>>>>> [email protected] >>>>>> 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 leve= l >>>>> 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 >>>>> [email protected] >>>>> 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 business= es >>> 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 >>> [email protected] >>> https://lists.sourceforge.net/lists/listinfo/checkstyle-user >>> >>> >> > > > -- > Best regards, > Evgeny Mandrikov aka Godin <http://godin.net.ru> > http://twitter.com/_godin_ > --90e6ba1efd78dfd8ee04ad0b1d0d Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Thanks Evgeny! I couldn't find the updated version of the JLS the other= day.<br> <br><br><div class=3D"gmail_quote">On Fri, Sep 16, 2011 at 10:39 AM, Evgeny= Mandrikov <span dir=3D"ltr"><<a href=3D"mailto:[email protected]">man= [email protected]</a>></span> wrote:<br><blockquote class=3D"gmail_quote"= style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> Hi Dinesh,<div><br></div><div>I saw your comment :</div><blockquote class= =3D"gmail_quote" style=3D"margin-top:0px;margin-right:0px;margin-bottom:0px= ;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 20= 4);border-left-style:solid;padding-left:1ex"> The least to say is that the JSR 334 is a mess and hard to understand.</blo= ckquote><div><br></div><div>So might be helpful to read=A0Java SE Specifica= tion instead of JSR -=A0<a href=3D"http://download.oracle.com/javase/cmn/sp= ec_index.html" target=3D"_blank">http://download.oracle.com/javase/cmn/spec= _index.html</a>=A0( only PDF version for Java 7 available for the moment ),= =A0interesting parts are :</div> <div><div>3.10 Literals</div></div><div><div>14.11 The switch Statement</di= v></div><div>14.20 The try statement</div><div>14.20.3 try-with-resources</= div><div><div>15.9 Class Instance Creation Expressions</div><div><br></div> <div>And I did an update in examples (=A0<a href=3D"https://github.com/Godi= n/sonar-experiments/tree/master/java7-language-features" target=3D"_blank">= https://github.com/Godin/sonar-experiments/tree/master/java7-language-featu= res</a>=A0)=A0and indeed as Oliver said - now parsing fails, but I hope tha= t now examples are complete.</div> <div><div></div><div class=3D"h5"> <div><br></div><div class=3D"gmail_quote">On Fri, Sep 16, 2011 at 11:28, Di= nesh Bolkensteyn <span dir=3D"ltr"><<a href=3D"mailto:dinesh.bolkensteyn= @sonarsource.com" target=3D"_blank">[email protected]</a>&= gt;</span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex">Thanks for the feedback, the issue will be i= nvestigated next week.<br><br><div class=3D"gmail_quote">On Thu, Sep 15, 20= 11 at 2:16 PM, Oliver Burn <span dir=3D"ltr"><<a href=3D"mailto:oliver@p= uppycrawl.com" target=3D"_blank">[email protected]</a>></span> wrote= :<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex">Hi Freddy,<br><br>Prior to the release I hav= e been testing against Java 7 code base and I found an error. I have re-ope= ned <a href=3D"https://sourceforge.net/tracker/index.php?func=3Ddetail&= aid=3D3403265&group_id=3D29721&atid=3D397080" target=3D"_blank">htt= ps://sourceforge.net/tracker/index.php?func=3Ddetail&aid=3D3403265&= group_id=3D29721&atid=3D397080</a> with the details.<br> <br>It would be great if Dinesh has a look at it.<br><br>Thanks,<br><font c= olor=3D"#888888">Oliver</font><div><div></div><div><br><br><div class=3D"gm= ail_quote">On Wed, Sep 7, 2011 at 22:50, Oliver Burn <span dir=3D"ltr"><= <a href=3D"mailto:[email protected]" target=3D"_blank">oliver@puppycraw= l.com</a>></span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex">Hopefully in the next month.<br><br>I'd = like to test it out first for bit.<br><br><div class=3D"gmail_quote"><div><= div> </div><div>On Wed, Sep 7, 2011 at 18:14, Freddy Mallet <span dir=3D"ltr">&l= t;<a href=3D"mailto:[email protected]" target=3D"_blank">freddy.malle= [email protected]</a>></span> wrote:<br> </div></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bo= rder-left:1px #ccc solid;padding-left:1ex"><div><div></div><div>Thanks Oliv= er !<div><br></div><div>Just in case, do you have=A0any idea when the relea= se of Checkstyle 5.5 might occur ?</div> <div><div><br clear=3D"all">----------------------------------------<br>Fre= ddy Mallet<br><a href=3D"http://www.SonarSource.org" target=3D"_blank">www.= SonarSource.org</a><br> <a href=3D"http://www.SonarSource.com" target=3D"_blank">www.SonarSource.co= m</a><br>----------------------------------------<br> <br><br></div><div><div></div><div><div class=3D"gmail_quote">On Tue, Sep 6= , 2011 at 1:37 PM, Oliver Burn <span dir=3D"ltr"><<a href=3D"mailto:oliv= [email protected]" target=3D"_blank">[email protected]</a>></span> w= rote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> The patch has been applied to Checkstyle.<br><br>Thanks!<br><br><div class= =3D"gmail_quote"><div><div></div><div>On Tue, Sep 6, 2011 at 18:15, Dinesh = Bolkensteyn <span dir=3D"ltr"><<a href=3D"mailto:dinesh.bolkensteyn@sona= rsource.com" target=3D"_blank">[email protected]</a>></= span> wrote:<br> </div></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bo= rder-left:1px #ccc solid;padding-left:1ex"><div><div></div><div>There is al= ready a proposed patch for the EOF issue from Lukas Platinsky @ <a href=3D"= https://sourceforge.net/tracker/?func=3Ddetail&aid=3D3393810&group_= id=3D29721&atid=3D397080" target=3D"_blank">https://sourceforge.net/tra= cker/?func=3Ddetail&aid=3D3393810&group_id=3D29721&atid=3D39708= 0</a><br> (which I did not try)<br><br>Indeed the support for "enum" as an = identifier (Java 4) is still an open issue.<br clear=3D"all"><font color=3D= "#888888"><span style=3D"font-family:arial,sans-serif;font-size:13px;border= -collapse:collapse"><br> --<br>Dinesh Bolkensteyn<br></span>Tweeting? <a href=3D"http://twitter.com/= DBolkensteyn" target=3D"_blank">http://twitter.com/DBolkensteyn</a></font><= div><span style=3D"font-family:arial, sans-serif;font-size:13px;border-coll= apse:collapse"></span><br> <span style=3D"font-family:arial,sans-serif;font-size:13px;border-collapse:= collapse"><br><a href=3D"http://www.SonarSource.org" target=3D"_blank">www.= SonarSource.org</a><br><a href=3D"http://www.SonarSource.com" target=3D"_bl= ank">www.SonarSource.com</a></span><br> <br> <br><br></div><div><div></div><div><div class=3D"gmail_quote">On Mon, Sep 5= , 2011 at 10:49 PM, Freddy Mallet <span dir=3D"ltr"><<a href=3D"mailto:f= [email protected]" target=3D"_blank">[email protected]= om</a>></span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> Hi Evgeny,<div><br></div><div>In fact Dinesh already tried to fix the java = grammar to handle this use case but that's a bit tricky so we decided t= o postpone this investigation.</div><div><br></div><font color=3D"#888888">= <div> Freddy =A0</div></font><div><div> <br clear=3D"all">----------------------------------------<br>Freddy Mallet= <br><a href=3D"http://www.SonarSource.org" target=3D"_blank">www.SonarSourc= e.org</a><br><a href=3D"http://www.SonarSource.com" target=3D"_blank">www.S= onarSource.com</a><br> ----------------------------------------<br> <br><br></div><div><div></div><div><div class=3D"gmail_quote">On Mon, Sep 5= , 2011 at 10:30 PM, Evgeny Mandrikov <span dir=3D"ltr"><<a href=3D"mailt= o:[email protected]" target=3D"_blank">[email protected]</a>></span>= wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> Dinesh FYI another interesting open issue is about analysis of Java 1.4 cod= e, where enum can be used as an identifier : <a href=3D"http://jira.codehau= s.org/browse/SONAR-1653" target=3D"_blank">http://jira.codehaus.org/browse/= SONAR-1653</a><div> <div></div><div><br> <br><div class=3D"gmail_quote">On Mon, Sep 5, 2011 at 19:56, Evgeny Mandrik= ov <span dir=3D"ltr"><<a href=3D"mailto:[email protected]" target=3D"_= blank">[email protected]</a>></span> wrote:<br><blockquote class=3D"gm= ail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-le= ft:1ex"> Hi all,<div><br></div><div>FYI: I tested this patch by applying it locally = on Checkstyle 5.5-SNAPSHOT and using this version in Sonar.</div><div>And i= t works like a charm for simple project, which uses all language features o= f Java 7 (=A0<a href=3D"https://github.com/Godin/sonar-experiments/tree/mas= ter/java7-language-features" target=3D"_blank">https://github.com/Godin/son= ar-experiments/tree/master/java7-language-features</a>=A0).</div> <div>Congratulations Dinesh!</div><div><br></div><div>However Dinesh, could= you please also take a look on another parsing issue, which is still prese= nt in 5.5-SNAPSHOT : <a href=3D"http://sourceforge.net/tracker/?func=3Ddeta= il&atid=3D397078&aid=3D1667137&group_id=3D29721" target=3D"_bla= nk">http://sourceforge.net/tracker/?func=3Ddetail&atid=3D397078&aid= =3D1667137&group_id=3D29721</a></div> <div>Currently in Sonar we have a workaround - we simply ignore this error,= =A0but IMO would be better to fix it, if you can ;)</div><div><div><div></d= iv><div><br><div class=3D"gmail_quote">On Fri, Sep 2, 2011 at 17:42, Dinesh= Bolkensteyn <span dir=3D"ltr"><<a href=3D"mailto:dinesh.bolkensteyn@son= arsource.com" target=3D"_blank">[email protected]</a>><= /span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex">Dear Olivier,<br><br>The patch is provided h= ere: <a href=3D"https://sourceforge.net/tracker/?func=3Ddetail&aid=3D34= 03265&group_id=3D29721&atid=3D397080" target=3D"_blank">https://sou= rceforge.net/tracker/?func=3Ddetail&aid=3D3403265&group_id=3D29721&= amp;atid=3D397080</a><br> <br>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= .<br><br>*** Original comment attached to the patch ***<br><br>This patch a= dds the support for Java 7 to Checkstyle's ANTLR grammar.<br> It comes with 1 unit test for each new Java 7 language feature.<br><br>This= patch should be backwards-compatible: AST for files which do not use Java = 7 features should be left unchanged.<br><br>Impact by Java 7 language featu= re:<br> <br>=A01) String in switch: None, the grammar already supported this.<br><b= r>=A02) Simplified variable arguments: None, the grammar should not be impa= cted by this feature.<br>=A0<br>=A03) Binary integer literals and underscor= es in numerical literals: The tokens value in the AST will be identical as = the one written in the source code.<br> <br>=A04) Diamond Generics: In presence of a diamond, the AST looks like:<b= r><br>+--TYPE_ARGUMENTS<br>=A0=A0=A0 |<br>=A0=A0=A0 +--GENERIC_START<br>=A0= =A0=A0 +--GENERIC_END<br><br>=A05) try-with-resources: In presence of a try= -with-resources, the AST looks like: <br> <br>+--try<br>=A0=A0=A0 |<br>=A0=A0=A0 +--LPAREN (new node containing the &= quot;resource")<br>=A0=A0=A0=A0=A0=A0=A0 |<br>=A0=A0=A0=A0=A0=A0=A0 +-= -MODIFIERS<br>=A0=A0=A0=A0=A0=A0=A0 +--TYPE<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 |<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ...<br>=A0=A0=A0=A0=A0=A0=A0 = +--IDENT<br>=A0=A0=A0=A0=A0=A0=A0 +--ASSIGN<br> =A0=A0=A0=A0=A0=A0=A0 +--EXPR<br> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 |<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ..= .<br>=A0=A0=A0=A0=A0=A0=A0 +--RPAREN<br>=A0=A0=A0 +--SLIST (list of stateme= nts of the try block, just like a try/catch)<br>=A0=A0=A0=A0=A0=A0=A0 |<br>= =A0=A0=A0=A0=A0=A0=A0 ...<br>=A0=A0=A0 +--LITERAL_CATCH (optionnally, if th= ere was a catch, just like a try/catch)<br> =A0=A0=A0 +=85 (unchanged, just like a try/catch)<br><br>=A06) Multi-catch = and more precise rethrow: In presence of a multi-catch, the AST looks like:= <br>=A0<br>+--try<br>=A0=A0=A0 |<br>=A0=A0=A0 +--SLIST (list of statements = of the try block)<br> =A0=A0=A0=A0=A0=A0=A0 |<br>=A0=A0=A0=A0=A0=A0=A0 ...<br>=A0=A0=A0 +--LITERA= L_CATCH<br>=A0=A0=A0=A0=A0=A0=A0 |<br>=A0=A0=A0=A0=A0=A0=A0 +--LPAREN<br>= =A0=A0=A0=A0=A0=A0=A0 +--PARAMETER_DEF<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= |<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 +--MODIFIERS<br>=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 +--TYPE<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 |<= br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 +--IDENT (containing the f= irst exception to catch, or a DOT node if it is a fully qualified type)<br> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 +--IDENT (containing the seco= nd exception to catch, or a DOT node if it is a fully qualified type)<br>= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 +--...<br>=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 +--IDENT (name of the exception variable)<br>=A0=A0=A0=A0= =A0=A0=A0 +--RPAREN<br> =A0=A0=A0=A0=A0=A0=A0 +--SLIST (list of statements of the catch block)<br>= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 |<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ..= .<br><br>Kind regards,<br><font color=3D"#888888"> =A0Dinesh Bolkensteyn</font><div><div></div><div><br><br><div class=3D"gmai= l_quote">On Tue, Aug 16, 2011 at 10:07 AM, Freddy Mallet <span dir=3D"ltr">= <<a href=3D"mailto:[email protected]" target=3D"_blank">fred= [email protected]</a>></span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"><div>Thanks for your answer Oliver ! So we&#= 39;ll start with the first baby step to patch the current Antlr grammar. We= should get back to you during the upcoming weeks.=A0</div> <div><br></div><div>Kind regards,</div><div>Freddy<br clear=3D"all"> ----------------------------------------<br>Freddy Mallet<br><a href=3D"htt= p://www.SonarSource.org" target=3D"_blank">www.SonarSource.org</a><br><a hr= ef=3D"http://www.SonarSource.com" target=3D"_blank">www.SonarSource.com</a>= <br> ----------------------------------------<br> <br><br><div class=3D"gmail_quote">On Tue, Aug 16, 2011 at 4:34 AM, Oliver = Burn <span dir=3D"ltr"><<a href=3D"mailto:[email protected]" target= =3D"_blank">[email protected]</a>></span> wrote:<br><blockquote clas= s=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pad= ding-left:1ex"> Hi Freddy,<br><br>Thanks for your kind offer.<br><br>My preference for a ne= w grammar is motivated by the following thoughts:<br><ul><li>Upgrade from A= NTLRv2 to ANTLRv3 - there a numerous benefits to not being left behind, inc= luding newer features and the awesome ANTLRworks</li> <li>The existing grammar has evolved along with the language - a fresh impl= ementation maybe cleaner</li><li>Hoping to find a ANTLR grammar out there t= hat somebody is maintaining. Bare in mind that when Java 8 comes out, where= will be a series of changes to the grammar required.</li> </ul>That all said, it would be easier to patch the existing grammar. I wou= ld happily take a patch that does that. :-)<br><br>Regards,<br>Oliver<br><b= r><div class=3D"gmail_quote"><div><div></div><div>On Tue, Aug 16, 2011 at 0= 1:57, Freddy Mallet <span dir=3D"ltr"><<a href=3D"mailto:freddy.mallet@g= mail.com" target=3D"_blank">[email protected]</a>></span> wrote:<b= r> </div></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bo= rder-left:1px #ccc solid;padding-left:1ex"><div><div></div><div>Hi Oliver,<= div><br></div><div>We would be happy to contribute to the support of java 7= [1]. Upgrading the current Antlr grammar should not be too complex (even i= f not simple) in order to support new java language enhancements :=A0</div> <div><div><ul><li>Strings in switch statements</li><li>try-with-resources s= tatements</li><li>improved type inference for generic instance creation (&q= uot;diamond")</li><li>better integral literals</li><li>and improved ex= ception handling (multi-catch)</li> </ul></div></div><div>In ticket=A03328367 [1], you mention the option to fu= lly rewrite the Antlr grammar instead of simply updating the existing one. = In few words, could you explain what would be the advantages of this soluti= on and why you seem to prefer this second solution ?</div> <div><br></div><div>Thanks</div><div>Freddy</div><div><br></div><div>[1] - = <a href=3D"http://sourceforge.net/tracker/?func=3Ddetail&aid=3D3328367&= amp;group_id=3D29721&atid=3D397078" target=3D"_blank">http://sourceforg= e.net/tracker/?func=3Ddetail&aid=3D3328367&group_id=3D29721&ati= d=3D397078</a> you seem to be=A0<br clear=3D"all"> ----------------------------------------<br><font color=3D"#888888">Freddy = Mallet<br><a href=3D"http://www.SonarSource.org" target=3D"_blank">www.Sona= rSource.org</a><br><a href=3D"http://www.SonarSource.com" target=3D"_blank"= >www.SonarSource.com</a><br> ----------------------------------------<br> </font></div> <br></div></div>-----------------------------------------------------------= -------------------<br> uberSVN's rich system and user administration capabilities and model<br= > configuration take the hassle out of deploying and managing Subversion and<= br> the tools developers use with it. Learn more about uberSVN and get a free<b= r> download at: =A0<a href=3D"http://p.sf.net/sfu/wandisco-dev2dev" target=3D"= _blank">http://p.sf.net/sfu/wandisco-dev2dev</a><br> <br>_______________________________________________<br> Checkstyle-user mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank">= [email protected]</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/checkstyle-user" ta= rget=3D"_blank">https://lists.sourceforge.net/lists/listinfo/checkstyle-use= r</a><br> <br></blockquote></div><br> <br>-----------------------------------------------------------------------= -------<br> uberSVN's rich system and user administration capabilities and model<br= > configuration take the hassle out of deploying and managing Subversion and<= br> the tools developers use with it. Learn more about uberSVN and get a free<b= r> download at: =A0<a href=3D"http://p.sf.net/sfu/wandisco-dev2dev" target=3D"= _blank">http://p.sf.net/sfu/wandisco-dev2dev</a><br> <br>_______________________________________________<br> Checkstyle-user mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank">= [email protected]</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/checkstyle-user" ta= rget=3D"_blank">https://lists.sourceforge.net/lists/listinfo/checkstyle-use= r</a><br> <br></blockquote></div><br></div> </blockquote></div><br> </div></div></blockquote></div><br><br clear=3D"all"><div><br></div></div><= /div><font color=3D"#888888">-- <br>Best regards,<br>Evgeny Mandrikov aka G= odin <<a href=3D"http://godin.net.ru" target=3D"_blank">http://godin.net= .ru</a>><br> <a href=3D"http://twitter.com/_godin_" target=3D"_blank">http://twitter.com= /_godin_</a><br> </font></div> </blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>Best regards= ,<br>Evgeny Mandrikov aka Godin <<a href=3D"http://godin.net.ru" target= =3D"_blank">http://godin.net.ru</a>><br><a href=3D"http://twitter.com/_g= odin_" target=3D"_blank">http://twitter.com/_godin_</a><br> </div></div></blockquote></div><br></div></div></div> </blockquote></div><br> </div></div><br></div></div><div>------------------------------------------= ------------------------------------<br> Special Offer -- Download ArcSight Logger for FREE!<br> Finally, a world-class log management solution at an even better<br> price-free! And you'll get a free "Love Thy Logs" t-shirt whe= n you<br> download Logger. Secure your free ArcSight Logger TODAY!<br> </div><a href=3D"http://p.sf.net/sfu/arcsisghtdev2dev" target=3D"_blank">ht= tp://p.sf.net/sfu/arcsisghtdev2dev</a><div><br>____________________________= ___________________<br> Checkstyle-user mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank">= [email protected]</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/checkstyle-user" ta= rget=3D"_blank">https://lists.sourceforge.net/lists/listinfo/checkstyle-use= r</a><br> <br></div></blockquote></div><br> <br>-----------------------------------------------------------------------= -------<br> Special Offer -- Download ArcSight Logger for FREE!<br> Finally, a world-class log management solution at an even better<br> price-free! And you'll get a free "Love Thy Logs" t-shirt whe= n you<br> download Logger. Secure your free ArcSight Logger TODAY!<br> <a href=3D"http://p.sf.net/sfu/arcsisghtdev2dev" target=3D"_blank">http://p= .sf.net/sfu/arcsisghtdev2dev</a><br>_______________________________________= ________<br> Checkstyle-user mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank">= [email protected]</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/checkstyle-user" ta= rget=3D"_blank">https://lists.sourceforge.net/lists/listinfo/checkstyle-use= r</a><br> <br></blockquote></div><br></div></div></div> <br></div></div>-----------------------------------------------------------= -------------------<br> Using storage to extend the benefits of virtualization and iSCSI<br> Virtualization increases hardware utilization and delivers a new level of<b= r> agility. Learn what those decisions are and how to modernize your storage<b= r> and backup environments for virtualization.<br> <a href=3D"http://www.accelacomm.com/jaw/sfnl/114/51434361/" target=3D"_bla= nk">http://www.accelacomm.com/jaw/sfnl/114/51434361/</a><div><br>__________= _____________________________________<br> Checkstyle-user mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank">= [email protected]</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/checkstyle-user" ta= rget=3D"_blank">https://lists.sourceforge.net/lists/listinfo/checkstyle-use= r</a><br> <br></div></blockquote></div><br> </blockquote></div><br> </div></div><br>-----------------------------------------------------------= -------------------<br> Doing More with Less: The Next Generation Virtual Desktop<br> What are the key obstacles that have prevented many mid-market businesses<b= r> from deploying virtual desktops? =A0 How do next-generation virtual desktop= s<br> provide companies an easier-to-deploy, easier-to-manage and more affordable= <br> virtual desktop model.<a href=3D"http://www.accelacomm.com/jaw/sfnl/114/514= 26474/" target=3D"_blank">http://www.accelacomm.com/jaw/sfnl/114/51426474/<= /a><div><br>_______________________________________________<br> Checkstyle-user mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank">= [email protected]</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/checkstyle-user" ta= rget=3D"_blank">https://lists.sourceforge.net/lists/listinfo/checkstyle-use= r</a><br> <br></div></blockquote></div><br> </blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>Best regards= ,<br>Evgeny Mandrikov aka Godin <<a href=3D"http://godin.net.ru" target= =3D"_blank">http://godin.net.ru</a>><br><a href=3D"http://twitter.com/_g= odin_" target=3D"_blank">http://twitter.com/_godin_</a><br> </div></div></div> </blockquote></div><br> --90e6ba1efd78dfd8ee04ad0b1d0d-- --===============8337857989809312351== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA http://p.sf.net/sfu/rim-devcon-copy2 --===============8337857989809312351== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Checkstyle-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/checkstyle-user --===============8337857989809312351==--