# FindBugs Report

## Project Information

Project:

FindBugs version: 3.0.1

Code analyzed:

- /home/kredel/jas/edu/jas/

## Metrics

113838 lines of code analyzed, in 1016 classes, in 16 packages.

Metric | Total | Density*
--- | --- | ---
High Priority Warnings | 1 | 0.01
Medium Priority Warnings | 37 | 0.33
Total Warnings | 38 | 0.33

(* Defects per Thousand lines of non-commenting source statements)

## Contents

- Bad practice Warnings
- Malicious code vulnerability Warnings
- Dodgy code Warnings
- Details

# Summary

Warning Type | Number
--- | ---
Bad practice Warnings | 22
Malicious code vulnerability Warnings | 1
Dodgy code Warnings | 15
Total | 38

# Warnings

Click on a warning row to see full context information.

## Bad practice Warnings

Code | Warning
--- | ---
Nm | The class name edu.jas.application.FactorFactory shadows the simple name of the superclass edu.jas.ufd.FactorFactory
| Bug type NM_SAME_SIMPLE_NAME_AS_SUPERCLASS (click for details) In class edu.jas.application.FactorFactory In class edu.jas.ufd.FactorFactory At FactorFactory.java:[lines 66-212]
Nm | The method name edu.jas.application.GBAlgorithmBuilder.Arri() doesn't start with a lower case letter
| Bug type NM_METHOD_NAMING_CONVENTION (click for details) In class edu.jas.application.GBAlgorithmBuilder In method edu.jas.application.GBAlgorithmBuilder.Arri() At GBAlgorithmBuilder.java:[lines 523-536]
OS | edu.jas.application.RunGB.getReader(String) may fail to close stream
| Bug type OS_OPEN_STREAM (click for details) In class edu.jas.application.RunGB In method edu.jas.application.RunGB.getReader(String) Need to close java.util.zip.ZipFile At RunGB.java:[line 489]
RV | edu.jas.poly.PolynomialComparator.compare(GenPolynomial, GenPolynomial) negates the return value of edu.jas.poly.GenPolynomial.compareTo(GenPolynomial)
| Bug type RV_NEGATING_RESULT_OF_COMPARETO (click for details) In class edu.jas.poly.PolynomialComparator In method edu.jas.poly.PolynomialComparator.compare(GenPolynomial, GenPolynomial) Called method edu.jas.poly.GenPolynomial.compareTo(GenPolynomial) Return value of edu.jas.poly.GenPolynomial.compareTo(GenPolynomial) of type int At PolynomialComparator.java:[line 51]
RV | edu.jas.poly.TermOrder$11.compare(ExpVector, ExpVector) negates the return value of edu.jas.poly.TermOrder$EVComparator.compare(ExpVector, ExpVector)
| Bug type RV_NEGATING_RESULT_OF_COMPARETO (click for details) In class edu.jas.poly.TermOrder$11 In method edu.jas.poly.TermOrder$11.compare(ExpVector, ExpVector) Called method edu.jas.poly.TermOrder$EVComparator.compare(ExpVector, ExpVector) Return value of edu.jas.poly.TermOrder$EVComparator.compare(ExpVector, ExpVector) of type int At TermOrder.java:[line 292]
RV | edu.jas.poly.TermOrder$71.compare(ExpVector, ExpVector) negates the return value of edu.jas.poly.TermOrder$EVComparator.compare(ExpVector, ExpVector)
| Bug type RV_NEGATING_RESULT_OF_COMPARETO (click for details) In class edu.jas.poly.TermOrder$71 In method edu.jas.poly.TermOrder$71.compare(ExpVector, ExpVector) Called method edu.jas.poly.TermOrder$EVComparator.compare(ExpVector, ExpVector) Return value of edu.jas.poly.TermOrder$EVComparator.compare(ExpVector, ExpVector) of type int At TermOrder.java:[line 1316]
RV | edu.jas.poly.Word.gradInvlexCompareTo(Word) negates the return value of edu.jas.poly.Word.compareTo(Word)
| Bug type RV_NEGATING_RESULT_OF_COMPARETO (click for details) In class edu.jas.poly.Word In method edu.jas.poly.Word.gradInvlexCompareTo(Word) Called method edu.jas.poly.Word.compareTo(Word) Return value of edu.jas.poly.Word.compareTo(Word) of type int At Word.java:[line 553]
SnVI | edu.jas.fd.SGCDParallelProxy is Serializable; consider declaring a serialVersionUID
| Bug type SE_NO_SERIALVERSIONID (click for details) In class edu.jas.fd.SGCDParallelProxy At SGCDParallelProxy.java:[lines 34-646]
SnVI | edu.jas.gb.GBProxy is Serializable; consider declaring a serialVersionUID
| Bug type SE_NO_SERIALVERSIONID (click for details) In class edu.jas.gb.GBProxy At GBProxy.java:[lines 28-165]
SnVI | edu.jas.gb.GroebnerBaseDistributedEC is Serializable; consider declaring a serialVersionUID
| Bug type SE_NO_SERIALVERSIONID (click for details) In class edu.jas.gb.GroebnerBaseDistributedEC At GroebnerBaseDistributedEC.java:[lines 44-470]
SnVI | edu.jas.gb.GroebnerBaseDistributedHybridEC is Serializable; consider declaring a serialVersionUID
| Bug type SE_NO_SERIALVERSIONID (click for details) In class edu.jas.gb.GroebnerBaseDistributedHybridEC At GroebnerBaseDistributedHybridEC.java:[lines 46-546]
SnVI | edu.jas.gb.GroebnerBaseParallel is Serializable; consider declaring a serialVersionUID
| Bug type SE_NO_SERIALVERSIONID (click for details) In class edu.jas.gb.GroebnerBaseParallel At GroebnerBaseParallel.java:[lines 39-281]
SnVI | edu.jas.gb.GroebnerBaseParIter is Serializable; consider declaring a serialVersionUID
| Bug type SE_NO_SERIALVERSIONID (click for details) In class edu.jas.gb.GroebnerBaseParIter At GroebnerBaseParIter.java:[lines 40-331]
SnVI | edu.jas.gb.GroebnerBaseSeqPairDistributed is Serializable; consider declaring a serialVersionUID
| Bug type SE_NO_SERIALVERSIONID (click for details) In class edu.jas.gb.GroebnerBaseSeqPairDistributed At GroebnerBaseSeqPairDistributed.java:[lines 44-385]
SnVI | edu.jas.gb.GroebnerBaseSeqPairParallel is Serializable; consider declaring a serialVersionUID
| Bug type SE_NO_SERIALVERSIONID (click for details) In class edu.jas.gb.GroebnerBaseSeqPairParallel At GroebnerBaseSeqPairParallel.java:[lines 36-267]
SnVI | edu.jas.gb.SGBProxy is Serializable; consider declaring a serialVersionUID
| Bug type SE_NO_SERIALVERSIONID (click for details) In class edu.jas.gb.SGBProxy At SGBProxy.java:[lines 28-314]
SnVI | edu.jas.gb.SolvableGroebnerBaseParallel is Serializable; consider declaring a serialVersionUID
| Bug type SE_NO_SERIALVERSIONID (click for details) In class edu.jas.gb.SolvableGroebnerBaseParallel At SolvableGroebnerBaseParallel.java:[lines 36-354]
SnVI | edu.jas.gb.SolvableGroebnerBaseSeqPairParallel is Serializable; consider declaring a serialVersionUID
| Bug type SE_NO_SERIALVERSIONID (click for details) In class edu.jas.gb.SolvableGroebnerBaseSeqPairParallel At SolvableGroebnerBaseSeqPairParallel.java:[lines 39-346]
SnVI | edu.jas.gbufd.GroebnerBasePseudoParallel is Serializable; consider declaring a serialVersionUID
| Bug type SE_NO_SERIALVERSIONID (click for details) In class edu.jas.gbufd.GroebnerBasePseudoParallel At GroebnerBasePseudoParallel.java:[lines 45-279]
SnVI | edu.jas.gbufd.GroebnerBasePseudoRecParallel is Serializable; consider declaring a serialVersionUID
| Bug type SE_NO_SERIALVERSIONID (click for details) In class edu.jas.gbufd.GroebnerBasePseudoRecParallel At GroebnerBasePseudoRecParallel.java:[lines 46-350]
SnVI | edu.jas.poly.GenPolynomial is Serializable; consider declaring a serialVersionUID
| Bug type SE_NO_SERIALVERSIONID (click for details) In class edu.jas.poly.GenPolynomial At GenPolynomial.java:[lines 47-2487]
SnVI | edu.jas.ufd.GCDProxy is Serializable; consider declaring a serialVersionUID
| Bug type SE_NO_SERIALVERSIONID (click for details) In class edu.jas.ufd.GCDProxy At GCDProxy.java:[lines 30-583]

