accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Billie J Rinaldi <billie.j.rina...@ugov.gov>
Subject Re: Syntax Question in Mutation.java
Date Mon, 05 Mar 2012 14:37:43 GMT
I would say there's no reason not to change it.  Removing warnings is good.

Billie


----- Original Message -----
> From: "David Medinets" <david.medinets@gmail.com>
> To: "accumulo-dev" <accumulo-dev@incubator.apache.org>
> Sent: Sunday, March 4, 2012 10:52:01 PM
> Subject: Syntax Question in Mutation.java
> In core/src/main/java/org/apache/accumulo/core/data/Mutation.java, I
> see the following code:
> 
> 
> private List<byte[]> values;
> private int cachedValLens = -1;
> 
> long getValueLengths() {
> if (values == null)
> return 0;
> 
> if (cachedValLens == -1) {
> int tmpCVL = 0;
> for (byte val[] : values)
> tmpCVL += val.length;
> 
> cachedValLens = tmpCVL;
> }
> 
> return cachedValLens;
> 
> }
> 
> PMD is suggesting that the line:
> 
> for (byte val[] : values)
> 
> should be
> 
> for (byte[] val : values)
> 
> Is this a useful change?

Mime
View raw message