Se ci dici la riga che solleva la NPE...Originariamente inviato da Fabietto206
Ho fatto così:
Però va in NullPointer, cosa sbaglio?codice:while (nav.hasNextElement()) { ddt = (DocumentoVenditaTes) nav.nextElement(); if(!ddt.getNumeroDDTCliente().getFormatted().equals(ddt.getNumeroDDTCliente().getNullValue())){ for(int i=0; i<vettoreNumeroDDT.length-1; i++){ vettoreNumeroDDT[i] = new NumericLTBL(ddt.getNumeroDDTCliente().getCName(), ddt.getNumeroDDTCliente().getAName()); vettoreNumeroDDT[i].setFormatted(ddt.getNumeroDDTCliente().getFormatted()); Integer elSucc = vettoreNumeroDDT[i+1].intValue(); // caso in cui il numero successivo è = if(!vettoreNumeroDDT[i].getFormatted().equals(elSucc) || !vettoreNumeroDDT[i].getFormatted().equals(elSucc - 1)){ // ci sono buchi Integer elCorrente = vettoreNumeroDDT[i].intValue(); Integer elCor = elCorrente + 1; while(elCor < elSucc){ cont.add(uno); elCor++; pdf.writeNewRow(FieldMapping.getValueOfAttribute(elCor, "numeroDDTCliente"), 0); } } } }