## Malicious code vulnerability Warnings

Code | Warning
--- | ---
MS | edu.jas.kern.ComputerThreads.NO_THREADS isn't final and can't be protected from malicious code
| Bug type MS_CANNOT_BE_FINAL (click for details) In class edu.jas.kern.ComputerThreads Field edu.jas.kern.ComputerThreads.NO_THREADS At ComputerThreads.java:[line 42]

## Dodgy code Warnings

Code | Warning
--- | ---
BC | Unchecked/unconfirmed cast from edu.jas.poly.GenPolynomial<C> to edu.jas.poly.GenSolvablePolynomial in edu.jas.application.SolvableLocalResidueRing.create(GenPolynomial)
| Bug type BC_UNCONFIRMED_CAST (click for details) In class edu.jas.application.SolvableLocalResidueRing In method edu.jas.application.SolvableLocalResidueRing.create(GenPolynomial) Actual type edu.jas.poly.GenPolynomial<C> Expected edu.jas.poly.GenSolvablePolynomial Value loaded from ? At SolvableLocalResidueRing.java:[line 123]
BC | Unchecked/unconfirmed cast from edu.jas.poly.GenPolynomial<C> to edu.jas.poly.GenSolvablePolynomial in edu.jas.application.SolvableLocalResidueRing.create(GenPolynomial, GenPolynomial)
| Bug type BC_UNCONFIRMED_CAST (click for details) In class edu.jas.application.SolvableLocalResidueRing In method edu.jas.application.SolvableLocalResidueRing.create(GenPolynomial, GenPolynomial) Actual type edu.jas.poly.GenPolynomial<C> Expected edu.jas.poly.GenSolvablePolynomial Value loaded from ? At SolvableLocalResidueRing.java:[line 132]
BC | Unchecked/unconfirmed cast from edu.jas.poly.GenPolynomial<C> to edu.jas.poly.GenSolvablePolynomial in edu.jas.application.SolvableLocalRing.create(GenPolynomial)
| Bug type BC_UNCONFIRMED_CAST (click for details) In class edu.jas.application.SolvableLocalRing In method edu.jas.application.SolvableLocalRing.create(GenPolynomial) Actual type edu.jas.poly.GenPolynomial<C> Expected edu.jas.poly.GenSolvablePolynomial Value loaded from ? At SolvableLocalRing.java:[line 121]
BC | Unchecked/unconfirmed cast from edu.jas.poly.GenPolynomial<C> to edu.jas.poly.GenSolvablePolynomial in edu.jas.application.SolvableLocalRing.create(GenPolynomial, GenPolynomial)
| Bug type BC_UNCONFIRMED_CAST (click for details) In class edu.jas.application.SolvableLocalRing In method edu.jas.application.SolvableLocalRing.create(GenPolynomial, GenPolynomial) Actual type edu.jas.poly.GenPolynomial<C> Expected edu.jas.poly.GenSolvablePolynomial Value loaded from ? At SolvableLocalRing.java:[line 130]
BC | Unchecked/unconfirmed cast from edu.jas.poly.GenPolynomial<C> to edu.jas.poly.GenSolvablePolynomial in edu.jas.application.SolvableResidueRing.create(GenPolynomial)
| Bug type BC_UNCONFIRMED_CAST (click for details) In class edu.jas.application.SolvableResidueRing In method edu.jas.application.SolvableResidueRing.create(GenPolynomial) Actual type edu.jas.poly.GenPolynomial<C> Expected edu.jas.poly.GenSolvablePolynomial Value loaded from ? At SolvableResidueRing.java:[line 124]
BC | Unchecked/unconfirmed cast from edu.jas.poly.GenPolynomial<C> to edu.jas.poly.GenSolvablePolynomial in edu.jas.application.SolvableResidueRing.create(GenPolynomial, GenPolynomial)
| Bug type BC_UNCONFIRMED_CAST (click for details) In class edu.jas.application.SolvableResidueRing In method edu.jas.application.SolvableResidueRing.create(GenPolynomial, GenPolynomial) Actual type edu.jas.poly.GenPolynomial<C> Expected edu.jas.poly.GenSolvablePolynomial Value loaded from ? At SolvableResidueRing.java:[line 136]
BC | Unchecked/unconfirmed cast from edu.jas.poly.GenPolynomial<C> to edu.jas.poly.GenSolvablePolynomial in edu.jas.fd.SolvableQuotientRing.create(GenPolynomial)
| Bug type BC_UNCONFIRMED_CAST (click for details) In class edu.jas.fd.SolvableQuotientRing In method edu.jas.fd.SolvableQuotientRing.create(GenPolynomial) Actual type edu.jas.poly.GenPolynomial<C> Expected edu.jas.poly.GenSolvablePolynomial Value loaded from ? At SolvableQuotientRing.java:[line 81]
BC | Unchecked/unconfirmed cast from edu.jas.poly.GenPolynomial<C> to edu.jas.poly.GenSolvablePolynomial in edu.jas.fd.SolvableQuotientRing.create(GenPolynomial, GenPolynomial)
| Bug type BC_UNCONFIRMED_CAST (click for details) In class edu.jas.fd.SolvableQuotientRing In method edu.jas.fd.SolvableQuotientRing.create(GenPolynomial, GenPolynomial) Actual type edu.jas.poly.GenPolynomial<C> Expected edu.jas.poly.GenSolvablePolynomial Value loaded from ? At SolvableQuotientRing.java:[line 90]
BC | instanceof will always return true for all non-null values in edu.jas.poly.RecSolvablePolynomial.evalAsRightRecursivePolynomial(), since all edu.jas.poly.RecSolvablePolynomial are instances of edu.jas.poly.RecSolvablePolynomial
| Bug type BC_VACUOUS_INSTANCEOF (click for details) In class edu.jas.poly.RecSolvablePolynomial In method edu.jas.poly.RecSolvablePolynomial.evalAsRightRecursivePolynomial() Actual type edu.jas.poly.RecSolvablePolynomial Expected edu.jas.poly.RecSolvablePolynomial At RecSolvablePolynomial.java:[line 764]
BC | instanceof will always return true for all non-null values in edu.jas.poly.RecSolvablePolynomial.isRightRecursivePolynomial(GenSolvablePolynomial), since all edu.jas.poly.RecSolvablePolynomial are instances of edu.jas.poly.RecSolvablePolynomial
| Bug type BC_VACUOUS_INSTANCEOF (click for details) In class edu.jas.poly.RecSolvablePolynomial In method edu.jas.poly.RecSolvablePolynomial.isRightRecursivePolynomial(GenSolvablePolynomial) Actual type edu.jas.poly.RecSolvablePolynomial Expected edu.jas.poly.RecSolvablePolynomial At RecSolvablePolynomial.java:[line 806]
BC | instanceof will always return true for all non-null values in edu.jas.poly.RecSolvablePolynomial.rightRecursivePolynomial(), since all edu.jas.poly.RecSolvablePolynomial are instances of edu.jas.poly.RecSolvablePolynomial
| Bug type BC_VACUOUS_INSTANCEOF (click for details) In class edu.jas.poly.RecSolvablePolynomial In method edu.jas.poly.RecSolvablePolynomial.rightRecursivePolynomial() Actual type edu.jas.poly.RecSolvablePolynomial Expected edu.jas.poly.RecSolvablePolynomial At RecSolvablePolynomial.java:[line 723]
DB | edu.jas.application.RingFactoryTokenizer.nextCoefficientRing() uses the same code for two branches
| Bug type DB_DUPLICATE_BRANCHES (click for details) In class edu.jas.application.RingFactoryTokenizer In method edu.jas.application.RingFactoryTokenizer.nextCoefficientRing() At RingFactoryTokenizer.java:[line 471] At RingFactoryTokenizer.java:[line 473]
DB | edu.jas.poly.GenPolynomialTokenizer.nextCoefficientRing() uses the same code for two branches
| Bug type DB_DUPLICATE_BRANCHES (click for details) In class edu.jas.poly.GenPolynomialTokenizer In method edu.jas.poly.GenPolynomialTokenizer.nextCoefficientRing() At GenPolynomialTokenizer.java:[line 826] At GenPolynomialTokenizer.java:[line 828]
SF | Switch statement found in edu.jas.poly.GenPolynomialTokenizer.nextPolynomial() where one case falls through to the next case
| Bug type SF_SWITCH_FALLTHROUGH (click for details) In class edu.jas.poly.GenPolynomialTokenizer In method edu.jas.poly.GenPolynomialTokenizer.nextPolynomial() At GenPolynomialTokenizer.java:[lines 329-332]
UCF | Useless control flow in edu.jas.fd.GCDLeftRightTest.testBaseQR()
| Bug type UCF_USELESS_CONTROL_FLOW (click for details) In class edu.jas.fd.GCDLeftRightTest In method edu.jas.fd.GCDLeftRightTest.testBaseQR() At GCDLeftRightTest.java:[line 591]

