Uploaded image for project: 'Apache RocketMQ'
  1. Apache RocketMQ
  2. ROCKETMQ-43

code style file didn't match check-style in typecast

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.0-incubating
    • Component/s: None
    • Labels:
      None

      Description

      I have already add RocketMQ's style file, and use IntelliJ to format file, still fail on style-check like this:

      [INFO] Starting audit...
      /home/travis/build/wu-sheng/incubator-rocketmq/namesrv/src/main/java/org/apache/rocketmq/namesrv/NamesrvStartup.java:105:47: error: 'typecast' is not followed by whitespace.

      In intelliJ auto-format:
      LoggerContext lc = (LoggerContext)LoggerFactory.getILoggerFactory();

      But in style-check:
      LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();

      It got my crazy... when I change some classes, which include cast.

        Issue Links

          Activity

          Hide
          wu-sheng Wu Sheng added a comment -

          There are both NoWhitespaceBefore and WhitespaceAfter modules in checkstyle.xml, like this:
          <module name="NoWhitespaceBefore"/>
          <module name="WhitespaceAfter"/>

          Show
          wu-sheng Wu Sheng added a comment - There are both NoWhitespaceBefore and WhitespaceAfter modules in checkstyle.xml, like this: <module name="NoWhitespaceBefore"/> <module name="WhitespaceAfter"/>
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user wu-sheng opened a pull request:

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

          ROCKETMQ-43 Remove NoWhitespaceBefore module in “rmq_checkstyle.xml”

          There are both NoWhitespaceBefore and WhitespaceAfter modules in checkstyle.xml, like this:
          <module name="NoWhitespaceBefore"/>
          <module name="WhitespaceAfter"/>

          ref https://issues.apache.org/jira/browse/ROCKETMQ-43

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

          $ git pull https://github.com/wu-sheng/incubator-rocketmq fix/ROCKETMQ-43

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

          https://github.com/apache/incubator-rocketmq/pull/36.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 #36


          commit 30bbee67d030c3d0910be773beb3eb1578ac4644
          Author: wusheng <wu.sheng@foxmail.com>
          Date: 2017-01-11T08:04:06Z

          ROCKETMQ-43: remove NoWhitespaceBefore module in “rmq_checkstyle.xml”


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user wu-sheng opened a pull request: https://github.com/apache/incubator-rocketmq/pull/36 ROCKETMQ-43 Remove NoWhitespaceBefore module in “rmq_checkstyle.xml” There are both NoWhitespaceBefore and WhitespaceAfter modules in checkstyle.xml, like this: <module name="NoWhitespaceBefore"/> <module name="WhitespaceAfter"/> ref https://issues.apache.org/jira/browse/ROCKETMQ-43 You can merge this pull request into a Git repository by running: $ git pull https://github.com/wu-sheng/incubator-rocketmq fix/ ROCKETMQ-43 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-rocketmq/pull/36.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 #36 commit 30bbee67d030c3d0910be773beb3eb1578ac4644 Author: wusheng <wu.sheng@foxmail.com> Date: 2017-01-11T08:04:06Z ROCKETMQ-43 : remove NoWhitespaceBefore module in “rmq_checkstyle.xml”
          Hide
          wu-sheng Wu Sheng added a comment -

          Send pull request on github

          Show
          wu-sheng Wu Sheng added a comment - Send pull request on github
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user zhouxinyu commented on a diff in the pull request:

          https://github.com/apache/incubator-rocketmq/pull/36#discussion_r95956604

          — Diff: tools/src/main/java/org/apache/rocketmq/tools/command/MQAdminStartup.java —
          @@ -194,7 +197,7 @@ public static void initCommand() {
          private static void initLogback() throws JoranException {
          String rocketmqHome = System.getProperty(MixAll.ROCKETMQ_HOME_PROPERTY, System.getenv(MixAll.ROCKETMQ_HOME_ENV));

          • LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
            + LoggerContext lc = (LoggerContext)LoggerFactory.getILoggerFactory();
              • End diff –

          Also please follow the RocketMQ [code-style](http://rocketmq.incubator.apache.org/docs/code-guidelines/)

          Show
          githubbot ASF GitHub Bot added a comment - Github user zhouxinyu commented on a diff in the pull request: https://github.com/apache/incubator-rocketmq/pull/36#discussion_r95956604 — Diff: tools/src/main/java/org/apache/rocketmq/tools/command/MQAdminStartup.java — @@ -194,7 +197,7 @@ public static void initCommand() { private static void initLogback() throws JoranException { String rocketmqHome = System.getProperty(MixAll.ROCKETMQ_HOME_PROPERTY, System.getenv(MixAll.ROCKETMQ_HOME_ENV)); LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); + LoggerContext lc = (LoggerContext)LoggerFactory.getILoggerFactory(); End diff – Also please follow the RocketMQ [code-style] ( http://rocketmq.incubator.apache.org/docs/code-guidelines/ )
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user wu-sheng commented on a diff in the pull request:

          https://github.com/apache/incubator-rocketmq/pull/36#discussion_r95957237

          — Diff: tools/src/main/java/org/apache/rocketmq/tools/command/MQAdminStartup.java —
          @@ -194,7 +197,7 @@ public static void initCommand() {
          private static void initLogback() throws JoranException {
          String rocketmqHome = System.getProperty(MixAll.ROCKETMQ_HOME_PROPERTY, System.getenv(MixAll.ROCKETMQ_HOME_ENV));

          • LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
            + LoggerContext lc = (LoggerContext)LoggerFactory.getILoggerFactory();
              • End diff –

          Already do that. Seem not work correctly.

          Show
          githubbot ASF GitHub Bot added a comment - Github user wu-sheng commented on a diff in the pull request: https://github.com/apache/incubator-rocketmq/pull/36#discussion_r95957237 — Diff: tools/src/main/java/org/apache/rocketmq/tools/command/MQAdminStartup.java — @@ -194,7 +197,7 @@ public static void initCommand() { private static void initLogback() throws JoranException { String rocketmqHome = System.getProperty(MixAll.ROCKETMQ_HOME_PROPERTY, System.getenv(MixAll.ROCKETMQ_HOME_ENV)); LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); + LoggerContext lc = (LoggerContext)LoggerFactory.getILoggerFactory(); End diff – Already do that. Seem not work correctly.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user wu-sheng commented on a diff in the pull request:

          https://github.com/apache/incubator-rocketmq/pull/36#discussion_r95957982

          — Diff: tools/src/main/java/org/apache/rocketmq/tools/command/MQAdminStartup.java —
          @@ -194,7 +197,7 @@ public static void initCommand() {
          private static void initLogback() throws JoranException {
          String rocketmqHome = System.getProperty(MixAll.ROCKETMQ_HOME_PROPERTY, System.getenv(MixAll.ROCKETMQ_HOME_ENV));

          • LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
            + LoggerContext lc = (LoggerContext)LoggerFactory.getILoggerFactory();
              • End diff –

          This file https://github.com/apache/incubator-rocketmq/blob/master/style/rmq_codeStyle.xml is used.
          In your website doc, just mention about import, but no style-file name.

          Show
          githubbot ASF GitHub Bot added a comment - Github user wu-sheng commented on a diff in the pull request: https://github.com/apache/incubator-rocketmq/pull/36#discussion_r95957982 — Diff: tools/src/main/java/org/apache/rocketmq/tools/command/MQAdminStartup.java — @@ -194,7 +197,7 @@ public static void initCommand() { private static void initLogback() throws JoranException { String rocketmqHome = System.getProperty(MixAll.ROCKETMQ_HOME_PROPERTY, System.getenv(MixAll.ROCKETMQ_HOME_ENV)); LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); + LoggerContext lc = (LoggerContext)LoggerFactory.getILoggerFactory(); End diff – This file https://github.com/apache/incubator-rocketmq/blob/master/style/rmq_codeStyle.xml is used. In your website doc, just mention about import, but no style-file name.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user wu-sheng commented on a diff in the pull request:

          https://github.com/apache/incubator-rocketmq/pull/36#discussion_r95958687

          — Diff: tools/src/main/java/org/apache/rocketmq/tools/command/MQAdminStartup.java —
          @@ -194,7 +197,7 @@ public static void initCommand() {
          private static void initLogback() throws JoranException {
          String rocketmqHome = System.getProperty(MixAll.ROCKETMQ_HOME_PROPERTY, System.getenv(MixAll.ROCKETMQ_HOME_ENV));

          • LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
            + LoggerContext lc = (LoggerContext)LoggerFactory.getILoggerFactory();
              • End diff –

          As you can see, travis-ci's check is passed. So I assume my code style is correct.
          I think maybe your `codeStyle` doesn't match your design purpose?

          Show
          githubbot ASF GitHub Bot added a comment - Github user wu-sheng commented on a diff in the pull request: https://github.com/apache/incubator-rocketmq/pull/36#discussion_r95958687 — Diff: tools/src/main/java/org/apache/rocketmq/tools/command/MQAdminStartup.java — @@ -194,7 +197,7 @@ public static void initCommand() { private static void initLogback() throws JoranException { String rocketmqHome = System.getProperty(MixAll.ROCKETMQ_HOME_PROPERTY, System.getenv(MixAll.ROCKETMQ_HOME_ENV)); LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); + LoggerContext lc = (LoggerContext)LoggerFactory.getILoggerFactory(); End diff – As you can see, travis-ci's check is passed. So I assume my code style is correct. I think maybe your `codeStyle` doesn't match your design purpose?
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 62d811e354c937327fcad0cb9399fcc5dc322b94 in incubator-rocketmq's branch refs/heads/master from wu-sheng
          [ https://git-wip-us.apache.org/repos/asf?p=incubator-rocketmq.git;h=62d811e ]

          ROCKETMQ-43 Remove NoWhitespaceBefore module in rmq_checkstyle.xml, closes apache/incubator-rocketmq#36

          Show
          jira-bot ASF subversion and git services added a comment - Commit 62d811e354c937327fcad0cb9399fcc5dc322b94 in incubator-rocketmq's branch refs/heads/master from wu-sheng [ https://git-wip-us.apache.org/repos/asf?p=incubator-rocketmq.git;h=62d811e ] ROCKETMQ-43 Remove NoWhitespaceBefore module in rmq_checkstyle.xml, closes apache/incubator-rocketmq#36
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

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

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/incubator-rocketmq/pull/36
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 62d811e354c937327fcad0cb9399fcc5dc322b94 in incubator-rocketmq's branch refs/heads/ROCKETMQ-57 from wu-sheng
          [ https://git-wip-us.apache.org/repos/asf?p=incubator-rocketmq.git;h=62d811e ]

          ROCKETMQ-43 Remove NoWhitespaceBefore module in rmq_checkstyle.xml, closes apache/incubator-rocketmq#36

          Show
          jira-bot ASF subversion and git services added a comment - Commit 62d811e354c937327fcad0cb9399fcc5dc322b94 in incubator-rocketmq's branch refs/heads/ ROCKETMQ-57 from wu-sheng [ https://git-wip-us.apache.org/repos/asf?p=incubator-rocketmq.git;h=62d811e ] ROCKETMQ-43 Remove NoWhitespaceBefore module in rmq_checkstyle.xml, closes apache/incubator-rocketmq#36

            People

            • Assignee:
              vongosling vongosling
              Reporter:
              wu-sheng Wu Sheng
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development