Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 256802 Details for
Bug 478227
IOUtilities.getQueryParameter() returns the wrong parameter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Test class showing the problem
Fail.java (text/x-java-source), 803 bytes, created by
Mark Macdonald
on 2015-09-23 14:41:01 EDT
(
hide
)
Description:
Test class showing the problem
Filename:
MIME Type:
Creator:
Mark Macdonald
Created:
2015-09-23 14:41:01 EDT
Size:
803 bytes
patch
obsolete
>package fail; > >public class Fail { > > // This is IOUtilities.getQueryParameter slightly adapted to not depend on javax.servlet > public static String getQueryParameter(String queryString, String name) { > if (queryString == null) > return null; > > for (String paramString : queryString.split("&")) { //$NON-NLS-1$ > if (paramString.startsWith(name)) { > String[] nameAndValue = paramString.split("=", 2); //$NON-NLS-1$ > if (nameAndValue.length == 2) > return nameAndValue[1]; > return ""; // parameter has no value //$NON-NLS-1$ > } > } > // parameter not found > return null; > } > > public static void main(String[] args) { > String expected = "bar"; > String actual = getQueryParameter("football=1&foo=bar", "foo"); > System.out.println("Expected: " + expected + ", actual: " + actual); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 478227
: 256802