Please suggest me if we can use findbug tool without jar开发者_运维问答 files as input or not!!. I am working on Android phone in which framework has been customised, so i cannot use Eclipse to build my code (I cannot use findbug plugin to compile). So i am using findbug GUI. But when we create new project, it expects jar files, java source code, Class archives. But Android does not support jar files, we usually create apk. So i am not able to provide input to findbugs. Please can anyone suggest me how to use findbugs when you have only java source code with you. Thanks in advance.
Findbugs requires bytecode to be passed for the analysis. For the fact of the matter it can only run the analysis either on .class or .jar files. The Eclipse plugin of Findbugs is intelligent enough to find the class files of the inputted source files do the analysis and then again find the souce files of those class files (if any) in the IDE and mark them as a result. So its deceiving unless you go into their developmental details. It won't work for your Android APK's if you dont have bytecode available for it.
Vaishali Kulkarni
-Weblayers Inc.
At it's basic level, FindBugs works with Java bytecode. Whether this is contained within a JAR, or as .class files in a directory structure, it doesn't really matter. However, since Android (as far as I'm aware) does not execute Java bytecode, instead it executes "Java source code compiled to Dalvik executable bytecode"[1], there will be nothing for FindBugs to analyse.
So while it is possible to use FindBugs without Jar files, it does require Java .class files, so I don't think it will work with Android APK's. However, if it's possible to compile your source with Java, there would be .class files to analyse.
[1] This is probably technically inaccurate, hopefully you get what I mean.
精彩评论