# FindBugs Report

## Project Information

Project:

FindBugs version: 2.0.1-rc3

Code analyzed:

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

## Metrics

78222 lines of code analyzed, in 792 classes, in 15 packages.

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

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

## Contents

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

# Summary

Warning Type | Number
--- | ---
Bad practice Warnings | 11
Correctness Warnings | 1
Malicious code vulnerability Warnings | 10
Performance 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 65-209]
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) At PolynomialComparator.java:[line 51]
RV | edu.jas.poly.TermOrder$69.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$69 In method edu.jas.poly.TermOrder$69.compare(ExpVector, ExpVector) Called method edu.jas.poly.TermOrder$EVComparator.compare(ExpVector, ExpVector) Return value of edu.jas.poly.TermOrder$EVComparator.compare(ExpVector, ExpVector) At TermOrder.java:[line 1269]
RV | edu.jas.poly.TermOrder$9.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$9 In method edu.jas.poly.TermOrder$9.compare(ExpVector, ExpVector) Called method edu.jas.poly.TermOrder$EVComparator.compare(ExpVector, ExpVector) Return value of edu.jas.poly.TermOrder$EVComparator.compare(ExpVector, ExpVector) At TermOrder.java:[line 249]
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 27-156]
SnVI | edu.jas.gb.GroebnerBaseDistributed is Serializable; consider declaring a serialVersionUID
| Bug type SE_NO_SERIALVERSIONID (click for details) In class edu.jas.gb.GroebnerBaseDistributed At GroebnerBaseDistributed.java:[lines 40-370]
SnVI | edu.jas.gb.GroebnerBaseDistributedHybrid is Serializable; consider declaring a serialVersionUID
| Bug type SE_NO_SERIALVERSIONID (click for details) In class edu.jas.gb.GroebnerBaseDistributedHybrid At GroebnerBaseDistributedHybrid.java:[lines 41-461]
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 33-285]
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 42-381]
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 35-265]
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 29-582]

## Correctness Warnings

Code | Warning
--- | ---
SA | Self comparison of $L0 with itself edu.jas.ps.Examples.example11()
| Bug type SA_LOCAL_SELF_COMPARISON (click for details) In class edu.jas.ps.Examples In method edu.jas.ps.Examples.example11() Local variable stored in JVM register 0 At Examples.java:[line 273]

## Malicious code vulnerability Warnings

