Bug #4043
Eclipse static code analysis potential issues
0%
History
#1 Updated by Greg Shah about 5 years ago
From Igor:
Eclipse warns about some potential issues:
finally block does not complete normally FontTable.java /p2j/src/com/goldencode/p2j/ui line 909 Null pointer access: The variable nr can only be null at this location WebMouseDirectManipulation.java /p2j/src/com/goldencode/p2j/ui/client/gui/driver/web line 264 Resource leak: 'br' is not closed at this location Code2Name.java /p2j/locale line 384 Resource leak: 'br' is not closed at this location Name2Code.java /p2j/locale line 397 Resource leak: 'ge' is never closed CallGraphWorker.java /p2j/src/com/goldencode/p2j/uast Resource leak: 'ge' is never closed CallGraphWorker.java /p2j/src/com/goldencode/p2j/uast Resource leak: 'gen' is not closed at this location ReportProtocol.java /p2j/src/com/goldencode/p2j/report/server Resource leak: 'lowSocket' is not closed at this location SessionManager.java /p2j/src/com/goldencode/p2j/net Resource leak: 'paths' is never closed FileDialogGuiImpl.java /p2j/src/com/goldencode/p2j/ui/client/gui/filechooser Resource leak: 'paths' is never closed FileDialogGuiImpl.java /p2j/src/com/goldencode/p2j/ui/client/gui/filechooser Resource leak: 'paths' is never closed NormalizePath.java /p2j/src/com/goldencode/util line 152 Resource leak: 'paths' is never closed NormalizePath.java /p2j/src/com/goldencode/util line 176 Resource leak: 'raf' is never closed FileStream.java /p2j/src/com/goldencode/p2j/util line 184 Resource leak: 'rs' is never closed AppServerHelper.java /p2j/src/com/goldencode/p2j/util line 1745 Resource leak: 'rs' is not closed at this location ReportWorker.java /p2j/src/com/goldencode/p2j/report line 1369 The type parameter T is hiding the type T BaseEntity.java /p2j/src/com/goldencode/p2j/ui line 984 The type parameter T is hiding the type T CallGraphHelper.java /p2j/src/com/goldencode/p2j/uast line 623 Unlikely argument type int for contains(Object) on a Collection<Short> ClassicTheme.java /p2j/src/com/goldencode/p2j/ui/client/gui/theme line 6610 Unlikely argument type int for contains(Object) on a Collection<Short> ClassicTheme.java /p2j/src/com/goldencode/p2j/ui/client/gui/theme line 6610 Unlikely argument type ParameterKey[] for containsKey(Object) on a Map<SignatureKey,ClassDefinition.MemberData> ClassDefinition.java /p2j/src/com/goldencode/p2j/uast line 347 Unlikely argument type ParameterKey[] for get(Object) on a Map<SignatureKey,ClassDefinition.MemberData> ClassDefinition.java /p2j/src/com/goldencode/p2j/uast line 350 Unlikely argument type TitledWindow<capture#158-of ?> for remove(Object) on a Map<GuiWindow,Set<TopLevelWindow>> WindowManager.java /p2j/src/com/goldencode/p2j/ui/client line 1161I understand that at least first one and last 5 look like real problems.
#2 Updated by Greg Shah about 5 years ago
Igor: Open a branch 4043a for fixes related to these issues. You will need to review each case and prepare changes that you deem appropriate. If there are any questions, post them here and the watchers will respond.
#3 Updated by Constantin Asofiei about 5 years ago
Unlikely argument type ParameterKey[] for containsKey(Object) on a Map<SignatureKey,ClassDefinition.MemberData> ClassDefinition.java /p2j/src/com/goldencode/p2j/uast line 347 Unlikely argument type ParameterKey[] for get(Object) on a Map<SignatureKey,ClassDefinition.MemberData> ClassDefinition.java /p2j/src/com/goldencode/p2j/uast line 350
These ones are solved in my pending changes (future 3751a).
#4 Updated by Igor Skornyakov about 5 years ago
created task branch 4043a from rev. 11303
#5 Updated by Igor Skornyakov about 5 years ago
In the FontTable.getCustomFontData
there is a return statement in the finally block. This means that we silently ignore all thrown exceptions (except IOException
which is caught explicitly).
Was it done intentionally?
Thank you.
#6 Updated by Igor Skornyakov about 5 years ago
Fixed all issues except ones mentioned by Constantin in note #3.
Committed to branch 4043a rev.11304
Ready for the code review