Bug 416987 ArrayIndexOutOfBoundsException when parsing padding style in HTML text
There is a bug in org.eclipse.birt.report.engine.layout.pdf.util.ShortHandProcessor at line 124 that causes ArrayIndexOutOfBoundsException when parsing padding like "padding:1pt 1.5pt 2pt 2.5pt": org.eclipse.birt.report.engine.layout.pdf.util.HTMLStyleProcessor - The css statement is:width:87.95pt;padding:1pt 1.5pt 2pt 2.5pt java.lang.ArrayIndexOutOfBoundsException: 4 at org.eclipse.birt.report.engine.layout.pdf.util.ShortHandProcessor$3.process(ShortHandProcessor.java:124) at org.eclipse.birt.report.engine.layout.pdf.util.ShortHandProcessor.process(ShortHandProcessor.java:617) at org.eclipse.birt.report.engine.layout.pdf.util.HTMLStyleProcessor.execute(HTMLStyleProcessor.java:161) at org.eclipse.birt.report.engine.layout.pdf.util.HTMLStyleProcessor.execute(HTMLStyleProcessor.java:251) at org.eclipse.birt.report.engine.layout.pdf.util.HTMLStyleProcessor.execute(HTMLStyleProcessor.java:251) at org.eclipse.birt.report.engine.layout.pdf.util.HTMLStyleProcessor.execute(HTMLStyleProcessor.java:251) at org.eclipse.birt.report.engine.layout.pdf.util.HTMLStyleProcessor.execute(HTMLStyleProcessor.java:251) at org.eclipse.birt.report.engine.layout.pdf.util.HTML2Content.processForeignData(HTML2Content.java:466) at org.eclipse.birt.report.engine.layout.pdf.util.HTML2Content.html2Content(HTML2Content.java:431) at org.eclipse.birt.report.engine.nLayout.LayoutEngine.startForeign(LayoutEngine.java:761) at org.eclipse.birt.report.engine.emitter.CompositeContentEmitter.startForeign(CompositeContentEmitter.java:266) at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:77) Let me know if you need an .rptdesign file to reproduce the error. The error is obvious. The following code tries to access an element at index 4 in the array of size 4: case 4 : buildPadding( buffer, vs[0], vs[1], vs[2], vs[4] );
engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/layout/pdf/util/ShortHandProcessor.java
appendStyle( buffer, CSSConstants.CSS_BORDER_BOTTOM_COLOR_PROPERTY,
				color );
	}
	protected void buildRightBorder( StringBuffer buffer, String width,
			String color, String style )
	{
		appendStyle( buffer, CSSConstants.CSS_BORDER_RIGHT_WIDTH_PROPERTY,
				width );
		appendStyle( buffer, CSSConstants.CSS_BORDER_RIGHT_COLOR_PROPERTY,
				color );
		appendStyle( buffer, CSSConstants.CSS_BORDER_RIGHT_STYLE_PROPERTY,
				style );
	}
	protected void buildBottomBorder( StringBuffer buffer, String width,
			String color, String style )
	{
		appendStyle( buffer, CSSConstants.CSS_BORDER_BOTTOM_WIDTH_PROPERTY,
				width );
		appendStyle( buffer, CSSConstants.CSS_BORDER_BOTTOM_COLOR_PROPERTY,
				color );
		appendStyle( buffer, CSSConstants.CSS_BORDER_BOTTOM_STYLE_PROPERTY,
				style );
	}
	protected void buildLeftBorder( StringBuffer buffer, String width,
			String color, String style )
	{
		appendStyle( buffer, CSSConstants.CSS_BORDER_LEFT_WIDTH_PROPERTY, width );
		appendStyle( buffer, CSSConstants.CSS_BORDER_LEFT_COLOR_PROPERTY, color );
		appendStyle( buffer, CSSConstants.CSS_BORDER_LEFT_STYLE_PROPERTY, style );
	}