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_FONT_FAMILY_PROPERTY,
										vs[0] );
								break;
							case 2 :
								appendStyle( buffer,
										CSSConstants.CSS_FONT_FAMILY_PROPERTY,
										vs[0] );
								buildFontSize( buffer, vs[1], engine );
								break;
							default :
								appendStyle( buffer,
										CSSConstants.CSS_FONT_FAMILY_PROPERTY,
										vs[vs.length - 1] );
								buildFontSize( buffer, vs[vs.length - 2],
										engine );
								String[] values = new String[vs.length - 2];
								System.arraycopy( vs, 0, values, 0,
										vs.length - 2 );
								buildFontStyle( buffer, values, engine );
								break;
						}
					}
				} );
	}
	protected static void appendStyle( StringBuffer buffer, String name,
			String value )
	{
		buffer.append( name );
		buffer.append( COLON );