[Json-rpc-java] coding style

Evan Leonard evan at mindreef.com
Fri Sep 28 10:06:30 SGT 2007


I agree with ant. Code style isn't that important. Which ever makes merging
easier makes sense to me.

(personally i like braces on new lines ;-)  )

Evan


On 9/27/07, ant elder <ant.elder at gmail.com> wrote:
>
> How about trying really hard to avoid this discussion for now?
>
> Coding styles are notoriously difficult to agree on, everyone has their
> own
> likes and dislikes and trying to pick one way will only be divisive. It is
> just where the whitespace goes in the source code - users aren't much
> interested in that.
>
>    ...ant
>
> On 9/27/07, Michael Clark <michael at metaparadigm.com> wrote:
> >
> > Hi Folks,
> >
> > Just wanted to ping the list on coding style.
> >
> > Since we are in talks with Arthur about a possible merge of the
> > JSON-RPC-Java project and JAbsorb I wanted to get some wider feedback on
> > coding style (it is a pretty major change and effects patch
> > compatibility if you have local changes).
> >
> > Ping us back that you:
> >
> > * prefer 1
> > * prefer 2
> > * prefer 2 but 1 might be a good idea until after my patch gets merged?
> >
> > I'll just feedback the results and stay neutral :)
> >
> > 1. This what we have in json-rpc-java svn trunk (which is similar to
> > that of apache-ant)
> >
> > indent=4 braces on same line
> >
> >     public void registerSerializer(Serializer s) throws Exception {
> >         Class classes[] = s.getSerializableClasses();
> >         Serializer exists;
> >         synchronized (serializerSet) {
> >             if(serializableMap == null) serializableMap = new HashMap();
> >             for (int i = 0; i < classes.length; i++) {
> >                 exists = (Serializer) serializableMap.get(classes[i]);
> >                 if (exists != null && exists.getClass() != s.getClass())
> >                     throw new Exception(
> >                             "different serializer already registered for
> "
> >                                     + classes[i].getName());
> >             }
> >             if (!serializerSet.contains(s)) {
> >                 if (isDebug())
> >                     log.info("registered serializer " + s.getClass
> > ().getName());
> >                 s.setOwner(this);
> >                 serializerSet.add(s);
> >                 serializerList.add(0, s);
> >                 for (int j = 0; j < classes.length; j++) {
> >                     serializableMap.put(classes[j], s);
> >                 }
> >             }
> >         }
> >     }
> >
> >
> >
> > 2. This what we have in jabsorb trunk:
> >
> > indent=2 braces on their own line
> >
> >   public void registerSerializer(Serializer s) throws Exception
> >   {
> >     Class classes[] = s.getSerializableClasses();
> >     Serializer exists;
> >     synchronized (serializerSet)
> >     {
> >       if (serializableMap == null)
> >       {
> >         serializableMap = new HashMap();
> >       }
> >       for (int i = 0; i < classes.length; i++)
> >       {
> >         exists = (Serializer) serializableMap.get(classes[i]);
> >         if (exists != null && exists.getClass() != s.getClass())
> >         {
> >           throw new Exception("different serializer already registered
> for
> > "
> >               + classes[i].getName());
> >         }
> >       }
> >       if (!serializerSet.contains(s))
> >       {
> >         if (log.isDebugEnabled())
> >         {
> >           log.debug("registered serializer " + s.getClass().getName());
> >         }
> >         s.setOwner(this);
> >         serializerSet.add(s);
> >         serializerList.add(0, s);
> >         for (int j = 0; j < classes.length; j++)
> >         {
> >           serializableMap.put(classes[j], s);
> >         }
> >       }
> >     }
> >   }
> >
> >
> >
> > _______________________________________________
> > Json-rpc-java mailing list
> > Json-rpc-java at oss.metaparadigm.com
> > http://oss.metaparadigm.com/mailman/listinfo/json-rpc-java
> >
> _______________________________________________
> Json-rpc-java mailing list
> Json-rpc-java at oss.metaparadigm.com
> http://oss.metaparadigm.com/mailman/listinfo/json-rpc-java
>


More information about the Json-rpc-java mailing list