Code | Warning
--- | ---
EI | edu.jas.poly.GenPolynomialRing.getVars() may expose internal representation by returning GenPolynomialRing.vars
| Bug type EI_EXPOSE_REP (click for details) In class edu.jas.poly.GenPolynomialRing In method edu.jas.poly.GenPolynomialRing.getVars() Field edu.jas.poly.GenPolynomialRing.vars At GenPolynomialRing.java:[line 409]
EI | edu.jas.poly.TermOrder.getWeight() may expose internal representation by returning TermOrder.weight
| Bug type EI_EXPOSE_REP (click for details) In class edu.jas.poly.TermOrder In method edu.jas.poly.TermOrder.getWeight() Field edu.jas.poly.TermOrder.weight At TermOrder.java:[line 1317]
EI | edu.jas.ps.MultiVarPowerSeriesRing.getVars() may expose internal representation by returning MultiVarPowerSeriesRing.vars
| Bug type EI_EXPOSE_REP (click for details) In class edu.jas.ps.MultiVarPowerSeriesRing In method edu.jas.ps.MultiVarPowerSeriesRing.getVars() Field edu.jas.ps.MultiVarPowerSeriesRing.vars At MultiVarPowerSeriesRing.java:[line 238]
EI2 | new edu.jas.application.Dimension(int, Set, Set, String[]) may expose internal representation by storing an externally mutable object into Dimension.v
| Bug type EI_EXPOSE_REP2 (click for details) In class edu.jas.application.Dimension In method new edu.jas.application.Dimension(int, Set, Set, String[]) Field edu.jas.application.Dimension.v Local variable stored in JVM register 4 At Dimension.java:[line 55]
EI2 | new edu.jas.poly.ExpVectorLong(long[]) may expose internal representation by storing an externally mutable object into ExpVectorLong.val
| Bug type EI_EXPOSE_REP2 (click for details) In class edu.jas.poly.ExpVectorLong In method new edu.jas.poly.ExpVectorLong(long[]) Field edu.jas.poly.ExpVectorLong.val Local variable stored in JVM register 1 At ExpVectorLong.java:[line 60]
EI2 | new edu.jas.poly.GenPolynomialRing(RingFactory, int, TermOrder, String[]) may expose internal representation by storing an externally mutable object into GenPolynomialRing.vars
| Bug type EI_EXPOSE_REP2 (click for details) In class edu.jas.poly.GenPolynomialRing In method new edu.jas.poly.GenPolynomialRing(RingFactory, int, TermOrder, String[]) Field edu.jas.poly.GenPolynomialRing.vars Local variable stored in JVM register 4 At GenPolynomialRing.java:[line 200]
EI2 | edu.jas.poly.GenPolynomialRing.setVars(String[]) may expose internal representation by storing an externally mutable object into GenPolynomialRing.vars
| Bug type EI_EXPOSE_REP2 (click for details) In class edu.jas.poly.GenPolynomialRing In method edu.jas.poly.GenPolynomialRing.setVars(String[]) Field edu.jas.poly.GenPolynomialRing.vars Local variable stored in JVM register 1 At GenPolynomialRing.java:[line 423]
EI2 | new edu.jas.poly.TermOrder(long[][]) may expose internal representation by storing an externally mutable object into TermOrder.weight
| Bug type EI_EXPOSE_REP2 (click for details) In class edu.jas.poly.TermOrder In method new edu.jas.poly.TermOrder(long[][]) Field edu.jas.poly.TermOrder.weight Local variable stored in JVM register 1 At TermOrder.java:[line 282]
EI2 | new edu.jas.ps.MultiVarPowerSeriesRing(RingFactory, int, int, String[]) may expose internal representation by storing an externally mutable object into MultiVarPowerSeriesRing.vars
| Bug type EI_EXPOSE_REP2 (click for details) In class edu.jas.ps.MultiVarPowerSeriesRing In method new edu.jas.ps.MultiVarPowerSeriesRing(RingFactory, int, int, String[]) Field edu.jas.ps.MultiVarPowerSeriesRing.vars Local variable stored in JVM register 4 At MultiVarPowerSeriesRing.java:[line 159]
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 40]

## Performance Warnings

Code | Warning
--- | ---
WMI | edu.jas.gb.OrderedSyzPairlist.put(GenPolynomial) makes inefficient use of keySet iterator instead of entrySet iterator
| Bug type WMI_WRONG_MAP_ITERATOR (click for details) In class edu.jas.gb.OrderedSyzPairlist In method edu.jas.gb.OrderedSyzPairlist.put(GenPolynomial) At OrderedSyzPairlist.java:[line 226]

## Dodgy code Warnings

