You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Zack Shoylev <no...@github.com> on 2014/11/12 21:01:37 UTC

[jclouds] Small cleanup of how RegionToEndpoint checks arguments. (#599)

You can merge this Pull Request by running:

  git pull https://github.com/rackspace/jclouds regiontoendpoint-assertionerror

Or you can view, comment on it, or merge it online at:

  https://github.com/jclouds/jclouds/pull/599

-- Commit Summary --

  * Small cleanup of how RegionToEndpoint checks arguments.

-- File Changes --

    M core/src/main/java/org/jclouds/location/functions/RegionToEndpoint.java (7)
    M core/src/test/java/org/jclouds/location/functions/RegionToEndpointTest.java (4)

-- Patch Links --

https://github.com/jclouds/jclouds/pull/599.patch
https://github.com/jclouds/jclouds/pull/599.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/599

Re: [jclouds] Small cleanup of how RegionToEndpoint checks arguments. (#599)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #1373](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/1373/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/599#issuecomment-62787773

Re: [jclouds] Small cleanup of how RegionToEndpoint checks arguments. (#599)

Posted by Adrian Cole <no...@github.com>.
> @@ -41,7 +41,7 @@ public void testCorrect() {
>        assertEquals(fn.apply("1"), URI.create("http://1"));
>     }
>  
> -   @Test(expectedExceptions = IllegalArgumentException.class)
> +   @Test(expectedExceptions = AssertionError.class)

just take out these tests.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/599/files#r20247211

Re: [jclouds] Small cleanup of how RegionToEndpoint checks arguments. (#599)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests-java-7 #286](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests-java-7/286/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/599#issuecomment-62873978

Re: [jclouds] Small cleanup of how RegionToEndpoint checks arguments. (#599)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds #1900](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/1900/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/599#issuecomment-62792219

Re: [jclouds] Small cleanup of how RegionToEndpoint checks arguments. (#599)

Posted by Zack Shoylev <no...@github.com>.
> @@ -43,8 +42,10 @@ public RegionToEndpoint(@Region Supplier<Map<String, Supplier<URI>>> regionToEnd
>     }
>  
>     @Override
> -   public URI apply(@Nullable Object from) {
> -      checkArgument(from != null && from instanceof String, "you must specify a region, as a String argument");
> +   public URI apply(Object from) {
> +      if (!(from instanceof String)) {

I am weary of relying too heavily on tools like error-prone, but I do like removing code. Just making sure!
Thanks @adriancole 

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/599/files#r20247852

Re: [jclouds] Small cleanup of how RegionToEndpoint checks arguments. (#599)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests-java-7 #285](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests-java-7/285/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/599#issuecomment-62796678

Re: [jclouds] Small cleanup of how RegionToEndpoint checks arguments. (#599)

Posted by Zack Shoylev <no...@github.com>.
Closed #599.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/599#event-192598739

Re: [jclouds] Small cleanup of how RegionToEndpoint checks arguments. (#599)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #1374](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/1374/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/599#issuecomment-62799009

Re: [jclouds] Small cleanup of how RegionToEndpoint checks arguments. (#599)

Posted by Adrian Cole <no...@github.com>.
> @@ -43,8 +42,10 @@ public RegionToEndpoint(@Region Supplier<Map<String, Supplier<URI>>> regionToEnd
>     }
>  
>     @Override
> -   public URI apply(@Nullable Object from) {
> -      checkArgument(from != null && from instanceof String, "you must specify a region, as a String argument");
> +   public URI apply(Object from) {
> +      if (!(from instanceof String)) {

I would take this out. This is a distraction and we could better solve this with a tool like error-prone than divert someone to wondering.. hmm what if that is not a String? Instead of focusing on the real code, there's a distraction.

I'd just note this potential snafu here: https://issues.apache.org/jira/browse/JCLOUDS-752
(ps take out @Nullable too).

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/599/files#r20247178

Re: [jclouds] Small cleanup of how RegionToEndpoint checks arguments. (#599)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds #1902](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/1902/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/599#issuecomment-62877911

Re: [jclouds] Small cleanup of how RegionToEndpoint checks arguments. (#599)

Posted by Zack Shoylev <no...@github.com>.
merged

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/599#issuecomment-62871915

Re: [jclouds] Small cleanup of how RegionToEndpoint checks arguments. (#599)

Posted by Zack Shoylev <no...@github.com>.
No backport planned
About to squash/merge

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/599#issuecomment-62869270

Re: [jclouds] Small cleanup of how RegionToEndpoint checks arguments. (#599)

Posted by Adrian Cole <no...@github.com>.
+1 squash and merge! (also fine for 1.8.x though ack that's pretty much a dead branch).

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/599#issuecomment-62794903

Re: [jclouds] Small cleanup of how RegionToEndpoint checks arguments. (#599)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests #1375](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests/1375/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/599#issuecomment-62874932

Re: [jclouds] Small cleanup of how RegionToEndpoint checks arguments. (#599)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds #1901](https://buildhive.cloudbees.com/job/jclouds/job/jclouds/1901/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/599#issuecomment-62803641

Re: [jclouds] Small cleanup of how RegionToEndpoint checks arguments. (#599)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-pull-requests-java-7 #284](https://jclouds.ci.cloudbees.com/job/jclouds-pull-requests-java-7/284/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/599#issuecomment-62786619