LeftCurly question

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

LeftCurly question

Andy Kriger
I'm seeing some unexpected behavior with LeftCurly and I'm wondering if someone can point out if: I'm doing something wrong; this is expected behavior; this is surprising to you too...

I want default behavior for LeftCurly braces (same line) for everything except classes, interfaces, constructors, and methods...

This is my rule...
     <module name="LeftCurly">
            <property name="option" value="nl"/>
            <property name="tokens" value="CLASS_DEF,INTERFACE_DEF,CTOR_DEF,METHOD_DEF"/>
     </module>

The problem is that code like this is not flagged (where the left curly should be on the same line as the try/catch blocks)...
      try
      {
         return getter.invoke(source);
      }
      catch (IllegalAccessException e)
      {
         throw new RuntimeException("Error: ", e);
      }

Any ideas what's going on here?

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: LeftCurly question

Thomas Suckow
Then I believe you need to make another LeftCurly Check with ones for
the same line.
Thomas Suckow



On Thu, Jun 11, 2009 at 2:11 PM, Andy Kriger <[hidden email]> wrote:

> I'm seeing some unexpected behavior with LeftCurly and I'm wondering if
> someone can point out if: I'm doing something wrong; this is expected
> behavior; this is surprising to you too...
> I want default behavior for LeftCurly braces (same line) for everything
> except classes, interfaces, constructors, and methods...
> This is my rule...
>      <module name="LeftCurly">
>             <property name="option" value="nl"/>
>             <property name="tokens"
> value="CLASS_DEF,INTERFACE_DEF,CTOR_DEF,METHOD_DEF"/>
>      </module>
> The problem is that code like this is not flagged (where the left curly
> should be on the same line as the try/catch blocks)...
>       try
>       {
>          return getter.invoke(source);
>       }
>       catch (IllegalAccessException e)
>       {
>          throw new RuntimeException("Error: ", e);
>       }
> Any ideas what's going on here?
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> Checkstyle-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/checkstyle-user
>
>

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: LeftCurly question

Andy Kriger
Yes - that worked. I wasn't sure that you could have multiple modules with the same name and different properties (I may have missed that in the docs). Thank you.

For those playing along at home...
      <module name="LeftCurly">
             <property name="option" value="nl"/>
             <property name="tokens  value="CLASS_DEF,INTERFACE_DEF,CTOR_DEF,METHOD_DEF"/>
      </module>
       <module name="LeftCurly">
             <property name="option" value="eol"/>
             <property name="tokens  value="..."/> <!-- everything else goes here -->
      </module>
 


On Thu, Jun 11, 2009 at 6:01 PM, Thomas Suckow <[hidden email]> wrote:
Then I believe you need to make another LeftCurly Check with ones for
the same line.
Thomas Suckow



On Thu, Jun 11, 2009 at 2:11 PM, Andy Kriger <[hidden email]> wrote:
> I'm seeing some unexpected behavior with LeftCurly and I'm wondering if
> someone can point out if: I'm doing something wrong; this is expected
> behavior; this is surprising to you too...
> I want default behavior for LeftCurly braces (same line) for everything
> except classes, interfaces, constructors, and methods...
> This is my rule...
>      <module name="LeftCurly">
>             <property name="option" value="nl"/>
>             <property name="tokens"
> value="CLASS_DEF,INTERFACE_DEF,CTOR_DEF,METHOD_DEF"/>
>      </module>
> The problem is that code like this is not flagged (where the left curly
> should be on the same line as the try/catch blocks)...
>       try
>       {
>          return getter.invoke(source);
>       }
>       catch (IllegalAccessException e)
>       {
>          throw new RuntimeException("Error: ", e);
>       }
> Any ideas what's going on here?
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> Checkstyle-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/checkstyle-user
>
>



--
Be well,
andy

Welcome to http://householder-yogi.net
On family, NYC, and practicing yoga.

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: LeftCurly question

Thomas Suckow
I couldn't remember either, been way too long since i looked in my config.

Thomas Suckow



On Fri, Jun 12, 2009 at 3:18 AM, Andy Kriger<[hidden email]> wrote:

> Yes - that worked. I wasn't sure that you could have multiple modules with
> the same name and different properties (I may have missed that in the docs).
> Thank you.
>
> For those playing along at home...
>       <module name="LeftCurly">
>              <property name="option" value="nl"/>
>              <property name="tokens
> value="CLASS_DEF,INTERFACE_DEF,CTOR_DEF,METHOD_DEF"/>
>       </module>
>        <module name="LeftCurly">
>              <property name="option" value="eol"/>
>              <property name="tokens  value="..."/> <!-- everything else goes
> here -->
>       </module>
>
>
> On Thu, Jun 11, 2009 at 6:01 PM, Thomas Suckow <[hidden email]> wrote:
>>
>> Then I believe you need to make another LeftCurly Check with ones for
>> the same line.
>> Thomas Suckow
>>
>>
>>
>> On Thu, Jun 11, 2009 at 2:11 PM, Andy Kriger <[hidden email]>
>> wrote:
>> > I'm seeing some unexpected behavior with LeftCurly and I'm wondering if
>> > someone can point out if: I'm doing something wrong; this is expected
>> > behavior; this is surprising to you too...
>> > I want default behavior for LeftCurly braces (same line) for everything
>> > except classes, interfaces, constructors, and methods...
>> > This is my rule...
>> >      <module name="LeftCurly">
>> >             <property name="option" value="nl"/>
>> >             <property name="tokens"
>> > value="CLASS_DEF,INTERFACE_DEF,CTOR_DEF,METHOD_DEF"/>
>> >      </module>
>> > The problem is that code like this is not flagged (where the left curly
>> > should be on the same line as the try/catch blocks)...
>> >       try
>> >       {
>> >          return getter.invoke(source);
>> >       }
>> >       catch (IllegalAccessException e)
>> >       {
>> >          throw new RuntimeException("Error: ", e);
>> >       }
>> > Any ideas what's going on here?
>> >
>> > ------------------------------------------------------------------------------
>> > Crystal Reports - New Free Runtime and 30 Day Trial
>> > Check out the new simplified licensing option that enables unlimited
>> > royalty-free distribution of the report engine for externally facing
>> > server and web deployment.
>> > http://p.sf.net/sfu/businessobjects
>> > _______________________________________________
>> > Checkstyle-user mailing list
>> > [hidden email]
>> > https://lists.sourceforge.net/lists/listinfo/checkstyle-user
>> >
>> >
>
>
>
> --
> Be well,
> andy
>
> Welcome to http://householder-yogi.net
> On family, NYC, and practicing yoga.
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> Checkstyle-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/checkstyle-user
>
>

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