Code | Warning
--- | ---
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 499] At RingFactoryTokenizer.java:[line 501]
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 765] At GenPolynomialTokenizer.java:[line 767]
DLS | Dead store to $L5 in edu.jas.poly.ExpVector.subst(int, long)
| Bug type DLS_DEAD_LOCAL_STORE (click for details) In class edu.jas.poly.ExpVector In method edu.jas.poly.ExpVector.subst(int, long) Local variable stored in JVM register 5 At ExpVector.java:[line 689]
DLS | Dead store to $L4 in edu.jas.poly.ExpVectorByte.subst(int, byte)
| Bug type DLS_DEAD_LOCAL_STORE (click for details) In class edu.jas.poly.ExpVectorByte In method edu.jas.poly.ExpVectorByte.subst(int, byte) Local variable stored in JVM register 4 At ExpVectorByte.java:[line 461]
DLS | Dead store to $L5 in edu.jas.poly.ExpVectorByte.subst(int, long)
| Bug type DLS_DEAD_LOCAL_STORE (click for details) In class edu.jas.poly.ExpVectorByte In method edu.jas.poly.ExpVectorByte.subst(int, long) Local variable stored in JVM register 5 At ExpVectorByte.java:[line 477]
DLS | Dead store to $L4 in edu.jas.poly.ExpVectorInteger.subst(int, int)
| Bug type DLS_DEAD_LOCAL_STORE (click for details) In class edu.jas.poly.ExpVectorInteger In method edu.jas.poly.ExpVectorInteger.subst(int, int) Local variable stored in JVM register 4 At ExpVectorInteger.java:[line 477]
DLS | Dead store to $L5 in edu.jas.poly.ExpVectorInteger.subst(int, long)
| Bug type DLS_DEAD_LOCAL_STORE (click for details) In class edu.jas.poly.ExpVectorInteger In method edu.jas.poly.ExpVectorInteger.subst(int, long) Local variable stored in JVM register 5 At ExpVectorInteger.java:[line 462]
DLS | Dead store to $L5 in edu.jas.poly.ExpVectorLong.subst(int, long)
| Bug type DLS_DEAD_LOCAL_STORE (click for details) In class edu.jas.poly.ExpVectorLong In method edu.jas.poly.ExpVectorLong.subst(int, long) Local variable stored in JVM register 5 At ExpVectorLong.java:[line 399]
DLS | Dead store to $L5 in edu.jas.poly.ExpVectorShort.subst(int, long)
| Bug type DLS_DEAD_LOCAL_STORE (click for details) In class edu.jas.poly.ExpVectorShort In method edu.jas.poly.ExpVectorShort.subst(int, long) Local variable stored in JVM register 5 At ExpVectorShort.java:[line 477]
DLS | Dead store to $L4 in edu.jas.poly.ExpVectorShort.subst(int, short)
| Bug type DLS_DEAD_LOCAL_STORE (click for details) In class edu.jas.poly.ExpVectorShort In method edu.jas.poly.ExpVectorShort.subst(int, short) Local variable stored in JVM register 4 At ExpVectorShort.java:[line 461]
DLS | Dead store to $L1 in edu.jas.ps.MultiVarPowerSeries.orderExpVector()
| Bug type DLS_DEAD_LOCAL_STORE (click for details) In class edu.jas.ps.MultiVarPowerSeries In method edu.jas.ps.MultiVarPowerSeries.orderExpVector() Local variable stored in JVM register 1 At MultiVarPowerSeries.java:[line 914]
DLS | Dead store to $L14 in edu.jas.ufd.FactorAbsolute.factorsAbsoluteIrreducible(GenPolynomial)
| Bug type DLS_DEAD_LOCAL_STORE (click for details) In class edu.jas.ufd.FactorAbsolute In method edu.jas.ufd.FactorAbsolute.factorsAbsoluteIrreducible(GenPolynomial) Local variable stored in JVM register 14 At FactorAbsolute.java:[line 849] Another occurrence at FactorAbsolute.java:[line 850]
DLS | Dead store to $L4 in new edu.jas.util.CartesianTwoProductInfiniteIterator(Iterable, Iterable)
| Bug type DLS_DEAD_LOCAL_STORE (click for details) In class edu.jas.util.CartesianTwoProductInfiniteIterator In method new edu.jas.util.CartesianTwoProductInfiniteIterator(Iterable, Iterable) Local variable stored in JVM register 4 At CartesianProductInfinite.java:[line 181]
DLS | Dead store to $L4 in new edu.jas.util.CartesianTwoProductInfiniteIteratorList(Iterable, Iterable)
| Bug type DLS_DEAD_LOCAL_STORE (click for details) In class edu.jas.util.CartesianTwoProductInfiniteIteratorList In method new edu.jas.util.CartesianTwoProductInfiniteIteratorList(Iterable, Iterable) Local variable stored in JVM register 4 At CartesianProductInfinite.java:[line 317]
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 307-310]

# Details

## 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.

## DLS_DEAD_LOCAL_STORE: Dead store to local variable

This instruction assigns a value to a local variable, but the value is not read or used in any subsequent instruction. Often, this indicates an error, because the value computed is never used.

Note that Sun's javac compiler often generates dead stores for final local variables. Because FindBugs is a bytecode-based tool, there is no easy way to eliminate these false positives.

## EI_EXPOSE_REP: May expose internal representation by returning reference to mutable object

Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is better approach in many situations.

## EI_EXPOSE_REP2: May expose internal representation by incorporating reference to mutable object

This code stores a reference to an externally mutable object into the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Storing a copy of the object is better approach in many situations.

## 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 accidently define methods that do not override methods in their superclasses.

## 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.

## SA_LOCAL_SELF_COMPARISON: Self comparison of value with itself

This method compares a local variable with itself, and may indicate a typo or a logic error. Make sure that you are comparing the right things.

## 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.

## WMI_WRONG_MAP_ITERATOR: Inefficient use of keySet iterator instead of entrySet iterator

This method accesses the value of a Map entry, using a key that was retrieved from a keySet iterator. It is more efficient to use an iterator on the entrySet of the map, to avoid the Map.get(key) lookup.