String[] (String errorReport) { if (errorReport == null) { errorReport = ""; } String[] messageAndDetails = errorReport.split("\n", 2); String message = null; if (messageAndDetails.length > 0) { message = messageAndDetails[0]; } if (message == null) { message = ""; } String details = null; if (messageAndDetails.length > 1) { details = messageAndDetails[1]; } if (details == null) { details = ""; } return new String[] {message, details}; }