Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 336042

Summary: [remoteserviceadmin] EndpointDescriptionParser.processValue does not handle whitespace correctly
Product: [RT] ECF Reporter: Scott Lewis <slewis>
Component: ecf.remoteservicesAssignee: Scott Lewis <slewis>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.4.0   
Target Milestone: 3.5.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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.