You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Filippo Diotalevi <fi...@gmail.com> on 2009/09/16 23:02:04 UTC

Coding standard changed? [Re: svn commit: r815960 - /felix/trunk/shell/src/main/java/org/apache/felix/shell/impl/SystemPropertiesCommandImpl.java]

Richard,
  are coding standard changed?

I use the Eclipse template file provided at
http://felix.apache.org/site/coding-standards.data/ApacheFelixCodingStandards.xml
(linked from http://felix.apache.org/site/coding-standards.html )

-- 
Filippo

On Wed, Sep 16, 2009 at 10:53 PM,  <ri...@apache.org> wrote:
> Author: rickhall
> Date: Wed Sep 16 20:53:28 2009
> New Revision: 815960
>
> URL: http://svn.apache.org/viewvc?rev=815960&view=rev
> Log:
> Reformatted code to Felix coding style (mostly removed extra whitespace).
>
> Modified:
>    felix/trunk/shell/src/main/java/org/apache/felix/shell/impl/SystemPropertiesCommandImpl.java
>
> Modified: felix/trunk/shell/src/main/java/org/apache/felix/shell/impl/SystemPropertiesCommandImpl.java
> URL: http://svn.apache.org/viewvc/felix/trunk/shell/src/main/java/org/apache/felix/shell/impl/SystemPropertiesCommandImpl.java?rev=815960&r1=815959&r2=815960&view=diff
> ==============================================================================
> --- felix/trunk/shell/src/main/java/org/apache/felix/shell/impl/SystemPropertiesCommandImpl.java (original)
> +++ felix/trunk/shell/src/main/java/org/apache/felix/shell/impl/SystemPropertiesCommandImpl.java Wed Sep 16 20:53:28 2009
> @@ -18,14 +18,12 @@
>  */
>  package org.apache.felix.shell.impl;
>
> -
>  import java.io.PrintStream;
>  import java.util.Iterator;
>  import java.util.StringTokenizer;
>
>  import org.apache.felix.shell.Command;
>
> -
>  /**
>  * Command to display, set and modify system properties
>  * Usage:
> @@ -35,61 +33,55 @@
>  */
>  public class SystemPropertiesCommandImpl implements Command
>  {
> -
> -    public void execute( String line, PrintStream out, PrintStream err )
> +    public void execute(String line, PrintStream out, PrintStream err)
>     {
> -        StringTokenizer st = new StringTokenizer( line );
> +        StringTokenizer st = new StringTokenizer(line);
>         int tokens = st.countTokens();
>
> -        if ( tokens == 1 )
> +        if (tokens == 1)
>         {
> -            printAll( out );
> +            printAll(out);
>         }
>         else
>         {
>             st.nextToken();
>             String propertyKey = st.nextToken();
>
> -            if ( tokens == 2 )
> +            if (tokens == 2)
>             {
> -                out.println( propertyKey + "=" + System.getProperty( propertyKey ) );
> +                out.println(propertyKey + "=" + System.getProperty(propertyKey));
>             }
>             else
>             {
>                 String value = st.nextToken();
> -                System.setProperty( propertyKey, value );
> -                out.println( "Set " + propertyKey + "=" + value );
> +                System.setProperty(propertyKey, value);
> +                out.println("Set " + propertyKey + "=" + value);
>             }
>         }
>     }
>
> -
> -    private void printAll( PrintStream out )
> +    private void printAll(PrintStream out)
>     {
> -        out.println( "-------System properties------" );
> -        for ( Iterator keyIterator = System.getProperties().keySet().iterator(); keyIterator.hasNext(); )
> +        out.println("-------System properties------");
> +        for (Iterator keyIterator = System.getProperties().keySet().iterator(); keyIterator.hasNext(); )
>         {
>             Object key = keyIterator.next();
> -            out.println( key.toString() + "=" + System.getProperty( key.toString() ) );
> +            out.println(key.toString() + "=" + System.getProperty(key.toString()));
>         }
>     }
>
> -
>     public String getName()
>     {
>         return "sysprop";
>     }
>
> -
>     public String getShortDescription()
>     {
>         return "Display, set and modify system properties";
>     }
>
> -
>     public String getUsage()
>     {
>         return "sysprop [<key>] [<value>]";
>     }
> -
> -}
> +}
> \ No newline at end of file
>
>

Re: Coding standard changed? [Re: svn commit: r815960 - /felix/trunk/shell/src/main/java/org/apache/felix/shell/impl/SystemPropertiesCommandImpl.java]

Posted by Derek Baum <de...@paremus.com>.
Hi,

I raised https://issues.apache.org/jira/browse/FELIX-1406 "eclipse
code format template does not match existing code" a while ago, but
forgot to follow it up.

Derek

