commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier Lamy <ol...@apache.org>
Subject Re: svn commit: r1188675 - /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTMap.java
Date Wed, 26 Oct 2011 09:59:39 GMT
Hello,
Weird as working here for me. Using idea EAP 11 (Nika) 110.137 (on osx).
I remember having issues for style with the previous 11 EAP.
In the idea ui configuration check in Code Style/Java
Tab Spaces -> Within -> Empty Method call parentheses.


2011/10/26 Maurizio Cucchiara <mcucchiara@apache.org>:
> Hi Olivier,
> actually I'm using the maven code style and convention, particularly
> the one [1] taken from here [2].
> Looking at the xml, and contextually at Idea, I realized that there is
> no way to define different behavior for the no-args method declaration
> (in this specific case if the SPACE_WITHIN_METHOD_PARENTHESES is true,
> Idea puts a space regardless of the presence of an argument or not)
>
> I tried to google without any results.
> Am I missing something?
>
> [1] http://maven.apache.org/developers/maven-idea-codestyle.xml
> [2] http://maven.apache.org/developers/conventions/code.html
>
>
> Twitter     :http://www.twitter.com/m_cucchiara
> G+          :https://plus.google.com/107903711540963855921
> Linkedin    :http://www.linkedin.com/in/mauriziocucchiara
>
> Maurizio Cucchiara
>
>
>
> On 25 October 2011 21:58, Olivier Lamy <olamy@apache.org> wrote:
>> 2011/10/25  <mcucchiara@apache.org>:
>>> Author: mcucchiara
>>> Date: Tue Oct 25 14:37:46 2011
>>> New Revision: 1188675
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1188675&view=rev
>>> Log:
>>> Fixed checkstyle warning
>>>
>>> Modified:
>>>    commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTMap.java
>>>
>>> Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTMap.java
>>> URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTMap.java?rev=1188675&r1=1188674&r2=1188675&view=diff
>>> ==============================================================================
>>> --- commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTMap.java
(original)
>>> +++ commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/ASTMap.java
Tue Oct 25 14:37:46 2011
>>> @@ -26,6 +26,7 @@ import java.util.Map;
>>>
>>>  /**
>>>  * $Id$
>>> + *
>>>  * @author Luke Blanshard (blanshlu@netscape.net)
>>>  * @author Drew Davidson (drew@ognl.org)
>>>  */
>>> @@ -34,7 +35,7 @@ class ASTMap
>>>  {
>>>     private String className;
>>>
>>> -    private Map<OgnlContext, Class> defaultMapClassMap = new HashMap<OgnlContext,
Class>();
>>> +    private Map<OgnlContext, Class> defaultMapClassMap = new HashMap<OgnlContext,
Class>( );
>>
>> Didn't we agree on using maven codestyle as defined in the check style
>> configuration in the pom ?
>> If I remember well for this point, your commit is wrong: no need of spaces here.
>>
>>
>>>
>>>     public ASTMap( int id )
>>>     {
>>> @@ -57,7 +58,7 @@ class ASTMap
>>>      * @return the class name.
>>>      * @since 4.0
>>>      */
>>> -    String getClassName()
>>> +    String getClassName( )
>>>     {
>>>         return className;
>>>     }
>>> @@ -72,12 +73,12 @@ class ASTMap
>>>             Class defaultMapClass = getDefaultMapClass( context );
>>>             try
>>>             {
>>> -                answer = (Map) defaultMapClass.newInstance();
>>> +                answer = (Map) defaultMapClass.newInstance( );
>>>             }
>>>             catch ( Exception ex )
>>>             {
>>>                 /* This should never happen */
>>> -                throw new OgnlException( "Default Map class '" + defaultMapClass.getName()
+ "' instantiation error",
>>> +                throw new OgnlException( "Default Map class '" + defaultMapClass.getName(
) + "' instantiation error",
>>>                                          ex );
>>>             }
>>>         }
>>> @@ -85,7 +86,7 @@ class ASTMap
>>>         {
>>>             try
>>>             {
>>> -                answer = (Map) OgnlRuntime.classForName( context, className
).newInstance();
>>> +                answer = (Map) OgnlRuntime.classForName( context, className
).newInstance( );
>>>             }
>>>             catch ( Exception ex )
>>>             {
>>> @@ -93,10 +94,10 @@ class ASTMap
>>>             }
>>>         }
>>>
>>> -        for ( int i = 0; i < jjtGetNumChildren(); ++i )
>>> +        for ( int i = 0; i < jjtGetNumChildren( ); ++i )
>>>         {
>>>             ASTKeyValue kv = (ASTKeyValue) _children[i];
>>> -            Node k = kv.getKey(), v = kv.getValue();
>>> +            Node k = kv.getKey( ), v = kv.getValue( );
>>>
>>>             answer.put( k.getValue( context, source ), ( v == null ) ?
null : v.getValue( context, source ) );
>>>         }
>>> @@ -113,16 +114,18 @@ class ASTMap
>>>     {
>>>         throw new UnsupportedCompilationException( "Map expressions not supported
as native java yet." );
>>>     }
>>> -
>>> +
>>>     public <R, P> R accept( NodeVisitor<? extends R, ? super P>
visitor, P data )
>>>         throws OgnlException
>>>     {
>>>         return visitor.visit( this, data );
>>>     }
>>>
>>> -    private Class getDefaultMapClass( OgnlContext context ) {
>>> +    private Class getDefaultMapClass( OgnlContext context )
>>> +    {
>>>         Class defaultMapClass = defaultMapClassMap.get( context );
>>> -        if (defaultMapClass != null) {
>>> +        if ( defaultMapClass != null )
>>> +        {
>>>             return defaultMapClass;
>>>         }
>>>
>>>
>>>
>>>
>>
>>
>>
>> --
>> Olivier Lamy
>> Talend : http://talend.com
>> http://twitter.com/olamy | http://linkedin.com/in/olamy
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>



-- 
Olivier Lamy
Talend : http://talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message