You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by huangyiminghappy <gi...@git.apache.org> on 2017/05/17 06:27:48 UTC

[GitHub] incubator-rocketmq pull request #104: Remove spaces before and after the pro...

GitHub user huangyiminghappy opened a pull request:

    https://github.com/apache/incubator-rocketmq/pull/104

    Remove spaces before and after the properties

    Remove spaces before and after the properties,Avoid errors due to spaces before and after the properties of data

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/huangyiminghappy/incubator-rocketmq master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-rocketmq/pull/104.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 #104
    
----
commit 0011c2fc9fd7092301e9ab87bb4b654bf7e90ae6
Author: huangyiming <hu...@163.com>
Date:   2017-05-17T06:20:16Z

    Remove spaces before and after the properties

commit 4492a1deb3be6e818dd18d48cdca49170dd67bd1
Author: huangyiming <hu...@163.com>
Date:   2017-05-17T06:26:18Z

    Update MixAll.java
    
    Remove spaces before and after the properties

----


---
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-rocketmq issue #104: Remove spaces before and after the properties

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/104
  
    
    [![Coverage Status](https://coveralls.io/builds/11577035/badge)](https://coveralls.io/builds/11577035)
    
    Coverage increased (+0.1%) to 31.122% when pulling **42c2c65924557ebaa6f30e9f449694125fa6bcea on huangyiminghappy:master** into **fa85abcdf6ee46e56403ddf86828a38683103fd0 on apache:master**.



---
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-rocketmq issue #104: Remove spaces before and after the properties

Posted by dongeforever <gi...@git.apache.org>.
Github user dongeforever commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/104
  
    IMO. if using trim, it is better to trim in all related places


---
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-rocketmq pull request #104: Remove spaces before and after the pro...

Posted by Jaskey <gi...@git.apache.org>.
Github user Jaskey commented on a diff in the pull request:

    https://github.com/apache/incubator-rocketmq/pull/104#discussion_r116984117
  
    --- Diff: common/src/main/java/org/apache/rocketmq/common/MixAll.java ---
    @@ -339,6 +339,8 @@ public static void properties2Object(final Properties p, final Object object) {
                         String key = first.toLowerCase() + tmp;
                         String property = p.getProperty(key);
                         if (property != null) {
    +                        // remove spaces before and after
    --- End diff --
    
    I think the purpose is clean enough so I don't think the comment is needed here for `trim()`


---
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-rocketmq issue #104: Remove spaces before and after the properties

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/104
  
    
    [![Coverage Status](https://:/builds/11999072/badge)](https://:/builds/11999072)
    
    Coverage increased (+7.7%) to 38.683% when pulling **818b159683b17224447749faa140b9ce12388730 on huangyiminghappy:master** into **fa85abcdf6ee46e56403ddf86828a38683103fd0 on apache:master**.



---
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-rocketmq issue #104: Remove spaces before and after the properties

Posted by Jaskey <gi...@git.apache.org>.
Github user Jaskey commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/104
  
    +1 


---
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-rocketmq issue #104: Remove spaces before and after the properties

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/104
  
    
    [![Coverage Status](https://coveralls.io/builds/11561267/badge)](https://coveralls.io/builds/11561267)
    
    Coverage decreased (-0.001%) to 30.976% when pulling **86ee77b85a1568fb239c3437ff42dac374c19aee on huangyiminghappy:master** into **fa85abcdf6ee46e56403ddf86828a38683103fd0 on apache:master**.



---
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-rocketmq pull request #104: [ROCKETMQ-201]Remove spaces before and...

Posted by huangyiminghappy <gi...@git.apache.org>.
Github user huangyiminghappy closed the pull request at:

    https://github.com/apache/incubator-rocketmq/pull/104


---
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-rocketmq issue #104: Remove spaces before and after the properties

Posted by huangyiminghappy <gi...@git.apache.org>.
Github user huangyiminghappy commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/104
  
    if i use the file like properties 
    ![image](https://cloud.githubusercontent.com/assets/9736914/26141246/7d28ded6-3b0d-11e7-8aab-c55df4643b26.png)
    ![image](https://cloud.githubusercontent.com/assets/9736914/26141384/2844ac78-3b0e-11e7-97f7-ed9161bbadf1.png)
    
    the properties's property has any space,it will get an Not expected value, Numeric possible type conversion error,but The string may get a bug that is not expected,Very difficult to troubleshoot



---
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-rocketmq issue #104: Remove spaces before and after the properties

Posted by dongeforever <gi...@git.apache.org>.
Github user dongeforever commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/104
  
    +1


---
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-rocketmq issue #104: Remove spaces before and after the properties

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/104
  
    
    [![Coverage Status](https://coveralls.io/builds/11581198/badge)](https://coveralls.io/builds/11581198)
    
    Coverage increased (+0.06%) to 31.036% when pulling **4ef07e4249daa9e9122a45bf195fb7f0e87246e1 on huangyiminghappy:master** into **fa85abcdf6ee46e56403ddf86828a38683103fd0 on apache:master**.



---
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-rocketmq pull request #104: Remove spaces before and after the pro...

Posted by zhouxinyu <gi...@git.apache.org>.
Github user zhouxinyu commented on a diff in the pull request:

    https://github.com/apache/incubator-rocketmq/pull/104#discussion_r118433272
  
    --- Diff: common/src/main/java/org/apache/rocketmq/common/MixAll.java ---
    @@ -279,7 +279,7 @@ public static String properties2String(final Properties properties) {
             StringBuilder sb = new StringBuilder();
             for (Map.Entry<Object, Object> entry : properties.entrySet()) {
                 if (entry.getValue() != null) {
    -                sb.append(entry.getKey().toString() + "=" + entry.getValue().toString() + "\n");
    +                sb.append(entry.getKey().toString().trim() + "=" + entry.getValue().toString().trim() + "\n");
    --- End diff --
    
    MixAll has many utility methods, I don't think it's a good idea to change the input in such method.
    If you really want to do this, maybe earlier is better.


---
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-rocketmq pull request #104: Remove spaces before and after the pro...

Posted by huangyiminghappy <gi...@git.apache.org>.
Github user huangyiminghappy commented on a diff in the pull request:

    https://github.com/apache/incubator-rocketmq/pull/104#discussion_r122374851
  
    --- Diff: common/src/main/java/org/apache/rocketmq/common/MixAll.java ---
    @@ -279,7 +279,7 @@ public static String properties2String(final Properties properties) {
             StringBuilder sb = new StringBuilder();
             for (Map.Entry<Object, Object> entry : properties.entrySet()) {
                 if (entry.getValue() != null) {
    -                sb.append(entry.getKey().toString() + "=" + entry.getValue().toString() + "\n");
    +                sb.append(entry.getKey().toString().trim() + "=" + entry.getValue().toString().trim() + "\n");
    --- End diff --
    
    @zhouxinyu   i have remove  the above change ,only change the properties's trim(), thank you review it
     


---
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-rocketmq pull request #104: Remove spaces before and after the pro...

Posted by huangyiminghappy <gi...@git.apache.org>.
Github user huangyiminghappy commented on a diff in the pull request:

    https://github.com/apache/incubator-rocketmq/pull/104#discussion_r117149430
  
    --- Diff: common/src/main/java/org/apache/rocketmq/common/MixAll.java ---
    @@ -339,6 +339,8 @@ public static void properties2Object(final Properties p, final Object object) {
                         String key = first.toLowerCase() + tmp;
                         String property = p.getProperty(key);
                         if (property != null) {
    +                        // remove spaces before and after
    --- End diff --
    
    ok,i remove the comment


---
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-rocketmq pull request #104: Remove spaces before and after the pro...

Posted by Jaskey <gi...@git.apache.org>.
Github user Jaskey commented on a diff in the pull request:

    https://github.com/apache/incubator-rocketmq/pull/104#discussion_r117158804
  
    --- Diff: common/src/main/java/org/apache/rocketmq/common/MixAll.java ---
    @@ -339,6 +339,8 @@ public static void properties2Object(final Properties p, final Object object) {
                         String key = first.toLowerCase() + tmp;
                         String property = p.getProperty(key);
                         if (property != null) {
    +                        // remove spaces before and after
    --- End diff --
    
    what about we also trim the method `public static String properties2String(final Properties properties)` ?


---
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-rocketmq issue #104: Remove spaces before and after the properties

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/104
  
    
    [![Coverage Status](https://coveralls.io/builds/11561267/badge)](https://coveralls.io/builds/11561267)
    
    Coverage decreased (-0.001%) to 30.976% when pulling **86ee77b85a1568fb239c3437ff42dac374c19aee on huangyiminghappy:master** into **fa85abcdf6ee46e56403ddf86828a38683103fd0 on apache:master**.



---
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-rocketmq issue #104: Remove spaces before and after the properties

Posted by Jaskey <gi...@git.apache.org>.
Github user Jaskey commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/104
  
    Thank you. Please notice your topic and also relate the issue to the jira link https://issues.apache.org/jira/browse/ROCKETMQ.


---
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-rocketmq issue #104: [ROCKETMQ-201]Remove spaces before and after ...

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/104
  
    
    [![Coverage Status](https://:/builds/12003059/badge)](https://:/builds/12003059)
    
    Coverage increased (+8.2%) to 39.184% when pulling **af830388b59461f7ca72a5ffd8c80e2f183aecfd on huangyiminghappy:master** into **fa85abcdf6ee46e56403ddf86828a38683103fd0 on apache:master**.



---
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-rocketmq pull request #104: Remove spaces before and after the pro...

Posted by huangyiminghappy <gi...@git.apache.org>.
Github user huangyiminghappy commented on a diff in the pull request:

    https://github.com/apache/incubator-rocketmq/pull/104#discussion_r117210642
  
    --- Diff: common/src/main/java/org/apache/rocketmq/common/MixAll.java ---
    @@ -339,6 +339,8 @@ public static void properties2Object(final Properties p, final Object object) {
                         String key = first.toLowerCase() + tmp;
                         String property = p.getProperty(key);
                         if (property != null) {
    +                        // remove spaces before and after
    --- End diff --
    
    yes ,you are right,wo can add trim like this:
    ![image](https://cloud.githubusercontent.com/assets/9736914/26197666/98939b5a-3bf5-11e7-8ea4-1526bca9009c.png)
    Add directly in properties2String is not accurate,because attribute and value also may before or after blank,i commit and pull request ,please review it ,thank you 


---
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-rocketmq pull request #104: Remove spaces before and after the pro...

Posted by huangyiminghappy <gi...@git.apache.org>.
Github user huangyiminghappy commented on a diff in the pull request:

    https://github.com/apache/incubator-rocketmq/pull/104#discussion_r120526362
  
    --- Diff: common/src/main/java/org/apache/rocketmq/common/MixAll.java ---
    @@ -279,7 +279,7 @@ public static String properties2String(final Properties properties) {
             StringBuilder sb = new StringBuilder();
             for (Map.Entry<Object, Object> entry : properties.entrySet()) {
                 if (entry.getValue() != null) {
    -                sb.append(entry.getKey().toString() + "=" + entry.getValue().toString() + "\n");
    +                sb.append(entry.getKey().toString().trim() + "=" + entry.getValue().toString().trim() + "\n");
    --- End diff --
    
    ok,I try it, thanks


---
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-rocketmq issue #104: Remove spaces before and after the properties

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/104
  
    
    [![Coverage Status](https://coveralls.io/builds/11581198/badge)](https://coveralls.io/builds/11581198)
    
    Coverage increased (+0.06%) to 31.036% when pulling **4ef07e4249daa9e9122a45bf195fb7f0e87246e1 on huangyiminghappy:master** into **fa85abcdf6ee46e56403ddf86828a38683103fd0 on apache:master**.



---
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.
---