On 5/25/06, Mikhail Loenko <[EMAIL PROTECTED]> 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