Skip to content
This repository has been archived by the owner on May 28, 2018. It is now read-only.

UriBuilder.fromPath(String path= null) #320

Closed
glassfishrobot opened this issue Mar 19, 2008 · 11 comments
Closed

UriBuilder.fromPath(String path= null) #320

glassfishrobot opened this issue Mar 19, 2008 · 11 comments

Comments

@glassfishrobot
Copy link

It does not throw IllegalArgumentException as specified in API javadoc

Environment

Operating System: All
Platform: All

@glassfishrobot
Copy link
Author

Reported by djiao@java.net

@glassfishrobot
Copy link
Author

Was assigned to jersey-issues

@glassfishrobot
Copy link
Author

sandoz@java.net said:
Accept.

@glassfishrobot
Copy link
Author

djiao@java.net said:
Same problem with UriBuilder.fromUri(String uri) when uri is null.

@glassfishrobot
Copy link
Author

sandoz@java.net said:
Fixed in the trunk.

@glassfishrobot
Copy link
Author

djiao@java.net said:
Tried again with July 14th jersey. Same problem still shows up. Please look at
it again.

@glassfishrobot
Copy link
Author

sandoz@java.net said:
The following Jersey unit test passes:

public void testIllegalArgumentException() {
boolean caught = false;
try

{ UriBuilder.fromPath(null); }

catch(IllegalArgumentException e)

{ caught = true; }
assertTrue(caught);

caught = false;
try { UriBuilder.fromUri((URI)null); } catch(IllegalArgumentException e) { caught = true; }

assertTrue(caught);

caught = false;
try

{ UriBuilder.fromUri((String)null); }

catch(IllegalArgumentException e)

{ caught = true; }

assertTrue(caught);
}

Suggest that you check the version of Jersey and your test code as i have not
made any changes.

@glassfishrobot
Copy link
Author

djiao@java.net said:
The failing case is:

caught = false;
try

{ //UriBuilder.fromUri((String)null); //this one passes for me as well UriBuilder.fromUri((""); }

catch(IllegalArgumentException e)

{ caught = true; }

assertTrue(caught);

@glassfishrobot
Copy link
Author

djiao@java.net said:
String "" is a valid uri.

@glassfishrobot
Copy link
Author

Marked as fixed on Wednesday, July 23rd 2008, 6:31:05 am

@glassfishrobot
Copy link
Author

This issue was imported from java.net JIRA JERSEY-48

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants