harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Fursov" <mike.fur...@gmail.com>
Subject Re: [website] harmony-dev agreements and recommendations
Date Thu, 25 May 2006 18:38:20 GMT
On 5/25/06, Mikhail Loenko <mloenko@gmail.com> wrote:
>
> The first grep result is:
>     private PropertyChangeEvent createPropertyChangeEvent(
>             String propertyName, int oldValue, int newValue) {
>         return new PropertyChangeEvent(sourceBean, propertyName,
>                 new Integer(oldValue), new Integer(newValue));
>     }
> How do you suggest to make it better?


Integer.valueOf, Boolean.valueOf. For Boolean new object is never created.


>
> > > 4) Never do manual array copying (our crypto API does )
> > >
> > > What do you mean by 'manual array copying'? How it should be done and
> why?
> >
> >
> > This is manual copying of arrays in loop instead of System.arraycopy()
> call
> > (System.arraycopy() can be implemented as performance primitive in VM or
> > JIT)
> > Check this code as example: ExemptionMechanism:249, Statement:164
>
> Agreed here. BTW, if array has a lenght of 5 what is the best copying way?


I do not know :) But in code with manual array copying of
arrays with dynamic number of iteration it's better to add a comment why
arraycopy method was not used.


-- 
Mikhail Fursov
Intel Middleware Products Division

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message