https://issues.apache.org/bugzilla/show_bug.cgi?id=57362
[email protected] changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW --- Comment #3 from [email protected] --- I just downloaded the src from svn and trying to get used to build process and creating patch . Meanwhile I just provide the test case and possible fix (which, I had tried out to be working). Test Examples: //Load existing excel with some chart on it having primary and secondary axis. final File res = new File("SampleExcel.xlsx"); final Workbook workbook = new XSSFWorkbook(OPCPackage.open(new FileInputStream(res))); final Sheet sh = workbook.getSheetAt(0); final XSSFSheet xsh = (XSSFSheet) sh; final XSSFDrawing drawing = xsh.createDrawingPatriarch(); final XSSFChart chart = drawing.getCharts().get(0); final List<XSSFChartAxis> axisList = (List<XSSFChartAxis>) chart.getAxis(); //Note: getAxis fails as axis variable inside chart is null. for(XSSFChartAxis axis: axisList){ //Do Some operation. } Fix:XSSFChart.java ===================== public List<? extends XSSFChartAxis> getAxis() { //ADDED NULL Check and Initialize the axis. if(axis == null){ axis = new ArrayList<XSSFChartAxis>(); } if (axis.isEmpty() && hasAxis()) { parseAxis(); } return axis; } -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
