Skip to content

Commit

Permalink
移除不需要的东西,并修正从3.2.6版本遗留下来的与3.5.8版本不兼容的代码
Browse files Browse the repository at this point in the history
  • Loading branch information
kuangye098 committed Jan 16, 2017
1 parent 06b009a commit 98020e8
Show file tree
Hide file tree
Showing 21 changed files with 197 additions and 14,532 deletions.
123 changes: 123 additions & 0 deletions checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!--
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.
-->
<!--Refer http://checkstyle.sourceforge.net/reports/google-java-style.html#s2.2-file-encoding -->
<module name="Checker">

<property name="localeLanguage" value="en"/>

<!--To configure the check to report on the first instance in each file-->
<module name="FileTabCharacter"/>

<!-- header -->
<module name="RegexpHeader">
<property name="header" value="/\*\*\nLicensed to the Apache.*"/>
</module>

<!--<module name="RegexpSingleline">-->
<!--<property name="format" value="System\.out\.println" />-->
<!--<property name="message" value="Prohibit invoking System.out.println in source code !" />-->
<!--</module>-->
<!--<module name="RegexpSingleline">-->
<!--<property name="format" value="//FIXME"/>-->
<!--<property name="message" value="Recommended fix FIXME task !"/>-->
<!--</module>-->
<!--<module name="RegexpSingleline">-->
<!--<property name="format" value="//TODO"/>-->
<!--<property name="message" value="Recommended fix TODO task !"/>-->
<!--</module>-->
<module name="RegexpSingleline">
<property name="format" value=".*[\u4E00-\u9FA5]+.*"/>
<property name="message" value="Recommended remove chinese !"/>
</module>

<module name="FileLength">
<property name="max" value="2000" />
</module>

<!--<module name="TreeWalker">-->

<!--&lt;!&ndash; code cleanup &ndash;&gt;-->
<!--<module name="UnusedImports">-->
<!--<property name="processJavadoc" value="true" />-->
<!--</module>-->
<!--<module name="RedundantImport"/>-->
<!--<module name="IllegalImport" />-->
<!--&lt;!&ndash;Checks that classes that override equals() also override hashCode()&ndash;&gt;-->
<!--<module name="EqualsHashCode"/>-->
<!--&lt;!&ndash;Checks for over-complicated boolean expressions. Currently finds code like if (b == true), b || true, !false, etc.&ndash;&gt;-->
<!--<module name="SimplifyBooleanExpression"/>-->
<!--<module name="OneStatementPerLine"/>-->
<!--<module name="UnnecessaryParentheses" />-->
<!--&lt;!&ndash;Checks for over-complicated boolean return statements. For example the following code&ndash;&gt;-->
<!--&lt;!&ndash;<module name="SimplifyBooleanReturn"/>&ndash;&gt;-->

<!--&lt;!&ndash; style &ndash;&gt;-->
<!--&lt;!&ndash;Check that the default is after all the cases in a switch statement&ndash;&gt;-->
<!--<module name="DefaultComesLast"/>-->
<!--&lt;!&ndash;Detects empty statements (standalone ";" semicolon)&ndash;&gt;-->
<!--<module name="EmptyStatement"/>-->
<!--&lt;!&ndash;Checks that long constants are defined with an upper ell&ndash;&gt;-->
<!--&lt;!&ndash;<module name="UpperEll"/>&ndash;&gt;-->
<!--&lt;!&ndash;-->
<!--<module name="ConstantName">-->
<!--<property name="format" value="(^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$)|(^log$)"/>-->
<!--</module>-->
<!--&ndash;&gt;-->
<!--&lt;!&ndash;Checks that local, non-final variable names conform to a format specified by the format property&ndash;&gt;-->
<!--<module name="LocalVariableName"/>-->
<!--&lt;!&ndash;Validates identifiers for local, final variables, including catch parameters&ndash;&gt;-->
<!--<module name="LocalFinalVariableName"/>-->
<!--&lt;!&ndash;Validates identifiers for non-static fields&ndash;&gt;-->
<!--<module name="MemberName"/>-->
<!--&lt;!&ndash;Validates identifiers for class type parameters&ndash;&gt;-->
<!--&lt;!&ndash;-->
<!--<module name="ClassTypeParameterName">-->
<!--<property name="format" value="^[A-Z0-9]*$"/>-->
<!--</module>-->
<!--&ndash;&gt;-->
<!--&lt;!&ndash;Validates identifiers for method type parameters&ndash;&gt;-->
<!--&lt;!&ndash;-->
<!--<module name="MethodTypeParameterName">-->
<!--<property name="format" value="^[A-Z0-9]*$"/>-->
<!--</module>-->
<!--&ndash;&gt;-->
<!--<module name="PackageName"/>-->
<!--<module name="ParameterName"/>-->
<!--<module name="StaticVariableName"/>-->
<!--<module name="TypeName"/>-->
<!--&lt;!&ndash;Checks that there are no import statements that use the * notation&ndash;&gt;-->
<!--&lt;!&ndash;<module name="AvoidStarImport"/>&ndash;&gt;-->

<!--&lt;!&ndash; whitespace &ndash;&gt;-->
<!--<module name="GenericWhitespace"/>-->
<!--<module name="NoWhitespaceBefore"/>-->
<!--<module name="WhitespaceAfter" />-->
<!--<module name="NoWhitespaceAfter"/>-->
<!--<module name="WhitespaceAround">-->
<!--<property name="allowEmptyConstructors" value="true"/>-->
<!--<property name="allowEmptyMethods" value="true"/>-->
<!--</module>-->
<!--<module name="Indentation"/>-->
<!--<module name="MethodParamPad"/>-->
<!--<module name="ParenPad"/>-->
<!--<module name="TypecastParenPad"/>-->
<!--</module>-->
</module>
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/**
* 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 com.alibaba.rocketmq.client;

import com.alibaba.rocketmq.common.UtilAll;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/**
* 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 com.alibaba.rocketmq.common.conflict;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/**
* 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 com.alibaba.rocketmq.example.filter;

import com.alibaba.rocketmq.common.filter.FilterContext;
Expand All @@ -7,16 +23,15 @@

public class MessageFilterImpl implements MessageFilter {

@Override
public boolean match(MessageExt msg, FilterContext context) {
String property = msg.getUserProperty("SequenceId");
@Override
public boolean match(MessageExt msg, FilterContext context) {
String property = msg.getUserProperty("SequenceId");
if (property != null) {
int id = Integer.parseInt(property);
if ((id % 3) == 0 && (id > 10)) {
return true;
}
}

return false;
}
}
}
8 changes: 4 additions & 4 deletions rocketmq-example/src/main/resources/MessageFilterImpl.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package com.alibaba.rocketmq.example.filter;

import com.alibaba.rocketmq.common.filter.FilterContext;
import com.alibaba.rocketmq.common.filter.MessageFilter;
import com.alibaba.rocketmq.common.message.MessageExt;


public class MessageFilterImpl implements MessageFilter {

@Override
public boolean match(MessageExt msg) {
String property = msg.getProperty("SequenceId");
public boolean match(MessageExt msg, FilterContext context) {
String property = msg.getUserProperty("SequenceId");
if (property != null) {
int id = Integer.parseInt(property);
if (((id % 10) == 0) && //
(id > 100)) {
if ((id % 3) == 0 && (id > 10)) {
return true;
}
}
Expand Down
Loading

0 comments on commit 98020e8

Please sign in to comment.