in method
public Pdu createPdu(java.nio.ByteBuffer buff)
Pdu aPdu = null; switch (pduTypeEnum) { ... case FIRE: aPdu = new FirePdu(); break; ... default: System.out.print("PDU not implemented. Type = " + pduType + "\n"); if (pduTypeEnum != null) { System.out.print("PDU not implemented name is: " + pduTypeEnum.getDescription()); } System.out.println(); } // end switch try { aPdu.unmarshal(buff); } catch (Exception exc) { //System.err.println("Could not unmarshal Pdu: " + exc.getMessage()); aPdu = null; }
Within the default case the variable aPdu is not initialized and therefore a NullPointerException is thrown when trying to unmarshal in the following try-catch statement.