Skip to content

Commit

Permalink
remove redundant declarations, update some plugins, fix typos,
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier committed Aug 9, 2023
1 parent 67a5642 commit d053223
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 80 deletions.
19 changes: 10 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
Expand All @@ -43,14 +43,14 @@
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
<version>9</version>
</parent>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -62,16 +62,16 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<version>3.11.0</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<version>3.3.0</version>
<configuration>
<attach>true</attach>
</configuration>
Expand All @@ -87,10 +87,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<version>3.5.0</version>
<configuration>
<show>public</show>
<attach>true</attach>
<source>7</source>
</configuration>
<executions>
<execution>
Expand All @@ -117,7 +118,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.4</version>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down
50 changes: 24 additions & 26 deletions src/main/java/com/zaxxer/sparsebits/SparseBitSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* <code>SparseBitSet</code> are labelled <code>
* 0</code>&nbsp;..&nbsp;<code>Integer.MAX_VALUE&nbsp;&minus;&nbsp;1</code>.
* After the last set bit of a <code>SparseBitSet</code>, any attempt to find
* a subsequent bit (<i>nextSetBit</i>()), will return an value of &minus;1.
* a subsequent bit (<i>nextSetBit</i>()), will return a value of &minus;1.
* If an attempt is made to use <i>nextClearBit</i>(), and all the bits are
* set from the starting position of the search to the bit labelled
* <code>Integer.MAX_VALUE&nbsp;&minus;&nbsp;1</code>, then similarly &minus;1
Expand Down Expand Up @@ -76,7 +76,7 @@ bits to select a bit within a word (and this is considered in places to be
scanning algorithms, meaning that the accesses are always nested three
deep. Again, the change this might be a large amount of work. On the
other hand, these three levels have proven, so far, to provide adequate
speed, and an storage efficient way to deal with sparseness.
speed, and a storage efficient way to deal with sparseness.
For simplicity, the level3 blocks and the level2 areas are always "full"
size, i.e., LENGTH3 and LENGTH2 respectively, and for consistency, the
Expand Down Expand Up @@ -161,7 +161,6 @@ when choosing to increase the size (see resize()). The only place where
* 4 "levels". Respectively (from the least significant end), level4, the
* address within word, the address within a level3 block, the address within
* a level2 area, and the level1 address of that area within the set.
*
* LEVEL4 is the number of bits of the level4 address (number of bits need
* to address the bits in a long)
*/
Expand Down Expand Up @@ -333,12 +332,12 @@ The test for index i (the first index in all cases) being in range is

/**
* Constructor for a new (sparse) bit set. All bits initially are effectively
* <code>false</code>. This is a internal constructor that collects all the
* <code>false</code>. This is an internal constructor that collects all the
* needed actions to initialise the bit set.
* <p>
* The capacity is taken to be a <i>suggestion</i> for a size of the bit set,
* in bits. An appropiate table size (a power of two) is then determined and
* used. The size will be grown as needed to accomodate any bits addressed
* used. The size will be grown as needed to accommodate any bits addressed
* during the use of the bit set.
*
* @param capacity a size in terms of bits
Expand Down Expand Up @@ -1225,7 +1224,7 @@ public void or(SparseBitSet b)
* Performs a logical <b>OR</b> of the two given <code>SparseBitSet</code>s.
* The returned <code>SparseBitSet</code> is created so that a bit in it has
* the value <code>true</code> if and only if it either had the value
* <code>true</code> in the set given by the first arguemetn or had the value
* <code>true</code> in the set given by the first argument or had the value
* <code>true</code> in the second argument, otherwise <code>false</code>.
*
* @param a a SparseBitSet
Expand Down Expand Up @@ -1290,7 +1289,7 @@ public void set(int i, boolean value)
* <code>j</code> (exclusive) to <code>true</code>.
*
* @param i index of the first bit to be set
* @param j index after the last bit to be se
* @param j index after the last bit to be set
* @exception IndexOutOfBoundsException if <code>i</code> is negative or is
* equal to Integer.MAX_INT, or <code>j</code> is negative, or
* <code>i</code> is larger than <code>j</code>.
Expand Down Expand Up @@ -1354,7 +1353,7 @@ public String statistics()
* include: Size, Length, Cardinality, Total words (<i>i.e.</i>, the total
* number of 64-bit "words"), Set array length (<i>i.e.</i>, the number of
* references that can be held by the top level array, Level2 areas in use,
* Level3 blocks in use,, Level2 pool size, Level3 pool size, and the
* Level3 blocks in use, Level2 pool size, Level3 pool size, and the
* Compaction count.
* <p>
* This method is intended for diagnostic use (as it is relatively expensive
Expand Down Expand Up @@ -1505,7 +1504,7 @@ public String toString()
/** Sequences of set bits longer than this value are shown by
* {@link #toString()} as a "sub-sequence," in the form <code>a..b</code>.
* Setting this value to zero causes each set bit to be listed individually.
* The default default value is 2 (which means sequences of three or more
* The default value is 2 (which means sequences of three or more
* bits set are shown as a subsequence, and all other set bits are listed
* individually).
* <p>
Expand Down Expand Up @@ -1647,8 +1646,8 @@ public static SparseBitSet xor(SparseBitSet a, SparseBitSet b)
* Throw the exception to indicate a range error. The <code>String</code>
* constructed reports all the possible errors in one message.
*
* @param i lower bound for a operation
* @param j upper bound for a operation
* @param i lower bound for an operation
* @param j upper bound for an operation
* @exception IndexOutOfBoundsException indicating the range is not valid
* @since 1.6
*/
Expand All @@ -1668,7 +1667,7 @@ protected static void throwIndexOutOfBoundsException(int i, int j)
}

