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
|| CSSConstants.CSS_300_VALUE.equals( vs[i] )
							|| CSSConstants.CSS_400_VALUE.equals( vs[i] )
							|| CSSConstants.CSS_500_VALUE.equals( vs[i] )
							|| CSSConstants.CSS_600_VALUE.equals( vs[i] )
							|| CSSConstants.CSS_700_VALUE.equals( vs[i] )
							|| CSSConstants.CSS_800_VALUE.equals( vs[i] )
							|| CSSConstants.CSS_900_VALUE.equals( vs[i] ) )
					{
						appendStyle( buffer,
								CSSConstants.CSS_FONT_WEIGHT_PROPERTY, vs[i] );
						continue;
					}
				}
			}
		}
	}
	protected void buildFontSize( StringBuffer buffer, String value,
			CSSEngine engine )
	{
		if ( value != null && value.length( ) > 0 )
		{
			String[] ss = value.split( "/" );
			if ( ss.length == 1 )
			{
				appendStyle( buffer, CSSConstants.CSS_FONT_SIZE_PROPERTY, value );
			}
			else
			{
				appendStyle( buffer, CSSConstants.CSS_FONT_SIZE_PROPERTY, ss[0] );
				appendStyle( buffer, CSSConstants.CSS_LINE_HEIGHT_PROPERTY,