# Details

## BC_VACUOUS_INSTANCEOF: instanceof will always return true

This instanceof test will always return true (unless the value being tested is null). Although this is safe, make sure it isn't an indication of some misunderstanding or some other logic error. If you really want to test the value for being null, perhaps it would be clearer to do better to do a null test rather than an instanceof test.

## BC_UNCONFIRMED_CAST: Unchecked/unconfirmed cast

This cast is unchecked, and not all instances of the type casted from can be cast to the type it is being cast to. Check that your program logic ensures that this cast will not fail.

## DB_DUPLICATE_BRANCHES: Method uses the same code for two branches

This method uses the same code to implement two branches of a conditional branch. Check to ensure that this isn't a coding mistake.

## MS_CANNOT_BE_FINAL: Field isn't final and can't be protected from malicious code

A mutable static field could be changed by malicious code or by accident from another package. Unfortunately, the way the field is used doesn't allow any easy fix to this problem.

## NM_SAME_SIMPLE_NAME_AS_SUPERCLASS: Class names shouldn't shadow simple name of superclass

This class has a simple name that is identical to that of its superclass, except that its superclass is in a different package (e.g., `alpha.Foo` extends `beta.Foo`). This can be exceptionally confusing, create lots of situations in which you have to look at import statements to resolve references and creates many opportunities to accidentally define methods that do not override methods in their superclasses.

