vongosling closed pull request #369: fix wrong word eclipse to elapsed URL: https://github.com/apache/rocketmq/pull/369
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/.github/ISSUE_TEMPLATE/issue_template.md b/.github/ISSUE_TEMPLATE/issue_template.md new file mode 100644 index 000000000..a77fb61d0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/issue_template.md @@ -0,0 +1,39 @@ +--- +name: ISSUE_TEMPLATE +about: Describe this issue template's purpose here. + +--- + +The issue tracker is **ONLY** used for bug report and feature request. Keep in mind, please check whether there is an existing same report before your raise a new one. + +Alternately (especially if your communication is not a bug report), you can send mail to our [mailing lists](http://rocketmq.apache.org/about/contact/). We welcome any friendly suggestions, bug fixes, collaboration and other improvements. + +Please ensure that your bug report is clear and that it is complete. Otherwise, we may be unable to understand it or to reproduce it, either of which would prevent us from fixing the bug. We strongly recommend the report(bug report or feature request) could include some hints as the following: + +**BUG REPORT** + +1. Please describe the issue you observed: + +- What did you do (The steps to reproduce)? + +- What did you expect to see? + +- What did you see instead? + +2. Please tell us about your environment: + +3. Other information (e.g. detailed explanation, logs, related issues, suggestions how to fix, etc): + +**FEATURE REQUEST** + +1. Please describe the feature you are requesting. + +2. Provide any additional detail on your proposed use case for this feature. + +2. Indicate the importance of this issue to you (blocker, must-have, should-have, nice-to-have). Are you currently using any workarounds to address this issue? + +4. If there are some sub-tasks using -[] for each subtask and create a corresponding issue to map to the sub task: + +- [sub-task1-issue-number](example_sub_issue1_link_here): sub-task1 description here, +- [sub-task2-issue-number](example_sub_issue2_link_here): sub-task2 description here, +- ... diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..f66d5f523 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,22 @@ +Please do not create a Pull Request without creating an issue first. + +## What is the purpose of the change + +XXXXX + +## Brief changelog + +XX + +## Verifying this change + +XXXX + +Follow this checklist to help us incorporate your contribution quickly and easily. + +- [x] Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue. +- [ ] Format the pull request title like `[ISSUE #123] Fix UnknownException when host config not exist`. Each commit in the pull request should have a meaningful subject line and body. +- [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. +- [ ] Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in [test module](https://github.com/apache/rocketmq/tree/master/test). +- [ ] Run `mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle` to make sure basic checks pass. Run `mvn clean install -DskipITs` to make sure unit-test pass. Run `mvn clean test-compile failsafe:integration-test` to make sure integration-test pass. +- [ ] If this contribution is large, please file an [Apache Individual Contributor License Agreement](http://www.apache.org/licenses/#clas). diff --git a/1 b/1 deleted file mode 100644 index 5f9f277ed..000000000 --- a/1 +++ /dev/null @@ -1,105 +0,0 @@ -# This is a combination of 3 commits. -# The first commit's message is: -remove spaces before and after the properties - -# This is the 2nd commit message: - -remove spaces before and after the properties - -remove spaces before and after the properties - -remove spaces before and after the properties - -remove spaces before and after the properties - -Remove spaces before and after the properties - -Remove spaces before and after the properties - -Remove spaces before and after the properties - -Remove spaces before and after the properties - -Remove the code that is not useful in the loop - -Remove the code that is not useful in the loop - -Remove the code that is not useful in the loop - -Remove the code that is not useful in the loop - -Remove the code that is not useful in the loop - -Remove spaces before and after the properties - -Remove spaces before and after the properties - -Remove the code that is not useful in the loop - -Remove the code that is not useful in the loop - -Remove the code that is not useful in the loop - -Remove the code that is not useful in the loop - -Remove the code that is not useful in the loop - -remove spaces before and after the properties - -remove spaces before and after the properties - -Remove spaces before and after the properties - -Remove spaces before and after the properties - -Remove spaces before and after the properties - -Remove spaces before and after the properties - -Remove the code that is not useful in the loop - -Remove the code that is not useful in the loop - -Remove the code that is not useful in the loop - -Remove the code that is not useful in the loop - -Remove the code that is not useful in the loop - -Remove spaces before and after the properties - -Remove spaces before and after the properties - -Remove the code that is not useful in the loop - -Remove the code that is not useful in the loop - -Remove the code that is not useful in the loop - -Remove the code that is not useful in the loop - -Remove the code that is not useful in the loop - -# This is the 3rd commit message: - -remove spaces before and after the properties - -# Please enter the commit message for your changes. Lines starting -# with '#' will be ignored, and an empty message aborts the commit. -# -# Date: Wed May 17 16:11:07 2017 +0800 -# -# interactive rebase in progress; onto a2894b6 -# Last commands done (3 commands done): -# squash 76b35ab remove spaces before and after the properties -# squash 92f83bc remove spaces before and after the properties -# Next commands to do (12 remaining commands): -# squash d142037 remove spaces before and after the properties -# squash 9df0fcb remove spaces before and after the properties -# You are currently rebasing branch 'Branch_0616' on 'a2894b6'. -# -# Changes to be committed: -# modified: client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java -# modified: common/src/main/java/org/apache/rocketmq/common/MixAll.java -# new file: "\357\200\272" -# diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 5d13fff38..000000000 --- a/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,20 +0,0 @@ -## What is the purpose of the change - -XXXXX - -## Brief changelog - -XX - -## Verifying this change - -XXXX - -Follow this checklist to help us incorporate your contribution quickly and easily: - -- [x] Make sure there is a [JIRA issue](https://issues.apache.org/jira/projects/ROCKETMQ/issues/) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue. -- [ ] Format the pull request title like `[ROCKETMQ-XXX] Fix UnknownException when host config not exist`. Each commit in the pull request should have a meaningful subject line and body. -- [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. -- [ ] Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in [test module](https://github.com/apache/rocketmq/tree/master/test). -- [ ] Run `mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle` to make sure basic checks pass. Run `mvn clean install -DskipITs` to make sure unit-test pass. Run `mvn clean test-compile failsafe:integration-test` to make sure integration-test pass. -- [ ] If this contribution is large, please file an [Apache Individual Contributor License Agreement](http://www.apache.org/licenses/#clas). diff --git a/README.md b/README.md index 8f37eb1e6..9b1986277 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,9 @@ It offers a variety of features: * Mailing Lists: <https://rocketmq.apache.org/about/contact/> * Home: <https://rocketmq.apache.org> * Docs: <https://rocketmq.apache.org/docs/quick-start/> -* Issues: <https://issues.apache.org/jira/browse/RocketMQ> +* Issues: <https://github.com/apache/rocketmq/issues> * Ask: <https://stackoverflow.com/questions/tagged/rocketmq> +* Slack: <https://rocketmq-community.slack.com/> ---------- diff --git a/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java b/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java index 0a6f0b45e..7e2934714 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java @@ -706,7 +706,7 @@ public synchronized void registerBrokerAll(final boolean checkOrderConfig, boole if (!PermName.isWriteable(this.getBrokerConfig().getBrokerPermission()) || !PermName.isReadable(this.getBrokerConfig().getBrokerPermission())) { - ConcurrentHashMap<String, TopicConfig> topicConfigTable = new ConcurrentHashMap<String, TopicConfig>(); + HashMap<String, TopicConfig> topicConfigTable = new HashMap<String, TopicConfig>(); for (TopicConfig topicConfig : topicConfigWrapper.getTopicConfigTable().values()) { TopicConfig tmp = new TopicConfig(topicConfig.getTopicName(), topicConfig.getReadQueueNums(), topicConfig.getWriteQueueNums(), diff --git a/broker/src/main/java/org/apache/rocketmq/broker/processor/PullMessageProcessor.java b/broker/src/main/java/org/apache/rocketmq/broker/processor/PullMessageProcessor.java index a46cbff2e..839f788d7 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/processor/PullMessageProcessor.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/processor/PullMessageProcessor.java @@ -94,8 +94,9 @@ private RemotingCommand processRequest(final Channel channel, RemotingCommand re (PullMessageRequestHeader) request.decodeCommandCustomHeader(PullMessageRequestHeader.class); response.setOpaque(request.getOpaque()); - - log.debug("receive PullMessage request command, {}", request); + if(log.isDebugEnabled()) { + log.debug("receive PullMessage request command, {}", request); + } if (!PermName.isReadable(this.brokerController.getBrokerConfig().getBrokerPermission())) { response.setCode(ResponseCode.NO_PERMISSION); diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java b/client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java index 83b9ee767..42b743694 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java @@ -149,7 +149,7 @@ public MQClientInstance(ClientConfig clientConfig, int instanceIndex, String cli this.consumerStatsManager = new ConsumerStatsManager(this.scheduledExecutorService); - log.info("created a new client Instance, FactoryIndex: {} ClinetID: {} {} {}, serializeType={}", + log.info("Created a new client Instance, InstanceIndex:{}, ClientID:{}, ClientConfig:{}, ClientVersion:{}, SerializerType:{}", this.instanceIndex, this.clientId, this.clientConfig, diff --git a/common/src/main/java/org/apache/rocketmq/common/MQVersion.java b/common/src/main/java/org/apache/rocketmq/common/MQVersion.java index 404f28df5..7e9322545 100644 --- a/common/src/main/java/org/apache/rocketmq/common/MQVersion.java +++ b/common/src/main/java/org/apache/rocketmq/common/MQVersion.java @@ -18,7 +18,7 @@ public class MQVersion { - public static final int CURRENT_VERSION = Version.V4_2_0_SNAPSHOT.ordinal(); + public static final int CURRENT_VERSION = Version.V4_2_0.ordinal(); public static String getVersionDesc(int value) { int length = Version.values().length; diff --git a/common/src/main/java/org/apache/rocketmq/common/ServiceThread.java b/common/src/main/java/org/apache/rocketmq/common/ServiceThread.java index bf7e72498..a332262d9 100644 --- a/common/src/main/java/org/apache/rocketmq/common/ServiceThread.java +++ b/common/src/main/java/org/apache/rocketmq/common/ServiceThread.java @@ -64,7 +64,7 @@ public void shutdown(final boolean interrupt) { this.thread.join(this.getJointime()); } long eclipseTime = System.currentTimeMillis() - beginTime; - log.info("join thread " + this.getServiceName() + " eclipse time(ms) " + eclipseTime + " " + log.info("join thread " + this.getServiceName() + " elapsed time(ms) " + eclipseTime + " " + this.getJointime()); } catch (InterruptedException e) { log.error("Interrupted", e); diff --git a/distribution/bin/runbroker b/distribution/bin/runbroker deleted file mode 100644 index 538f8e16b..000000000 --- a/distribution/bin/runbroker +++ /dev/null @@ -1,15 +0,0 @@ -@echo off -rem Licensed to the Apache Software Foundation (ASF) under one or more -rem contributor license agreements. See the NOTICE file distributed with -rem this work for additional information regarding copyright ownership. -rem The ASF licenses this file to You under the Apache License, Version 2.0 -rem (the "License"); you may not use this file except in compliance with -rem the License. You may obtain a copy of the License at -rem -rem http://www.apache.org/licenses/LICENSE-2.0 -rem -rem Unless required by applicable law or agreed to in writing, software -rem distributed under the License is distributed on an "AS IS" BASIS, -rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -rem See the License for the specific language governing permissions and -rem limitations under the License. diff --git a/distribution/release-client.xml b/distribution/release-client.xml index 84d33a017..9f5da2552 100644 --- a/distribution/release-client.xml +++ b/distribution/release-client.xml @@ -26,7 +26,6 @@ <fileSet> <directory>../</directory> <includes> - <include>DISCLAIMER</include> <include>README.md</include> </includes> </fileSet> diff --git a/distribution/release.xml b/distribution/release.xml index d87ad5db4..1ec535e7c 100644 --- a/distribution/release.xml +++ b/distribution/release.xml @@ -27,7 +27,6 @@ <fileSet> <directory>../</directory> <includes> - <include>DISCLAIMER</include> <include>README.md</include> </includes> </fileSet> diff --git a/pom.xml b/pom.xml index 80db29f54..b22649cb9 100644 --- a/pom.xml +++ b/pom.xml @@ -249,10 +249,12 @@ <version>0.12</version> <configuration> <excludes> + <exclude>.gitignore</exclude> <exclude>.travis.yml</exclude> <exclude>CONTRIBUTING.md</exclude> - <exclude>bin/README.md</exclude> - <exclude>PULL_REQUEST_TEMPLATE.md</exclude> + <exclude>**/README.md</exclude> + <exclude>.github/**/*</exclude> + <exclude>**/test/resources/**/*</exclude> </excludes> </configuration> </plugin> diff --git a/remoting/src/test/resources/certs/client.pem b/remoting/src/test/resources/certs/client.pem index 31412fea8..cb6580d90 100644 --- a/remoting/src/test/resources/certs/client.pem +++ b/remoting/src/test/resources/certs/client.pem @@ -1,18 +1,19 @@ -----BEGIN CERTIFICATE----- -MIIC8zCCAdsCAQIwDQYJKoZIhvcNAQEFBQAwfDELMAkGA1UEBhMCemgxCzAJBgNV +MIIDATCCAekCAQIwDQYJKoZIhvcNAQEFBQAwfDELMAkGA1UEBhMCemgxCzAJBgNV BAgMAnpqMQswCQYDVQQHDAJoejEPMA0GA1UECgwGYXBhY2hlMREwDwYDVQQLDAhy b2NrZXRtcTEOMAwGA1UEAwwFeXVrb24xHzAdBgkqhkiG9w0BCQEWEHl1a29uQGFw -YWNoZS5vcmcwHhcNMTcxMjExMDkyOTUyWhcNMTgwMTEwMDkyOTUyWjCBhjELMAkG -A1UEBhMCemgxCzAJBgNVBAgMAnpqMQswCQYDVQQHDAJoejEPMA0GA1UECgwGYXBh -Y2hlMREwDwYDVQQLDAhyb2NrZXRtcTEWMBQGA1UEAwwNZm9vYmFyLmNsaWVudDEh -MB8GCSqGSIb3DQEJARYSZm9vQGJhci5jbGllbnQuY29tMIGfMA0GCSqGSIb3DQEB -AQUAA4GNADCBiQKBgQDoz5Uo2ZN+1ywSQXORv6kDbDXVQ72ZxBp7a6ltFLh4xdk/ -yz7bBjmryz+cAh759s8DEdngl2cCnSiM0r5NC91zox/12Di4EWt3IPdJVe1s5/VD -Bqt5zoxbYyDgz47c95cGALgLdTB/itBPgobghQYBanWPVBNLLltw19DLf1gd6QID -AQABMA0GCSqGSIb3DQEBBQUAA4IBAQDEpVFFcFILdnEXjyDSbgJ8rxXaUYV2aK+a -l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M23EOyfd1zcwOZJA7a54kfOpiTjz +wrtes5yoQznun5WtGcLM8ZmyaQ+Jr3j6NyZhOwULzK1+A8YUsW6Ww39xTxQoIHEQ +7eirb54= -----END CERTIFICATE----- diff --git a/remoting/src/test/resources/certs/server.pem b/remoting/src/test/resources/certs/server.pem index b73e33ef8..0187247af 100644 --- a/remoting/src/test/resources/certs/server.pem +++ b/remoting/src/test/resources/certs/server.pem @@ -1,18 +1,19 @@ -----BEGIN CERTIFICATE----- -MIIC5DCCAcwCAQEwDQYJKoZIhvcNAQEFBQAwfDELMAkGA1UEBhMCemgxCzAJBgNV +MIIDATCCAekCAQIwDQYJKoZIhvcNAQEFBQAwfDELMAkGA1UEBhMCemgxCzAJBgNV BAgMAnpqMQswCQYDVQQHDAJoejEPMA0GA1UECgwGYXBhY2hlMREwDwYDVQQLDAhy b2NrZXRtcTEOMAwGA1UEAwwFeXVrb24xHzAdBgkqhkiG9w0BCQEWEHl1a29uQGFw -YWNoZS5vcmcwHhcNMTcxMjExMDkyNjIwWhcNMTgwMTEwMDkyNjIwWjB4MQswCQYD -VQQGEwJ6aDELMAkGA1UECAwCemoxCzAJBgNVBAcMAmh6MQ8wDQYDVQQKDAZhcGFj -aGUxETAPBgNVBAsMCHJvY2tldG1xMQ8wDQYDVQQDDAZmb29iYXIxGjAYBgkqhkiG -9w0BCQEWC2Zvb0BiYXIuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDr -JqeGLayEbAXQUC8jyJmnwkcp0yZbNzTReIOp2a/XtHnwWPN9IMPZAXm3JutN7HWT -ZfeX80a9vrK14uRSWxuxZqtfhdMSzSv5CloqxrTTE9g7m5oVXSsl2CUryJ6BkZK0 -M2zhtDHQMsxOkDujo4zTfsRpJmnVsgsjRekvGKjCUwIDAQABMA0GCSqGSIb3DQEB -BQUAA4IBAQCmhSgxU5PRhBD2qahj2eWKcmz3FCevXgfyN/EUrwI2dZTU5fXPP+m9 -YBLAYUINI0eYGWt0wlGJ6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y8Gjl9spQ3oeXpoNUoz84OF4KIBRTzSMv8CrmqPdFY +Zd2MGjw= -----END CERTIFICATE----- diff --git a/store/src/main/java/org/apache/rocketmq/store/ha/HAConnection.java b/store/src/main/java/org/apache/rocketmq/store/ha/HAConnection.java index 8b9750464..ddae12eff 100644 --- a/store/src/main/java/org/apache/rocketmq/store/ha/HAConnection.java +++ b/store/src/main/java/org/apache/rocketmq/store/ha/HAConnection.java @@ -300,6 +300,8 @@ public void run() { } } + HAConnection.this.haService.getWaitNotifyObject().removeFromWaitingThreadTable(); + if (this.selectMappedBufferResult != null) { this.selectMappedBufferResult.release(); } diff --git a/store/src/main/java/org/apache/rocketmq/store/ha/WaitNotifyObject.java b/store/src/main/java/org/apache/rocketmq/store/ha/WaitNotifyObject.java index 6aba37529..a4c34cb08 100644 --- a/store/src/main/java/org/apache/rocketmq/store/ha/WaitNotifyObject.java +++ b/store/src/main/java/org/apache/rocketmq/store/ha/WaitNotifyObject.java @@ -96,4 +96,11 @@ public void allWaitForRunning(long interval) { } } } + + public void removeFromWaitingThreadTable() { + long currentThreadId = Thread.currentThread().getId(); + synchronized (this) { + this.waitingThreadTable.remove(currentThreadId); + } + } } diff --git a/store/src/test/java/org/apache/rocketmq/store/ha/WaitNotifyObjectTest.java b/store/src/test/java/org/apache/rocketmq/store/ha/WaitNotifyObjectTest.java new file mode 100644 index 000000000..99e44320b --- /dev/null +++ b/store/src/test/java/org/apache/rocketmq/store/ha/WaitNotifyObjectTest.java @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.rocketmq.store.ha; + +import org.junit.Assert; +import org.junit.Test; + +import static org.junit.Assert.*; + +public class WaitNotifyObjectTest { + @Test + public void removeFromWaitingThreadTable() throws Exception { + final WaitNotifyObject waitNotifyObject = new WaitNotifyObject(); + for (int i = 0; i < 5; i++) { + Thread t = new Thread(new Runnable() { + @Override + public void run() { + waitNotifyObject.allWaitForRunning(100); + waitNotifyObject.removeFromWaitingThreadTable(); + } + }); + t.start(); + t.join(); + } + Assert.assertEquals(0, waitNotifyObject.waitingThreadTable.size()); + } + +} diff --git a/tools/src/main/java/org/apache/rocketmq/tools/command/MQAdminStartup.java b/tools/src/main/java/org/apache/rocketmq/tools/command/MQAdminStartup.java index d3342e818..a9e3c64df 100644 --- a/tools/src/main/java/org/apache/rocketmq/tools/command/MQAdminStartup.java +++ b/tools/src/main/java/org/apache/rocketmq/tools/command/MQAdminStartup.java @@ -155,7 +155,7 @@ public static void initCommand() { initCommand(new QueryMsgByKeySubCommand()); initCommand(new QueryMsgByUniqueKeySubCommand()); initCommand(new QueryMsgByOffsetSubCommand()); - initCommand(new QueryMsgByUniqueKeySubCommand()); + initCommand(new PrintMessageSubCommand()); initCommand(new PrintMessageByQueueCommand()); initCommand(new SendMsgStatusCommand()); diff --git a/tools/src/main/java/org/apache/rocketmq/tools/command/topic/UpdateTopicSubCommand.java b/tools/src/main/java/org/apache/rocketmq/tools/command/topic/UpdateTopicSubCommand.java index 8fdb9d3db..27e4c19d7 100644 --- a/tools/src/main/java/org/apache/rocketmq/tools/command/topic/UpdateTopicSubCommand.java +++ b/tools/src/main/java/org/apache/rocketmq/tools/command/topic/UpdateTopicSubCommand.java @@ -67,15 +67,15 @@ public Options buildCommandlineOptions(Options options) { opt.setRequired(false); options.addOption(opt); - opt = new Option("o", "order", true, "set topic's order(true|false"); + opt = new Option("o", "order", true, "set topic's order(true|false)"); opt.setRequired(false); options.addOption(opt); - opt = new Option("u", "unit", true, "is unit topic (true|false"); + opt = new Option("u", "unit", true, "is unit topic (true|false)"); opt.setRequired(false); options.addOption(opt); - opt = new Option("s", "hasUnitSub", true, "has unit sub (true|false"); + opt = new Option("s", "hasUnitSub", true, "has unit sub (true|false)"); opt.setRequired(false); options.addOption(opt); ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
