Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350141 - Incorrect use of valueGroup causes ArrayIndexOutOfBoundsException in tokenizer
Summary: Incorrect use of valueGroup causes ArrayIndexOutOfBoundsException in tokenizer
Status: CLOSED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: RM (show other bugs)
Version: 5.0   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-23 09:56 EDT by Greg Watson CLA
Modified: 2011-06-24 01:02 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Watson CLA 2011-06-23 09:56:59 EDT
Incorrect use of the valueGroup attribute cases an unhandled ArrayIndexOutOfBoundsException when parsing a stream:

java.lang.ArrayIndexOutOfBoundsException: 2
	at org.eclipse.ptp.rm.jaxb.control.internal.data.AbstractAssign.getValue(AbstractAssign.java:346)
	at org.eclipse.ptp.rm.jaxb.control.internal.data.SetImpl.getValue(SetImpl.java:48)
	at org.eclipse.ptp.rm.jaxb.control.internal.data.AbstractAssign.assign(AbstractAssign.java:241)
	at org.eclipse.ptp.rm.jaxb.control.internal.data.MatchImpl.doMatch(MatchImpl.java:131)
	at org.eclipse.ptp.rm.jaxb.control.internal.data.TargetImpl.doMatch(TargetImpl.java:127)
	at org.eclipse.ptp.rm.jaxb.control.internal.runnable.command.ConfigurableRegexTokenizer.matchTargets(ConfigurableRegexTokenizer.java:295)
	at org.eclipse.ptp.rm.jaxb.control.internal.runnable.command.ConfigurableRegexTokenizer.read(ConfigurableRegexTokenizer.java:371)
	at org.eclipse.ptp.rm.jaxb.control.internal.runnable.command.ConfigurableRegexTokenizer.run(ConfigurableRegexTokenizer.java:182)
	at java.lang.Thread.run(Thread.java:680)
	
Here is the XML:

				<target type="attribute">
					<match>
						<expression>ompi:version:full:([^:]*)</expression>
						<set field="name">
							<entry value="ompi_version"/>
						</set>
						<set field="value">
							<entry valueGroup="2"/>
						</set>
						<set field="visible">
							<entry value="true"/>
						</set>
						<set field="readOnly">
							<entry value="true"/>
						</set>
					</match>
				</target>

This should generate an error message rather than an unhandled exception
Comment 1 Albert L. Rossi CLA 2011-06-24 01:02:57 EDT
The user is now notified of this usage error via a MessageDialog; the exception, however, is still thrown.