## NM_METHOD_NAMING_CONVENTION: Method names should start with a lower case letter

Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized.

## OS_OPEN_STREAM: Method may fail to close stream

The method creates an IO stream object, does not assign it to any fields, pass it to other methods that might close it, or return it, and does not appear to close the stream on all paths out of the method. This may result in a file descriptor leak. It is generally a good idea to use a `finally` block to ensure that streams are closed.

## RV_NEGATING_RESULT_OF_COMPARETO: Negating the result of compareTo()/compare()

This code negatives the return value of a compareTo or compare method. This is a questionable or bad programming practice, since if the return value is Integer.MIN_VALUE, negating the return value won't negate the sign of the result. You can achieve the same intended result by reversing the order of the operands rather than by negating the results.

## SF_SWITCH_FALLTHROUGH: Switch statement found where one case falls through to the next case

This method contains a switch statement where one case branch will fall through to the next case. Usually you need to end this case with a break or return.

## SE_NO_SERIALVERSIONID: Class is Serializable, but doesn't define serialVersionUID

This class implements the `Serializable` interface, but does not define a `serialVersionUID` field. A change as simple as adding a reference to a .class object will add synthetic fields to the class, which will unfortunately change the implicit serialVersionUID (e.g., adding a reference to `String.class` will generate a static field `class$java$lang$String`). Also, different source code to bytecode compilers may use different naming conventions for synthetic variables generated for references to class objects or inner classes. To ensure interoperability of Serializable across versions, consider adding an explicit serialVersionUID.

## UCF_USELESS_CONTROL_FLOW: Useless control flow

This method contains a useless control flow statement, where control flow continues onto the same place regardless of whether or not the branch is taken. For example, this is caused by having an empty statement block for an `if` statement:

        if (argv.length == 0) {
        // TODO: handle this case
        }