HabchiSarra / SmellDetector

GNU Affero General Public License v3.0
3 stars 1 forks source link

[tazapp] Duplicate java class found by JDT #14

Closed aveuiller closed 5 years ago

aveuiller commented 5 years ago

While trying to analyze a commit of the project woffs/tazapp-android, we have an issue with a duplicate java class:

spoon.compiler.ModelBuildingException: The type BuildTypeProvider is already defined
    at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.reportProblem(JDTBasedSpoonCompiler.java:612)
    at spoon.support.compiler.jdt.TreeBuilderRequestor.acceptResult(TreeBuilderRequestor.java:37)
    at spoon.support.compiler.jdt.TreeBuilderCompiler.buildUnits(TreeBuilderCompiler.java:99)
    at spoon.support.compiler.jdt.JDTBatchCompiler.getUnits(JDTBatchCompiler.java:266)
    at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.buildUnits(JDTBasedSpoonCompiler.java:444)
    at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.buildUnitsAndModel(JDTBasedSpoonCompiler.java:388)
    at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.buildSources(JDTBasedSpoonCompiler.java:340)
    at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:129)
    at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:113)
    at spoon.Launcher.buildModel(Launcher.java:769)
    at fr.inria.sniffer.detector.analyzer.MainProcessor.process(MainProcessor.java:59)
    at fr.inria.sniffer.detector.analyzer.Main.runAnalysis(Main.java:104)
    at fr.inria.sniffer.detector.analyzer.Main.main(Main.java:70)

This comes from the fact that BuildTypeProvider is defined in both the flavours release and debug.

To solve this, we intend to add a directory exclusion by pattern.

Relates to https://github.com/HabchiSarra/Sniffer/issues/5