2009/9/16 Filippo Diotalevi <fi...@gmail.com>:
> Richard,
>  are coding standard changed?
>
> I use the Eclipse template file provided at
> http://felix.apache.org/site/coding-standards.data/ApacheFelixCodingStandards.xml
> (linked from http://felix.apache.org/site/coding-standards.html )
>
> --
> Filippo
>
> On Wed, Sep 16, 2009 at 10:53 PM,  <ri...@apache.org> wrote:
>> Author: rickhall
>> Date: Wed Sep 16 20:53:28 2009
>> New Revision: 815960
>>
>> URL: http://svn.apache.org/viewvc?rev=815960&view=rev
>> Log:
>> Reformatted code to Felix coding style (mostly removed extra whitespace).
>>
>> Modified:
>>    felix/trunk/shell/src/main/java/org/apache/felix/shell/impl/SystemPropertiesCommandImpl.java
>>
>> Modified: felix/trunk/shell/src/main/java/org/apache/felix/shell/impl/SystemPropertiesCommandImpl.java
>> URL: http://svn.apache.org/viewvc/felix/trunk/shell/src/main/java/org/apache/felix/shell/impl/SystemPropertiesCommandImpl.java?rev=815960&r1=815959&r2=815960&view=diff
>> ==============================================================================
>> --- felix/trunk/shell/src/main/java/org/apache/felix/shell/impl/SystemPropertiesCommandImpl.java (original)
>> +++ felix/trunk/shell/src/main/java/org/apache/felix/shell/impl/SystemPropertiesCommandImpl.java Wed Sep 16 20:53:28 2009
>> @@ -18,14 +18,12 @@
>>  */
>>  package org.apache.felix.shell.impl;
>>
>> -
>>  import java.io.PrintStream;
>>  import java.util.Iterator;
>>  import java.util.StringTokenizer;
>>
>>  import org.apache.felix.shell.Command;
>>
>> -
>>  /**
>>  * Command to display, set and modify system properties
>>  * Usage:
>> @@ -35,61 +33,55 @@
>>  */
>>  public class SystemPropertiesCommandImpl implements Command
>>  {
>> -
>> -    public void execute( String line, PrintStream out, PrintStream err )
>> +    public void execute(String line, PrintStream out, PrintStream err)
>>     {
>> -        StringTokenizer st = new StringTokenizer( line );
>> +        StringTokenizer st = new StringTokenizer(line);
>>         int tokens = st.countTokens();
>>
>> -        if ( tokens == 1 )
>> +        if (tokens == 1)
>>         {
>> -            printAll( out );
>> +            printAll(out);
>>         }
>>         else
>>         {
>>             st.nextToken();
>>             String propertyKey = st.nextToken();
>>
>> -            if ( tokens == 2 )
>> +            if (tokens == 2)
>>             {
>> -                out.println( propertyKey + "=" + System.getProperty( propertyKey ) );
>> +                out.println(propertyKey + "=" + System.getProperty(propertyKey));
>>             }
>>             else
>>             {
>>                 String value = st.nextToken();
>> -                System.setProperty( propertyKey, value );
>> -                out.println( "Set " + propertyKey + "=" + value );
>> +                System.setProperty(propertyKey, value);
>> +                out.println("Set " + propertyKey + "=" + value);
>>             }
>>         }
>>     }
>>
>> -
>> -    private void printAll( PrintStream out )
>> +    private void printAll(PrintStream out)
>>     {
>> -        out.println( "-------System properties------" );
>> -        for ( Iterator keyIterator = System.getProperties().keySet().iterator(); keyIterator.hasNext(); )
>> +        out.println("-------System properties------");
>> +        for (Iterator keyIterator = System.getProperties().keySet().iterator(); keyIterator.hasNext(); )
>>         {
>>             Object key = keyIterator.next();
>> -            out.println( key.toString() + "=" + System.getProperty( key.toString() ) );
>> +            out.println(key.toString() + "=" + System.getProperty(key.toString()));
>>         }
>>     }
>>
>> -
>>     public String getName()
>>     {
>>         return "sysprop";
>>     }
>>
>> -
>>     public String getShortDescription()
>>     {
>>         return "Display, set and modify system properties";
>>     }
>>
>> -
>>     public String getUsage()
>>     {
>>         return "sysprop [<key>] [<value>]";
>>     }
>> -
>> -}
>> +}
>> \ No newline at end of file
>>
>>
>

Re: Coding standard changed? [Re: svn commit: r815960 - /felix/trunk/shell/src/main/java/org/apache/felix/shell/impl/SystemPropertiesCommandImpl.java]

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 9/16/09 23:11, Filippo Diotalevi wrote:
> On Wed, Sep 16, 2009 at 11:08 PM, Richard S. Hall<he...@ungoverned.org>  wrote:
>    
>> No. The code had spaces after/before parens and double lines between
>> methods, so i removed them. I don't use Eclipse, so perhaps the style
>> template is wrong.
>>
>> ->  richard
>>      
> Thanks, sorry about the wrong style; I'll fix the template and upload a new one.
>    

No problem. I am only strict for the subprojects on which I work (or try 
to). :-)

Yes, if it is wrong please fix it. Thanks.

-> richard

Re: Coding standard changed? [Re: svn commit: r815960 - /felix/trunk/shell/src/main/java/org/apache/felix/shell/impl/SystemPropertiesCommandImpl.java]

Posted by Filippo Diotalevi <fi...@gmail.com>.
On Wed, Sep 16, 2009 at 11:08 PM, Richard S. Hall <he...@ungoverned.org> wrote:
> No. The code had spaces after/before parens and double lines between
> methods, so i removed them. I don't use Eclipse, so perhaps the style
> template is wrong.
>
> -> richard

Thanks, sorry about the wrong style; I'll fix the template and upload a new one.

-- 
Filippo Diotalevi

Re: Coding standard changed? [Re: svn commit: r815960 - /felix/trunk/shell/src/main/java/org/apache/felix/shell/impl/SystemPropertiesCommandImpl.java]

Posted by "Richard S. Hall" <he...@ungoverned.org>.
No. The code had spaces after/before parens and double lines between 
methods, so i removed them. I don't use Eclipse, so perhaps the style 
template is wrong.

-> richard

On 9/16/09 23:02, Filippo Diotalevi wrote:
> Richard,
>    are coding standard changed?
>
> I use the Eclipse template file provided at
> http://felix.apache.org/site/coding-standards.data/ApacheFelixCodingStandards.xml
> (linked from http://felix.apache.org/site/coding-standards.html )
>
>