Bug 57226 - CellStyle.setShrinkToFit(true); makes the program fail, without throwing any error
Summary: CellStyle.setShrinkToFit(true); makes the program fail, without throwing any ...
Status: NEEDINFO
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-17 00:48 UTC by giovannig
Modified: 2015-09-13 20:55 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description giovannig 2014-11-17 00:48:29 UTC
I have a java class that initializes different cell styles to will be applied on a spreadsheet. Like the following:

private void createNormalStyle(Workbook wb){
		CellStyle cs = wb.createCellStyle();

		
//		cs.setShrinkToFit(true);
		
		cs.setAlignment(CellStyle.ALIGN_LEFT);
		cs.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
		
		
		this.standardCellStyle=cs;

	}

If I add the line that sets the rhinkToFt to true, the program blocks, without throwing any error.
If I remove it the program works fine.
Comment 1 Nick Burch 2014-11-17 07:34:11 UTC
Is this on all files, or just one?

Have you tried with the latest version of Apache POI? (3.11 beta 3)

Is this on all JVMs, or just one machine+JVM combination?
Comment 2 giovannig 2014-11-17 10:01:45 UTC
Only JVM 1.6.

I have tried only with Apache POI 3.10 (3.10-FINAL).

It was happening just with one file. I did not try with other files.
Comment 3 giovannig 2014-11-17 10:02:19 UTC
(In reply to giovannig from comment #2)
> Only JVM 1.6.
> 
> I have tried only with Apache POI 3.10 (3.10-FINAL).
> 
> It was happening just with one file. I did not try with other files.

Srry, I was meaning JVM 1.7
Comment 4 Dominik Stadler 2015-09-13 20:55:01 UTC
If this is still a problem for you we need a bit more information here, i.e. what is "jstack" reporting when you run it with the pid of the java program that hangs? Can you provide a self-sufficient sample-code that reproduces the problem? Ideally as a unit-test that we can add the test-suite of POI to keep a potential problem from re-appearing in the future?