/**
* Intializes all the additional objects required for correct operation.
* Initializes all the additional objects required for correct operation.
*
* @since 1.6
*/
Expand Down Expand Up @@ -1699,7 +1698,7 @@ protected final void nullify(int start)
}

/**
* Resize the bit array. Moves the entries in the the bits array of this
* Resize the bit array. Moves the entries in the bits array of this
* SparseBitSet into an array whose size (which may be larger or smaller) is
* the given bit size (<i>i.e.</i>, includes the bit whose index is one less
* that the given value). If the new array is smaller, the excess entries in
Expand Down Expand Up @@ -1921,7 +1920,7 @@ corresponding lengths (if any). */
}
if (isZero) // The resulting a3 block has no values
{// nested if!
/* If there is an level 2 area make the entry for this
/* If there is a level 2 area make the entry for this
level3 block be a null (i.e., remove any a3 block ). */
if (haveA2)
a2[u2] = null;
Expand Down Expand Up @@ -2183,7 +2182,7 @@ public enum Statistics
*
* @see #statisticsUpdate()
*/
protected class Cache
protected static class Cache
{
/**
* <i>hash</i> is updated by the <i>statisticsUpdate</i>() method.
Expand Down Expand Up @@ -2792,7 +2791,7 @@ protected boolean block(int base, int u3, int v3, long[] a3, long[] b3)

//-----------------------------------------------------------------------------
/**
* Set creates entries everywhere within the range. Hence no empty level2
* Set creates entries everywhere within the range. Hence, no empty level2
* areas or level3 blocks are ignored, and no empty (all zero) blocks are
* returned.
*
Expand Down Expand Up @@ -2974,7 +2973,6 @@ protected void finish(int a2Count, int a3Count)
* in sequential order of the words in the set for which the statistics
* are being accumulated, and only for non-null values of the second
* parameter.
*
* Two of the values (a2Count and a3Count) are not updated here,
* but are done in the code near where this method is called.
*
Expand Down Expand Up @@ -3053,45 +3051,45 @@ protected boolean block(int base, int u3, int v3, long[] a3, long[] b3)
/**
* Word and block <b>and</b> strategy.
*/
protected static final transient AndStrategy andStrategy = new AndStrategy();
protected static final AndStrategy andStrategy = new AndStrategy();
/**
* Word and block <b>andNot</b> strategy.
*/
protected static final transient AndNotStrategy andNotStrategy = new AndNotStrategy();
protected static final AndNotStrategy andNotStrategy = new AndNotStrategy();
/**
* Word and block <b>clear</b> strategy.
*/
protected static final transient ClearStrategy clearStrategy = new ClearStrategy();
protected static final ClearStrategy clearStrategy = new ClearStrategy();
/**
* Word and block <b>copy</b> strategy.
*/
protected static final transient CopyStrategy copyStrategy = new CopyStrategy();
protected static final CopyStrategy copyStrategy = new CopyStrategy();
/**
* Word and block <b>equals</b> strategy.
*/
protected transient EqualsStrategy equalsStrategy;
/**
* Word and block <b>flip</b> strategy.
*/
protected static final transient FlipStrategy flipStrategy = new FlipStrategy();
protected static final FlipStrategy flipStrategy = new FlipStrategy();
/**
* Word and block <b>intersects</b> strategy.
*/
protected static transient IntersectsStrategy intersectsStrategy = new IntersectsStrategy();
protected static final IntersectsStrategy intersectsStrategy = new IntersectsStrategy();
/**
* Word and block <b>or</b> strategy.
*/
protected static final transient OrStrategy orStrategy = new OrStrategy();
protected static final OrStrategy orStrategy = new OrStrategy();
/**
* Word and block <b>set</b> strategy.
*/
protected static final transient SetStrategy setStrategy = new SetStrategy();
protected static final SetStrategy setStrategy = new SetStrategy();
/**
* Word and block <b>update</b> strategy.
*/
protected transient UpdateStrategy updateStrategy;
/**
* Word and block <b>xor</b> strategy.
*/
protected static final transient XorStrategy xorStrategy = new XorStrategy();
protected static final XorStrategy xorStrategy = new XorStrategy();
}
Loading

0 comments on commit d053223

Please sign in to comment.