Skip to content

Commit

Permalink
Merge pull request #129 from alrossi/fix/2.6/statistics_npe
Browse files Browse the repository at this point in the history
(2.6) statistics: Fix NPE in Html tree creation
  • Loading branch information
paulmillar committed Jul 18, 2013
2 parents 9dc4684 + 1492ece commit 459b034
Showing 1 changed file with 5 additions and 12 deletions.
Expand Up @@ -464,7 +464,7 @@ private void updateHtmlMonth( Calendar calendar ) throws IOException {

list = resortFileList( list , -1 ) ;

long [] counter = null ;
long [] counter = new long[12] ;
long [] total = new long[12] ;
long [] lastInMonth = new long[12] ;

Expand Down Expand Up @@ -493,7 +493,6 @@ private void updateHtmlMonth( Calendar calendar ) throws IOException {

st.nextToken() ;
String key = _dayOfCalendar.format( new Date( Long.parseLong( st.nextToken() ) ) ) ;
counter = new long[12] ;
for( int j = 0 ; j < counter.length ; j++ ){
counter[j] = Long.parseLong(st.nextToken()) ;
}
Expand All @@ -517,7 +516,7 @@ private void updateHtmlMonth( Calendar calendar ) throws IOException {
}


total[YESTERDAY] = counter[YESTERDAY] ;
total[YESTERDAY] = counter[YESTERDAY] ;
total[YESTERDAY+1] = counter[YESTERDAY+1] ;
total[TODAY] = lastInMonth[TODAY] ;
total[TODAY+1] = lastInMonth[TODAY+1] ;
Expand All @@ -530,7 +529,7 @@ private void updateHtmlYear( Calendar calendar ) throws IOException {

list = resortFileList( list , -1 ) ;

long [] counter = null ;
long [] counter = new long[12] ;
long [] total = new long[12] ;
long [] lastInMonth = new long[12] ;

Expand Down Expand Up @@ -558,7 +557,6 @@ private void updateHtmlYear( Calendar calendar ) throws IOException {

st.nextToken() ;
String key = _monthOfCalendar.format( new Date( Long.parseLong( st.nextToken() ) ) ) ;
counter = new long[12] ;
for( int j = 0 ; j < counter.length ; j++ ){
counter[j] = Long.parseLong(st.nextToken()) ;
}
Expand Down Expand Up @@ -594,7 +592,7 @@ private void updateHtmlTop( ) throws IOException {

list = resortFileList( list , -1 ) ;

long [] counter = null ;
long [] counter = new long[12] ;
long [] total = new long[12] ;
long [] lastInYear = new long[12] ;

Expand Down Expand Up @@ -622,7 +620,6 @@ private void updateHtmlTop( ) throws IOException {

st.nextToken() ;
String key = _yearOfCalendar.format( new Date( Long.parseLong( st.nextToken() ) ) ) ;
counter = new long[12] ;
for( int j = 0 ; j < counter.length ; j++ ){
counter[j] = Long.parseLong(st.nextToken()) ;
}
Expand Down Expand Up @@ -1464,11 +1461,7 @@ private Map<String,Map<String,long[]>> getBillingStatistics()
Map<String,Map<String,long[]>> generic = (Map<String,Map<String,long[]>>) o;
_log.info("getBillingStatistics : billing replied with "+generic);

Iterator<String> poolNames = generic.keySet().iterator() ;

for( int i = 0 ; poolNames.hasNext() ; i++ ){

String poolName = poolNames.next() ;
for (String poolName: generic.keySet()) {

m = new CellMessage( new CellPath("billing") , GET_POOL_STATISTICS+" "+poolName ) ;
try{
Expand Down

0 comments on commit 459b034

Please sign in to comment.