스푼을 사용하여 Hadoop과 같은 큰 프로젝트의 소스 코드를 분석 할 때 클래스 이름이 같고 패키지 디렉토리가 다른 Java 클래스가 존재할 수 있으므로 "xxx 유형이 이미 정의되었습니다."라는 문제가 자주 발생합니다 하위 프로젝트.큰 프로젝트의 소스 코드에 대한 스푼의 소스 코드 분석에서 "유형 xxx는 이미 정의되어 있습니다"를 어떻게 처리합니까?
"java -cp xx spoon.Launcher -i ~/hadoop-0.23.3-src/-p myspoon.CatchProcessor"를 실행할 때 다음 오류가 발생합니다.
Exception in thread "main" spoon.compiler.ModelBuildingException: The type JobInProgress is already defined
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.reportProblem(JDTBasedSpoonCompiler.java:550)
at spoon.support.compiler.jdt.TreeBuilderRequestor.acceptResult(TreeBuilderRequestor.java:37)
at spoon.support.compiler.jdt.TreeBuilderCompiler.buildUnits(TreeBuilderCompiler.java:73)
at spoon.support.compiler.jdt.JDTBatchCompiler.getUnits(JDTBatchCompiler.java:120)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.buildUnits(JDTBasedSpoonCompiler.java:410)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.buildUnitsAndModel(JDTBasedSpoonCompiler.java:372)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.buildSources(JDTBasedSpoonCompiler.java:348)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:119)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:102)
at spoon.Launcher.buildModel(Launcher.java:700)
at spoon.Launcher.run(Launcher.java:651)
at spoon.Launcher.run(Launcher.java:106)
at spoon.Launcher.main(Launcher.java:99)
그리고 두 JobInProgress.java이 같은 하위 프로젝트 "하둡 - 맵리 듀스 프로젝트"이 문제를 해결하는 방법 그래서
./hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobInProgress.java
./hadoop-mapreduce-project/src/java/org/apache/hadoop/mapred/JobInProgress.java
에있다 찾을 ????? 은 이미 "누락 된 파일"문제에 대한
Exception in thread "main" spoon.compiler.ModelBuildingException: The import org.apache.hadoop.conf cannot be resolved at xxx
모든 의견의 또 다른 문제가 발생할 수 있기 때문에 우리가, 숟가락 분석을 실행하려면 둘 중 하나를 멀리 이동할 수없는 것 같습니다 것을 발견? 감사.
감사합니다. 이것은 좋은 제안입니다. 나는 시도 할 것이다. –