FindBugs (1.3.3)
Analysis for
OpenJFX compiler 1.0-internal-root
FindBugs Analysis generated at: Wed, 7 May 2008 08:13:19 -0700
Package |
Code Size |
Bugs |
Bugs p1 |
Bugs p2 |
Bugs p3 |
Bugs Exp. |
Ratio |
Overall
(23 packages),
(896 classes)
|
42277 |
29 |
2 |
27 |
|
|
|
com.sun.javafx.api |
121 |
2 |
|
2 |
|
|
|
com.sun.javafx.runtime.util |
1832 |
3 |
|
3 |
|
|
|
com.sun.tools.javafx.code |
506 |
1 |
|
1 |
|
|
|
com.sun.tools.javafx.comp |
10057 |
13 |
2 |
11 |
|
|
|
com.sun.tools.javafx.main |
1520 |
1 |
|
1 |
|
|
|
javafx.reflect |
401 |
9 |
|
9 |
|
|
|
Analyzed Files:
- /export/openjfx/hudson/jobs/openjfx-compiler/workspace/openjfx-compiler/build/classes
Used Libraries:
- /export/openjfx/hudson/jobs/openjfx-compiler/workspace/openjfx-compiler/lib/javac.jar
- /export/openjfx/hudson/jobs/openjfx-compiler/workspace/openjfx-compiler/lib/script-api.jar
- /export/openjfx/build-tools/antlr-2008-01-14.10/runtime-2008-01-14.10.jar
- /export/openjfx/build-tools/ant-1.7.0/ant.jar
- /export/openjfx/hudson/jobs/openjfx-compiler/workspace/openjfx-compiler/lib/Scenario.jar
- /export/openjfx/hudson/jobs/openjfx-compiler/workspace/openjfx-compiler/lib/swing-layout.jar
Analysis Errors:
- Missing ref classes for analysis:
- org.apache.tools.ant.launch.Locator
HE / HE_EQUALS_USE_HASHCODE
This class overrides equals(Object)
, but does not
override hashCode()
, and inherits the implementation of
hashCode()
from java.lang.Object
(which returns
the identity hash code, an arbitrary value assigned to the object
by the VM). Therefore, the class is very likely to violate the
invariant that equal objects must have equal hashcodes.
If you don't think instances of this class will ever be inserted into a HashMap/HashTable,
the recommended hashCode
implementation to use is:
public int hashCode() {
assert false : "hashCode not designed";
return 42; // any arbitrary constant will do
}
Eq / EQ_SELF_USE_OBJECT
This class defines a covariant version of the equals()
method, but inherits the normal equals(Object)
method
defined in the base java.lang.Object
class.
The class should probably define a boolean equals(Object)
method.
DB / DB_DUPLICATE_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.
BIT / BIT_SIGNED_CHECK
This method compares an expression such as
((event.detail & SWT.SELECTED) > 0)
.
Using bit arithmetic and then comparing with the greater than operator can
lead to unexpected results (of course depending on the value of
SWT.SELECTED). If SWT.SELECTED is a negative number, this is a candidate
for a bug. Even when SWT.SELECTED is not negative, it seems good practice
to use '!= 0' instead of '> 0'.
Boris Bokowski
NP / NP_UNWRITTEN_FIELD
The program is dereferencing a field that does not seem to ever have a non-null value written to it.
Dereferencing this value will generate a null pointer exception.
SS / SS_SHOULD_BE_STATIC
This class contains an instance final field that
is initialized to a compile-time static value.
Consider making the field static.
ST / ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD
This instance method writes to a static field. This is tricky to get
correct if multiple instances are being manipulated,
and generally bad practice.
UPM / UPM_UNCALLED_PRIVATE_METHOD
This private method is never called. Although it is
possible that the method will be invoked through reflection,
it is more likely that the method is never used, and should be
removed.
DP / DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED
This code creates a classloader, which requires a security manager.
If this code will be granted security permissions, but might be invoked by code that does not
have security permissions, then the classloader creation needs to occur inside a doPrivileged block.
Eq / EQ_DOESNT_OVERRIDE_EQUALS
This class extends a class that defines an equals method and adds fields, but doesn't
define an equals method itself. Thus, equality on instances of this class will
ignore the identity of the subclass and the added fields. Be sure this is what is intended,
and that you don't need to override the equals method. Even if you don't need to override
the equals method, consider overriding it anyway to document the fact
that the equals method for the subclass just return the result of
invoking super.equals(o).
Nm / NM_WRONG_PACKAGE_INTENTIONAL
The method in the subclass doesn't override a similar method in a superclass because the type of a parameter doesn't exactly match
the type of the corresponding parameter in the superclass. For example, if you have:
import alpha.Foo;
public class A {
public int f(Foo x) { return 17; }
}
----
import beta.Foo;
public class B extends A {
public int f(Foo x) { return 42; }
public int f(alpha.Foo x) { return 27; }
}
The f(Foo)
method defined in class B
doesn't
override the
f(Foo)
method defined in class A
, because the argument
types are Foo
's from different packages.
In this case, the subclass does define a method with a signature identical to the method in the superclass,
so this is presumably understood. However, such methods are exceptionally confusing. You should strongly consider
removing or deprecating the method with the similar but not identical signature.
BC / BC_VACUOUS_INSTANCEOF
This instanceof test will always return true. Although this is safe, make sure it isn't
an indication of some misunderstanding or some other logic error.
NP / NP_NULL_PARAM_DEREF
This method call passes a null value to a method which might
dereference it unconditionally.
UwF / UWF_UNWRITTEN_FIELD
This field is never written. All reads of it will return the default
value. Check for errors (should it have been initialized?), or remove it if it is useless.
SIC / SIC_INNER_SHOULD_BE_STATIC
This class is an inner class, but does not use its embedded reference
to the object which created it. This reference makes the instances
of the class larger, and may keep the reference to the creator object
alive longer than necessary. If possible, the class should be
made static.
NP / NP_NULL_ON_SOME_PATH
There is a branch of statement that, if executed, guarantees that
a null value will be dereferenced, which
would generate a NullPointerException
when the code is executed.
Of course, the problem might be that the branch or statement is infeasible and that
the null pointer exception can't ever be executed; deciding that is beyond the ability of FindBugs.
DLS / DLS_DEAD_LOCAL_STORE
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.
In class com.sun.javafx.api.ToolProvider
In method com.sun.javafx.api.ToolProvider.getJavaFXScriptEngine()
In class com.sun.javafx.api.ToolProvider$CompilerClassLoader
At ToolProvider.java:[line 77]
com.sun.javafx.api.ToolProvider.getJavaFXScriptEngine() creates a com.sun.javafx.api.ToolProvider$CompilerClassLoader classloader, which should be performed within a doPrivileged block
In class com.sun.javafx.api.ToolProvider
In method com.sun.javafx.api.ToolProvider.getJavafxCompiler()
In class com.sun.javafx.api.ToolProvider$CompilerClassLoader
At ToolProvider.java:[line 56]
com.sun.javafx.api.ToolProvider.getJavafxCompiler() creates a com.sun.javafx.api.ToolProvider$CompilerClassLoader classloader, which should be performed within a doPrivileged block
In class com.sun.javafx.runtime.util.FXFormatter$FormatSpecifier
In method com.sun.javafx.runtime.util.FXFormatter$FormatSpecifier.checkInteger()
At FXFormatter.java:[line 3182]
At FXFormatter.java:[line 3184]
Method com.sun.javafx.runtime.util.FXFormatter$FormatSpecifier.checkInteger() uses the same code for two branches
In class com.sun.javafx.runtime.util.FXFormatter$FormatSpecifier
In method com.sun.javafx.runtime.util.FXFormatter$FormatSpecifier.conversion()
At FXFormatter.java:[line 2803]
Private method com.sun.javafx.runtime.util.FXFormatter$FormatSpecifier.conversion() is never called
In class com.sun.javafx.runtime.util.FXFormatter$FormatSpecifier$BigDecimalLayout
At FXFormatter.java:[lines 3893-4015]
Should com.sun.javafx.runtime.util.FXFormatter$FormatSpecifier$BigDecimalLayout be a _static_ inner class?
In class com.sun.tools.javafx.code.FunctionType
In method com.sun.tools.javac.code.Type.equals(Object)
At Type.java:[line 223]
com.sun.tools.javafx.code.FunctionType doesn't override com.sun.tools.javac.code.Type.equals(Object)
In class com.sun.tools.javafx.comp.JavafxAttr
In method com.sun.tools.javafx.comp.JavafxAttr.visitAssignop(JCTree$JCAssignOp)
Actual type com.sun.tools.javac.tree.JCTree$JCExpression
Expected com.sun.tools.javac.tree.JCTree$JCExpression
At JavafxAttr.java:[line 2230]
Another occurrence at JavafxAttr.java:[line 2237]
instanceof will always return true in com.sun.tools.javafx.comp.JavafxAttr.visitAssignop(JCTree$JCAssignOp), since all com.sun.tools.javac.tree.JCTree$JCExpression are instances of com.sun.tools.javac.tree.JCTree$JCExpression
In class com.sun.tools.javafx.comp.JavafxAttr
In method com.sun.tools.javafx.comp.JavafxAttr.visitBinary(JCTree$JCBinary)
Actual type com.sun.tools.javac.tree.JCTree$JCExpression
Expected com.sun.tools.javac.tree.JCTree$JCExpression
At JavafxAttr.java:[line 2417]
Another occurrence at JavafxAttr.java:[line 2425]
instanceof will always return true in com.sun.tools.javafx.comp.JavafxAttr.visitBinary(JCTree$JCBinary), since all com.sun.tools.javac.tree.JCTree$JCExpression are instances of com.sun.tools.javac.tree.JCTree$JCExpression
In class com.sun.tools.javafx.comp.JavafxAttr
In method com.sun.tools.javafx.comp.JavafxAttr.visitFunctionValue(JFXFunctionValue)
Local variable named enclScope
At JavafxAttr.java:[line 1570]
Dead store to enclScope in com.sun.tools.javafx.comp.JavafxAttr.visitFunctionValue(JFXFunctionValue)
In class com.sun.tools.javafx.comp.JavafxAttr
In method com.sun.tools.javafx.comp.JavafxAttr.visitClassDeclaration(JFXClassDeclaration)
Called method com.sun.tools.javafx.code.JavafxTypes.addFxClass(Symbol$ClassSymbol, JFXClassDeclaration)
Argument 1 might be null but must not be null
Local variable named c
Method invoked at JavafxAttr.java:[line 2793]
Known null at JavafxAttr.java:[line 2769]
Method call in com.sun.tools.javafx.comp.JavafxAttr.visitClassDeclaration(JFXClassDeclaration) passes null for unconditionally dereferenced parameter of com.sun.tools.javafx.code.JavafxTypes.addFxClass(Symbol$ClassSymbol, JFXClassDeclaration)
In class com.sun.tools.javafx.comp.JavafxClassReader$2
In method com.sun.tools.javac.code.Type.equals(Object)
At Type.java:[line 223]
com.sun.tools.javafx.comp.JavafxClassReader$2 doesn't override com.sun.tools.javac.code.Type.equals(Object)
In class com.sun.tools.javafx.comp.JavafxEnter
In method com.sun.tools.javafx.comp.JavafxEnter.scan(List)
In class com.sun.tools.javafx.tree.JavafxTreeScanner
In method com.sun.tools.javafx.tree.JavafxTreeScanner.scan(List)
Actual type com.sun.tools.javac.util.List
Expected java.util.List
In method com.sun.tools.javafx.tree.JavafxTreeScanner.scan(List)
At JavafxEnter.java:[lines 113-116]
com.sun.tools.javafx.comp.JavafxEnter.scan(List) doesn't override method in superclass because parameter type com.sun.tools.javac.util.List doesn't match superclass parameter type java.util.List
In class com.sun.tools.javafx.comp.JavafxMemberEnter
Field com.sun.tools.javafx.comp.JavafxMemberEnter.localEnv
At JavafxMemberEnter.java:[line 600]
Unwritten field: com.sun.tools.javafx.comp.JavafxMemberEnter.localEnv
In class com.sun.tools.javafx.comp.JavafxModuleBuilder$2
In method com.sun.tools.javafx.comp.JavafxModuleBuilder$2.scan(JCTree)
At JavafxModuleBuilder.java:[line 300]
Check for sign of bitwise operation in com.sun.tools.javafx.comp.JavafxModuleBuilder$2.scan(JCTree)
In class com.sun.tools.javafx.comp.JavafxToBound
Field com.sun.tools.javafx.comp.JavafxToBound.attrEnv
At JavafxToBound.java:[line 52]
Unwritten field: com.sun.tools.javafx.comp.JavafxToBound.attrEnv
In class com.sun.tools.javafx.comp.JavafxToBound$5
Field com.sun.tools.javafx.comp.JavafxToBound$5.isSimple
At JavafxToBound.java:[line 749]
Unread field: com.sun.tools.javafx.comp.JavafxToBound$5.isSimple; should this field be static?
In class com.sun.tools.javafx.comp.JavafxToJava
In method com.sun.tools.javafx.comp.JavafxToJava.convertTranslated(JCTree$JCExpression, JCDiagnostic$DiagnosticPosition, Type, Type)
Local variable named stats
At JavafxToJava.java:[line 232]
Dead store to stats in com.sun.tools.javafx.comp.JavafxToJava.convertTranslated(JCTree$JCExpression, JCDiagnostic$DiagnosticPosition, Type, Type)
In class com.sun.tools.javafx.comp.JavafxToJava
In method com.sun.tools.javafx.comp.JavafxToJava.visitInterpolateValue(JFXInterpolateValue)
Local variable named interp
At JavafxToJava.java:[line 3269]
Dead store to interp in com.sun.tools.javafx.comp.JavafxToJava.visitInterpolateValue(JFXInterpolateValue)
In class com.sun.tools.javafx.comp.JavafxToJava
In method com.sun.tools.javafx.comp.JavafxToJava.visitConditional(JCTree$JCConditional)
Local variable named falseSide
Dereferenced at JavafxToJava.java:[line 2435]
Known null at JavafxToJava.java:[line 2400]
Known null at JavafxToJava.java:[line 2438]
Possible null pointer dereference of falseSide in com.sun.tools.javafx.comp.JavafxToJava.visitConditional(JCTree$JCConditional)
In class com.sun.tools.javafx.main.RecognizedOptions$21
In method com.sun.tools.javafx.main.RecognizedOptions$21.process(Options, String)
Field com.sun.tools.javac.code.Type.moreInfo
At RecognizedOptions.java:[line 473]
Write to static field com.sun.tools.javac.code.Type.moreInfo from instance method com.sun.tools.javafx.main.RecognizedOptions$21.process(Options, String)
In class javafx.reflect.ClassRef
In method javafx.reflect.ClassRef.equals(ClassRef)
At ClassRef.java:[line 54]
javafx.reflect.ClassRef defines equals(ClassRef) method and uses Object.equals(Object)
In class javafx.reflect.ClassRef
In method javafx.reflect.ClassRef.equals(ClassRef)
At ClassRef.java:[line 54]
javafx.reflect.ClassRef defines equals and uses Object.hashCode()
In class javafx.reflect.FunctionTypeRef
In method javafx.reflect.FunctionTypeRef.equals(FunctionTypeRef)
At FunctionTypeRef.java:[lines 54-61]
javafx.reflect.FunctionTypeRef defines equals(FunctionTypeRef) method and uses Object.equals(Object)
In class javafx.reflect.FunctionTypeRef
In method javafx.reflect.FunctionTypeRef.equals(FunctionTypeRef)
At FunctionTypeRef.java:[lines 54-61]
javafx.reflect.FunctionTypeRef defines equals and uses Object.hashCode()
In class javafx.reflect.FunctionTypeRef
In method javafx.reflect.FunctionTypeRef.equals(FunctionTypeRef)
Field javafx.reflect.FunctionTypeRef.argTypes
At FunctionTypeRef.java:[line 58]
Another occurrence at FunctionTypeRef.java:[line 58]
Read of unwritten field argTypes in javafx.reflect.FunctionTypeRef.equals(FunctionTypeRef)
In class javafx.reflect.FunctionTypeRef
In method javafx.reflect.FunctionTypeRef.equals(FunctionTypeRef)
Field javafx.reflect.FunctionTypeRef.returnType
At FunctionTypeRef.java:[line 54]
Read of unwritten field returnType in javafx.reflect.FunctionTypeRef.equals(FunctionTypeRef)
In class javafx.reflect.FunctionTypeRef
In method javafx.reflect.FunctionTypeRef.getArgumentType(int)
Field javafx.reflect.FunctionTypeRef.argTypes
At FunctionTypeRef.java:[line 49]
Read of unwritten field argTypes in javafx.reflect.FunctionTypeRef.getArgumentType(int)
In class javafx.reflect.FunctionTypeRef
Field javafx.reflect.FunctionTypeRef.argTypes
At FunctionTypeRef.java:[line 49]
Unwritten field: javafx.reflect.FunctionTypeRef.argTypes
In class javafx.reflect.FunctionTypeRef
Field javafx.reflect.FunctionTypeRef.returnType
At FunctionTypeRef.java:[line 51]
Unwritten field: javafx.reflect.FunctionTypeRef.returnType