Enable some additional checkstyle rules

This commit is contained in:
Sean Owen 2016-06-04 22:40:48 +01:00
parent 389f69f4b2
commit 032e1547ae
6 changed files with 21 additions and 6 deletions

View file

@ -446,7 +446,7 @@ public abstract class ResultHandler {
* Like {@link #launchIntent(Intent)} but will tell you if it is not handle-able * Like {@link #launchIntent(Intent)} but will tell you if it is not handle-able
* via {@link ActivityNotFoundException}. * via {@link ActivityNotFoundException}.
* *
* @throws ActivityNotFoundException * @throws ActivityNotFoundException if Intent can't be handled
*/ */
final void rawLaunchIntent(Intent intent) { final void rawLaunchIntent(Intent intent) {
if (intent != null) { if (intent != null) {

View file

@ -307,12 +307,12 @@ public final class BitArray implements Cloneable {
// now correct the int's if the bit size isn't a multiple of 32 // now correct the int's if the bit size isn't a multiple of 32
if (size != oldBitsLen * 32) { if (size != oldBitsLen * 32) {
int leftOffset = oldBitsLen * 32 - size; int leftOffset = oldBitsLen * 32 - size;
int currentInt = (newBits[0] >>> leftOffset); int currentInt = newBits[0] >>> leftOffset;
for (int i = 1; i < oldBitsLen; i++) { for (int i = 1; i < oldBitsLen; i++) {
int nextInt = newBits[i]; int nextInt = newBits[i];
currentInt |= nextInt << (32 - leftOffset); currentInt |= nextInt << (32 - leftOffset);
newBits[i - 1] = currentInt; newBits[i - 1] = currentInt;
currentInt = (nextInt >>> leftOffset); currentInt = nextInt >>> leftOffset;
} }
newBits[oldBitsLen - 1] = currentInt; newBits[oldBitsLen - 1] = currentInt;
} }

View file

@ -179,7 +179,6 @@ public final class ITFReader extends OneDReader {
* @param row row of black/white values to search * @param row row of black/white values to search
* @return Array, containing index of start of 'start block' and end of * @return Array, containing index of start of 'start block' and end of
* 'start block' * 'start block'
* @throws NotFoundException
*/ */
int[] decodeStart(BitArray row) throws NotFoundException { int[] decodeStart(BitArray row) throws NotFoundException {
int endStart = skipWhiteSpace(row); int endStart = skipWhiteSpace(row);
@ -208,7 +207,7 @@ public final class ITFReader extends OneDReader {
* *
* @param row bit array representing the scanned barcode. * @param row bit array representing the scanned barcode.
* @param startPattern index into row of the start or end pattern. * @param startPattern index into row of the start or end pattern.
* @throws NotFoundException if the quiet zone cannot be found, a ReaderException is thrown. * @throws NotFoundException if the quiet zone cannot be found
*/ */
private void validateQuietZone(BitArray row, int startPattern) throws NotFoundException { private void validateQuietZone(BitArray row, int startPattern) throws NotFoundException {
@ -252,7 +251,6 @@ public final class ITFReader extends OneDReader {
* @param row row of black/white values to search * @param row row of black/white values to search
* @return Array, containing index of start of 'end block' and end of 'end * @return Array, containing index of start of 'end block' and end of 'end
* block' * block'
* @throws NotFoundException
*/ */
int[] decodeEnd(BitArray row) throws NotFoundException { int[] decodeEnd(BitArray row) throws NotFoundException {

View file

@ -83,6 +83,9 @@ public abstract class AbstractRSSReader extends OneDReader {
throw NotFoundException.getNotFoundInstance(); throw NotFoundException.getNotFoundInstance();
} }
/**
* @deprecated call {@link MathUtils#sum(int[])}
*/
@Deprecated @Deprecated
protected static int count(int[] array) { protected static int count(int[] array) {
return MathUtils.sum(array); return MathUtils.sum(array);

View file

@ -42,6 +42,9 @@ public final class PDF417Common {
private PDF417Common() { private PDF417Common() {
} }
/**
* @deprecated call {@link MathUtils#sum(int[])}
*/
@Deprecated @Deprecated
public static int getBitCountSum(int[] moduleBitCount) { public static int getBitCountSum(int[] moduleBitCount) {
return MathUtils.sum(moduleBitCount); return MathUtils.sum(moduleBitCount);

View file

@ -88,6 +88,7 @@
<!-- <module name="LocalVariableName"/> --> <!-- <module name="LocalVariableName"/> -->
<module name="MemberName"/> <module name="MemberName"/>
<module name="MethodName"/> <module name="MethodName"/>
<module name="NonEmptyAtclauseDescription"/>
<module name="PackageName"/> <module name="PackageName"/>
<!-- <module name="ParameterName"/> --> <!-- <module name="ParameterName"/> -->
<module name="StaticVariableName"/> <module name="StaticVariableName"/>
@ -97,6 +98,7 @@
<!-- Checks for imports --> <!-- Checks for imports -->
<!-- See http://checkstyle.sf.net/config_import.html --> <!-- See http://checkstyle.sf.net/config_import.html -->
<module name="AvoidStarImport"/> <module name="AvoidStarImport"/>
<module name="AvoidStaticImport"/>
<module name="IllegalImport"/> <!-- defaults to sun.* packages --> <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
<module name="RedundantImport"/> <module name="RedundantImport"/>
<module name="UnusedImports"/> <module name="UnusedImports"/>
@ -124,6 +126,7 @@
<module name="TypecastParenPad"/> <module name="TypecastParenPad"/>
<!-- <module name="WhitespaceAfter"/> --> <!-- <module name="WhitespaceAfter"/> -->
<!-- <module name="WhitespaceAround"/> --> <!-- <module name="WhitespaceAround"/> -->
<module name="UnnecessaryParentheses"/>
<!-- Modifier Checks --> <!-- Modifier Checks -->
@ -147,14 +150,19 @@
<!-- See http://checkstyle.sf.net/config_coding.html --> <!-- See http://checkstyle.sf.net/config_coding.html -->
<!--<module name="AvoidInlineConditionals"/>--> <!--<module name="AvoidInlineConditionals"/>-->
<module name="EmptyStatement"/> <module name="EmptyStatement"/>
<module name="EqualsAvoidNull"/>
<module name="EqualsHashCode"/> <module name="EqualsHashCode"/>
<!--<module name="HiddenField"/>--> <!--<module name="HiddenField"/>-->
<module name="IllegalInstantiation"/> <module name="IllegalInstantiation"/>
<!-- <module name="InnerAssignment"/> --> <!-- <module name="InnerAssignment"/> -->
<!-- <module name="MagicNumber"/> --> <!-- <module name="MagicNumber"/> -->
<!-- <module name="MissingSwitchDefault"/> --> <!-- <module name="MissingSwitchDefault"/> -->
<module name="MissingDeprecated"/>
<module name="MissingOverride"/>
<module name="DefaultComesLast"/>
<module name="SimplifyBooleanExpression"/> <module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/> <module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality"/>
<!-- Checks for class design --> <!-- Checks for class design -->
<!-- See http://checkstyle.sf.net/config_design.html --> <!-- See http://checkstyle.sf.net/config_design.html -->
@ -162,12 +170,15 @@
<module name="FinalClass"/> <module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/> <module name="HideUtilityClassConstructor"/>
<module name="InterfaceIsType"/> <module name="InterfaceIsType"/>
<module name="OneTopLevelClass"/>
<module name="SuperFinalize"/>
<!-- <module name="VisibilityModifier"/> --> <!-- <module name="VisibilityModifier"/> -->
<!-- Miscellaneous other checks. --> <!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html --> <!-- See http://checkstyle.sf.net/config_misc.html -->
<module name="ArrayTypeStyle"/> <module name="ArrayTypeStyle"/>
<module name="MultipleVariableDeclarations"/>
<!--<module name="FinalParameters"/>--> <!--<module name="FinalParameters"/>-->
<!-- <module name="TodoComment"/> --> <!-- <module name="TodoComment"/> -->
<module name="UpperEll"/> <module name="UpperEll"/>