Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336042 - [remoteserviceadmin] EndpointDescriptionParser.processValue does not handle whitespace correctly
Summary: [remoteserviceadmin] EndpointDescriptionParser.processValue does not handle w...
Status: RESOLVED FIXED
Alias: None
Product: ECF
Classification: RT
Component: ecf.remoteservices (show other bugs)
Version: 3.4.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5.0   Edit
Assignee: Scott Lewis CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-02 02:42 EST by Scott Lewis CLA
Modified: 2011-02-02 13:00 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Lewis CLA 2011-02-02 02:42:06 EST
In EndpointDescriptionParser.processValue is this code:

		private String processValue(String characters) {
			if (characters == null || characters.length() == 0)
				return null;

			if (valueType.equals("String")) //$NON-NLS-1$
				return characters;
			int startIndex = 0;
			while (Character.isWhitespace(characters.charAt(startIndex)))
				startIndex++;
			int endIndex = characters.length() - 1;

			while (Character.isWhitespace(characters.charAt(endIndex)))
				endIndex--;
			return characters.substring(startIndex, endIndex + 1);
		}


This code will fail with an ArrayIndexOutOfBounds exception if the characters is " " (a single space).
Comment 1 Scott Lewis CLA 2011-02-02 13:00:21 EST
Fix released to master.