Update
This commit is contained in:
+1
-1
@@ -15,7 +15,7 @@ GumTreeInput1/
|
||||
GumTreeOutput1/
|
||||
GumTreeResults/
|
||||
|
||||
*/Test.java
|
||||
*TestParser.java
|
||||
src/main/java/edu/lu/uni/serval/FixPatternParser/TestParser.java
|
||||
# Package Files #
|
||||
*.jar
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
-4162
File diff suppressed because it is too large
Load Diff
-345
@@ -1,345 +0,0 @@
|
||||
cdi-spec-cdi-tck_1f4449_5c4cecimpl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInitializerMethod/UnderwaterCity.java
|
||||
ovgu-ccd-jchess_539e0c_51d212tests/game/BoardTest.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/interceptorOrder/AnotherInterceptor.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/interceptorOrder/AnotherInterceptor.java
|
||||
ovgu-ccd-jchess_8f6345_02437btests/eventbus/events/PossibleMovesEventTest.java
|
||||
ovgu-ccd-jchess_8f6345_ce05eajchess/tests/eventbus/events/GenericErrorEventTest.java
|
||||
ovgu-ccd-jchess_c6c052_93b24dtests/game/BoardTest.java
|
||||
GenomicParisCentre-aozan_b0fb79_28f573src/main/java/fr/ens/transcriptome/aozan/tests/sample/RecoverablePFClusterSampleTest.java
|
||||
cdi-spec-cdi-tck_c1c53f_bbae6aimpl/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ProcessInjectionTargetObserver.java
|
||||
cdi-spec-cdi-tck_c1c53f_bbae6aimpl/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ProcessInjectionTargetObserver.java
|
||||
cdi-spec-cdi-tck_c1c53f_bbae6aimpl/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ProcessInjectionTargetObserver.java
|
||||
cdi-spec-cdi-tck_c1c53f_bbae6aimpl/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ProcessInjectionTargetObserver.java
|
||||
cdi-spec-cdi-tck_c1c53f_bbae6aimpl/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ProcessInjectionTargetObserver.java
|
||||
cdi-spec-cdi-tck_c1c53f_bbae6aimpl/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ProcessInjectionTargetObserver.java
|
||||
cdi-spec-cdi-tck_c1c53f_bbae6aimpl/src/main/java/org/jboss/cdi/tck/tests/extensions/container/event/ProcessInjectionTargetObserver.java
|
||||
cdi-spec-cdi-tck_2528be_45bd28impl/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/EJBRequestContextTest.java
|
||||
cdi-spec-cdi-tck_052fe3_9c3913impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
|
||||
cdi-spec-cdi-tck_052fe3_9c3913impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
|
||||
ovgu-ccd-jchess_0c6f77_64be90tests/game/PawnMovementTest.java
|
||||
ovgu-ccd-jchess_0c6f77_64be90tests/game/PawnMovementTest.java
|
||||
ovgu-ccd-jchess_46320b_44b78dtests/eventbus/events/UpdateBoardEventTest.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/interceptorOrder/FirstInterceptor.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/interceptorOrder/FirstInterceptor.java
|
||||
cdi-spec-cdi-tck_45bd28_7f9880impl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance/resolution/enterprise/ComplicatedInterceptor.java
|
||||
cdi-spec-cdi-tck_45bd28_7f9880impl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance/resolution/enterprise/ComplicatedInterceptor.java
|
||||
cdi-spec-cdi-tck_45bd28_7f9880impl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance/resolution/enterprise/ComplicatedInterceptor.java
|
||||
cdi-spec-cdi-tck_45bd28_7f9880impl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance/resolution/enterprise/ComplicatedInterceptor.java
|
||||
cdi-spec-cdi-tck_5c4cec_cdcf11impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/CircularDependencyTest.java
|
||||
cdi-spec-cdi-tck_a90bd5_272854impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/EnterpriseProducerMethodDefinitionTest.java
|
||||
cdi-spec-cdi-tck_a90bd5_272854impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/EnterpriseProducerMethodDefinitionTest.java
|
||||
cdi-spec-cdi-tck_a90bd5_272854impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/EnterpriseProducerMethodDefinitionTest.java
|
||||
cdi-spec-cdi-tck_a90bd5_272854impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/enterprise/EnterpriseProducerMethodDefinitionTest.java
|
||||
cdi-spec-cdi-tck_c2b3a5_522ff8impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedType.java
|
||||
cdi-spec-cdi-tck_9f605d_a90ee7impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/ejb/FMSModelIII.java
|
||||
cdi-spec-cdi-tck_9f605d_a90ee7impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/ejb/FMSModelIII.java
|
||||
cdi-spec-cdi-tck_115981_73b2e4impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
|
||||
cdi-spec-cdi-tck_1f4449_5c4cecimpl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/UnderwaterCity.java
|
||||
cdi-spec-cdi-tck_5c4cec_cdcf11impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Food.java
|
||||
cdi-spec-cdi-tck_5c4cec_cdcf11impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Food.java
|
||||
GenomicParisCentre-aozan_35c16c_4e8300src/main/java/fr/ens/transcriptome/aozan/tests/sample/RecoverablePFClusterSampleTest.java
|
||||
ovgu-ccd-jchess_d83098_e4c034tests/eventbus/events/NewGameEventTest.java
|
||||
cdi-spec-cdi-tck_323676_679913impl/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/InfoServlet.java
|
||||
cdi-spec-cdi-tck_d280f9_45ab65impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/ejb/FMSModelIII.java
|
||||
cdi-spec-cdi-tck_d280f9_45ab65impl/src/main/java/org/jboss/jsr299/tck/tests/context/request/ejb/FMSModelIII.java
|
||||
cdi-spec-cdi-tck_323676_679913impl/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/TimeoutService.java
|
||||
cdi-spec-cdi-tck_323676_679913impl/src/main/java/org/jboss/cdi/tck/tests/context/request/event/timeout/TimeoutService.java
|
||||
cdi-spec-cdi-tck_7ac130_1ab762impl/src/main/java/org/jboss/cdi/tck/tests/alternative/AlternativeAvailabilityTest.java
|
||||
cdi-spec-cdi-tck_7ac130_1ab762impl/src/main/java/org/jboss/cdi/tck/tests/alternative/AlternativeAvailabilityTest.java
|
||||
cdi-spec-cdi-tck_7ac130_1ab762impl/src/main/java/org/jboss/cdi/tck/tests/alternative/AlternativeAvailabilityTest.java
|
||||
cdi-spec-cdi-tck_7ac130_1ab762impl/src/main/java/org/jboss/cdi/tck/tests/alternative/AlternativeAvailabilityTest.java
|
||||
cdi-spec-cdi-tck_7ac130_1ab762impl/src/main/java/org/jboss/cdi/tck/tests/alternative/AlternativeAvailabilityTest.java
|
||||
cdi-spec-cdi-tck_7ac130_1ab762impl/src/main/java/org/jboss/cdi/tck/tests/alternative/AlternativeAvailabilityTest.java
|
||||
datasift-datasift-java_0c7070_e7cfd7src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_0c7070_e7cfd7src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_0c7070_e7cfd7src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_0c7070_e7cfd7src/org/datasift/tests/DataForTests.java
|
||||
cdi-spec-cdi-tck_663aa2_3089a2impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SelectEventTest.java
|
||||
cdi-spec-cdi-tck_663aa2_3089a2impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SelectEventTest.java
|
||||
cdi-spec-cdi-tck_663aa2_3089a2impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SelectEventTest.java
|
||||
cdi-spec-cdi-tck_663aa2_3089a2impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SelectEventTest.java
|
||||
cdi-spec-cdi-tck_663aa2_3089a2impl/src/main/java/org/jboss/jsr299/tck/tests/event/select/SelectEventTest.java
|
||||
ovgu-ccd-jchess_e0c952_e4c034tests/game/BoardTest.java
|
||||
cdi-spec-cdi-tck_663aa2_3089a2impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/DynamicLookupTest.java
|
||||
ovgu-ccd-jchess_0c6f77_6046dctests/game/BoardTest.java
|
||||
cdi-spec-cdi-tck_83a7e7_07365fimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
|
||||
cdi-spec-cdi-tck_83a7e7_07365fimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
|
||||
cdi-spec-cdi-tck_83a7e7_07365fimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
|
||||
cdi-spec-cdi-tck_83a7e7_07365fimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
|
||||
cdi-spec-cdi-tck_83a7e7_07365fimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
|
||||
cdi-spec-cdi-tck_83a7e7_07365fimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
|
||||
cdi-spec-cdi-tck_83a7e7_07365fimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
|
||||
cdi-spec-cdi-tck_83a7e7_07365fimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
|
||||
cdi-spec-cdi-tck_83a7e7_07365fimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
|
||||
cdi-spec-cdi-tck_83a7e7_07365fimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
|
||||
ovgu-ccd-jchess_46320b_44b78dtests/eventbus/events/PromotionSelectEventTest.java
|
||||
cdi-spec-cdi-tck_5c4cec_cdcf11impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Pig.java
|
||||
cdi-spec-cdi-tck_5c4cec_cdcf11impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Pig.java
|
||||
ovgu-ccd-jchess_ce05ea_a4b44ejchess/tests/BoardTest.java
|
||||
ovgu-ccd-jchess_ce05ea_a4b44ejchess/tests/BoardTest.java
|
||||
ovgu-ccd-jchess_8f6345_02437btests/eventbus/events/PossiblePromotionsEventTest.java
|
||||
ovgu-ccd-jchess_64be90_542035tests/eventbus/events/GenericErrorEventTest.java
|
||||
ovgu-ccd-jchess_46320b_25b619jchess/tests/eventbus/events/GenericErrorEventTest.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/interceptorOrder/InterceptorOrderTest.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/interceptorOrder/InterceptorOrderTest.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/interceptorOrder/InterceptorOrderTest.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/interceptorOrder/InterceptorOrderTest.java
|
||||
datasift-datasift-java_125c6e_63473esrc/org/datasift/tests/DataForTests.java
|
||||
cdi-spec-cdi-tck_83a7e7_07365fimpl/src/main/java/org/jboss/cdi/tck/tests/definition/qualifier/TameLiteral.java
|
||||
ovgu-ccd-jchess_8f6345_02437btests/eventbus/events/UpdateStatusMessageEventTest.java
|
||||
ovgu-ccd-jchess_8f6345_02437btests/eventbus/events/GenericErrorEventTest.java
|
||||
cdi-spec-cdi-tck_1f4449_5c4cecimpl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInjectedField/UnderwaterCity.java
|
||||
cdi-spec-cdi-tck_064f60_09d838impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java
|
||||
datasift-datasift-java_ec80f0_28c956src/org/datasift/tests/DataForTests.java
|
||||
cdi-spec-cdi-tck_1f4449_5c4cecimpl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/CityDecorator.java
|
||||
cdi-spec-cdi-tck_7173e9_bb0d87impl/src/main/java/org/jboss/cdi/tck/tests/context/dependent/DependentContextTest.java
|
||||
cdi-spec-cdi-tck_3e9879_490ee4impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
|
||||
cdi-spec-cdi-tck_3e9879_490ee4impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
|
||||
cdi-spec-cdi-tck_3e9879_490ee4impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
|
||||
nuxeo-nuxeo-chemistry_6f4b50_79fb13nuxeo-opencmis-tests/src/main/java/org/nuxeo/ecm/core/opencmis/tests/Helper.java
|
||||
nuxeo-nuxeo-chemistry_6f4b50_79fb13nuxeo-opencmis-tests/src/main/java/org/nuxeo/ecm/core/opencmis/tests/Helper.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/interceptorOrder/SecondInterceptor.java
|
||||
ovgu-ccd-jchess_d83098_e4c034tests/eventbus/events/GenericErrorEventTest.java
|
||||
ovgu-ccd-jchess_d83098_e4c034tests/eventbus/events/GenericErrorEventTest.java
|
||||
ovgu-ccd-jchess_44b78d_02437btests/game/BoardTest.java
|
||||
ovgu-ccd-jchess_44b78d_02437btests/game/BoardTest.java
|
||||
cdi-spec-cdi-tck_c2b3a5_522ff8impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/observer/ObserverImpl.java
|
||||
ovgu-ccd-jchess_aa116b_ff9991tests/game/BoardTest.java
|
||||
mkovatsc-Californium_86d96e_367d3acf-plugtest-server/src/main/java/ch/ethz/inf/vs/californium/plugtests/resources/ObservePumping.java
|
||||
cdi-spec-cdi-tck_35cff0_b8e4edimpl/src/main/java/org/jboss/cdi/tck/tests/extensions/communication/broken/FooExtension.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/interceptorOrder/TransactionalInterceptor.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/interceptorOrder/TransactionalInterceptor.java
|
||||
cdi-spec-cdi-tck_2528be_45bd28impl/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FMSModelIII.java
|
||||
cdi-spec-cdi-tck_2528be_45bd28impl/src/main/java/org/jboss/cdi/tck/tests/context/request/ejb/FMSModelIII.java
|
||||
ovgu-ccd-jchess_46320b_44b78dtests/eventbus/events/GenericErrorEventTest.java
|
||||
cdi-spec-cdi-tck_41a384_1bc22aimpl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/FileLogger.java
|
||||
ovgu-ccd-jchess_aa116b_ff9991tests/eventbus/events/GenericErrorEventTest.java
|
||||
cdi-spec-cdi-tck_31bc89_e2c0afimpl/src/main/java/org/jboss/jsr299/tck/tests/context/request/ejb/FMSModelIII.java
|
||||
cdi-spec-cdi-tck_31bc89_e2c0afimpl/src/main/java/org/jboss/jsr299/tck/tests/context/request/ejb/FMSModelIII.java
|
||||
cdi-spec-cdi-tck_31bc89_e2c0afimpl/src/main/java/org/jboss/jsr299/tck/tests/context/request/ejb/FMSModelIII.java
|
||||
cdi-spec-cdi-tck_31bc89_e2c0afimpl/src/main/java/org/jboss/jsr299/tck/tests/context/request/ejb/FMSModelIII.java
|
||||
cdi-spec-cdi-tck_31bc89_e2c0afimpl/src/main/java/org/jboss/jsr299/tck/tests/context/request/ejb/FMSModelIII.java
|
||||
cdi-spec-cdi-tck_d280f9_45ab65impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
|
||||
cdi-spec-cdi-tck_d280f9_45ab65impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
|
||||
ovgu-ccd-jchess_d83098_e4c034tests/eventbus/events/UpdateBoardEventTest.java
|
||||
ovgu-ccd-jchess_8f6345_02437btests/game/BoardTest.java
|
||||
cdi-spec-cdi-tck_d64861_d084d9impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/FooImpl.java
|
||||
ovgu-ccd-jchess_46320b_44b78dtests/eventbus/events/UpdateStatusMessageEventTest.java
|
||||
cdi-spec-cdi-tck_a08b80_fe2cf9impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/enterpriseBeanWithNonPassivatingInitializerInDecorator/BrokenDecorator.java
|
||||
ovgu-ccd-jchess_46320b_8f6345jchess/tests/BoardTest.java
|
||||
ovgu-ccd-jchess_46320b_8f6345jchess/tests/BoardTest.java
|
||||
cdi-spec-cdi-tck_41a384_1bc22aimpl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
|
||||
cdi-spec-cdi-tck_41a384_1bc22aimpl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java
|
||||
cdi-spec-cdi-tck_41a384_1bc22aimpl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/aroundInvoke/order/OverridenInterceptor.java
|
||||
ovgu-ccd-jchess_a4b44e_ff9991tests/eventbus/events/GenericErrorEventTest.java
|
||||
ovgu-ccd-jchess_a4b44e_ff9991tests/eventbus/events/SelectEventTest.java
|
||||
ovgu-ccd-jchess_e1f7fd_117abajchess/tests/BoardTest.java
|
||||
ovgu-ccd-jchess_e1f7fd_117abajchess/tests/BoardTest.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/RadarInterceptor.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/RadarInterceptor.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/RadarInterceptor.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/RadarInterceptor.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/RadarInterceptor.java
|
||||
cdi-spec-cdi-tck_41a384_1bc22aimpl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/producer/method/ProducerImpl.java
|
||||
ovgu-ccd-jchess_accad2_956deejchess/tests/game/MoveTest.java
|
||||
cdi-spec-cdi-tck_07365f_6e252cimpl/src/main/java/org/jboss/cdi/tck/tests/event/observer/RoleLiteral.java
|
||||
openmicroscopy-bioformats_3f0b2b_a3a809components/test-suite/src/loci/tests/testng/TestTools.java
|
||||
cdi-spec-cdi-tck_a08b80_fe2cf9impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/enterpriseBeanWithNonPassivatingConstructorFieldInDecorator/BrokenDecorator.java
|
||||
cdi-spec-cdi-tck_a08b80_fe2cf9impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/enterpriseBeanWithNonPassivatingInjectedFieldInDecorator/BrokenDecorator.java
|
||||
cdi-spec-cdi-tck_a08b80_fe2cf9impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/enterpriseBeanWithNonPassivatingInjectedFieldInDecorator/BrokenDecorator.java
|
||||
cdi-spec-cdi-tck_f27903_fe6e92impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
|
||||
cdi-spec-cdi-tck_f27903_fe6e92impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
|
||||
cdi-spec-cdi-tck_f27903_fe6e92impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
|
||||
cdi-spec-cdi-tck_45ab65_a90ee7impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
|
||||
cdi-spec-cdi-tck_45ab65_a90ee7impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
|
||||
ovgu-ccd-jchess_aa116b_d40cdetests/game/PawnMovementTest.java
|
||||
ovgu-ccd-jchess_aa116b_d40cdetests/game/PawnMovementTest.java
|
||||
GenomicParisCentre-aozan_b0fb79_28f573src/main/java/fr/ens/transcriptome/aozan/tests/lane/RawClustersPhixLaneTest.java
|
||||
GenomicParisCentre-aozan_b0fb79_28f573src/main/java/fr/ens/transcriptome/aozan/tests/lane/RawClustersPhixLaneTest.java
|
||||
ovgu-ccd-jchess_d83098_e4c034tests/eventbus/events/UpdateStatusMessageEventTest.java
|
||||
ovgu-ccd-jchess_e0c952_9b9751tests/eventbus/events/GenericErrorEventTest.java
|
||||
cdi-spec-cdi-tck_52ac2f_249966impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/BeanByTypeTest.java
|
||||
cdi-spec-cdi-tck_534265_0cb10eimpl/src/main/java/org/jboss/jsr299/tck/tests/policy/PolicyAvailabilityTest.java
|
||||
cdi-spec-cdi-tck_534265_0cb10eimpl/src/main/java/org/jboss/jsr299/tck/tests/policy/PolicyAvailabilityTest.java
|
||||
cdi-spec-cdi-tck_6e252c_257eedimpl/src/main/java/org/jboss/cdi/tck/tests/deployment/lifecycle/ExtensionsTest.java
|
||||
cdi-spec-cdi-tck_c2b3a5_522ff8impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerProcessor.java
|
||||
cdi-spec-cdi-tck_45bd28_7f9880impl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance/resolution/enterprise/EnterpriseInterceptorBindingResolutionTest.java
|
||||
cdi-spec-cdi-tck_45bd28_7f9880impl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance/resolution/enterprise/EnterpriseInterceptorBindingResolutionTest.java
|
||||
cdi-spec-cdi-tck_45bd28_7f9880impl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance/resolution/enterprise/EnterpriseInterceptorBindingResolutionTest.java
|
||||
cdi-spec-cdi-tck_45bd28_7f9880impl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance/resolution/enterprise/EnterpriseInterceptorBindingResolutionTest.java
|
||||
datasift-datasift-java_2358e1_87b245src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_2358e1_87b245src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_2358e1_87b245src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_2358e1_87b245src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_2358e1_87b245src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_2358e1_87b245src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_2358e1_87b245src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_2358e1_87b245src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_2358e1_87b245src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_2358e1_87b245src/org/datasift/tests/DataForTests.java
|
||||
ovgu-ccd-jchess_c60cdc_0af1d6jchess/tests/BoardTest.java
|
||||
ovgu-ccd-jchess_a4b44e_ff9991tests/eventbus/events/PossiblePromotionsEventTest.java
|
||||
ovgu-ccd-jchess_d10543_4a4240tests/game/BoardTest.java
|
||||
cdi-spec-cdi-tck_663aa2_3089a2impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java
|
||||
cdi-spec-cdi-tck_663aa2_3089a2impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java
|
||||
cdi-spec-cdi-tck_663aa2_3089a2impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java
|
||||
cdi-spec-cdi-tck_663aa2_3089a2impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java
|
||||
cdi-spec-cdi-tck_663aa2_3089a2impl/src/main/java/org/jboss/jsr299/tck/tests/event/fires/FireEventTest.java
|
||||
cdi-spec-cdi-tck_679913_bbc371impl/src/main/java/org/jboss/cdi/tck/tests/context/request/event/jms/AbstractMessageListener.java
|
||||
cdi-spec-cdi-tck_77ce8b_c7c418impl/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ProcessBeanObserver.java
|
||||
cdi-spec-cdi-tck_77ce8b_c7c418impl/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ProcessBeanObserver.java
|
||||
cdi-spec-cdi-tck_77ce8b_c7c418impl/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ProcessBeanObserver.java
|
||||
cdi-spec-cdi-tck_77ce8b_c7c418impl/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ProcessBeanObserver.java
|
||||
cdi-spec-cdi-tck_77ce8b_c7c418impl/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ProcessBeanObserver.java
|
||||
cdi-spec-cdi-tck_77ce8b_c7c418impl/src/main/java/org/jboss/cdi/tck/tests/extensions/processBean/ProcessBeanObserver.java
|
||||
ovgu-ccd-jchess_6046dc_542035tests/game/PawnMovementTest.java
|
||||
ovgu-ccd-jchess_6046dc_542035tests/game/PawnMovementTest.java
|
||||
cdi-spec-cdi-tck_ae1af4_96cf0fimpl/src/main/java/org/jboss/jsr299/tck/tests/extensions/processBean/ProcessBeanObserver.java
|
||||
GenomicParisCentre-aozan_35c16c_4e8300src/main/java/fr/ens/transcriptome/aozan/tests/lane/RawClustersPhixLaneTest.java
|
||||
GenomicParisCentre-aozan_35c16c_4e8300src/main/java/fr/ens/transcriptome/aozan/tests/lane/RawClustersPhixLaneTest.java
|
||||
ovgu-ccd-jchess_46320b_44b78dtests/eventbus/events/NewGameEventTest.java
|
||||
ovgu-ccd-jchess_0c6f77_6046dctests/eventbus/events/GenericErrorEventTest.java
|
||||
cdi-spec-cdi-tck_07365f_6e252cimpl/src/main/java/org/jboss/cdi/tck/tests/event/RoleLiteral.java
|
||||
cdi-spec-cdi-tck_41a384_1bc22aimpl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
|
||||
ovgu-ccd-jchess_d83098_e4c034tests/eventbus/events/PossiblePromotionsEventTest.java
|
||||
cdi-spec-cdi-tck_45ab65_a90ee7impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
|
||||
cdi-spec-cdi-tck_45ab65_a90ee7impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
|
||||
ovgu-ccd-jchess_3992d4_f5a653jchess/tests/BoardTest.java
|
||||
ovgu-ccd-jchess_3992d4_f5a653jchess/tests/BoardTest.java
|
||||
datasift-datasift-java_48e2b8_be06e5src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_48e2b8_be06e5src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_48e2b8_be06e5src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_48e2b8_be06e5src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_48e2b8_be06e5src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_48e2b8_be06e5src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_48e2b8_be06e5src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_48e2b8_be06e5src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_48e2b8_be06e5src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_48e2b8_be06e5src/org/datasift/tests/DataForTests.java
|
||||
cdi-spec-cdi-tck_b6f67b_792776impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/IntegerBean.java
|
||||
cdi-spec-cdi-tck_b6f67b_792776impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/IntegerBean.java
|
||||
cdi-spec-cdi-tck_45bd28_7f9880impl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance/resolution/ComplicatedInterceptor.java
|
||||
cdi-spec-cdi-tck_45bd28_7f9880impl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance/resolution/ComplicatedInterceptor.java
|
||||
cdi-spec-cdi-tck_45bd28_7f9880impl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance/resolution/ComplicatedInterceptor.java
|
||||
cdi-spec-cdi-tck_45bd28_7f9880impl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance/resolution/ComplicatedInterceptor.java
|
||||
ovgu-ccd-jchess_8f6345_02437btests/eventbus/events/UpdateBoardEventTest.java
|
||||
ovgu-ccd-jchess_a4b44e_ff9991tests/eventbus/events/PossibleMovesEventTest.java
|
||||
cdi-spec-cdi-tck_8b2c24_835b48impl/src/main/java/org/jboss/cdi/tck/tests/extensions/annotated/synthetic/AppleExtension.java
|
||||
cdi-spec-cdi-tck_8b2c24_835b48impl/src/main/java/org/jboss/cdi/tck/tests/extensions/annotated/synthetic/AppleExtension.java
|
||||
cdi-spec-cdi-tck_a196cf_e5c163impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/IntegerBean.java
|
||||
cdi-spec-cdi-tck_a196cf_e5c163impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/custom/IntegerBean.java
|
||||
mkovatsc-Californium_86d96e_367d3acf-plugtest-server/src/main/java/ch/ethz/inf/vs/californium/plugtests/resources/LongPath.java
|
||||
ovgu-ccd-jchess_8f6345_02437btests/eventbus/events/NewGameEventTest.java
|
||||
cdi-spec-cdi-tck_45bd28_7f9880impl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance/resolution/InterceptorBindingResolutionTest.java
|
||||
cdi-spec-cdi-tck_45bd28_7f9880impl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance/resolution/InterceptorBindingResolutionTest.java
|
||||
cdi-spec-cdi-tck_45bd28_7f9880impl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance/resolution/InterceptorBindingResolutionTest.java
|
||||
cdi-spec-cdi-tck_45bd28_7f9880impl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance/resolution/InterceptorBindingResolutionTest.java
|
||||
cdi-spec-cdi-tck_45bd28_7f9880impl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/inheritance/resolution/InterceptorBindingResolutionTest.java
|
||||
ovgu-ccd-jchess_d83098_e4c034tests/eventbus/events/PromotionSelectEventTest.java
|
||||
ovgu-ccd-jchess_d83098_e4c034tests/eventbus/events/PossibleMovesEventTest.java
|
||||
ovgu-ccd-jchess_46320b_44b78dtests/eventbus/events/SelectEventTest.java
|
||||
cdi-spec-cdi-tck_e2c0af_e3604cimpl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
|
||||
cdi-spec-cdi-tck_e2c0af_e3604cimpl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
|
||||
cdi-spec-cdi-tck_e2c0af_e3604cimpl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
|
||||
cdi-spec-cdi-tck_e2c0af_e3604cimpl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
|
||||
ovgu-ccd-jchess_a4b44e_ff9991tests/eventbus/events/UpdateStatusMessageEventTest.java
|
||||
cdi-spec-cdi-tck_3089a2_94f402impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/processBean/ProcessBeanObserver.java
|
||||
cdi-spec-cdi-tck_3089a2_94f402impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/processBean/ProcessBeanObserver.java
|
||||
cdi-spec-cdi-tck_3089a2_94f402impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/processBean/ProcessBeanObserver.java
|
||||
ovgu-ccd-jchess_a4b44e_ff9991tests/eventbus/events/UpdateBoardEventTest.java
|
||||
datasift-datasift-java_17b159_ba28e7src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_17b159_ba28e7src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_17b159_ba28e7src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_17b159_ba28e7src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_17b159_ba28e7src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_17b159_ba28e7src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_17b159_ba28e7src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_17b159_ba28e7src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_17b159_ba28e7src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_17b159_ba28e7src/org/datasift/tests/DataForTests.java
|
||||
ovgu-ccd-jchess_46320b_44b78dtests/eventbus/events/PossibleMovesEventTest.java
|
||||
ovgu-ccd-jchess_25b619_ce05eajchess/tests/BoardTest.java
|
||||
ovgu-ccd-jchess_25b619_ce05eajchess/tests/BoardTest.java
|
||||
ovgu-ccd-jchess_25b619_ce05eajchess/tests/BoardTest.java
|
||||
ovgu-ccd-jchess_a4b44e_ff9991tests/eventbus/events/NewGameEventTest.java
|
||||
cdi-spec-cdi-tck_08b25b_73b89cimpl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/IndirectStockWatcher.java
|
||||
ovgu-ccd-jchess_46320b_44b78dtests/game/BoardTest.java
|
||||
cdi-spec-cdi-tck_7dc28c_95ba30impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Petrol.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/SessionBeanInterceptorOrderTest.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/SessionBeanInterceptorOrderTest.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/SessionBeanInterceptorOrderTest.java
|
||||
ovgu-ccd-jchess_d83098_e4c034tests/eventbus/events/SelectEventTest.java
|
||||
ovgu-ccd-jchess_8f6345_02437btests/eventbus/events/PromotionSelectEventTest.java
|
||||
mkovatsc-Californium_86d96e_367d3acf-plugtest-server/src/main/java/ch/ethz/inf/vs/californium/plugtests/resources/ObserveNon.java
|
||||
cdi-spec-cdi-tck_80c2ea_33e585impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
|
||||
ovgu-ccd-jchess_f5a653_847ba8jchess/tests/BoardTest.java
|
||||
cdi-spec-cdi-tck_246cd0_9f605dimpl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
|
||||
cdi-spec-cdi-tck_246cd0_9f605dimpl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
|
||||
cdi-spec-cdi-tck_d64861_d084d9impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/FooDecorator1.java
|
||||
GenomicParisCentre-aozan_2b07f7_b27861src/main/java/fr/ens/transcriptome/aozan/tests/AozanTestRegistry.java
|
||||
ovgu-ccd-jchess_968848_2637a6tests/game/BoardTest.java
|
||||
cdi-spec-cdi-tck_41a384_1bc22aimpl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/CityDecorator.java
|
||||
cdi-spec-cdi-tck_246cd0_9f605dimpl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
|
||||
cdi-spec-cdi-tck_246cd0_9f605dimpl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/MissileInterceptor.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/MissileInterceptor.java
|
||||
cdi-spec-cdi-tck_835b48_912f2cimpl/src/main/java/org/jboss/cdi/tck/tests/interceptors/definition/enterprise/interceptorOrder/MissileInterceptor.java
|
||||
ovgu-ccd-jchess_a4b44e_ff9991tests/game/BoardTest.java
|
||||
cdi-spec-cdi-tck_7dc28c_95ba30impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/CircularDependencyTest.java
|
||||
cdi-spec-cdi-tck_7dc28c_95ba30impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/CircularDependencyTest.java
|
||||
ovgu-ccd-jchess_46320b_44b78dtests/eventbus/events/PossiblePromotionsEventTest.java
|
||||
cdi-spec-cdi-tck_65985f_61de9aimpl/src/main/java/org/jboss/cdi/tck/tests/event/fires/FireEventTest.java
|
||||
cdi-spec-cdi-tck_65985f_61de9aimpl/src/main/java/org/jboss/cdi/tck/tests/event/fires/FireEventTest.java
|
||||
ovgu-ccd-jchess_64be90_542035tests/game/BoardTest.java
|
||||
cdi-spec-cdi-tck_08b25b_73b89cimpl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/enterprise/LazyFarmer.java
|
||||
cdi-spec-cdi-tck_663aa2_3089a2impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
|
||||
cdi-spec-cdi-tck_663aa2_3089a2impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
|
||||
cdi-spec-cdi-tck_663aa2_3089a2impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
|
||||
cdi-spec-cdi-tck_663aa2_3089a2impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
|
||||
cdi-spec-cdi-tck_663aa2_3089a2impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
|
||||
cdi-spec-cdi-tck_4d97e6_7173e9impl/src/main/java/org/jboss/cdi/tck/tests/context/jms/LoggerService.java
|
||||
cdi-spec-cdi-tck_dab39b_94241eimpl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/finalProducerFieldNotPassivationCapable/RecordProducer.java
|
||||
datasift-datasift-java_6a725f_8efcc2src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_6a725f_8efcc2src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_6a725f_8efcc2src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_6a725f_8efcc2src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_6a725f_8efcc2src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_6a725f_8efcc2src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_6a725f_8efcc2src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_6a725f_8efcc2src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_6a725f_8efcc2src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_6a725f_8efcc2src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_6a725f_8efcc2src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_6a725f_8efcc2src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_6a725f_8efcc2src/org/datasift/tests/DataForTests.java
|
||||
ovgu-ccd-jchess_539e0c_51d212tests/eventbus/events/GenericErrorEventTest.java
|
||||
cdi-spec-cdi-tck_064f60_09d838impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalNonBean.java
|
||||
cdi-spec-cdi-tck_c2b3a5_522ff8impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
|
||||
datasift-datasift-java_cded15_ec80f0src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_cded15_ec80f0src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_cded15_ec80f0src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_cded15_ec80f0src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_cded15_ec80f0src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_cded15_ec80f0src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_cded15_ec80f0src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_cded15_ec80f0src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_cded15_ec80f0src/org/datasift/tests/DataForTests.java
|
||||
datasift-datasift-java_cded15_ec80f0src/org/datasift/tests/DataForTests.java
|
||||
cdi-spec-cdi-tck_663aa2_3089a2impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/BindingTypeABinding.java
|
||||
ovgu-ccd-jchess_e4c034_c00408tests/eventbus/events/GenericErrorEventTest.java
|
||||
ovgu-ccd-jchess_8f6345_02437btests/eventbus/events/SelectEventTest.java
|
||||
cdi-spec-cdi-tck_f42f7a_36b99fimpl/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
|
||||
cdi-spec-cdi-tck_f42f7a_36b99fimpl/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
|
||||
cdi-spec-cdi-tck_f42f7a_36b99fimpl/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
|
||||
cdi-spec-cdi-tck_f42f7a_36b99fimpl/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
|
||||
cdi-spec-cdi-tck_f42f7a_36b99fimpl/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
|
||||
cdi-spec-cdi-tck_f42f7a_36b99fimpl/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
|
||||
cdi-spec-cdi-tck_f42f7a_36b99fimpl/src/main/java/org/jboss/cdi/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
|
||||
ovgu-ccd-jchess_a4b44e_ff9991tests/eventbus/events/PromotionSelectEventTest.java
|
||||
datasift-datasift-java_27ae5e_cd68a4src/org/datasift/tests/DataForTests.java
|
||||
cdi-spec-cdi-tck_c2b3a5_522ff8impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/container/event/ProcessAnnotatedTypeObserver.java
|
||||
cdi-spec-cdi-tck_7dc28c_95ba30impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Car.java
|
||||
cdi-spec-cdi-tck_9f605d_a90ee7impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
|
||||
cdi-spec-cdi-tck_9f605d_a90ee7impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/ejb/FMSModelIII.java
|
||||
cdi-spec-cdi-tck_d64861_d084d9impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/invocation/FooDecorator2.java
|
||||
cdi-spec-cdi-tck_663aa2_3089a2impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/bean/bytype/TameLiteral.java
|
||||
-1189
File diff suppressed because it is too large
Load Diff
@@ -26,4 +26,38 @@ public class Checker {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean withBlockStatement(int type) {
|
||||
if (type == 19) return true; // DoStatement
|
||||
if (type == 24) return true; // ForStatement
|
||||
if (type == 25) return true; // IfStatement
|
||||
if (type == 30) return true; // LabeledStatement
|
||||
if (type == 50) return true; // SwitchStatement
|
||||
if (type == 51) return true; // SynchronizedStatement
|
||||
if (type == 54) return true; // TryStatement
|
||||
if (type == 61) return true; // WhileStatement
|
||||
if (type == 70) return true; // EnhancedForStatement
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isStatement(int type) {
|
||||
if (type == 6) return true; // AssertStatement
|
||||
if (type == 10) return true; // BreakStatement
|
||||
if (type == 17) return true; // ConstructorInvocation
|
||||
if (type == 18) return true; // ContinueStatement
|
||||
if (type == 21) return true; // ExpressionStatement
|
||||
if (type == 41) return true; // ReturnStatement
|
||||
if (type == 46) return true; // SuperConstructorInvocation
|
||||
if (type == 49) return true; // SwitchCase
|
||||
if (type == 53) return true; // ThrowStatement
|
||||
if (type == 56) return true; // TypeDeclarationStatement
|
||||
if (type == 60) return true; // VariableDeclarationStatement
|
||||
return withBlockStatement(type);
|
||||
}
|
||||
|
||||
public static boolean isStatement2(int type) {
|
||||
if (type == 8) return true; // block
|
||||
if (type == 12) return true; // CatchClause
|
||||
return isStatement(type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,6 +150,8 @@ public abstract class Parser implements ParserInterface {
|
||||
actionStr = actionStr.substring(index + 2);
|
||||
if (actionStr.startsWith("MethodName")) {
|
||||
singleEdit = singleEdit.replace("SimpleName", "MethodName");
|
||||
} else if (actionStr.startsWith("ClassName")) {
|
||||
singleEdit = singleEdit.replace("SimpleName", "ClassName");
|
||||
} else {
|
||||
if (actionStr.startsWith("Name")) {
|
||||
char c = actionStr.charAt(5);
|
||||
|
||||
+108
-145
@@ -19,6 +19,7 @@ import edu.lu.uni.serval.gumtree.regroup.HierarchicalActionSet;
|
||||
import edu.lu.uni.serval.gumtree.regroup.HunkActionFilter;
|
||||
import edu.lu.uni.serval.gumtree.regroup.SimpleTree;
|
||||
import edu.lu.uni.serval.gumtree.regroup.SimplifyTree;
|
||||
import edu.lu.uni.serval.violation.code.parser.ViolationSourceCodeTree;
|
||||
|
||||
/**
|
||||
* Parse fix violations with GumTree in terms of multiple statements.
|
||||
@@ -51,6 +52,7 @@ public class FixedViolationHunkParser extends FixedViolationParser {
|
||||
@Override
|
||||
public void parseFixPatterns(File prevFile, File revFile, File diffentryFile) {
|
||||
List<Violation> allViolations = readViolations(prevFile, revFile);
|
||||
// if (allViolations.size() >= 0) return;
|
||||
// GumTree results
|
||||
List<HierarchicalActionSet> actionSets = parseChangedSourceCodeWithGumTree2(prevFile, revFile);
|
||||
if (this.resultType != 0) {
|
||||
@@ -63,8 +65,7 @@ public class FixedViolationHunkParser extends FixedViolationParser {
|
||||
type = "#NoStatementChange:";
|
||||
}
|
||||
for (Violation v : allViolations) {
|
||||
unfixedViolations += type + revFile.getName() + ":" + v.getStartLineNum() + ":" + v.getEndLineNum() + ":" + v.getViolationType() + "\n";
|
||||
System.err.println(type + revFile.getName() + ":" + v.getStartLineNum() + ":" + v.getEndLineNum() + ":" + v.getViolationType());
|
||||
this.unfixedViolations += type + revFile.getName() + ":" + v.getStartLineNum() + ":" + v.getEndLineNum() + ":" + v.getViolationType() + "\n";
|
||||
}
|
||||
} else {
|
||||
List<DiffEntryHunk> diffentryHunks = new DiffEntryReader().readHunks2(diffentryFile);
|
||||
@@ -81,35 +82,6 @@ public class FixedViolationHunkParser extends FixedViolationParser {
|
||||
List<HierarchicalActionSet> hunkActionSets = violation.getActionSets();
|
||||
// multiple UPD, and some UPD contain other UPD.
|
||||
removeOverlapperdUPD(hunkActionSets);
|
||||
// // Remove overlapped UPD and INS, MOV
|
||||
// List<HierarchicalActionSet> addActions = new ArrayList<>();
|
||||
// List<HierarchicalActionSet> insertActions = new ArrayList<>();
|
||||
// for (HierarchicalActionSet hunkActionSet : hunkActionSets) {
|
||||
// if (hunkActionSet.getActionString().startsWith("INS")) insertActions.add(hunkActionSet);
|
||||
// if (hunkActionSet.getActionString().startsWith("UPD")) addActions.add(hunkActionSet);
|
||||
// }
|
||||
// List<HierarchicalActionSet> selectedActionSets = new ArrayList<>();
|
||||
// for (HierarchicalActionSet hunkActionSet : hunkActionSets) {
|
||||
// if (insertActions.contains(hunkActionSet)) {
|
||||
// boolean isIntersection = false;
|
||||
// int bugStartL1 = hunkActionSet.getBugStartLineNum();
|
||||
// int bugEndL1 = hunkActionSet.getBugEndLineNum();
|
||||
// for (HierarchicalActionSet addAction : addActions) {
|
||||
// int bugStartL = addAction.getBugStartLineNum();
|
||||
// int bugEndL = addAction.getBugEndLineNum();
|
||||
// if (bugEndL1 < bugStartL || bugStartL1 > bugEndL) {
|
||||
// continue;
|
||||
// }
|
||||
// isIntersection = true;
|
||||
// break;
|
||||
// }
|
||||
// if (!isIntersection) {
|
||||
// selectedActionSets.add(hunkActionSet);
|
||||
// }
|
||||
// continue;
|
||||
// }
|
||||
// selectedActionSets.add(hunkActionSet);
|
||||
// }
|
||||
|
||||
// Range of buggy source code
|
||||
int bugStartLine = 0;
|
||||
@@ -146,47 +118,16 @@ public class FixedViolationHunkParser extends FixedViolationParser {
|
||||
|
||||
if (fixStartLine == 0 && bugStartLine == 0) {
|
||||
this.unfixedViolations += "#WRONG: " + revFile.getName() + ":" + violation.getStartLineNum() + ":" + violation.getEndLineNum() + ":" + violation.getViolationType() + "\n";
|
||||
this.nullMappingGumTreeResult ++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (fixStartLine == 0 && bugStartLine != 0) {
|
||||
// pure delete actions.
|
||||
if (fixStartLine == 0 && bugStartLine != 0) {// pure delete actions.
|
||||
this.pureDeletions ++;
|
||||
this.unfixedViolations += "#PureDeletion:" + revFile.getName() + ":" + violation.getStartLineNum() + ":" + violation.getEndLineNum() + ":" + violation.getViolationType() + "\n";
|
||||
System.err.println("#PureDeletion:" + revFile.getName() + ":" + violation.getStartLineNum()
|
||||
+ ":" + violation.getEndLineNum() + ":" + violation.getViolationType());
|
||||
// get the exact buggy code by violation's position. TODO later
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert the ITree of buggy code to a simple tree.
|
||||
* It will be used to compute the similarity.
|
||||
*/
|
||||
SimpleTree simpleTree = new SimpleTree();
|
||||
simpleTree.setLabel("Block");
|
||||
simpleTree.setNodeType("Block");
|
||||
List<SimpleTree> children = new ArrayList<>();
|
||||
String astEditScripts = "";
|
||||
for (HierarchicalActionSet hunkActionSet : hunkActionSets) {
|
||||
// TODO simplify buggy tree with buggy code.
|
||||
/**
|
||||
// * Select edit scripts for deep learning.
|
||||
// * Edit scripts will be used to mine common fix patterns.
|
||||
// */
|
||||
// // 1. First level: AST node type.
|
||||
// astEditScripts += getASTEditScripts(hunkActionSet);
|
||||
// // 2. source code: raw tokens
|
||||
// // 3. abstract identifiers:
|
||||
// // 4. semi-source code:
|
||||
SimplifyTree abstractIdentifier = new SimplifyTree();
|
||||
abstractIdentifier.abstractTree(hunkActionSet, bugEndPosition);
|
||||
SimpleTree simpleT = hunkActionSet.getSimpleTree();
|
||||
if (simpleT == null) { // Failed to get the simple tree for INS actions.
|
||||
continue;
|
||||
}
|
||||
children.add(simpleT);
|
||||
}
|
||||
|
||||
// if (children.size() == 0) continue;
|
||||
boolean isPureInsert = false;
|
||||
if (bugStartLine == 0 && violation.getBugStartLineNum() > 0) {
|
||||
@@ -199,22 +140,16 @@ public class FixedViolationHunkParser extends FixedViolationParser {
|
||||
this.largeHunk ++;
|
||||
this.unfixedViolations += "#LargeHunk:" + revFile.getName() + ":" + violation.getStartLineNum()
|
||||
+ ":" + violation.getEndLineNum() + ":" + violation.getViolationType() + "\n";
|
||||
System.err.println("#LargeHunk:" + revFile.getName() + ":" + violation.getStartLineNum()
|
||||
+ ":" + violation.getEndLineNum() + ":" + violation.getViolationType());
|
||||
continue;
|
||||
// continue;
|
||||
}
|
||||
|
||||
simpleTree.setChildren(children);
|
||||
simpleTree.setParent(null);
|
||||
|
||||
// Source Code of patches.
|
||||
String patchSourceCode = getPatchSourceCode(prevFile, revFile, bugStartLine, bugEndLine, fixStartLine, fixEndLine, isPureInsert);
|
||||
// Obtain Source Code of patches from DiffEntries.
|
||||
// String patchSourceCode = getPatchSourceCode(prevFile, revFile, bugStartLine, bugEndLine, fixStartLine, fixEndLine, isPureInsert);
|
||||
String patchSourceCode = this.readPatchSourceCode(violation, bugStartLine, bugEndLine, fixStartLine, fixEndLine);
|
||||
if ("".equals(patchSourceCode)) {
|
||||
this.nullSourceCode ++;
|
||||
this.unfixedViolations += "#NullSourceCode:" + revFile.getName() + ":" + violation.getStartLineNum()
|
||||
+ ":" + violation.getEndLineNum() + ":" + violation.getViolationType() + "\n";
|
||||
System.err.println("#NullSourceCode:" + revFile.getName() + ":" + violation.getStartLineNum()
|
||||
+ ":" + violation.getEndLineNum() + ":" + violation.getViolationType());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -223,35 +158,41 @@ public class FixedViolationHunkParser extends FixedViolationParser {
|
||||
* Edit scripts will be used to mine common fix patterns.
|
||||
*/
|
||||
// 1. First level: AST node type.
|
||||
astEditScripts += getASTEditScriptsDeepFirst(hunkActionSets, bugEndPosition, fixEndPosition);
|
||||
String astEditScripts = getASTEditScriptsDeepFirst(hunkActionSets, bugEndPosition, fixEndPosition);
|
||||
// 2. source code: raw tokens
|
||||
// 3. abstract identifiers:
|
||||
// 4. semi-source code:
|
||||
String[] editScriptTokens = astEditScripts.split(" ");
|
||||
int size = editScriptTokens.length;
|
||||
// if (size == 1) {
|
||||
// this.nullMappingGumTreeResult ++;
|
||||
// continue;
|
||||
// }
|
||||
if (size == 1) {
|
||||
// if ("MOVMethodDeclaration".equals(astEditScripts)) {
|
||||
// this.nullMappingGumTreeResult ++;
|
||||
// this.unfixedViolations += "#NullMatchedGumTreeResult:" + revFile.getName() + ":" +violation.getStartLineNum() + ":" +
|
||||
// violation.getEndLineNum() + ":" + violation.getViolationType() + "\n";
|
||||
// continue;
|
||||
// }
|
||||
this.nullMappingGumTreeResult ++;
|
||||
this.unfixedViolations += "#NullMatchedGumTreeResult:" + revFile.getName() + ":" +violation.getStartLineNum() + ":" +
|
||||
violation.getEndLineNum() + ":" + violation.getViolationType() + "\n";
|
||||
continue;
|
||||
}
|
||||
String alarmType = violation.getViolationType();
|
||||
|
||||
// String patchPosition = "\n" + revFile.getName() + "Position: " + violation.getStartLineNum() + " --> " + violation.getEndLineNum() + "\n@@ -" + bugStartLine + ", " + bugEndLine + " +" + fixStartLine + ", " + fixEndLine + "@@\n";
|
||||
String patchPosition = "\n" + revFile.getName() + "\nPosition: " + violation.getStartLineNum() + " --> " + violation.getEndLineNum() + "\n@@ -" + bugStartLine + ", " + bugEndLine + " +" + fixStartLine + ", " + fixEndLine + "@@\n";
|
||||
// String patchPosition = "\n" + "Position: " + violation.getStartLineNum() + " --> " + violation.getEndLineNum() + "\n@@ -" + bugStartLine + ", " + bugEndLine + " +" + fixStartLine + ", " + fixEndLine + "@@\n";
|
||||
// String info = Configuration.PATCH_SIGNAL + "\nAlarm Type :" + violation.getAlarmType() + "\n" + patchPosition + patchSourceCode + "\nAST Diff###:\n" + getAstEditScripts(hunkActionSets, bugEndPosition, fixEndPosition) + "\n";
|
||||
String info = Configuration.PATCH_SIGNAL + "\nAlarm Type :" + alarmType + "\n" + patchPosition + patchSourceCode + "\nAST Diff###:\n" + getAstEditScripts(hunkActionSets, bugEndPosition, fixEndPosition) + "\n";
|
||||
// String patchPosition = "\n" + "Position: " + violation.getStartLineNum() + " --> " + violation.getEndLineNum() + "\n@@ -" + bugStartLine + ", " + bugEndLine + " +" + fixStartLine + ", " + fixEndLine + "@@\n";
|
||||
String info = Configuration.PATCH_SIGNAL + "\nAlarm Type :" + violation.getViolationType() + "\n" + patchSourceCode + "\n\n";// + patchPosition + revFile.getName() + "\n";
|
||||
// String info = Configuration.PATCH_SIGNAL + "\nAlarm Type :" + alarmType + "\n" + patchSourceCode + "\n\n";// + patchPosition + revFile.getName() + "\n";
|
||||
// if (noUpdate(editScriptTokens)) {
|
||||
//
|
||||
// if (!"SE_NO_SERIALVERSIONID".equals(alarmType)) {
|
||||
// if (containsFiledDeclaration(hunkActionSets)) {
|
||||
//// this.nullMappingGumTreeResult ++; //TODO
|
||||
//// this.nullMappingGumTreeResult ++;
|
||||
// this.testingInfo += info + revFile.getName() + "\n";
|
||||
// this.testingInfo += "#TestingInfo: " + revFile.getName() + ":" + violation.getStartLineNum()
|
||||
// + ":" + violation.getEndLineNum() + ":" + violation.getViolationType();
|
||||
// this.unfixedViolations += "#TestingInfo:" + revFile.getName() + ":" + violation.getStartLineNum()
|
||||
// + ":" + violation.getEndLineNum() + ":" + violation.getViolationType() + "\n";
|
||||
// System.err.println("#TestingInfo:" + revFile.getName() + ":" + violation.getStartLineNum()
|
||||
// + ":" + violation.getEndLineNum() + ":" + violation.getViolationType());
|
||||
// this.testInfos ++;
|
||||
// continue;
|
||||
// }
|
||||
@@ -270,14 +211,12 @@ public class FixedViolationHunkParser extends FixedViolationParser {
|
||||
// } else if (containSpecialStmt(hunkActionSets, bugEndPosition, fixEndPosition)) {
|
||||
//
|
||||
// } else {
|
||||
//// this.nullMappingGumTreeResult ++; // TODO
|
||||
//// this.nullMappingGumTreeResult ++;
|
||||
// this.testingInfo += info + revFile.getName() + "\n";
|
||||
// this.testingInfo += "#TestingInfo: " + revFile.getName() + ":" + violation.getStartLineNum()
|
||||
// + ":" + violation.getEndLineNum() + ":" + violation.getViolationType();
|
||||
// this.unfixedViolations += "#TestingInfo:" + revFile.getName() + ":" + violation.getStartLineNum()
|
||||
// + ":" + violation.getEndLineNum() + ":" + violation.getViolationType() + "\n";
|
||||
// System.err.println("#TestingInfo:" + revFile.getName() + ":" + violation.getStartLineNum()
|
||||
// + ":" + violation.getEndLineNum() + ":" + violation.getViolationType());
|
||||
// this.testInfos ++;
|
||||
// continue;
|
||||
// }
|
||||
@@ -288,11 +227,13 @@ public class FixedViolationHunkParser extends FixedViolationParser {
|
||||
this.astEditScripts += astEditScripts + "\n";
|
||||
this.violationTypes += alarmType + "\n";
|
||||
// this.buggyTrees += Configuration.BUGGY_TREE_TOKEN + "\n" + simpleTree.toString() + "\n";
|
||||
|
||||
SimpleTree simpleTree = getBuggyCodeTree(violation, bugEndPosition, prevFile, bugStartLine, bugEndLine);
|
||||
String tokens = Tokenizer.getTokensDeepFirst(simpleTree).trim();
|
||||
if ("Block Block".equals(tokens)) {
|
||||
tokens = getContextTokens(patchSourceCode);
|
||||
}
|
||||
this.tokensOfSourceCode += tokens + "\n";
|
||||
this.tokensOfSourceCode += tokens + "\n";
|
||||
// this.actionSets += Configuration.BUGGY_TREE_TOKEN + "\n" + readActionSet(actionSet, "") + "\n";
|
||||
// this.originalTree += Configuration.BUGGY_TREE_TOKEN + "\n" + actionSet.getOriginalTree().toString() + "\n";
|
||||
|
||||
@@ -300,6 +241,69 @@ public class FixedViolationHunkParser extends FixedViolationParser {
|
||||
}
|
||||
}
|
||||
|
||||
private SimpleTree getBuggyCodeTree(Violation violation, int bugEndPosition, File prevFile, int bugStartLine, int bugEndLine) {
|
||||
SimpleTree simpleTree = null;
|
||||
|
||||
String type = violation.getViolationType();
|
||||
if ("EQ_DOESNT_OVERRIDE_EQUALS".equals(type)|| "HE_EQUALS_USE_HASHCODE".equals(type) || "HE_INHERITS_EQUALS_USE_HASHCODE".equals(type)||
|
||||
"SE_NO_SUITABLE_CONSTRUCTOR".equals(type) || "RI_REDUNDANT_INTERFACES".equals(type)
|
||||
||"CN_IDIOM".equals(type)||"SE_NO_SERIALVERSIONID".equals(type) || "SE_COMPARATOR_SHOULD_BE_SERIALIZABLE".equals(type)) {
|
||||
// Class name level, tokens
|
||||
// classStartP <= vS <= vE <= classEndP
|
||||
ViolationSourceCodeTree parser = new ViolationSourceCodeTree(prevFile, violation.getStartLineNum(), violation.getEndLineNum());
|
||||
ITree classNameTree = parser.getClassNameTokens();
|
||||
simpleTree = new SimplifyTree().canonicalizeSourceCodeTree(classNameTree, null);
|
||||
} else {
|
||||
simpleTree = new SimpleTree();
|
||||
simpleTree.setLabel("Block");
|
||||
simpleTree.setNodeType("Block");
|
||||
List<SimpleTree> children = new ArrayList<>();
|
||||
|
||||
int vStartLine = violation.getStartLineNum();
|
||||
int vEndLine = violation.getEndLineNum();
|
||||
if (bugStartLine < vStartLine && vEndLine < bugEndLine) {
|
||||
ViolationSourceCodeTree parser = new ViolationSourceCodeTree(prevFile, violation.getStartLineNum(), violation.getEndLineNum());
|
||||
parser.extract();
|
||||
List<ITree> matchedTrees = parser.getViolationSourceCodeTrees();
|
||||
if (matchedTrees.size() > 0) {
|
||||
for (ITree matchedTree : matchedTrees) {
|
||||
SimpleTree simpleT = new SimplifyTree().canonicalizeSourceCodeTree(matchedTree, simpleTree);
|
||||
children.add(simpleT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (children.size() == 0) {
|
||||
List<HierarchicalActionSet> hunkActionSets = violation.getActionSets();
|
||||
/*
|
||||
* Convert the ITree of buggy code to a simple tree.
|
||||
* It will be used to compute the similarity.
|
||||
*/
|
||||
for (HierarchicalActionSet hunkActionSet : hunkActionSets) {
|
||||
// TODO simplify buggy tree with buggy code.
|
||||
/**
|
||||
* Select edit scripts for deep learning.
|
||||
* Edit scripts will be used to mine common fix patterns.
|
||||
*/
|
||||
// // 1. First level: AST node type.
|
||||
// // 2. source code: raw tokens
|
||||
// // 3. abstract identifiers:
|
||||
// // 4. semi-source code:
|
||||
SimplifyTree abstractIdentifier = new SimplifyTree();
|
||||
abstractIdentifier.abstractTree(hunkActionSet, bugEndPosition);
|
||||
SimpleTree simpleT = hunkActionSet.getSimpleTree();
|
||||
if (simpleT == null) { // Failed to get the simple tree for INS actions.
|
||||
continue;
|
||||
}
|
||||
children.add(simpleT);
|
||||
}
|
||||
}
|
||||
simpleTree.setChildren(children);
|
||||
simpleTree.setParent(null);
|
||||
}
|
||||
return simpleTree;
|
||||
}
|
||||
|
||||
private void removeOverlapperdUPD(List<HierarchicalActionSet> actionSets) {
|
||||
if (actionSets.size() == 1) {
|
||||
return;
|
||||
@@ -314,11 +318,20 @@ public class FixedViolationHunkParser extends FixedViolationParser {
|
||||
List<HierarchicalActionSet> overlappedUpdates = new ArrayList<>();
|
||||
if (updates.size() > 1) {
|
||||
for (HierarchicalActionSet update : updates) {
|
||||
int startLine = update.getBugStartLineNum();
|
||||
int endLine = update.getBugEndLineNum();
|
||||
int endPosition = update.getBugEndPosition();
|
||||
for (HierarchicalActionSet update2 : updates) {
|
||||
if (update.equals(update2)) continue;
|
||||
if (update.getBugStartLineNum() <= update2.getBugStartLineNum()
|
||||
&& update2.getBugEndLineNum() <= update.getBugEndLineNum()) {
|
||||
overlappedUpdates.add(update);
|
||||
int startLine2 = update2.getBugStartLineNum();
|
||||
int endLine2 = update2.getBugEndLineNum();
|
||||
int endPosition2 = update2.getBugEndPosition();
|
||||
if (startLine <= startLine2
|
||||
&& endLine2 <= endLine && endPosition2 < endPosition) {
|
||||
if (!overlappedUpdates.contains(update)) {
|
||||
overlappedUpdates.add(update);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -326,26 +339,12 @@ public class FixedViolationHunkParser extends FixedViolationParser {
|
||||
actionSets.removeAll(overlappedUpdates);
|
||||
}
|
||||
|
||||
// private List<HierarchicalActionSet> getExactActionSets(Violation violation,
|
||||
// List<HierarchicalActionSet> hunkActionSets) {
|
||||
// List<HierarchicalActionSet> deleteActionSets = new ArrayList<>();
|
||||
// for (HierarchicalActionSet hunkActionSet : hunkActionSets) {
|
||||
// int startLine = hunkActionSet.getBugStartLineNum();
|
||||
// int endLine = hunkActionSet.getBugEndLineNum();
|
||||
// if (violation.getStartLineNum() <= startLine && endLine <= violation.getEndLineNum()) {
|
||||
// String astNodeType = hunkActionSet.getAstNodeType();
|
||||
// if (astNodeType.endsWith("Statement") || astNodeType.endsWith("FieldDeclaration")) {
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return deleteActionSets;
|
||||
// }
|
||||
|
||||
private List<Violation> identifyFixRangeHeuristically(List<Violation> violations, List<DiffEntryHunk> diffentryHunks, File revFile) {
|
||||
List<Violation> selectedViolations = new ArrayList<>();
|
||||
for (Violation violation : violations) {
|
||||
|
||||
int violationStartLineNum = violation.getBugStartLineNum();
|
||||
|
||||
if (violationStartLineNum > 0) {
|
||||
int violationEndLineNum = violation.getEndLineNum();
|
||||
for (int index = 0, hunkListSize = diffentryHunks.size(); index < hunkListSize; index ++) {
|
||||
@@ -455,12 +454,12 @@ public class FixedViolationHunkParser extends FixedViolationParser {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (violation.getHunks().size() == 0) {
|
||||
// This fixed violation cannot be matched with a DiffEntry, it is difficult to identify related source code change for it.
|
||||
this.nullMatchedDiffEntry ++;
|
||||
this.unfixedViolations += "#NullDiffEntry: " + revFile.getName() + " : " +violation.getStartLineNum() + " : "
|
||||
+ violation.getEndLineNum() + " : " + violation.getViolationType() + "\n";
|
||||
System.err.println("#NullDiffEntry: " + revFile.getName() + " : " +violation.getStartLineNum() + " : " + violation.getEndLineNum() + " : " + violation.getViolationType());
|
||||
} else {
|
||||
selectedViolations.add(violation);
|
||||
}
|
||||
@@ -472,33 +471,6 @@ public class FixedViolationHunkParser extends FixedViolationParser {
|
||||
return selectedViolations;
|
||||
}
|
||||
|
||||
private boolean containsFiledDeclaration(List<HierarchicalActionSet> hunkActionSets) {
|
||||
for (HierarchicalActionSet hunkActionSet : hunkActionSets) {
|
||||
if (hunkActionSet.getAstNodeType().equals("FieldDeclaration")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean containSpecialStmt(List<HierarchicalActionSet> hunkActionSets, int bugEndPosition, int fixEndPosition) {
|
||||
for (HierarchicalActionSet hunkActionSet : hunkActionSets) {
|
||||
if (hunkActionSet.getActionString().startsWith("INS")) {
|
||||
if (hunkActionSet.getAstNodeType().equals("IfStatement")) {
|
||||
return true;
|
||||
}
|
||||
if (hunkActionSet.getAstNodeType().equals("ThrowStatement")) {
|
||||
return true;
|
||||
}
|
||||
if (hunkActionSet.getAstNodeType().equals("ReturnStatement")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private String getContextTokens(String patchSourceCode) {
|
||||
BufferedReader reader = new BufferedReader(new StringReader(patchSourceCode));
|
||||
String line = null;
|
||||
@@ -533,13 +505,4 @@ public class FixedViolationHunkParser extends FixedViolationParser {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean noUpdate(String[] tokens) {
|
||||
for (String token : tokens) {
|
||||
if (token.startsWith("UPD") || token.startsWith("MOV")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+83
-14
@@ -10,6 +10,7 @@ import java.util.List;
|
||||
import com.github.gumtreediff.actions.model.Action;
|
||||
|
||||
import edu.lu.uni.serval.FixPatternParser.Parser;
|
||||
import edu.lu.uni.serval.diffentry.DiffEntryHunk;
|
||||
import edu.lu.uni.serval.gumtree.GumTreeComparer;
|
||||
import edu.lu.uni.serval.gumtree.regroup.HierarchicalActionSet;
|
||||
import edu.lu.uni.serval.gumtree.regroup.HierarchicalRegrouper;
|
||||
@@ -103,10 +104,13 @@ public class FixedViolationParser extends Parser {
|
||||
int endLine = Integer.parseInt(positionStr[2]);
|
||||
String violationType = positionStr[0];
|
||||
|
||||
// if ("UPM_UNCALLED_PRIVATE_METHOD".equals(violationType)) continue;
|
||||
|
||||
Violation violation = new Violation(startLine, endLine, violationType);
|
||||
violation.setFileName(fileName);
|
||||
|
||||
if (startLine == -1) {
|
||||
violation.setBugStartLineNum(0);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the parent range of a violation.
|
||||
@@ -117,8 +121,14 @@ public class FixedViolationParser extends Parser {
|
||||
int violationStartLine = alarmTree.getViolationFinalStartLine();
|
||||
violation.setBugStartLineNum(violationStartLine);
|
||||
if (violationStartLine > 0) {// 0: no source code, -1: range is too large, which contains several inner classes, methods or fields.
|
||||
// FileHelper.outputToFile("logs/testV3.txt", "\n", true);
|
||||
violation.setBugEndLineNum(alarmTree.getViolationFinalEndLine());
|
||||
// if (violationType.equals("SE_NO_SERIALVERSIONID")){
|
||||
// FileHelper.outputToFile("OUTPUT/list1.txt", line + ":" + revFile.getName() + "\n", true);
|
||||
// }
|
||||
} else {
|
||||
// if (!violationType.equals("SE_NO_SERIALVERSIONID")) {
|
||||
// FileHelper.outputToFile("OUTPUT/list.txt", line + ":" + revFile.getName() + "\n", true);
|
||||
// }
|
||||
}
|
||||
violations.add(violation);
|
||||
}
|
||||
@@ -134,24 +144,29 @@ public class FixedViolationParser extends Parser {
|
||||
return violations;
|
||||
}
|
||||
|
||||
protected String getPatchSourceCode(File prevFile, File revFile, int startLineNum, int endLineNum, int startLineNum2, int endLineNum2) {
|
||||
String buggyStatements = readSourceCode(prevFile, startLineNum, endLineNum, "-");
|
||||
String fixedStatements = readSourceCode(revFile, startLineNum2, endLineNum2, "+");
|
||||
return buggyStatements + fixedStatements;
|
||||
}
|
||||
|
||||
protected String getPatchSourceCode(File prevFile, File revFile, int startLineNum, int endLineNum, int startLineNum2, int endLineNum2, boolean isInsert) {
|
||||
/**
|
||||
* Read patch source code from buggy and fixed files.
|
||||
* @param prevFile
|
||||
* @param revFile
|
||||
* @param bugStartLineNum
|
||||
* @param bugEndLineNum
|
||||
* @param fixStartLineNum
|
||||
* @param fixEndLineNum
|
||||
* @param isInsert
|
||||
* @return
|
||||
*/
|
||||
protected String getPatchSourceCode(File prevFile, File revFile, int bugStartLineNum, int bugEndLineNum, int fixStartLineNum, int fixEndLineNum, boolean isInsert) {
|
||||
String buggyStatements = "";
|
||||
if (isInsert) {
|
||||
buggyStatements = readSourceCode(prevFile, startLineNum, endLineNum, "");
|
||||
buggyStatements = readSourceCode(prevFile, bugStartLineNum, bugEndLineNum, "");
|
||||
} else {
|
||||
buggyStatements = readSourceCode(prevFile, startLineNum, endLineNum, "-");
|
||||
buggyStatements = readSourceCode(prevFile, bugStartLineNum, bugEndLineNum, "-");
|
||||
}
|
||||
String fixedStatements = readSourceCode(revFile, startLineNum2, endLineNum2, "+");
|
||||
String fixedStatements = readSourceCode(revFile, fixStartLineNum, fixEndLineNum, "+");
|
||||
return buggyStatements + fixedStatements;
|
||||
}
|
||||
|
||||
protected String readSourceCode(File file, int startLineNum, int endLineNum, String type) {
|
||||
private String readSourceCode(File file, int startLineNum, int endLineNum, String type) {
|
||||
String sourceCode = "";
|
||||
String fileContent = FileHelper.readFile(file);
|
||||
BufferedReader reader = null;
|
||||
@@ -178,6 +193,60 @@ public class FixedViolationParser extends Parser {
|
||||
return sourceCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read patch source code from diffentries.
|
||||
* @param violation
|
||||
* @param bugStartLine
|
||||
* @param bugEndLine
|
||||
* @param fixStartLine
|
||||
* @param fixEndLine
|
||||
* @return
|
||||
*/
|
||||
protected String readPatchSourceCode(Violation violation, int bugStartLine, int bugEndLine, int fixStartLine, int fixEndLine) {
|
||||
String patch = "";
|
||||
List<DiffEntryHunk> diffentries = violation.getHunks();
|
||||
for (DiffEntryHunk diffentry : diffentries) {
|
||||
int currentBugLine = diffentry.getBugLineStartNum() - 1;
|
||||
int currentFixLine = diffentry.getFixLineStartNum() - 1;
|
||||
String sourceCode = diffentry.getHunk();
|
||||
|
||||
BufferedReader reader = new BufferedReader(new StringReader(sourceCode));
|
||||
String line = null;
|
||||
|
||||
try {
|
||||
while ((line = reader.readLine()) != null) {
|
||||
if (line.startsWith("+")) {
|
||||
currentFixLine ++;
|
||||
if (fixStartLine <= currentFixLine && currentFixLine <= fixEndLine) {
|
||||
patch += line + "\n";
|
||||
}
|
||||
} else if (line.startsWith("-")) {
|
||||
currentBugLine ++;
|
||||
if (bugStartLine <= currentBugLine && currentBugLine <= bugEndLine) {
|
||||
patch += line + "\n";
|
||||
}
|
||||
} else {
|
||||
currentFixLine ++;
|
||||
currentBugLine ++;
|
||||
if ((bugStartLine <= currentBugLine && currentBugLine <= bugEndLine) ||
|
||||
(fixStartLine <= currentFixLine && currentFixLine <= fixEndLine)) {
|
||||
patch += line + "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
reader.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return patch;
|
||||
}
|
||||
|
||||
public String getAlarmTypes() {
|
||||
return violationTypes;
|
||||
}
|
||||
|
||||
+1
-1
@@ -123,7 +123,7 @@ public class FixedViolationSingleStatementParser extends FixedViolationParser {
|
||||
}
|
||||
|
||||
// Source Code of patches.
|
||||
String patchSourceCode = getPatchSourceCode(prevFile, revFile, startLine, endLine, startLine2, endLine2);
|
||||
String patchSourceCode = getPatchSourceCode(prevFile, revFile, startLine, endLine, startLine2, endLine2, false);
|
||||
this.patchesSourceCode += Configuration.PATCH_SIGNAL + "\n" + revFile.getName() + "\n" + patchSourceCode + "\n";
|
||||
this.sizes += size + "\n";
|
||||
this.astEditScripts += astEditScripts + "\n";
|
||||
|
||||
@@ -26,19 +26,20 @@ public class AkkaParser {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void main(String[] args) {
|
||||
String violationType = Configuration.ROOT_PATH + "UnfixedViolations/";
|
||||
String violationType = Configuration.GUM_TREE_INPUT + "UnfixedViolations/";
|
||||
File file = new File(violationType);
|
||||
File[] violationTypes = file.listFiles();
|
||||
for (File violationT : violationTypes) {
|
||||
if (violationT.isDirectory()) {
|
||||
violationType = violationT.getName();
|
||||
if (!violationType.equals("SF_SWITCH_NO_DEFAULT")) continue;
|
||||
// input data
|
||||
log.info("Get the input data...");
|
||||
final List<MessageFile> msgFiles = getMessageFiles(Configuration.GUM_TREE_INPUT, violationType);
|
||||
log.info("MessageFiles: " + msgFiles.size());
|
||||
|
||||
// output path
|
||||
final String sourceCodeFilesPath = Configuration.ROOT_PATH + "UnfixedViolations/" + violationType + "/";
|
||||
final String sourceCodeFilesPath = Configuration.ROOT_PATH + "UnfixedViolations_RQ3/" + violationType + "/";
|
||||
FileHelper.deleteDirectory(sourceCodeFilesPath);
|
||||
|
||||
ActorSystem system = null;
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package edu.lu.uni.serval.MultipleThreadsParser3;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import akka.actor.ActorRef;
|
||||
import akka.actor.ActorSystem;
|
||||
import edu.lu.uni.serval.MultipleThreadsParser.MessageFile;
|
||||
import edu.lu.uni.serval.MultipleThreadsParser.WorkMessage;
|
||||
import edu.lu.uni.serval.config.Configuration;
|
||||
import edu.lu.uni.serval.utils.FileHelper;
|
||||
|
||||
/**
|
||||
* Multi-thread parser of parsing source code of fixed violations.
|
||||
*
|
||||
* @author kui.liu
|
||||
*
|
||||
*/
|
||||
public class AkkaParser2 {
|
||||
|
||||
private static Logger log = LoggerFactory.getLogger(AkkaParser2.class);
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void main(String[] args) {
|
||||
// input data
|
||||
log.info("Get the input data...");
|
||||
final List<MessageFile> msgFiles = getMessageFiles(Configuration.GUM_TREE_INPUT);
|
||||
log.info("MessageFiles: " + msgFiles.size());
|
||||
|
||||
// output path
|
||||
final String sourceCodeFilesPath = Configuration.ROOT_PATH + "fixedViolations/";
|
||||
FileHelper.deleteDirectory(sourceCodeFilesPath);
|
||||
|
||||
ActorSystem system = null;
|
||||
ActorRef parsingActor = null;
|
||||
int numberOfWorkers = 431;
|
||||
final WorkMessage msg = new WorkMessage(0, msgFiles);
|
||||
try {
|
||||
log.info("Akka begins...");
|
||||
system = ActorSystem.create("Mining-Pattern-System");
|
||||
parsingActor = system.actorOf(ParseFixPatternActor.props(numberOfWorkers, sourceCodeFilesPath, "Type"), "mine-pattern-actor");
|
||||
parsingActor.tell(msg, ActorRef.noSender());
|
||||
} catch (Exception e) {
|
||||
system.shutdown();
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get violation-related files.
|
||||
*
|
||||
* @param gumTreeInput
|
||||
* @return
|
||||
*/
|
||||
public static List<MessageFile> getMessageFiles(String inputPath) {
|
||||
File sourceCodeFilesPath = new File(inputPath + "prevFiles/");
|
||||
File[] sourceCodeFiles = sourceCodeFilesPath.listFiles();
|
||||
List<MessageFile> msgFiles = new ArrayList<>();
|
||||
|
||||
for (File sourceCodeFile : sourceCodeFiles) {
|
||||
if (sourceCodeFile.getName().endsWith(".java")) {
|
||||
String fileName = sourceCodeFile.getName();
|
||||
fileName = fileName.substring(5).replace(".java", ".txt");
|
||||
File positionFile = new File(inputPath + "positions/" + fileName); // position file
|
||||
MessageFile msgFile = new MessageFile(null, sourceCodeFile, null);
|
||||
msgFile.setPositionFile(positionFile);
|
||||
msgFiles.add(msgFile);
|
||||
}
|
||||
}
|
||||
|
||||
return msgFiles;
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,7 @@ public class ParseFixPatternActor extends UntypedActor {
|
||||
if (message instanceof WorkMessage) {
|
||||
List<MessageFile> files = ((WorkMessage) message).getMsgFiles();
|
||||
int size = files.size();
|
||||
int average = (int) Math.round((double) size / numberOfWorkers);
|
||||
int average = size / numberOfWorkers;
|
||||
|
||||
for (int i = 0; i < numberOfWorkers; i ++) {
|
||||
int fromIndex = i * average;
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package edu.lu.uni.serval.MultipleThreadsParser3;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
@@ -11,6 +15,7 @@ import akka.actor.UntypedActor;
|
||||
import akka.japi.Creator;
|
||||
import edu.lu.uni.serval.MultipleThreadsParser.MessageFile;
|
||||
import edu.lu.uni.serval.MultipleThreadsParser.WorkMessage;
|
||||
import edu.lu.uni.serval.config.Configuration;
|
||||
import edu.lu.uni.serval.utils.FileHelper;
|
||||
import edu.lu.uni.serval.violation.code.parser.ViolationCodeParser;
|
||||
|
||||
@@ -44,6 +49,8 @@ public class ParseFixPatternWorker extends UntypedActor {
|
||||
StringBuilder sourceCode = new StringBuilder();
|
||||
StringBuilder sizes = new StringBuilder();
|
||||
StringBuilder tokens = new StringBuilder();
|
||||
|
||||
List<String> violationTypes = readTypes();
|
||||
|
||||
int id = msg.getId();
|
||||
int counter = 0;
|
||||
@@ -56,6 +63,7 @@ public class ParseFixPatternWorker extends UntypedActor {
|
||||
}
|
||||
ViolationCodeParser parser = new ViolationCodeParser();
|
||||
parser.parse(prevFile, positionFile);
|
||||
parser.setTypes(violationTypes);
|
||||
|
||||
String sourceCodeStr = parser.sourceCode;
|
||||
if ("".equals(sourceCodeStr)) {
|
||||
@@ -66,9 +74,9 @@ public class ParseFixPatternWorker extends UntypedActor {
|
||||
|
||||
counter ++;
|
||||
if (counter % 100 == 0) {
|
||||
FileHelper.outputToFile(sourceCodeFilesPath + "SourCode/sourcecode_" + id + ".list", sourceCode, true);
|
||||
FileHelper.outputToFile(sourceCodeFilesPath + "Sizes/sourcecode_" + id + ".list", sizes, true);
|
||||
FileHelper.outputToFile(sourceCodeFilesPath + "Tokens/sourcecode_" + id + ".list", tokens, true);
|
||||
FileHelper.outputToFile(sourceCodeFilesPath + "SourceCode/worker_" + id + ".list", sourceCode, true);
|
||||
FileHelper.outputToFile(sourceCodeFilesPath + "Sizes/worker_" + id + ".list", sizes, true);
|
||||
FileHelper.outputToFile(sourceCodeFilesPath + "Tokens/worker_" + id + ".list", tokens, true);
|
||||
sourceCode.setLength(0);
|
||||
sizes.setLength(0);
|
||||
tokens.setLength(0);
|
||||
@@ -77,9 +85,9 @@ public class ParseFixPatternWorker extends UntypedActor {
|
||||
}
|
||||
|
||||
if (sizes.length() > 0) {
|
||||
FileHelper.outputToFile(sourceCodeFilesPath + "SourCode/sourcecode_" + id + ".list", sourceCode, true);
|
||||
FileHelper.outputToFile(sourceCodeFilesPath + "Sizes/sourcecode_" + id + ".list", sizes, true);
|
||||
FileHelper.outputToFile(sourceCodeFilesPath + "Tokens/sourcecode_" + id + ".list", tokens, true);
|
||||
FileHelper.outputToFile(sourceCodeFilesPath + "SourceCode/worker_" + id + ".list", sourceCode, true);
|
||||
FileHelper.outputToFile(sourceCodeFilesPath + "Sizes/worker_" + id + ".list", sizes, true);
|
||||
FileHelper.outputToFile(sourceCodeFilesPath + "Tokens/worker_" + id + ".list", tokens, true);
|
||||
sourceCode.setLength(0);
|
||||
sizes.setLength(0);
|
||||
tokens.setLength(0);
|
||||
@@ -93,4 +101,22 @@ public class ParseFixPatternWorker extends UntypedActor {
|
||||
}
|
||||
}
|
||||
|
||||
private List<String> readTypes() {
|
||||
String fileName = Configuration.ROOT_PATH + "fixedViolations/types.list";
|
||||
String content = FileHelper.readFile(fileName);
|
||||
List<String> types = new ArrayList<>();
|
||||
BufferedReader reader = new BufferedReader(new StringReader(content));
|
||||
try {
|
||||
String line = null;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
types.add(line);
|
||||
}
|
||||
reader.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// System.err.println(types.size());
|
||||
return types;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
package edu.lu.uni.serval.findbugs;
|
||||
|
||||
public class FindBugsAanalyser {
|
||||
|
||||
}
|
||||
@@ -213,6 +213,16 @@ public class HierarchicalActionSet implements Comparable<HierarchicalActionSet>
|
||||
strList.add("----" + str1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
strList.clear();
|
||||
strList.add(str);
|
||||
for (HierarchicalActionSet actionSet : subActions) {
|
||||
actionSet.toString();
|
||||
List<String> strList1 = actionSet.strList;
|
||||
for (String str1 : strList1) {
|
||||
strList.add("----" + str1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
str = "";
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.github.gumtreediff.actions.model.Update;
|
||||
import com.github.gumtreediff.tree.ITree;
|
||||
|
||||
import edu.lu.uni.serval.FixPattern.utils.ASTNodeMap;
|
||||
import edu.lu.uni.serval.FixPattern.utils.Checker;
|
||||
import edu.lu.uni.serval.utils.ListSorter;
|
||||
|
||||
/**
|
||||
@@ -59,7 +60,14 @@ public class HierarchicalRegrouper {
|
||||
if (parentAct != null) {
|
||||
addToActionSets(actSet, parentAct, actionSets);
|
||||
} else {
|
||||
reActionSets.add(actSet);
|
||||
// TypeDeclaration, FieldDeclaration, MethodDeclaration, Statement.
|
||||
// CatchClause, ConstructorInvocation, SuperConstructorInvocation, SwitchCase
|
||||
String astNodeType = actSet.getAstNodeType();
|
||||
if (astNodeType.endsWith("TypeDeclaration") || astNodeType.endsWith("FieldDeclaration") || astNodeType.endsWith("EnumDeclaration") ||
|
||||
astNodeType.endsWith("MethodDeclaration") || astNodeType.endsWith("Statement") ||
|
||||
astNodeType.endsWith("ConstructorInvocation") || astNodeType.endsWith("CatchClause") || astNodeType.endsWith("SwitchCase")) {
|
||||
reActionSets.add(actSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
return reActionSets;
|
||||
@@ -111,7 +119,6 @@ public class HierarchicalRegrouper {
|
||||
Action action = actSet.getAction();
|
||||
|
||||
if (!areRelatedActions(action, act)) continue;
|
||||
|
||||
if (action.equals(parentAct)) { // actSet is the parent of actionSet.
|
||||
actionSet.setParent(actSet);
|
||||
actSet.getSubActions().add(actionSet);
|
||||
@@ -135,7 +142,7 @@ public class HierarchicalRegrouper {
|
||||
int startPosition2 = parent.getPosition();
|
||||
int length2 = parent.getLength();
|
||||
|
||||
if (!(startPosition2 >= startPosition && startPosition + length <= startPosition2 + length2)) {
|
||||
if (!(startPosition2 <= startPosition && startPosition + length <= startPosition2 + length2)) {
|
||||
// when act is not the sub-set of action.
|
||||
return false;
|
||||
}
|
||||
@@ -152,15 +159,12 @@ public class HierarchicalRegrouper {
|
||||
}
|
||||
|
||||
private boolean addToAactionSet(Action act, Action parentAct, List<HierarchicalActionSet> actionSets) {
|
||||
ITree parentTree = parentAct.getNode();
|
||||
|
||||
for(HierarchicalActionSet actionSet : actionSets) {
|
||||
Action action = actionSet.getAction();
|
||||
|
||||
if (!areRelatedActions(action, act)) continue;
|
||||
|
||||
ITree tree = action.getNode();
|
||||
if (tree.equals(parentTree)) { // actionSet is the parent of actSet.
|
||||
if (action.equals(parentAct)) { // actionSet is the parent of actSet.
|
||||
HierarchicalActionSet actSet = createActionSet(act, actionSet.getAction(), actionSet);
|
||||
actionSet.getSubActions().add(actSet);
|
||||
sortSubActions(actionSet);
|
||||
@@ -186,6 +190,10 @@ public class HierarchicalRegrouper {
|
||||
private Action findParentAction(Action action, List<Action> actions) {
|
||||
|
||||
ITree parent = action.getNode().getParent();
|
||||
if (action instanceof Addition) {
|
||||
parent = ((Addition) action).getParent(); // parent in the fixed source code tree
|
||||
}
|
||||
|
||||
if (parent.getType() == 55) {
|
||||
int type = action.getNode().getType();
|
||||
// Modifier, NormalAnnotation, MarkerAnnotation, SingleMemberAnnotation
|
||||
@@ -196,11 +204,13 @@ public class HierarchicalRegrouper {
|
||||
// QualifiedType, WildcardType, UnionType, IntersectionType, NameQualifiedType, SimpleName
|
||||
return null;
|
||||
}
|
||||
} else if (parent.getType() == 31) { // method declaration
|
||||
int type = action.getNode().getType();
|
||||
if (Checker.isStatement(type)) {// statements
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (action instanceof Addition) {
|
||||
parent = ((Addition) action).getParent(); // parent in the fixed source code tree
|
||||
}
|
||||
for (Action act : actions) {
|
||||
if (act.getNode().equals(parent)) {
|
||||
if (areRelatedActions(act, action)) {
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package edu.lu.uni.serval.gumtree.regroup;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -13,6 +10,7 @@ import com.github.gumtreediff.actions.model.Move;
|
||||
import com.github.gumtreediff.actions.model.Update;
|
||||
import com.github.gumtreediff.tree.ITree;
|
||||
|
||||
import edu.lu.uni.serval.FixPattern.utils.Checker;
|
||||
import edu.lu.uni.serval.FixPatternParser.CUCreator;
|
||||
import edu.lu.uni.serval.FixPatternParser.violations.Violation;
|
||||
import edu.lu.uni.serval.diffentry.DiffEntryHunk;
|
||||
@@ -196,13 +194,7 @@ public class HunkActionFilter {
|
||||
for (int i = 0, size = children.size(); i < size; i ++) {
|
||||
ITree child = children.get(i);
|
||||
int type = child.getType();
|
||||
if (type == 6 || type == 10 || type == 12 || type == 17 || type == 18 || type == 19 || type == 21 || type == 8// Block, EmptyStatement
|
||||
|| type == 24 || type == 25 || type == 30 || type == 41 || type == 46 || type == 49 || type == 50
|
||||
|| type == 51 || type == 53 || type == 54 || type == 56 || type == 60 || type == 61 || type == 70) {
|
||||
//AssertStatement, BreakStatement, CatchClause, ConstructorInvocation, ContinueStatement, DoStatement
|
||||
// ExpressionStatement, ForStatement, IfStatement, LabeledStatement, ReturnStatement, SuperConstructorInvocation
|
||||
// SwitchCase, SwitchStatement, SynchronizedStatement, ThrowStatement, TryStatement
|
||||
// TypeDeclarationStatement, VariableDeclarationStatement, WhileStatement, EnhancedForStatement
|
||||
if (Checker.isStatement2(type)) {
|
||||
if ( i > 0) {
|
||||
child = children.get(i - 1);
|
||||
endPosition = child.getPos() + child.getLength();
|
||||
@@ -381,8 +373,6 @@ public class HunkActionFilter {
|
||||
for (Violation violation : violations) {
|
||||
this.unfixedViolations += "#NullMatchedGumTreeResult:" + revFile.getName() + ":" +violation.getStartLineNum() + ":" +
|
||||
violation.getEndLineNum() + ":" + violation.getViolationType() + "\n";
|
||||
System.err.println("#NullMatchedGumTreeResult:" + revFile.getName() + ":" +violation.getStartLineNum() + ":" +
|
||||
violation.getEndLineNum() + ":" + violation.getViolationType());
|
||||
}
|
||||
return selectedViolations;
|
||||
}
|
||||
@@ -391,79 +381,115 @@ public class HunkActionFilter {
|
||||
int violationStartLine = violation.getStartLineNum();
|
||||
int violationEndLine = violation.getEndLineNum();
|
||||
int bugHunkStartLine = violation.getBugStartLineNum();
|
||||
if (bugHunkStartLine == 0) {// Null source code matched for this violation.
|
||||
// String type = getType(violation);
|
||||
// continue;
|
||||
} else if (bugHunkStartLine == -1) {//
|
||||
specialVioaltionTypes(violation, actionSets, prevUnit, revUnit);
|
||||
// continue;
|
||||
} else {
|
||||
int bugHunkEndLine = violation.getBugEndLineNum();
|
||||
int fixHunkStartLine = violation.getFixStartLineNum();
|
||||
int fixHunkEndLine = violation.getFixEndLineNum();
|
||||
|
||||
for (HierarchicalActionSet actionSet : actionSets) {
|
||||
int actionBugStartLine = actionSet.getBugStartLineNum();
|
||||
if (actionBugStartLine == 0) {
|
||||
actionBugStartLine = setLineNumbers(actionSet, prevUnit, revUnit);
|
||||
}
|
||||
int actionBugEndLine = actionSet.getBugEndLineNum();
|
||||
int actionFixStartLine = actionSet.getFixStartLineNum();
|
||||
int actionFixEndLine = actionSet.getFixEndLineNum();
|
||||
|
||||
if (!specialVioaltionTypes(violation, actionSets, prevUnit, revUnit)) {
|
||||
if (bugHunkStartLine == 0) {// Null source code matched for this violation.
|
||||
// String type = getType(violation);
|
||||
} else if (bugHunkStartLine == -1) {//
|
||||
// specialVioaltionTypes(violation, actionSets, prevUnit, revUnit);
|
||||
} else {
|
||||
int bugHunkEndLine = violation.getBugEndLineNum();
|
||||
int fixHunkStartLine = violation.getFixStartLineNum();
|
||||
int fixHunkEndLine = violation.getFixEndLineNum();
|
||||
|
||||
String actionStr = actionSet.getActionString();
|
||||
if (actionStr.startsWith("INS")) {
|
||||
if (fixHunkStartLine <= actionFixStartLine && actionFixEndLine <= fixHunkEndLine) {
|
||||
if (actionBugStartLine != 0) {
|
||||
if (violationStartLine <= actionBugEndLine && violationEndLine >= actionBugStartLine) {
|
||||
for (HierarchicalActionSet actionSet : actionSets) {
|
||||
int actionBugStartLine = actionSet.getBugStartLineNum();
|
||||
if (actionBugStartLine == 0) {
|
||||
actionBugStartLine = setLineNumbers(actionSet, prevUnit, revUnit);
|
||||
}
|
||||
int actionBugEndLine = actionSet.getBugEndLineNum();
|
||||
int actionFixStartLine = actionSet.getFixStartLineNum();
|
||||
int actionFixEndLine = actionSet.getFixEndLineNum();
|
||||
|
||||
String actionStr = actionSet.getActionString();
|
||||
if (actionStr.startsWith("INS")) {
|
||||
if (fixHunkStartLine <= actionFixStartLine && actionFixEndLine <= fixHunkEndLine) {
|
||||
if (actionBugStartLine != 0) {
|
||||
if (violationStartLine <= actionBugEndLine && violationEndLine >= actionBugStartLine) {
|
||||
violation.getActionSets().add(actionSet);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// INS with MOV actions that are not identified in previous IF predicate, and pure INS actions
|
||||
if (violation.getBugFixStartLineNum() >= actionFixEndLine && actionFixStartLine <= violation.getBugFixEndLineNum()) {
|
||||
violation.getActionSets().add(actionSet);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// INS with MOV actions that are not identified in previous IF predicate, and pure INS actions
|
||||
if (violation.getBugFixStartLineNum() >= actionFixEndLine && actionFixStartLine <= violation.getBugFixEndLineNum()) {
|
||||
violation.getActionSets().add(actionSet);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (bugHunkStartLine <= actionBugStartLine && violationEndLine <= bugHunkEndLine) {
|
||||
if (violationStartLine <= actionBugEndLine && violationEndLine >= actionBugStartLine) {
|
||||
violation.getActionSets().add(actionSet);
|
||||
} else if (!actionStr.startsWith("MOV")){// ignore move actions.
|
||||
if (bugHunkStartLine <= actionBugStartLine && violationEndLine <= bugHunkEndLine) {
|
||||
if (violationStartLine <= actionBugEndLine && violationEndLine >= actionBugStartLine) {
|
||||
violation.getActionSets().add(actionSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (violation.getActionSets().size() > 0) {
|
||||
// FieldDeclaration: single insert, move, delete or update.
|
||||
// List<HierarchicalActionSet> matchedActionSets = filterActionSets(violation.getActionSets());
|
||||
// violation.getActionSets().clear();
|
||||
// violation.getActionSets().addAll(matchedActionSets);
|
||||
selectedViolations.add(violation);
|
||||
} else {
|
||||
this.unfixedViolations += "#NullMatchedGumTreeResult:" + revFile.getName() + ":" +violation.getStartLineNum() + ":" +
|
||||
violation.getEndLineNum() + ":" + violation.getViolationType() + "\n";
|
||||
System.err.println("#NullMatchedGumTreeResult:" + revFile.getName() + ":" +violation.getStartLineNum() + ":" +
|
||||
violation.getEndLineNum() + ":" + violation.getViolationType());
|
||||
}
|
||||
}
|
||||
return selectedViolations;
|
||||
}
|
||||
public String unfixedViolations = "";
|
||||
|
||||
private void specialVioaltionTypes(Violation violation, List<HierarchicalActionSet> actionSets, CompilationUnit prevUnit, CompilationUnit revUnit) {
|
||||
private boolean specialVioaltionTypes(Violation violation, List<HierarchicalActionSet> actionSets, CompilationUnit prevUnit, CompilationUnit revUnit) {
|
||||
String type = violation.getViolationType();
|
||||
if ("SE_NO_SUITABLE_CONSTRUCTOR".equals(type)) {// 158, 47
|
||||
|
||||
if ("NM_METHOD_NAMING_CONVENTION".equals(type) || "SE_NO_SUITABLE_CONSTRUCTOR_FOR_EXTERNALIZATION".equals(type)) {
|
||||
int startLine = violation.getStartLineNum();
|
||||
for (HierarchicalActionSet actionSet : actionSets) {
|
||||
int actionBugStartLine = actionSet.getBugStartLineNum();
|
||||
if (actionBugStartLine == 0) {
|
||||
actionBugStartLine = setLineNumbers(actionSet, prevUnit, revUnit);
|
||||
}
|
||||
if (actionSet.getActionString().startsWith("UPD MethodDeclaration@@")) {
|
||||
if (Math.abs(startLine - actionBugStartLine) <= 2) {
|
||||
violation.getActionSets().add(actionSet);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ("EQ_DOESNT_OVERRIDE_EQUALS".equals(type)) {
|
||||
for (HierarchicalActionSet actionSet : actionSets) {
|
||||
int actionBugStartLine = actionSet.getBugStartLineNum();
|
||||
if (actionBugStartLine == 0) {
|
||||
actionBugStartLine = setLineNumbers(actionSet, prevUnit, revUnit);
|
||||
}
|
||||
if (actionSet.getActionString().startsWith("INS MethodDeclaration@@MethodName:equals")) {
|
||||
violation.getActionSets().add(actionSet);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if ("HE_EQUALS_USE_HASHCODE".equals(type) || "HE_INHERITS_EQUALS_USE_HASHCODE".equals(type)) {
|
||||
for (HierarchicalActionSet actionSet : actionSets) {
|
||||
int actionBugStartLine = actionSet.getBugStartLineNum();
|
||||
if (actionBugStartLine == 0) {
|
||||
actionBugStartLine = setLineNumbers(actionSet, prevUnit, revUnit);
|
||||
}
|
||||
if (actionSet.getActionString().startsWith("INS MethodDeclaration@@MethodName:hashCode")) {
|
||||
violation.getActionSets().add(actionSet);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if ("SE_NO_SUITABLE_CONSTRUCTOR".equals(type) || "RI_REDUNDANT_INTERFACES".equals(type)) {
|
||||
int startLine = violation.getStartLineNum();
|
||||
for (HierarchicalActionSet actionSet : actionSets) {
|
||||
int actionBugStartLine = actionSet.getBugStartLineNum();
|
||||
if (actionBugStartLine == 0) {
|
||||
actionBugStartLine = setLineNumbers(actionSet, prevUnit, revUnit);
|
||||
}
|
||||
if (actionSet.getActionString().startsWith("UPD TypeDeclaration@@")) {
|
||||
violation.getActionSets().add(actionSet);
|
||||
break;
|
||||
if (Math.abs(startLine - actionBugStartLine) <= 2) {
|
||||
violation.getActionSets().add(actionSet);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ("CN_IDIOM".equals(type)) { // 202 23
|
||||
@@ -473,77 +499,38 @@ public class HunkActionFilter {
|
||||
if (actionBugStartLine == 0) {
|
||||
actionBugStartLine = setLineNumbers(actionSet, prevUnit, revUnit);
|
||||
}
|
||||
if (actionSet.getActionString().startsWith("INS MethodDeclaration@@clone")) {
|
||||
if (actionSet.getActionString().startsWith("INS MethodDeclaration@@MethodName:clone")) {
|
||||
// || actionSet.getActionString().startsWith("UPD MethodDeclaration@@clone")) {
|
||||
violation.getActionSets().add(actionSet);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if ("SE_NO_SERIALVERSIONID".equals(type)) {// 12 1960
|
||||
} else if ("SE_NO_SERIALVERSIONID".equals(type) || "SE_COMPARATOR_SHOULD_BE_SERIALIZABLE".equals(type)) {// 12 1960
|
||||
// change superclass or interface, add field or remove @SuppressWarnings("serial"), some are inner class
|
||||
for (HierarchicalActionSet actionSet : actionSets) {
|
||||
int actionBugStartLine = actionSet.getBugStartLineNum();
|
||||
if (actionBugStartLine == 0) {
|
||||
actionBugStartLine = setLineNumbers(actionSet, prevUnit, revUnit);
|
||||
}
|
||||
if (actionSet.getActionString().startsWith("UPD TypeDeclaration@")) {
|
||||
violation.getActionSets().add(actionSet);
|
||||
}
|
||||
if (actionSet.getActionString().startsWith("INS FieldDeclaration@") && actionSet.getNode().getLabel().contains("serialVersionUID")) {
|
||||
violation.getActionSets().add(actionSet);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if ("SE_NO_SUITABLE_CONSTRUCTOR_FOR_EXTERNALIZATION".equals(type)) { // 175 34
|
||||
// constructor
|
||||
for (HierarchicalActionSet actionSet : actionSets) {
|
||||
int actionBugStartLine = actionSet.getBugStartLineNum();
|
||||
if (actionBugStartLine == 0) {
|
||||
actionBugStartLine = setLineNumbers(actionSet, prevUnit, revUnit);
|
||||
}
|
||||
if (actionSet.getActionString().startsWith("UPD MethodDeclaration@@")) {
|
||||
violation.getActionSets().add(actionSet);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if ("SE_COMPARATOR_SHOULD_BE_SERIALIZABLE".equals(type)) { // 89 148
|
||||
//class, and add a field se...?
|
||||
for (HierarchicalActionSet actionSet : actionSets) {
|
||||
int actionBugStartLine = actionSet.getBugStartLineNum();
|
||||
if (actionBugStartLine == 0) {
|
||||
actionBugStartLine = setLineNumbers(actionSet, prevUnit, revUnit);
|
||||
}
|
||||
if (actionSet.getActionString().startsWith("UPD TypeDeclaration@")) {
|
||||
violation.getActionSets().add(actionSet);
|
||||
}
|
||||
if (actionSet.getActionString().startsWith("INS FieldDeclaration@") && actionSet.getNode().getLabel().contains("serialVersionUID")) {
|
||||
violation.getActionSets().add(actionSet);
|
||||
break;
|
||||
int startLine = violation.getStartLineNum();
|
||||
if (Math.abs(startLine - actionBugStartLine) <= 2) {
|
||||
violation.getActionSets().add(actionSet);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private List<HierarchicalActionSet> filterActionSets(List<HierarchicalActionSet> actionSets) {
|
||||
List<HierarchicalActionSet> matchedActionSets = new ArrayList<>();
|
||||
// find the update
|
||||
HierarchicalActionSet updateActionSet = null;
|
||||
for (HierarchicalActionSet actionSet : actionSets) {
|
||||
if (actionSet.getAction() instanceof Update) {
|
||||
updateActionSet = actionSet;
|
||||
}
|
||||
}
|
||||
|
||||
if (updateActionSet != null) {
|
||||
if (updateActionSet.getAstNodeType().equals("FieldDeclaration")) {
|
||||
matchedActionSets.clear();
|
||||
matchedActionSets.add(updateActionSet);
|
||||
return matchedActionSets;
|
||||
}
|
||||
}
|
||||
|
||||
return actionSets;
|
||||
}
|
||||
|
||||
private String getType(Violation violation) {
|
||||
String type = violation.getViolationType();
|
||||
switch (type) {
|
||||
@@ -703,33 +690,36 @@ public class HunkActionFilter {
|
||||
fixEndPosition = fixStartPosition + newNode.getLength();
|
||||
|
||||
String astNodeType = actionSet.getAstNodeType();
|
||||
if ("EnhancedForStatement".equals(astNodeType) || "ForStatement".equals(astNodeType)
|
||||
|| "DoStatement".equals(astNodeType) || "WhileStatement".equals(astNodeType)
|
||||
|| "LabeledStatement".equals(astNodeType) || "SynchronizedStatement".equals(astNodeType)
|
||||
|| "IfStatement".equals(astNodeType) || "TryStatement".equals(astNodeType)
|
||||
|| "MethodDeclaration".equals(astNodeType)) {
|
||||
// if (Checker.withBlockStatement(newNode.getType())) {
|
||||
//// List<ITree> children = update.getNode().getChildren();
|
||||
//// bugEndPosition = getEndPosition(children);
|
||||
//// List<ITree> newChildren = newNode.getChildren();
|
||||
//// fixEndPosition = getEndPosition(newChildren);
|
||||
// } else
|
||||
if ("TypeDeclaration".equals(astNodeType)) {
|
||||
bugEndPosition = getClassBodyStartPosition(update.getNode());
|
||||
fixEndPosition = getClassBodyStartPosition(newNode);
|
||||
} else if ("MethodDeclaration".equals(astNodeType)) {
|
||||
List<ITree> children = update.getNode().getChildren();
|
||||
bugEndPosition = getEndPosition(children);
|
||||
List<ITree> newChildren = newNode.getChildren();
|
||||
fixEndPosition = getEndPosition(newChildren);
|
||||
|
||||
if (bugEndPosition == 0) {
|
||||
bugEndPosition = bugStartPosition + actionSet.getLength();
|
||||
}
|
||||
if (fixEndPosition == 0) {
|
||||
fixEndPosition = fixStartPosition + newNode.getLength();
|
||||
}
|
||||
} else if ("TypeDeclaration".equals(astNodeType)) {
|
||||
bugEndPosition = getClassBodyStartPosition(update.getNode());
|
||||
fixEndPosition = getClassBodyStartPosition(newNode);
|
||||
|
||||
if (bugEndPosition == 0) {
|
||||
bugEndPosition = bugStartPosition + actionSet.getLength();
|
||||
}
|
||||
if (fixEndPosition == 0) {
|
||||
fixEndPosition = fixStartPosition + newNode.getLength();
|
||||
}
|
||||
}
|
||||
if (fixEndPosition == 0) {
|
||||
fixEndPosition = fixStartPosition + newNode.getLength();
|
||||
}
|
||||
} else if (actionStr.startsWith("DEL")) {
|
||||
ITree buggyTree = actionSet.getNode();
|
||||
int type = buggyTree.getType();
|
||||
if (type == 55) { // TypeDeclaration
|
||||
bugEndPosition = getClassBodyStartPosition(buggyTree);
|
||||
} else if (type == 31 || Checker.withBlockStatement(type)) {//MethodDeclaration && Block-Statements
|
||||
List<ITree> children = buggyTree.getChildren();
|
||||
bugEndPosition = getEndPosition(children);
|
||||
}
|
||||
}
|
||||
if (bugEndPosition == 0) {
|
||||
bugEndPosition = bugStartPosition + actionSet.getLength();
|
||||
}
|
||||
}
|
||||
actionBugStartLine = bugStartPosition == 0 ? 0 : prevUnit.getLineNumber(bugStartPosition);
|
||||
|
||||
@@ -139,11 +139,12 @@ public class SimplifyTree {
|
||||
// sourceCodeSimpleTree = originalSourceCodeTree(tree, null);
|
||||
// abstractIdentifierTree = abstractIdentifierTree(actionSet, tree, null);
|
||||
// abstractSimpleTree = semiSourceCodeTree(actionSet, tree, null);
|
||||
if (actionSet.getActionString().startsWith("UPD")) {
|
||||
simpleTree = canonicalizeSourceCodeTree(tree, null, bugEndPosition);
|
||||
} else {
|
||||
simpleTree = canonicalizeSourceCodeTree(tree, null);
|
||||
}
|
||||
// if (actionSet.getActionString().startsWith("UPD")) {
|
||||
// simpleTree = canonicalizeSourceCodeTree(tree, null, bugEndPosition);
|
||||
// } else {
|
||||
// simpleTree = canonicalizeSourceCodeTree(tree, null);
|
||||
// }
|
||||
simpleTree = canonicalizeSourceCodeTree(tree, null, bugEndPosition);
|
||||
}
|
||||
|
||||
actionSet.setAbstractSimpleTree(abstractSimpleTree);
|
||||
|
||||
@@ -4,38 +4,163 @@ import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Scanner;
|
||||
|
||||
import edu.lu.uni.serval.FixPatternParser.Tokenizer;
|
||||
import edu.lu.uni.serval.config.Configuration;
|
||||
import edu.lu.uni.serval.gumtree.regroup.SimpleTree;
|
||||
import edu.lu.uni.serval.utils.FileHelper;
|
||||
|
||||
public class ParseViolations {
|
||||
|
||||
private static final String OUTPUT_PATH = Configuration.ROOT_PATH + "LiveStudy/BugsInfo/";
|
||||
private static int i = 0;
|
||||
private static int j = 0;
|
||||
|
||||
public static void main(String[] args) {
|
||||
ParseViolations parser = new ParseViolations();
|
||||
|
||||
String violationFile = Configuration.ROOT_PATH + "LiveStudy/violations.list";
|
||||
Map<String, Violation> violations = new HashMap<>();
|
||||
violations = parser.readViolations(violationFile);
|
||||
|
||||
// output path
|
||||
// FileHelper.deleteDirectory(OUTPUT_PATH);
|
||||
List<String> projects = new ArrayList<>();
|
||||
File[] files = new File(OUTPUT_PATH).listFiles();
|
||||
for (File file : files) {
|
||||
if (file.isDirectory()) {
|
||||
projects.add(file.getName());
|
||||
}
|
||||
}
|
||||
String projectsPath = Configuration.ROOT_PATH + "LiveStudy/projects/";
|
||||
parser.parseViolationToTokens(violations, projectsPath);
|
||||
|
||||
String bugsListPath = Configuration.ROOT_PATH + "LiveStudy/BugsList/";
|
||||
List<File> bugsListFiles = FileHelper.getAllFiles(bugsListPath, ".list");
|
||||
for (File bugsListFile : bugsListFiles) {
|
||||
String fileName = FileHelper.getFileNameWithoutExtension(bugsListFile);
|
||||
if (projects.contains(fileName)) continue;
|
||||
ParseViolations parser = new ParseViolations();
|
||||
Map<String, Violation> violations = new HashMap<>(); // <ProjectName, Violations>, Violation: <projectName, List<Alarm>>.
|
||||
violations = parser.readViolations(bugsListFile);
|
||||
parser.parseViolationToTokens(violations, projectsPath);
|
||||
}
|
||||
|
||||
System.out.println(i);
|
||||
System.out.println(j);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the source code tokens of all violation instances by visiting each java project.
|
||||
*
|
||||
* @param violations
|
||||
* @param projectsPath
|
||||
*/
|
||||
public void parseViolationToTokens(Map<String, Violation> violations, String projectsPath) {
|
||||
for (Map.Entry<String, Violation> entry : violations.entrySet()) {
|
||||
String projectName = entry.getKey();
|
||||
List<Alarm> alarms = entry.getValue().getAlarms();
|
||||
List<File> javaFiles = FileHelper.getAllFiles(projectsPath + projectName, ".java");
|
||||
|
||||
//Each violation: commons-math : DLS_DEAD_LOCAL_STORE : org/apache/commons/math4/dfp/Dfp.java : 2049 : 2049
|
||||
/**
|
||||
* @ProjectName
|
||||
* @ViolationType
|
||||
* @FileName
|
||||
* @LineNumber
|
||||
* @SourceCode
|
||||
* @Tokens
|
||||
* @NumberOfTokens
|
||||
*/
|
||||
// sizes file, tokens file, and bugs-info file
|
||||
StringBuilder sizesBuilder = new StringBuilder();
|
||||
StringBuilder tokensBuilder = new StringBuilder();
|
||||
StringBuilder bugsInfoBuilder = new StringBuilder();
|
||||
for (Alarm alarm : alarms) {
|
||||
String fileName = alarm.getFileName();
|
||||
// if (fileName.toLowerCase(Locale.ENGLISH).contains("test")) continue;
|
||||
|
||||
File sourceCodeFile = locateSourceCodeFile(javaFiles, fileName);
|
||||
if (sourceCodeFile == null) {
|
||||
j ++;
|
||||
continue;
|
||||
}
|
||||
|
||||
Parser parser = new Parser(alarm, sourceCodeFile);
|
||||
parser.parse();
|
||||
SimpleTree simpleTree = parser.getSimpleTree();
|
||||
|
||||
if (simpleTree != null) {
|
||||
int finalStartLine = parser.getFinalStartLine();
|
||||
int finalEndLine = parser.getFinalEndLine();
|
||||
String violationType = alarm.getAlarmType();
|
||||
|
||||
String tokens = Tokenizer.getTokensDeepFirst(simpleTree);
|
||||
String[] tokensArray = tokens.split(" ");
|
||||
int length = tokensArray.length;
|
||||
StringBuilder sourceCode = readSourceCode(sourceCodeFile, finalStartLine, finalEndLine);
|
||||
|
||||
sizesBuilder.append(length).append("\n");
|
||||
tokensBuilder.append(tokens).append("\n");
|
||||
bugsInfoBuilder.append("###BugInstance###\n##Info:");
|
||||
bugsInfoBuilder.append(violationType).append(":");
|
||||
bugsInfoBuilder.append(projectName).append(":");
|
||||
bugsInfoBuilder.append(fileName).append(":");
|
||||
bugsInfoBuilder.append(finalStartLine).append(":");
|
||||
bugsInfoBuilder.append(finalEndLine).append("\n");
|
||||
bugsInfoBuilder.append(sourceCode).append("\n");
|
||||
i ++;
|
||||
} else {
|
||||
j ++;
|
||||
}
|
||||
}
|
||||
|
||||
FileHelper.outputToFile(OUTPUT_PATH + "sizes.list", sizesBuilder, true);
|
||||
FileHelper.outputToFile(OUTPUT_PATH + "tokens.list", tokensBuilder, true);
|
||||
FileHelper.outputToFile(OUTPUT_PATH + "bugsInfo.list", bugsInfoBuilder, true);
|
||||
}
|
||||
}
|
||||
|
||||
private StringBuilder readSourceCode(File javaFile, int startLine, int endLine) {
|
||||
StringBuilder sourceCode = new StringBuilder("##Source_Code:\n");
|
||||
FileInputStream fis = null;
|
||||
Scanner scanner = null;
|
||||
|
||||
try {
|
||||
fis = new FileInputStream(javaFile);
|
||||
scanner = new Scanner(fis);
|
||||
int counter = 0;
|
||||
while (scanner.hasNextLine()) {
|
||||
String line = scanner.nextLine();
|
||||
counter ++;
|
||||
if (startLine <= counter && counter <= endLine) {
|
||||
sourceCode.append(line + "\n");
|
||||
}
|
||||
if (counter == endLine) break;
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
scanner.close();
|
||||
fis.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
return sourceCode;
|
||||
}
|
||||
|
||||
private File locateSourceCodeFile(List<File> javaFiles, String fileName) {
|
||||
for (File javaFile : javaFiles) {
|
||||
if (javaFile.getPath().endsWith(fileName)) return javaFile;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Map<String, Violation> readViolations(String violationFile) {
|
||||
return readViolations(new File(violationFile));
|
||||
}
|
||||
|
||||
public Map<String, Violation> readViolations(File violationFile) {
|
||||
Map<String, Violation> violations = new HashMap<>();
|
||||
|
||||
FileInputStream fis = null;
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package edu.lu.uni.serval.livestudy;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.github.gumtreediff.tree.ITree;
|
||||
|
||||
import edu.lu.uni.serval.gumtree.regroup.SimpleTree;
|
||||
import edu.lu.uni.serval.gumtree.regroup.SimplifyTree;
|
||||
import edu.lu.uni.serval.violation.code.parser.ViolationSourceCodeTree;
|
||||
|
||||
public class Parser {
|
||||
// input
|
||||
private Alarm alarm;
|
||||
private File sourceCodeFile;
|
||||
|
||||
// output
|
||||
private int finalStartLine = 0;
|
||||
private int finalEndLine = 0;
|
||||
private SimpleTree simpleTree = null;
|
||||
|
||||
public Parser(Alarm alarm, File sourceCodeFile) {
|
||||
this.alarm = alarm;
|
||||
this.sourceCodeFile = sourceCodeFile;
|
||||
}
|
||||
|
||||
public int getFinalStartLine() {
|
||||
return finalStartLine;
|
||||
}
|
||||
|
||||
public int getFinalEndLine() {
|
||||
return finalEndLine;
|
||||
}
|
||||
|
||||
public SimpleTree getSimpleTree() {
|
||||
return simpleTree;
|
||||
}
|
||||
|
||||
public void parse() {
|
||||
int startLine = this.alarm.getStartLine();
|
||||
int endLine = this.alarm.getEndLine();
|
||||
|
||||
String violationType = this.alarm.getAlarmType();
|
||||
|
||||
ViolationSourceCodeTree treeParser = new ViolationSourceCodeTree(this.sourceCodeFile, startLine, endLine);
|
||||
|
||||
if ("EQ_DOESNT_OVERRIDE_EQUALS".equals(violationType)|| "HE_EQUALS_USE_HASHCODE".equals(violationType)
|
||||
|| "HE_INHERITS_EQUALS_USE_HASHCODE".equals(violationType)|| "SE_NO_SUITABLE_CONSTRUCTOR".equals(violationType)
|
||||
|| "RI_REDUNDANT_INTERFACES".equals(violationType) || "CN_IDIOM".equals(violationType)
|
||||
|| "SE_NO_SERIALVERSIONID".equals(violationType) || "SE_COMPARATOR_SHOULD_BE_SERIALIZABLE".equals(violationType)) {
|
||||
// Class name level, tokens
|
||||
// classStartP <= vS <= vE <= classEndP
|
||||
ITree classNameTree = treeParser.getClassNameTokens();
|
||||
if (classNameTree != null) {
|
||||
this.simpleTree = new SimplifyTree().canonicalizeSourceCodeTree(classNameTree, null);
|
||||
} else {
|
||||
System.err.println("#Null_Violation_Hunk: " + this.alarm.getAlarmType() + ":" + this.sourceCodeFile.getPath() + ":" + startLine + ":" + endLine);
|
||||
}
|
||||
} else {
|
||||
treeParser.extract();
|
||||
List<ITree> matchedTrees = treeParser.getViolationSourceCodeTrees();
|
||||
if (matchedTrees.size() == 0) {
|
||||
System.err.println("#Null_Violation_Hunk: " + this.alarm.getAlarmType() + ":" + this.sourceCodeFile.getPath() + ":" + startLine + ":" + endLine);
|
||||
} else {
|
||||
this.simpleTree = new SimpleTree();
|
||||
this.simpleTree.setLabel("Block");
|
||||
this.simpleTree.setNodeType("Block");
|
||||
List<SimpleTree> children = new ArrayList<>();
|
||||
for (ITree matchedTree : matchedTrees) {
|
||||
SimpleTree simpleT = new SimplifyTree().canonicalizeSourceCodeTree(matchedTree, this.simpleTree);
|
||||
children.add(simpleT);
|
||||
}
|
||||
this.simpleTree.setChildren(children);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.simpleTree != null) {
|
||||
this.finalStartLine = treeParser.getViolationFinalStartLine();
|
||||
this.finalEndLine = treeParser.getViolationFinalEndLine();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
## Parse the violations of Live Study ##
|
||||
|
||||
1. Localize bugs with FindBugs.
|
||||
2. Parse results of FindBugs. (bug-type project.)
|
||||
|
||||
3. Parse source code of violations. (ParseViolation.java)
|
||||
@@ -0,0 +1,19 @@
|
||||
package edu.lu.uni.serval.livestudy;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import edu.lu.uni.serval.config.Configuration;
|
||||
import edu.lu.uni.serval.utils.FileHelper;
|
||||
|
||||
public class Test {
|
||||
public static void main(String[] argus) {
|
||||
List<File> files = FileHelper.getAllFiles(Configuration.ROOT_PATH + "LiveStudy/projects/camel/", ".java");
|
||||
for (File file : files ) {
|
||||
// if (file.getPath().endsWith("/ItemList.java")) {
|
||||
// System.out.println(file.getPath());
|
||||
// }
|
||||
FileHelper.outputToFile("OUTPUT/camel.test", file.getPath() + "\n", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package edu.lu.uni.serval.statistics;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import edu.lu.uni.serval.config.Configuration;
|
||||
import edu.lu.uni.serval.utils.FileHelper;
|
||||
|
||||
public class Categories {
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
String content = FileHelper.readFile(Configuration.ROOT_PATH + "RQ1/Quantity-per-V-Type.csv");
|
||||
BufferedReader reader = new BufferedReader(new StringReader(content));
|
||||
String line = reader.readLine();
|
||||
int counter = 0;
|
||||
// int size = 400;
|
||||
Map<String, Integer> map = new HashMap<>();
|
||||
map.put("Dodgy code", 0);
|
||||
map.put("Experimental", 0);
|
||||
map.put("Internationalization", 0);
|
||||
map.put("Multithreaded correctness", 0);
|
||||
map.put("Malicious code vulnerability", 0);
|
||||
map.put("Performance", 0);
|
||||
map.put("Correctness", 0);
|
||||
map.put("Security", 0);
|
||||
map.put("Bad practice", 0);
|
||||
map.put("Other", 0);
|
||||
// List<Integer> list = new ArrayList<>();
|
||||
Map<String, List<Integer>> map2 = new HashMap<>();
|
||||
map2.put("Dodgy code", new ArrayList<Integer>());
|
||||
map2.put("Experimental", new ArrayList<Integer>());
|
||||
map2.put("Internationalization", new ArrayList<Integer>());
|
||||
map2.put("Multithreaded correctness", new ArrayList<Integer>());
|
||||
map2.put("Malicious code vulnerability", new ArrayList<Integer>());
|
||||
map2.put("Performance", new ArrayList<Integer>());
|
||||
map2.put("Correctness", new ArrayList<Integer>());
|
||||
map2.put("Security", new ArrayList<Integer>());
|
||||
map2.put("Bad practice", new ArrayList<Integer>());
|
||||
map2.put("Other", new ArrayList<Integer>());
|
||||
while ((line = reader.readLine()) != null) {
|
||||
String type = line.substring(line.lastIndexOf(",") + 1);
|
||||
counter ++;
|
||||
if (map.containsKey(type)) {
|
||||
map.put(type, map.get(type) + 1);
|
||||
} else {
|
||||
map.put(type, 1);
|
||||
}
|
||||
if (counter % 10 == 0) {
|
||||
for (Map.Entry<String, List<Integer>> entry : map2.entrySet()) {
|
||||
String type2 = entry.getKey();
|
||||
Integer integ = map.get(type2);
|
||||
if (integ == null) {
|
||||
map2.get(type2).add(0);
|
||||
} else {
|
||||
map2.get(type2).add(integ);
|
||||
}
|
||||
}
|
||||
// System.out.println();
|
||||
}
|
||||
}
|
||||
reader.close();
|
||||
for (Map.Entry<String, Integer> entry : map.entrySet()) {
|
||||
System.out.println(entry.getKey() + "," + entry.getValue());
|
||||
}
|
||||
for (Map.Entry<String, List<Integer>> entry : map2.entrySet()) {
|
||||
System.out.println(entry.getKey() + "," + entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package edu.lu.uni.serval.statistics;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Scanner;
|
||||
|
||||
import edu.lu.uni.serval.config.Configuration;
|
||||
import edu.lu.uni.serval.utils.FileHelper;
|
||||
|
||||
public class FixedVilations {
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
// projectName,ViolationType,Number.
|
||||
FileInputStream fis = new FileInputStream(Configuration.ROOT_PATH + "RQ1/fixed-alarms-v1.0.list");
|
||||
Scanner scanner = new Scanner(fis);
|
||||
Map<String, Integer> map = new HashMap<>();
|
||||
int counter = 0;
|
||||
while (scanner.hasNextLine()) {
|
||||
String line = scanner.nextLine();
|
||||
String[] elements = line.split(":");
|
||||
// String violationType = elements[0];
|
||||
// String projectName = elements[1];
|
||||
String key = elements[1] + "," + elements[0];
|
||||
if (map.containsKey(key)) {
|
||||
map.put(key, map.get(key)+ 1);
|
||||
} else {
|
||||
map.put(key, 1);
|
||||
}
|
||||
counter ++;
|
||||
}
|
||||
|
||||
scanner.close();
|
||||
fis.close();
|
||||
|
||||
System.out.println(counter);
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (Map.Entry<String, Integer> entry : map.entrySet()) {
|
||||
builder.append(entry.getKey()).append(",").append(entry.getValue()).append("\n");
|
||||
counter -= entry.getValue();
|
||||
}
|
||||
FileHelper.outputToFile(Configuration.ROOT_PATH + "RQ1/fixedViolations-v-1.0.csv", builder, false);
|
||||
System.out.println(counter);
|
||||
}
|
||||
|
||||
}
|
||||
+32
-7
@@ -1,25 +1,34 @@
|
||||
package edu.lu.uni.serval.violation.hunksize;
|
||||
package edu.lu.uni.serval.statistics;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import edu.lu.uni.serval.config.Configuration;
|
||||
import edu.lu.uni.serval.utils.FileHelper;
|
||||
import edu.lu.uni.serval.utils.ListSorter;
|
||||
|
||||
public class HunkSizeComputer {
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
String unfixedAlarmFile = "Dataset/Unfixed-Alarms/";
|
||||
|
||||
List<File> unfixedAlarmFiles = FileHelper.getAllFilesInCurrentDiectory(unfixedAlarmFile, ".csv");
|
||||
String violationsFilePath = Configuration.ROOT_PATH + "unFixedInstances/";
|
||||
sizes(violationsFilePath, ".list");
|
||||
}
|
||||
|
||||
public static void sizes(String filePath, String fileType) throws NumberFormatException, IOException {
|
||||
List<File> unfixedAlarmFiles = FileHelper.getAllFilesInCurrentDiectory(filePath, fileType);
|
||||
System.out.println(unfixedAlarmFiles.size());
|
||||
StringBuilder builder = new StringBuilder();
|
||||
int counter = 0;
|
||||
int size = 0;
|
||||
int i = 0;
|
||||
List<Integer> sizes = new ArrayList<>();
|
||||
Map<Integer, Integer> map = new HashMap<>();// <size, amount>
|
||||
for (File file : unfixedAlarmFiles) {
|
||||
String content = FileHelper.readFile(file);
|
||||
BufferedReader reader = new BufferedReader(new StringReader(content));
|
||||
@@ -28,7 +37,7 @@ public class HunkSizeComputer {
|
||||
String[] elements = line.split(",");
|
||||
int startLine = Integer.parseInt(elements[4]);
|
||||
int endLine = Integer.parseInt(elements[5]);
|
||||
|
||||
i ++;
|
||||
if (startLine == -1 || endLine == -1) continue;
|
||||
|
||||
int range = endLine - startLine + 1;
|
||||
@@ -38,9 +47,15 @@ public class HunkSizeComputer {
|
||||
}
|
||||
size ++;
|
||||
sizes.add(range);
|
||||
if (map.containsKey(range)) {
|
||||
map.put(range, map.get(range) + 1);
|
||||
} else {
|
||||
map.put(range, 1);
|
||||
}
|
||||
}
|
||||
reader.close();
|
||||
}
|
||||
System.out.println(i);
|
||||
|
||||
String content = FileHelper.readFile("Dataset/fixed-alarms-v1.0.list");
|
||||
BufferedReader reader = new BufferedReader(new StringReader(content));
|
||||
@@ -62,6 +77,11 @@ public class HunkSizeComputer {
|
||||
builder.append(range + "\n");
|
||||
size ++;
|
||||
sizes.add(range);
|
||||
if (map.containsKey(range)) {
|
||||
map.put(range, map.get(range) + 1);
|
||||
} else {
|
||||
map.put(range, 1);
|
||||
}
|
||||
}
|
||||
reader.close();
|
||||
|
||||
@@ -69,13 +89,18 @@ public class HunkSizeComputer {
|
||||
|
||||
System.out.println(size);
|
||||
System.out.println(counter);
|
||||
System.out.println(sizes.size());
|
||||
ListSorter<Integer> sorter = new ListSorter<>(sizes);
|
||||
sizes = sorter.sortAscending();
|
||||
System.out.println(sizes.get((int) (sizes.size() * 0.7)));
|
||||
System.out.println(sizes.get((int) (sizes.size() * 0.8)));
|
||||
System.out.println(sizes.get((int) (sizes.size() * 0.9)));
|
||||
System.out.println(sizes.get((int) (sizes.size() * 0.95)));
|
||||
|
||||
int sum = 0;
|
||||
for (i = 1; i <= 100; i ++) {
|
||||
sum += map.get(i);
|
||||
System.out.println(i + "," + String.format("%.2f", ((double) sum / size * 100)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package edu.lu.uni.serval.statistics;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Scanner;
|
||||
|
||||
import edu.lu.uni.serval.config.Configuration;
|
||||
import edu.lu.uni.serval.utils.FileHelper;
|
||||
|
||||
/**
|
||||
* Statistics of files and code lines of projects in Live Study.
|
||||
*
|
||||
* @author kui.liu
|
||||
*
|
||||
*/
|
||||
public class NumberOfFilesAndCodeLines {
|
||||
|
||||
public static void main(String[] args) {
|
||||
// String projectsPath = Configuration.ROOT_PATH + "LiveStudy/BugsInfo/";
|
||||
// File[] projects = new File(projectsPath).listFiles();
|
||||
// for (File project : projects) {
|
||||
// if (project.isDirectory()) {
|
||||
// new NumberOfFilesAndCodeLines().statistic(project.getName());
|
||||
// }
|
||||
// }
|
||||
for (int i = 1; i <= 50; i ++) {
|
||||
System.out.print(" & " + i);
|
||||
}
|
||||
}
|
||||
|
||||
public void statistic(String project) {
|
||||
List<File> javaFiles = FileHelper.getAllFiles(Configuration.ROOT_PATH + "LiveStudy/projects/" + project, ".java");
|
||||
int numberOfFiles = 0;
|
||||
int LOC = 0;
|
||||
for (File javaFile : javaFiles) {
|
||||
if (!javaFile.getPath().toLowerCase(Locale.ENGLISH).contains("test")) {
|
||||
numberOfFiles ++;
|
||||
LOC += readLinesOfCode(javaFile);
|
||||
}
|
||||
// numberOfFiles ++;
|
||||
// LOC += readLinesOfCode(javaFile);
|
||||
}
|
||||
System.out.println(project + " : Files = " + numberOfFiles + ", LOC = " + LOC);
|
||||
}
|
||||
|
||||
private int readLinesOfCode(File javaFile) {
|
||||
int LOC = 0;
|
||||
Scanner scanner = null;
|
||||
FileInputStream fis = null;
|
||||
try {
|
||||
fis = new FileInputStream(javaFile);
|
||||
scanner = new Scanner(fis);
|
||||
|
||||
while (scanner.hasNextLine()) {
|
||||
scanner.nextLine();
|
||||
LOC ++;
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
scanner.close();
|
||||
fis.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
return LOC;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -50,8 +50,13 @@ public class Statistic {
|
||||
*/
|
||||
// statistics("../FPM_Violations/RQ1/all-leafnodes-per-project-vtype.csv", "");
|
||||
// statistics("../FPM_Violations/RQ1/distinct-fixed-summary-per-project-vtype.csv", "Fixed");
|
||||
statistics("../FPM_Violations/RQ1/fixedViolations-v-1.0.csv", "Fixed_1.0");
|
||||
// fixedVSunfixed();
|
||||
|
||||
statisticsOfFixedViolations();
|
||||
}
|
||||
|
||||
public static void statisticsOfFixedViolations() {
|
||||
String statistic = "../FPM_Violations/OUTPUT";
|
||||
List<File> files = FileHelper.getAllFiles(statistic, ".list");
|
||||
|
||||
@@ -123,7 +128,6 @@ public class Statistic {
|
||||
String content = FileHelper.readFile(file);
|
||||
BufferedReader reader = new BufferedReader(new StringReader(content));
|
||||
String line = null;
|
||||
i ++;
|
||||
try {
|
||||
while ((line = reader.readLine()) != null) {
|
||||
// types1
|
||||
@@ -197,37 +201,38 @@ public class Statistic {
|
||||
System.out.println("NullSourceCode: " + nullSourceCode + " :: " + types.get("#NullSourceCode") + " :: " + types1.get("#NullSourceCode"));
|
||||
System.out.println("Timeout: " + timeout + " :: " + types.get("#Timeout") + " :: " + types1.get("#Timeout"));
|
||||
System.out.println("TestingInfo: " + TestingInfo + " :: " + types.get("#TestingInfo") + " :: " + types1.get("#TestingInfo"));
|
||||
System.out.println("A: " + (positions + testAlarms + timeout));
|
||||
System.out.println("B: " + (numV + testAlarms + timeout));
|
||||
// System.out.println("A: " + (positions + testAlarms + timeout));
|
||||
// System.out.println("B: " + (numV + testAlarms + timeout));
|
||||
System.out.println(testAlarms + nullGumTreeResults + noSourceCodeChagnes + noStatementChanges +
|
||||
nullDiffentry + nullMappingGumTreeResults + largeHunk + nullSourceCode + timeout + TestingInfo);
|
||||
nullDiffentry + nullMappingGumTreeResults + nullSourceCode + timeout + TestingInfo);
|
||||
System.out.println(nullGumTreeResults + noSourceCodeChagnes + noStatementChanges +
|
||||
nullDiffentry + nullMappingGumTreeResults + largeHunk + nullSourceCode + TestingInfo);
|
||||
nullDiffentry + nullMappingGumTreeResults + nullSourceCode + TestingInfo);
|
||||
System.out.println(testAlarms + timeout);
|
||||
// System.out.println(sum);
|
||||
// System.out.println(sum2);
|
||||
System.out.println(sum3);
|
||||
System.out.println(sum4);
|
||||
/*30717 56630 1580, 88927
|
||||
System.out.println(types1);
|
||||
/*32690 56237 ,, 88927 31782
|
||||
* Statistics:
|
||||
|
||||
TestViolation: 4682 :: null :: null
|
||||
NullGumTreeResults: 0 :: null :: null
|
||||
NoSourceCodeChange: 7010 :: null :: 7010
|
||||
NoStatementChange: 0 :: null :: null
|
||||
NullDiffEntry: 7100 :: null :: 7100
|
||||
NullMatchedGumTreeResult: 25336 :: null :: 25336
|
||||
PureDeletion: 18238 :: null :: 18238
|
||||
LargeHunk: 12502 :: null :: 12502
|
||||
NullSourceCode: 0 :: null :: null
|
||||
NoSourceCodeChange: 7010 :: null :: 6984
|
||||
NoStatementChange: 163 :: null :: 163
|
||||
NullDiffEntry: 6943 :: null :: 6943
|
||||
NullMatchedGumTreeResult: 25747 :: null :: 25747
|
||||
PureDeletion: 10815 :: null :: 10815
|
||||
LargeHunk: 6318 :: null :: 6318
|
||||
NullSourceCode: 1025 :: null :: 1025
|
||||
Timeout: 0 :: null :: null
|
||||
TestingInfo: 9071 :: null :: 9071
|
||||
A: 88927
|
||||
B: 88927
|
||||
63759
|
||||
59077
|
||||
TestingInfo: 0 :: null :: null
|
||||
A: 4682
|
||||
B: 4682
|
||||
51888
|
||||
47206
|
||||
4682
|
||||
59077
|
||||
47180
|
||||
0
|
||||
*/
|
||||
}
|
||||
@@ -239,6 +244,7 @@ B: 88927
|
||||
Map<String, Integer> violationTypesMap = new HashMap<>();
|
||||
Map<String, Integer> projectsMap = new HashMap<>();
|
||||
Map<String, Integer> perVperProjMap = new HashMap<>();
|
||||
Map<String, List<String>> perVProjs = new HashMap<>();
|
||||
Map<String, List<String>> widespreadViolationsMap = new HashMap<>();
|
||||
|
||||
while (scanner.hasNextLine()) {
|
||||
@@ -262,6 +268,14 @@ B: 88927
|
||||
projectList.add(projectName);
|
||||
widespreadViolationsMap.put(violationType, projectList);
|
||||
}
|
||||
|
||||
if (perVProjs.containsKey(violationType)) {
|
||||
perVProjs.get(violationType).add(projectName);
|
||||
} else {
|
||||
List<String> projs = new ArrayList<>();
|
||||
projs.add(projectName);
|
||||
perVProjs.put(violationType, projs);
|
||||
}
|
||||
}
|
||||
|
||||
scanner.close();
|
||||
@@ -316,6 +330,8 @@ B: 88927
|
||||
List<String> sortedViolationTypes = new ArrayList<>();
|
||||
|
||||
Map<String, Integer> quantityOfCategory = new HashMap<>();
|
||||
Map<String, List<String>> violationTypesOfCategory = new HashMap<>();
|
||||
Map<String, List<String>> projectsOfCategory = new HashMap<>();
|
||||
StringBuilder violationsBuilder = new StringBuilder("Type,Identifier,Quantity,Widespread,Category\n");
|
||||
int identifier = 0;
|
||||
for (Map.Entry<String, Integer> entry : violationTypesMap.entrySet()) {
|
||||
@@ -335,6 +351,29 @@ B: 88927
|
||||
quantityOfCategory.put(category, quantity);
|
||||
}
|
||||
|
||||
if (violationTypesOfCategory.containsKey(category)) {
|
||||
List<String> violationTypes = violationTypesOfCategory.get(category);
|
||||
if (!violationTypes.contains(violationType)) {
|
||||
violationTypes.add(violationType);
|
||||
}
|
||||
} else {
|
||||
List<String> violationTypes = new ArrayList<>();
|
||||
violationTypes.add(violationType);
|
||||
violationTypesOfCategory.put(category, violationTypes);
|
||||
}
|
||||
|
||||
if (projectsOfCategory.containsKey(category)) {
|
||||
List<String> projs = projectsOfCategory.get(category);
|
||||
List<String> projs2 = perVProjs.get(violationType);
|
||||
for (String proj : projs2) {
|
||||
if (!projs.contains(proj)) {
|
||||
projs.add(proj);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
projectsOfCategory.put(category, perVProjs.get(violationType));
|
||||
}
|
||||
|
||||
sortedViolationTypes.add(violationType);
|
||||
}
|
||||
FileHelper.outputToFile("../FPM_Violations/RQ1/Quantity-per-" + type + "V-Type.csv", violationsBuilder, false);
|
||||
@@ -348,9 +387,10 @@ B: 88927
|
||||
}
|
||||
FileHelper.outputToFile("../FPM_Violations/RQ1/Quantity-per-" + type + "Proj.csv", pBuilder, false);
|
||||
|
||||
StringBuilder categoryBuilder = new StringBuilder("Category,Quantity\n");
|
||||
StringBuilder categoryBuilder = new StringBuilder("Category,Quantity,Types,Projects\n");
|
||||
for (Map.Entry<String, Integer> entry : quantityOfCategory.entrySet()) {
|
||||
categoryBuilder.append(entry.getKey() + "," + entry.getValue() + "\n");
|
||||
String key = entry.getKey();
|
||||
categoryBuilder.append(key + "," + entry.getValue() + "," + violationTypesOfCategory.get(key).size() + "," + projectsOfCategory.get(key).size() + "\n");
|
||||
}
|
||||
FileHelper.outputToFile("../FPM_Violations/RQ1/Quantity-per-" + type + "Category.csv", categoryBuilder, false);
|
||||
|
||||
@@ -390,6 +430,8 @@ B: 88927
|
||||
StringBuilder ssbuilder = new StringBuilder("Type, Identifier, Quantity, Category\n");
|
||||
Map<String, Integer> perTypePerProj = new HashMap<>();
|
||||
Map<String, List<String>> categoryProjects = new HashMap<>();
|
||||
|
||||
List<String> others = new ArrayList<>();
|
||||
for (int j = 0; j < sortedViolationTypes.size(); j ++) {
|
||||
String violationType = sortedViolationTypes.get(j);
|
||||
List<Integer> projs = new ArrayList<>();
|
||||
@@ -403,6 +445,9 @@ B: 88927
|
||||
String category = categories.get(violationType);
|
||||
if (category == null || category.equals("null")) {
|
||||
category = "Other";
|
||||
if (!others.contains(violationType)) {
|
||||
others.add(violationType);
|
||||
}
|
||||
}
|
||||
ssbuilder.append(violationType + "," + (j + 1) + "," + value + "," + category + "\n");
|
||||
|
||||
@@ -420,12 +465,13 @@ B: 88927
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ListSorter<Integer> sorter2 = new ListSorter<Integer>(projs);
|
||||
projs = sorter2.sortAscending();
|
||||
int index = projs.size() % 2 == 0 ? projs.size() / 2 - 1 : projs.size() / 2;
|
||||
perTypePerProj.put(violationType, projs.get(index));
|
||||
}
|
||||
|
||||
System.out.println(others);
|
||||
|
||||
for (Map.Entry<String, List<String>> entry : categoryVList.entrySet()) {
|
||||
System.out.println(entry.getKey() + ":" + entry.getValue().size() + ":" + categoryProjects.get(entry.getKey()).size());
|
||||
|
||||
@@ -11,21 +11,32 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Scanner;
|
||||
|
||||
import edu.lu.uni.serval.config.Configuration;
|
||||
import edu.lu.uni.serval.diffentry.DiffEntryHunk;
|
||||
import edu.lu.uni.serval.diffentry.DiffEntryReader;
|
||||
import edu.lu.uni.serval.utils.FileHelper;
|
||||
import edu.lu.uni.serval.utils.ListSorter;
|
||||
|
||||
public class Test {
|
||||
/**
|
||||
* Commons-lang: 54. PZLA_PREFER_ZERO_LENGTH_ARRAYS
|
||||
* commons-lang: 1, 4, 5 ES_COMPARING_PARAMETER_STRING_WITH_EQ
|
||||
* @param args
|
||||
* @throws IOException
|
||||
*/
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
boolean b1 = false;
|
||||
boolean b2 = false;
|
||||
System.out.println(!b1 || b2 && b1);
|
||||
System.out.println(b2 && b1);
|
||||
// testV1();
|
||||
// testV2();
|
||||
testV3("../FPM_Violations/OAR.FPM.4222306.stderr", "OUTPUT/unparsedviolations.txt");
|
||||
// testV3("../FPM_Violations/OAR.FPM.4225346.stderr", "OUTPUT/unparsedviolations.txt");
|
||||
// testV4("../FPM_Violations/OAR.FPM.4222208.stderr");
|
||||
}
|
||||
|
||||
private static void testV4(String inputFile) throws IOException {
|
||||
public static void testV4(String inputFile) throws IOException {
|
||||
FileInputStream fis = new FileInputStream(inputFile);
|
||||
Scanner scanner = new Scanner(fis);
|
||||
StringBuilder builder = new StringBuilder();
|
||||
@@ -79,7 +90,7 @@ public class Test {
|
||||
FileHelper.outputToFile("Dataset/a.txt", builder, false);
|
||||
}
|
||||
|
||||
private static void testV3(String inputFile, String outputFile) throws IOException {
|
||||
public static void testV3(String inputFile, String outputFile) throws IOException {
|
||||
FileInputStream fis = new FileInputStream(inputFile);
|
||||
Scanner scanner = new Scanner(fis);
|
||||
|
||||
@@ -107,11 +118,17 @@ public class Test {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (Map.Entry<String, List<String>> entry : types.entrySet()) {
|
||||
System.out.println(entry.getKey());
|
||||
if (entry.getKey().equals("#LargeHunk") || entry.getKey().equals("#TestingInfo")) {
|
||||
if (entry.getKey().equals("#NoStatementChange")) {
|
||||
// --- /dev/null
|
||||
builder.append(entry.getKey() + "\n");
|
||||
List<String> files = entry.getValue();
|
||||
for (String file : files) {
|
||||
builder.append(" " + file + "\n");
|
||||
String fileName = Configuration.GUM_TREE_INPUT + "diffentries/" + file.substring(0, file.indexOf(".java")) + ".txt";
|
||||
String content = FileHelper.readFile(fileName);
|
||||
if (!content.contains("--- /dev/null")) {
|
||||
System.out.println(file.substring(0, file.indexOf(".java")) + ".txt");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -151,13 +168,13 @@ public class Test {
|
||||
|
||||
public static void testV1() throws IOException {
|
||||
Map<String, Map<String, List<String>>> map = new HashMap<>();
|
||||
String content = FileHelper.readFile("logs/testV1.txt");
|
||||
String content = FileHelper.readFile("OUTPUT/list-1.txt");
|
||||
BufferedReader reader = new BufferedReader(new StringReader(content));
|
||||
String line = null;
|
||||
List<String> types1 = new ArrayList<>();
|
||||
List<String> types2 = new ArrayList<>();
|
||||
while ((line = reader.readLine()) != null) {
|
||||
String[] elements = line.split(" : ");
|
||||
String[] elements = line.split(":");
|
||||
String type = elements[0];
|
||||
String startLine = elements[2];
|
||||
if (!"-1".equals(startLine)) {
|
||||
@@ -210,7 +227,7 @@ public class Test {
|
||||
}
|
||||
}
|
||||
}
|
||||
FileHelper.outputToFile("logs/NullV.txt", builder, false);
|
||||
FileHelper.outputToFile("OUTPUT/NullV.txt", builder, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,21 +29,31 @@ import edu.lu.uni.serval.utils.FileHelper;
|
||||
*/
|
||||
public class ViolatePositionReader {
|
||||
/*
|
||||
-1 : 3788
|
||||
0 : 1921
|
||||
1 : 3106
|
||||
71 : 302
|
||||
23 : 4929
|
||||
72 : 87
|
||||
28 : 404
|
||||
31 : 74390
|
||||
|
||||
0 : 1280
|
||||
-1 : 15
|
||||
1 : 505 AnonymousClassDeclaration
|
||||
23 : 7108 FieldDeclaration
|
||||
71 : 310 EnumDeclaration
|
||||
55 : 640 TypeDeclaration
|
||||
72 : 87 EnumConstantDeclaration
|
||||
28 : 1022 Initializer
|
||||
31 : 77960 MethodDeclaration
|
||||
|
||||
*/
|
||||
public static void main(String[] args) throws NumberFormatException, IOException {
|
||||
List<MessageFile> msgFiles = getMessageFiles(Configuration.GUM_TREE_INPUT);
|
||||
|
||||
Map<Integer, Integer> map1 = new HashMap<>();
|
||||
Map<String, Map<Integer, Integer>> map2 = new HashMap<>();
|
||||
|
||||
StringBuilder zeorBuilder = new StringBuilder();
|
||||
StringBuilder minusOneBuilder = new StringBuilder();
|
||||
for (MessageFile file : msgFiles) {
|
||||
|
||||
// if (!file.getPrevFile().getName().equals(
|
||||
//"prev_ovgu-ccd-jchess_c3f4a0_bdca7bjchess#util#PixelCoordinateNotOnBoardException.java")) continue;
|
||||
|
||||
String fileContent = FileHelper.readFile(file.getPositionFile());
|
||||
BufferedReader reader = null;
|
||||
reader = new BufferedReader(new StringReader(fileContent));
|
||||
@@ -54,11 +64,16 @@ public class ViolatePositionReader {
|
||||
int startLine = Integer.parseInt(positionStr[1]);
|
||||
int endLine = Integer.parseInt(positionStr[2]);
|
||||
String violationType = positionStr[0];
|
||||
|
||||
ViolationSourceCodeTree alarmTree = new ViolationSourceCodeTree(file.getPrevFile(), startLine, endLine);
|
||||
alarmTree.locateParentNode();
|
||||
|
||||
int range = alarmTree.getViolationFinalStartLine();
|
||||
int range;
|
||||
if (startLine != -1) {
|
||||
ViolationSourceCodeTree alarmTree = new ViolationSourceCodeTree(file.getPrevFile(), startLine, endLine);
|
||||
alarmTree.locateParentNode();
|
||||
range = alarmTree.getViolationFinalStartLine();
|
||||
} else {
|
||||
range = 0;
|
||||
}
|
||||
|
||||
if (map1.containsKey(range)) {
|
||||
map1.put(range, map1.get(range) + 1);
|
||||
} else {
|
||||
@@ -77,6 +92,12 @@ public class ViolatePositionReader {
|
||||
map.put(range, 1);
|
||||
map2.put(violationType, map);
|
||||
}
|
||||
|
||||
if (range == 0) {
|
||||
zeorBuilder.append(line + ":" + file.getPrevFile().getName() + "\n");
|
||||
} else if (range == -1) {
|
||||
minusOneBuilder.append(line + ":" + file.getPrevFile().getName() + "\n");
|
||||
}
|
||||
}
|
||||
|
||||
reader.close();
|
||||
@@ -84,6 +105,8 @@ public class ViolatePositionReader {
|
||||
for (Map.Entry<Integer, Integer> entry : map1.entrySet()) {
|
||||
System.out.println(entry.getKey() + " : " + entry.getValue());
|
||||
}
|
||||
FileHelper.outputToFile("Dataset/0.list", zeorBuilder, false);
|
||||
FileHelper.outputToFile("Dataset/1.list", minusOneBuilder, false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -125,11 +125,14 @@ public class ViolationCodeParser {
|
||||
int startLine = violation.getStartLineNum();
|
||||
int endLine = violation.getEndLineNum();
|
||||
|
||||
if (endLine > startLine + 5) {
|
||||
// log.warn("#Large_Violation_Hunk: " + javaFile.getName() + ":" + startLine + ":" + endLine + ":" + alarmType);
|
||||
continue;
|
||||
}
|
||||
String type = violation.getViolationType();
|
||||
|
||||
// if (violationTypes != null && violationTypes.contains(type)) {
|
||||
//// if (endLine > startLine + 5) {
|
||||
////// log.warn("#Large_Violation_Hunk: " + javaFile.getName() + ":" + startLine + ":" + endLine + ":" + alarmType);
|
||||
//// continue;
|
||||
//// }
|
||||
// }
|
||||
ViolationSourceCodeTree alarmTree = new ViolationSourceCodeTree(javaFile, startLine, endLine);
|
||||
alarmTree.extract();
|
||||
List<ITree> matchedTrees = alarmTree.getViolationSourceCodeTrees();
|
||||
@@ -156,13 +159,15 @@ public class ViolationCodeParser {
|
||||
|
||||
startLine = alarmTree.getViolationFinalStartLine();
|
||||
endLine = alarmTree.getViolationFinalEndLine();
|
||||
String sourceCode = readSourceCode(javaFile, startLine, endLine);
|
||||
String sourceCode = readSourceCode(javaFile, startLine, endLine, violation.getViolationType());
|
||||
this.sourceCode += sourceCode + "\n";
|
||||
}
|
||||
}
|
||||
|
||||
private String readSourceCode(File javaFile, int startLine, int endLine) {
|
||||
private String readSourceCode(File javaFile, int startLine, int endLine, String violationType) {
|
||||
StringBuilder sourceCode = new StringBuilder("##Source_Code:\n");
|
||||
sourceCode.append(violationType).append("\n");
|
||||
sourceCode.append(javaFile.getName().replaceAll("#", "/")).append("\nPosition: ").append(startLine).append(" : ").append(endLine).append("\n");
|
||||
FileInputStream fis = null;
|
||||
Scanner scanner = null;
|
||||
|
||||
@@ -258,4 +263,9 @@ public class ViolationCodeParser {
|
||||
}
|
||||
return violations;
|
||||
}
|
||||
|
||||
public void setTypes(List<String> violationTypes) {
|
||||
this.violationTypes = violationTypes;
|
||||
}
|
||||
private List<String> violationTypes = null;
|
||||
}
|
||||
|
||||
+145
-70
@@ -8,6 +8,7 @@ import org.eclipse.jdt.core.dom.CompilationUnit;
|
||||
|
||||
import com.github.gumtreediff.tree.ITree;
|
||||
|
||||
import edu.lu.uni.serval.FixPattern.utils.Checker;
|
||||
import edu.lu.uni.serval.FixPatternParser.CUCreator;
|
||||
import edu.lu.uni.serval.gumtree.GumTreeGenerator;
|
||||
import edu.lu.uni.serval.gumtree.GumTreeGenerator.GumTreeType;
|
||||
@@ -68,6 +69,7 @@ public class ViolationSourceCodeTree {
|
||||
int endLine = cUnit.getLineNumber(endPosition - 1);
|
||||
if (endLine < violationStartLine) continue;
|
||||
|
||||
// FIXME the violation occurred in the Class Name
|
||||
matchTrees(tree.getChildren());
|
||||
}
|
||||
|
||||
@@ -77,7 +79,7 @@ public class ViolationSourceCodeTree {
|
||||
ITree lastTree = matchedTrees.get(size - 1);
|
||||
this.violationFinalEndLine = cUnit.getLineNumber(lastTree.getPos() + lastTree.getLength());
|
||||
} else {
|
||||
System.err.println(this.file.getName() + "===" + this.violationStartLine + ":" + this.violationEndLine);
|
||||
System.err.println(this.file.getName() + " : " + this.violationStartLine + " : " + this.violationEndLine);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -97,6 +99,7 @@ public class ViolationSourceCodeTree {
|
||||
int endLine = cUnit.getLineNumber(endPosition - 1);
|
||||
if (endLine < violationStartLine) continue;
|
||||
|
||||
// FIXME the violation occurred in the Class Name
|
||||
matchTrees(tree.getChildren());
|
||||
}
|
||||
|
||||
@@ -106,8 +109,7 @@ public class ViolationSourceCodeTree {
|
||||
ITree lastTree = matchedTrees.get(size - 1);
|
||||
this.violationFinalEndLine = cUnit.getLineNumber(lastTree.getPos() + lastTree.getLength());
|
||||
} else {
|
||||
System.err.println(type);
|
||||
System.err.println(this.file.getName() + "===" + this.violationStartLine + ":" + this.violationEndLine);
|
||||
System.err.println(type + " : " + this.file.getName() + " : " + this.violationStartLine + " : " + this.violationEndLine);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -179,7 +181,8 @@ public class ViolationSourceCodeTree {
|
||||
*/
|
||||
matchedTrees.add(tree);
|
||||
}
|
||||
if (containsBlockStatement(tree)) {
|
||||
int type = tree.getType();
|
||||
if (type == 8 || type == 12 || Checker.withBlockStatement(type)) {
|
||||
int endLine = cUnit.getLineNumber(tree.getPos() + tree.getLength());
|
||||
if (endLine > violationEndLine) {
|
||||
tree = removeBlock(tree);
|
||||
@@ -199,7 +202,8 @@ public class ViolationSourceCodeTree {
|
||||
int endPosition = startPosition + child.getLength();
|
||||
int endLine = cUnit.getLineNumber(endPosition);
|
||||
if (endLine > this.violationEndLine) {
|
||||
if (child.getType() == 8 || containsBlockStatement(child)) { // 8: Block
|
||||
int type = child.getType();
|
||||
if (type == 8 || type == 12 || Checker.withBlockStatement(type)) { // 8: Block, CatchClause
|
||||
child = removeBlock(child);
|
||||
if (child.getChildren().size() == 0) {
|
||||
continue;
|
||||
@@ -214,13 +218,14 @@ public class ViolationSourceCodeTree {
|
||||
|
||||
private ITree getParentStatement(ITree tree) {
|
||||
ITree parent = tree;
|
||||
int type = parent.getType();
|
||||
do {
|
||||
parent = parent.getParent();
|
||||
if (parent == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
int type = parent.getType();
|
||||
type = parent.getType();
|
||||
if (type == 1 || type == 31 || type == 55 || type == 71) {
|
||||
// AnonymousClassDeclaration
|
||||
// MethodDeclaration Initializer (type == 28)
|
||||
@@ -235,37 +240,12 @@ public class ViolationSourceCodeTree {
|
||||
|
||||
private boolean isStatement(ITree tree) {
|
||||
int type = tree.getType(); // 8 Block
|
||||
if (type == 6) return true; // AssertStatement
|
||||
if (type == 10) return true; // BreakStatement
|
||||
if (type == 17) return true; // ConstructorInvocation
|
||||
if (type == 18) return true; // ContinueStatement
|
||||
if (type == 21) return true; // ExpressionStatement
|
||||
if (type == 12) return true; // catchClause
|
||||
if (type == 23) return true; // FieldDeclaration
|
||||
if (type == 41) return true; // ReturnStatement
|
||||
if (type == 46) return true; // SuperConstructorInvocation
|
||||
if (type == 49) return true; // SwitchCase
|
||||
if (type == 53) return true; // ThrowStatement
|
||||
if (type == 56) return true; // TypeDeclarationStatement
|
||||
if (type == 60) return true; // VariableDeclarationStatement
|
||||
if (containsBlockStatement(tree)) return true;
|
||||
if (Checker.isStatement(type)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean containsBlockStatement(ITree tree) {
|
||||
int type = tree.getType();
|
||||
if (type == 12) return true; // catchClause
|
||||
if (type == 19) return true; // DoStatement
|
||||
if (type == 24) return true; // ForStatement
|
||||
if (type == 25) return true; // IfStatement
|
||||
if (type == 30) return true; // LabeledStatement
|
||||
if (type == 50) return true; // SwitchStatement
|
||||
if (type == 51) return true; // SynchronizedStatement
|
||||
if (type == 54) return true; // TryStatement
|
||||
if (type == 61) return true; // WhileStatement
|
||||
if (type == 70) return true; // EnhancedForStatement
|
||||
return false;
|
||||
}
|
||||
|
||||
public void locateParentNode(String type) {
|
||||
ITree rootTree = new GumTreeGenerator().generateITreeForJavaFile(file, GumTreeType.EXP_JDT);
|
||||
|
||||
@@ -281,12 +261,12 @@ public class ViolationSourceCodeTree {
|
||||
int endLine = cUnit.getLineNumber(endPosition - 1);
|
||||
if (endLine < violationStartLine) continue;
|
||||
|
||||
if (startLine == this.violationStartLine || endLine == this.violationEndLine) {
|
||||
this.violationFinalStartLine = startLine;
|
||||
this.violationFinalEndLine = endLine;
|
||||
}
|
||||
locateParentNode(tree.getChildren(), type);
|
||||
}
|
||||
|
||||
// if (this.violationFinalStartLine == 0) {
|
||||
// FileHelper.outputToFile("logs/testV1.txt", type + " : " + this.file.getName() + " : " + this.violationStartLine + " : " + this.violationEndLine + "\n", true);
|
||||
// }
|
||||
}
|
||||
|
||||
private void locateParentNode(List<ITree> trees, String type) {
|
||||
@@ -352,9 +332,11 @@ public class ViolationSourceCodeTree {
|
||||
break;
|
||||
}
|
||||
|
||||
int astNodeType = tree.getType();
|
||||
// Class Name(super class etc.), Field, initializer, EnumDeclaration, EnumConstantDeclaration, Method Name, method body,
|
||||
if (tree.getType() == 31 || tree.getType() == 23 || tree.getType() == 28 || tree.getType() == 71 || tree.getType() == 72) {
|
||||
// MethodDeclaration, FieldDeclaration, Initializer, EnumDeclaration, EnumConstantDeclaration
|
||||
if (astNodeType == 31 || astNodeType == 23 || astNodeType == 28 || astNodeType == 71 || astNodeType == 72
|
||||
|| astNodeType == 1 || astNodeType == 55) {// inner class
|
||||
// MethodDeclaration, FieldDeclaration, Initializer, EnumDeclaration, EnumConstantDeclaration, AnonymousClassDeclaration
|
||||
this.violationFinalStartLine = startLine;
|
||||
this.violationFinalEndLine = endLine;
|
||||
break;
|
||||
@@ -369,13 +351,7 @@ public class ViolationSourceCodeTree {
|
||||
for (int i = 0, size = children.size(); i < size; i ++) {
|
||||
ITree child = children.get(i);
|
||||
int type = child.getType();
|
||||
if (type == 6 || type == 10 || type == 12 || type == 17 || type == 18 || type == 19 || type == 21 || type == 8// Block, EmptyStatement
|
||||
|| type == 24 || type == 25 || type == 30 || type == 41 || type == 46 || type == 49 || type == 50
|
||||
|| type == 51 || type == 53 || type == 54 || type == 56 || type == 60 || type == 61 || type == 70) {
|
||||
//AssertStatement, BreakStatement, CatchClause, ConstructorInvocation, ContinueStatement, DoStatement
|
||||
// ExpressionStatement, ForStatement, IfStatement, LabeledStatement, ReturnStatement, SuperConstructorInvocation
|
||||
// SwitchCase, SwitchStatement, SynchronizedStatement, ThrowStatement, TryStatement
|
||||
// TypeDeclarationStatement, VariableDeclarationStatement, WhileStatement, EnhancedForStatement
|
||||
if (Checker.isStatement2(type)) {
|
||||
if ( i > 0) {
|
||||
child = children.get(i - 1);
|
||||
return child.getPos() + child.getLength();
|
||||
@@ -450,6 +426,20 @@ public class ViolationSourceCodeTree {
|
||||
int endLine = cUnit.getLineNumber(endPosition - 1);
|
||||
if (endLine < violationStartLine) continue;
|
||||
|
||||
int type = tree.getType();
|
||||
switch (type) {
|
||||
case 55:
|
||||
this.classNamePosition = 1;
|
||||
break;
|
||||
case 71:
|
||||
this.enumPosition = 1;
|
||||
break;
|
||||
case 72:
|
||||
this.enumConsP = 1;
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
locateParentNode(tree.getChildren());
|
||||
}
|
||||
|
||||
@@ -457,8 +447,15 @@ public class ViolationSourceCodeTree {
|
||||
// FileHelper.outputToFile("logs/testV1.txt", type + " : " + this.file.getName() + " : " + this.violationStartLine + " : " + this.violationEndLine + "\n", true);
|
||||
// }
|
||||
}
|
||||
|
||||
int methodPosition = 0;
|
||||
int classNamePosition = 0;
|
||||
int fieldPosition = 0;
|
||||
int initializerP = 0;
|
||||
int anonymousPosition = 0;
|
||||
int enumPosition = 0;
|
||||
int enumConsP = 0;
|
||||
private void locateParentNode(List<ITree> trees) {
|
||||
boolean isBigRange = false;
|
||||
for (ITree tree : trees) {
|
||||
int startPosition = tree.getPos();
|
||||
int startLine = cUnit.getLineNumber(startPosition);
|
||||
@@ -472,24 +469,59 @@ public class ViolationSourceCodeTree {
|
||||
continue;
|
||||
}
|
||||
|
||||
int type = tree.getType();
|
||||
if (isBigRange) {
|
||||
if (type == 31 || type == 55 || type == 23 || type == 28 || type == 71 || type == 72
|
||||
|| type == 81 || type == 82|| type == 1) {
|
||||
this.violationFinalStartLine = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (endLine < violationEndLine) {
|
||||
if (this.violationFinalStartLine == 0) {
|
||||
this.violationFinalStartLine = -1;
|
||||
this.violationFinalStartLine = type;
|
||||
isBigRange = true;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
int type = tree.getType();
|
||||
// Class Name(super class etc.), Method Name,
|
||||
if (type == 31) { //MethodDeclaration, TypeDeclaration
|
||||
if (type == 31) { //MethodDeclaration
|
||||
this.violationFinalStartLine = type;
|
||||
this.methodPosition = 1;
|
||||
locateParentNode(tree.getChildren());
|
||||
break;
|
||||
} else if (type == 23 || type == 28 || type == 71 || type == 72
|
||||
|| type == 81 || type == 82|| type == 1) {
|
||||
// FieldDeclaration, Initializer, EnumDeclaration, EnumConstantDeclaration,
|
||||
// AnnotationTypeDeclaration, AnnotationTypeMemberDeclaration, AnonymousClassDeclaration
|
||||
} else if (type == 55) {// TypeDeclaration, inner class
|
||||
this.violationFinalStartLine = type;
|
||||
this.classNamePosition = 1;
|
||||
locateParentNode(tree.getChildren());
|
||||
break;
|
||||
} else if (type == 1) {// AnonymousClassDeclaration
|
||||
this.violationFinalStartLine = type;
|
||||
this.anonymousPosition = 1;
|
||||
locateParentNode(tree.getChildren());
|
||||
break;
|
||||
} else if (type == 23) {// FieldDeclaration
|
||||
this.violationFinalStartLine = type;
|
||||
this.fieldPosition = 1;
|
||||
locateParentNode(tree.getChildren());
|
||||
break;
|
||||
} else if (type == 28) {// Initializer
|
||||
this.violationFinalStartLine = type;
|
||||
this.initializerP = 1;
|
||||
locateParentNode(tree.getChildren());
|
||||
break;
|
||||
} else if (type == 71) {// EnumDeclaration
|
||||
this.violationFinalStartLine = type;
|
||||
this.enumPosition = 1;
|
||||
locateParentNode(tree.getChildren());
|
||||
break;
|
||||
} else if (type == 72) {// EnumConstantDeclaration
|
||||
this.violationFinalStartLine = tree.getType();
|
||||
this.enumConsP = 1;
|
||||
locateParentNode(tree.getChildren());
|
||||
break;
|
||||
} else {
|
||||
locateParentNode(tree.getChildren());
|
||||
@@ -546,7 +578,10 @@ public class ViolationSourceCodeTree {
|
||||
if (endLine == violationEndLine) {
|
||||
if (tree.getType() == 31) { // MethodDeclaration
|
||||
if (startLine == violationStartLine) {
|
||||
|
||||
int finalEndPosition = getMethodDeclarationWithoutBody(tree);
|
||||
addToMatchedTrees(tree);
|
||||
this.violationFinalStartLine = cUnit.getLineNumber(tree.getPos());
|
||||
this.violationFinalEndLine = cUnit.getLineNumber(finalEndPosition);
|
||||
} else {
|
||||
matchTrees(tree.getChildren());
|
||||
}
|
||||
@@ -561,7 +596,7 @@ public class ViolationSourceCodeTree {
|
||||
continue;
|
||||
} else if (parent.getType() == 31) { // method name
|
||||
if (startLine == violationStartLine || endLine < violationEndLine) {
|
||||
int finalEndPosition = getMethodDeclarationWithBody(parent);
|
||||
int finalEndPosition = getMethodDeclarationWithoutBody(parent);
|
||||
addToMatchedTrees(parent);
|
||||
this.violationFinalStartLine = cUnit.getLineNumber(parent.getPos());
|
||||
this.violationFinalEndLine = cUnit.getLineNumber(finalEndPosition);
|
||||
@@ -569,7 +604,7 @@ public class ViolationSourceCodeTree {
|
||||
break;
|
||||
} else if (parent.getType() == 55) { // class name
|
||||
if (startLine == violationStartLine || endLine < violationEndLine) {
|
||||
int finalEndPosition = getClassDecalrationWithBody(parent);
|
||||
int finalEndPosition = getClassDecalrationWithoutBody(parent);
|
||||
addToMatchedTrees(parent);
|
||||
this.violationFinalStartLine = cUnit.getLineNumber(parent.getPos());
|
||||
this.violationFinalEndLine = cUnit.getLineNumber(finalEndPosition);
|
||||
@@ -593,7 +628,7 @@ public class ViolationSourceCodeTree {
|
||||
continue;
|
||||
} else if (parent.getType() == 31) { // method name
|
||||
if (startLine == violationStartLine || endLine < violationEndLine) {
|
||||
int finalEndPosition = getMethodDeclarationWithBody(parent);
|
||||
int finalEndPosition = getMethodDeclarationWithoutBody(parent);
|
||||
addToMatchedTrees(parent);
|
||||
this.violationFinalStartLine = cUnit.getLineNumber(parent.getPos());
|
||||
this.violationFinalEndLine = cUnit.getLineNumber(finalEndPosition);
|
||||
@@ -601,7 +636,7 @@ public class ViolationSourceCodeTree {
|
||||
break;
|
||||
} else if (parent.getType() == 55) { // class name
|
||||
if (startLine == violationStartLine || endLine < violationEndLine) {
|
||||
int finalEndPosition = getClassDecalrationWithBody(parent);
|
||||
int finalEndPosition = getClassDecalrationWithoutBody(parent);
|
||||
addToMatchedTrees(parent);
|
||||
this.violationFinalStartLine = cUnit.getLineNumber(parent.getPos());
|
||||
this.violationFinalEndLine = cUnit.getLineNumber(finalEndPosition);
|
||||
@@ -616,19 +651,13 @@ public class ViolationSourceCodeTree {
|
||||
}
|
||||
}
|
||||
|
||||
private int getMethodDeclarationWithBody(ITree tree) {
|
||||
private int getMethodDeclarationWithoutBody(ITree tree) {
|
||||
List<ITree> children = tree.getChildren();
|
||||
List<ITree> newChildren = new ArrayList<>();
|
||||
for (int i = 0, size = children.size(); i < size; i ++) {
|
||||
ITree child = children.get(i);
|
||||
int type = child.getType();
|
||||
if (type == 6 || type == 10 || type == 12 || type == 17 || type == 18 || type == 19 || type == 21 || type == 8// Block, EmptyStatement
|
||||
|| type == 24 || type == 25 || type == 30 || type == 41 || type == 46 || type == 49 || type == 50
|
||||
|| type == 51 || type == 53 || type == 54 || type == 56 || type == 60 || type == 61 || type == 70) {
|
||||
//AssertStatement, BreakStatement, CatchClause, ConstructorInvocation, ContinueStatement, DoStatement
|
||||
// ExpressionStatement, ForStatement, IfStatement, LabeledStatement, ReturnStatement, SuperConstructorInvocation
|
||||
// SwitchCase, SwitchStatement, SynchronizedStatement, ThrowStatement, TryStatement
|
||||
// TypeDeclarationStatement, VariableDeclarationStatement, WhileStatement, EnhancedForStatement
|
||||
if (Checker.isStatement2(type)) {
|
||||
if (i > 0) {
|
||||
child = children.get(i - 1);
|
||||
return child.getPos() + child.getLength() + 1;
|
||||
@@ -643,7 +672,7 @@ public class ViolationSourceCodeTree {
|
||||
return 0;
|
||||
}
|
||||
|
||||
private int getClassDecalrationWithBody(ITree tree) {
|
||||
private int getClassDecalrationWithoutBody(ITree tree) {
|
||||
List<ITree> children = tree.getChildren();
|
||||
List<ITree> newChildren = new ArrayList<>();
|
||||
for (int i = 0, size = children.size(); i < size; i ++) {
|
||||
@@ -669,7 +698,6 @@ public class ViolationSourceCodeTree {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
private ITree getParentStatement2(ITree tree) {
|
||||
ITree parent = tree;
|
||||
do {
|
||||
@@ -692,4 +720,51 @@ public class ViolationSourceCodeTree {
|
||||
|
||||
return parent;
|
||||
}
|
||||
|
||||
public ITree getClassNameTokens() {
|
||||
ITree classNameTree = null;
|
||||
|
||||
ITree rootTree = new GumTreeGenerator().generateITreeForJavaFile(file, GumTreeType.EXP_JDT);
|
||||
List<ITree> trees = rootTree.getChildren();
|
||||
for (ITree tree : trees) {
|
||||
int type = tree.getType();
|
||||
if (type == 55 || type == 71) {
|
||||
classNameTree = tree;
|
||||
ITree classNameTree2 = getClassNameTokens(tree.getChildren());
|
||||
if (classNameTree2 != null) {
|
||||
classNameTree = classNameTree2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (classNameTree != null) {
|
||||
int finalEndPosition = getClassDecalrationWithoutBody(classNameTree);
|
||||
int finalStartPosition = classNameTree.getPos();
|
||||
this.violationFinalStartLine = this.cUnit.getLineNumber(finalStartPosition);
|
||||
this.violationFinalEndLine = this.cUnit.getLineNumber(finalEndPosition);
|
||||
}
|
||||
return classNameTree;
|
||||
}
|
||||
|
||||
private ITree getClassNameTokens(List<ITree> children) {
|
||||
ITree classNameTree = null;
|
||||
for (ITree tree : children) {
|
||||
int startPosition = tree.getPos();
|
||||
int startLine = cUnit.getLineNumber(startPosition);
|
||||
if (startLine > violationStartLine) {
|
||||
break;
|
||||
}
|
||||
|
||||
int endPosition = startPosition + tree.getLength();
|
||||
int endLine = cUnit.getLineNumber(endPosition - 1);
|
||||
if (endLine < violationStartLine) continue;
|
||||
|
||||
int type = tree.getType();
|
||||
if (type == 55 || type == 71) {
|
||||
classNameTree = tree;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return classNameTree;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import edu.lu.uni.serval.config.Configuration;
|
||||
@@ -78,6 +77,7 @@ public class Test {
|
||||
}
|
||||
reader.close();
|
||||
System.out.println(b);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,6 +27,24 @@ public class TestViolationParser {
|
||||
}
|
||||
}
|
||||
|
||||
List<String> violationTypes = new ArrayList<>();
|
||||
violationTypes.add("NP_NONNULL_RETURN_VIOLATION");
|
||||
violationTypes.add("NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE");
|
||||
violationTypes.add("NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE");
|
||||
violationTypes.add("ODR_OPEN_DATABASE_RESOURCE");
|
||||
violationTypes.add("PZLA_PREFER_ZERO_LENGTH_ARRAYS");
|
||||
violationTypes.add("RI_REDUNDANT_INTERFACES");
|
||||
violationTypes.add("RV_RETURN_VALUE_IGNORED_BAD_PRACTICE");
|
||||
violationTypes.add("RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT");
|
||||
violationTypes.add("SE_NO_SERIALVERSIONID");
|
||||
violationTypes.add("SF_SWITCH_NO_DEFAULT");
|
||||
violationTypes.add("SIC_INNER_SHOULD_BE_STATIC");
|
||||
violationTypes.add("SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING");
|
||||
violationTypes.add("UC_USELESS_CONDITION");
|
||||
violationTypes.add("UC_USELESS_OBJECT");
|
||||
violationTypes.add("UCF_USELESS_CONTROL_FLOW");
|
||||
violationTypes.add("WMI_WRONG_MAP_ITERATOR");
|
||||
|
||||
// Violation instances of single violation type
|
||||
String unfixedViolations = "../FPM_Violations/unFixedInstances/";
|
||||
String unfixedFilesPath = Configuration.GUM_TREE_INPUT + "UnfixedViolations/";
|
||||
@@ -34,6 +52,7 @@ public class TestViolationParser {
|
||||
List<File> unfixedAlarmFiles = FileHelper.getAllFilesInCurrentDiectory(unfixedViolations, ".list");
|
||||
for (File file : unfixedAlarmFiles) {
|
||||
String fileName = FileHelper.getFileNameWithoutExtension(file);
|
||||
if (!violationTypes.contains(fileName)) continue;
|
||||
FileHelper.createDirectory(unfixedFilesPath + fileName + "/");
|
||||
FileHelper.createDirectory(unfixedPositionsFilePath + fileName + "/");
|
||||
ViolationParser parser = new ViolationParser();
|
||||
|
||||
Reference in New Issue
Block a user