Bug 14919

Summary: HSSFSheet#getNumMergedRegions() throws NullPointerException
Product: POI Reporter: Toshiaki Kamoshida <kamoshida.toshiaki>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED DUPLICATE    
Severity: minor    
Priority: P3    
Version: 2.0-dev   
Target Milestone: ---   
Hardware: Other   
OS: other   

Description Toshiaki Kamoshida 2002-11-28 04:08:44 UTC
Hello,

When HSSFSheet instance is created by 
org.apache.poi.hssf.usermodel.HSSFSheet#createSheet(),instance field 
org.apache.poi.hssf.model.Sheet#marged is(not initialized correctry?) null,
calling HSSFSheet#getNumMergedRegions() and #getMergedRegionAt(int) throws 
NullPointerException.

I found it at 1.8.0dev.

Please try this code.
-------------------------------------------------------------
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

public class POITest {
	public static void main(String args[]){
		HSSFWorkbook b = new HSSFWorkbook();
		HSSFSheet s = b.createSheet();
		System.out.println(s.getNumMergedRegions());
	}
}
-------------------------------------------------------------

Thanks for each developer's good effort.
Comment 1 Toshiaki Kamoshida 2002-12-04 06:17:53 UTC
Sorry,this is a duplicate of bug No.13483.

*** This bug has been marked as a duplicate of 13483 ***