Skip to content

Commit

Permalink
changed method name to getMaxValue()
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudenw committed Jul 16, 2023
1 parent ad09dbf commit aba6993
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 6 deletions.
67 changes: 67 additions & 0 deletions src/conf/checkstyle.orig
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0"?>
<!--
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.
-->

<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.2//EN"
"https://checkstyle.org/dtds/configuration_1_2.dtd">

<!-- Apache Commons Collections customization of default Checkstyle behavior -->
<module name="Checker">
<property name="localeLanguage" value="en"/>
<module name="JavadocPackage"/>
<module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf" />
</module>
<module name="FileTabCharacter">
<property name="fileExtensions" value="java,xml"/>
</module>
<module name="RegexpSingleline">
<!-- \s matches whitespace character, $ matches end of line. -->
<property name="format" value="\s+$"/>
<property name="message" value="Line has trailing spaces."/>
</module>
<module name="SuppressionFilter">
<property name="file" value="${checkstyle.suppressions.file}"/>
</module>
<module name="Header">
<property name="headerFile" value="${checkstyle.header.file}"/>
</module>
<module name="TreeWalker">
<module name="AvoidStarImport"/>
<module name="IllegalImport"/>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<module name="NeedBraces"/>
<module name="JavadocMethod">
<property name="accessModifiers" value="protected" />
</module>
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<module name="UpperEll" />
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly"/>
<module name="GenericWhitespace"/>
<module name="WhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="Indentation">
<!-- Indentation style recommended by Oracle -->
<property name="caseIndent" value="0"/>
</module>
</module>
</module>
84 changes: 84 additions & 0 deletions src/conf/checkstyle2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0"?>
<!--
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.
-->

<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.2//EN"
"https://checkstyle.org/dtds/configuration_1_2.dtd">

<!-- Apache Commons Collections customization of default Checkstyle behavior -->
<module name="Checker">
<property name="localeLanguage" value="en"/>
<module name="JavadocPackage"/>
<module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf" />
</module>
<module name="FileTabCharacter">
<property name="fileExtensions" value="java,xml"/>
</module>
<module name="RegexpSingleline">
<!-- \s matches whitespace character, $ matches end of line. -->
<property name="format" value="\s+$"/>
<property name="message" value="Line has trailing spaces."/>
</module>
<module name="SuppressionFilter">
<property name="file" value="${checkstyle.suppressions.file}"/>
</module>
<module name="Header">
<property name="headerFile" value="${checkstyle.header.file}"/>
</module>
<module name="TreeWalker">
<module name="AvoidStarImport"/>
<module name="IllegalImport"/>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<module name="NeedBraces"/>
<module name="JavadocMethod">
<property name="accessModifiers" value="protected" />
</module>
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<module name="UpperEll" />
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly"/>
<module name="GenericWhitespace"/>
<module name="WhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="Indentation">
<!-- Indentation style recommended by Oracle -->
<property name="caseIndent" value="0"/>
</module>
<!-- start of custom modules -->
<module name="JavadocStyle"/>
<!-- <module name="EmptyLineSeparator"> -->
<!-- <property name="tokens" value="IMPORT, STATIC_IMPORT, CLASS_DEF, INTERFACE_DEF, ENUM_DEF, STATIC_INIT, INSTANCE_INIT, METHOD_DEF, CTOR_DEF, VARIABLE_DEF, RECORD_DEF, COMPACT_CTOR_DEF" /> -->
<!-- <property name="allowMultipleEmptyLines" value="false"/> -->
<!-- <property name="allowNoEmptyLineBetweenFields" value="false"/> -->
<!-- <property name="allowMultipleEmptyLinesInsideClassMembers" value="false"/> -->
<!-- </module> -->
<!-- end of custom modules -->
</module>
<!-- start of custom modules -->
<!-- matches blank line before closing brace -->
<module name="RegexpMultiline">
<property name="format" value="\s+$\s*\}"/>
<property name="message" value="Extra blank line" />
</module>
<!-- end of custom modules -->
</module>

Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ public void clear() {
}

@Override
public int maxValue() {
public int getMaxValue() {
return Integer.MAX_VALUE;
}

@Override
public ArrayCountingBloomFilter copy() {
return new ArrayCountingBloomFilter(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ public interface CountingBloomFilter extends BloomFilter, BitCountProducer {
boolean isValid();

/**
* Returns maximum value for a cell in this Counting filter can hold.
* @return the maximum value for a cell in this Counting filter can hold.
* Returns maximum value for a cell in this Counting filter.
* @return the maximum value for a cell in this Counting filter.
*/
int maxValue();
int getMaxValue();

// Modification Operations

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public final void testCountingSpecificMerge() {
// test overflow

final CountingBloomFilter bf5 = createEmptyFilter(getTestShape());
assertTrue(bf5.add(getMaximumValueProducer(bf5.maxValue())), "Should add to empty");
assertTrue(bf5.add(getMaximumValueProducer(bf5.getMaxValue())), "Should add to empty");
assertTrue(bf5.isValid(), "Should be valid");

final CountingBloomFilter bf6 = bf5.copy();
Expand All @@ -157,7 +157,7 @@ public void testAdd() {
// test overflow

final CountingBloomFilter bf2 = createEmptyFilter(getTestShape());
assertTrue(bf2.add(getMaximumValueProducer(bf2.maxValue())), "Should add to empty");
assertTrue(bf2.add(getMaximumValueProducer(bf2.getMaxValue())), "Should add to empty");
assertTrue(bf2.isValid(), "Should be valid");

assertFalse(bf2.add(createFilter(getTestShape(), TestingHashers.FROM1)), "Should not add");
Expand Down

0 comments on commit aba6993

Please sign in to comment.