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
if ( u != null
								&& u.getLexicalUnitType( ) == LexicalUnit.SAC_IDENT )
						{
							if ( isIdentifier( values[i + 1],
									IStyle.STYLE_BACKGROUND_REPEAT, engine ) )
							{
								result[1] = values[i + 1];
								return result;
							}
						}
					}
					result[1] = values[i];
				}
			}
		}
		return result;
	}
	protected boolean isIdentifier( String value, int index, CSSEngine engine )
	{
		if ( value != null )
		{
			IdentifierManager im = (IdentifierManager) engine
					.getPropertyManagerFactory( ).getValueManager( index );
			if ( im.getIdentifiers( ).get( value.toLowerCase( ).intern( ) ) != null )
			{
				return true;
			}
		}
		return false;
	}