You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by andreaturli <gi...@git.apache.org> on 2014/07/11 18:34:11 UTC
[GitHub] incubator-brooklyn pull request: trim string value before transfor...
GitHub user andreaturli opened a pull request:
https://github.com/apache/incubator-brooklyn/pull/66
trim string value before transform it in a primitive
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/andreaturli/incubator-brooklyn fix/string-to-primitive
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-brooklyn/pull/66.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #66
----
commit de6fbd3d542c5232fdf78b0ae7ec5811c9ae0b5e
Author: Andrea Turli <an...@gmail.com>
Date: 2014-07-11T09:49:48Z
trim string value before transform it in a primitive
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: trim string value before transfor...
Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/66#discussion_r14885890
--- Diff: core/src/main/java/brooklyn/util/flags/TypeCoercions.java ---
@@ -46,6 +43,19 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.google.common.base.CaseFormat;
--- End diff --
Try not to reorganise imports (especially when no other changes) - previous was the Eclipse defaults; I believe this is the IntelliJ defaults.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: trim string value before transfor...
Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/66#issuecomment-48918929
Code looks good (except for import changes).
Unrelated: I've just seen the `TypeCoercions.stringToPrimitive` special cases for boolean: yes, no, t, f, y, n. Not convinced we want those! But it's completely unrelated to this PR.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: trim string value before transfor...
Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/66#discussion_r14870970
--- Diff: core/src/main/java/brooklyn/util/flags/TypeCoercions.java ---
@@ -326,7 +325,7 @@ public static boolean isPrimitiveOrBoxer(Class<?> type) {
@SuppressWarnings("unchecked")
public static <T> T stringToPrimitive(String value, Class<T> targetType) {
assert Primitives.allPrimitiveTypes().contains(targetType) || Primitives.allWrapperTypes().contains(targetType) : "targetType="+targetType;
-
+ value = value.trim();
--- End diff --
I think you should do this after the test for Character/char, else you'll never be able to coerce to char ' '.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: trim string value before transfor...
Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/66#issuecomment-49047603
Was wondering about the reorganize imports; but will just merge now anyway. Merging.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: trim string value before transfor...
Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/66#issuecomment-48882958
It would be worth adding a few lines to `TypeCoercionsTest.testCoerceStringToPrimitive` too.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: trim string value before transfor...
Posted by andreaturli <gi...@git.apache.org>.
Github user andreaturli commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/66#issuecomment-48889621
thanks @sjcorbett, I think now it is ok
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: trim string value before transfor...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/incubator-brooklyn/pull/66
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: trim string value before transfor...
Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/66#issuecomment-49045879
In case you're waiting on me: I can't merge this as I've not been set up to commit yet.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---