package com.highway2urhell.service.impl;

import com.highway2urhell.VersionUtils;
import com.highway2urhell.domain.EntryPathData;
import com.highway2urhell.service.AbstractLeechService;

import java.util.List;

public class SpringServiceMethodService extends AbstractLeechService {

    public static final String FRAMEWORK_NAME = "SPRING_METHOD";

    public SpringServiceMethodService() {
        super(
                FRAMEWORK_NAME,
                VersionUtils.getVersion(
                        "org.springframework.web.servlet.mvc.method.RequestMappingInfo",
                        "org.springframework",
                        "spring-webmvc"));
    }

    @Override
    public void receiveData(List<EntryPathData> incoming) {
        // clearPreviousData();
        LOGGER.debug("receive incoming data");
        gatherData(incoming);
        LOGGER.debug("data gathering complete.SPRING_METHOD Found {} entries", getFrameworkInformations().getListEntryPath().size());
    }
}

@@ -180,16 +180,44 @@
 rvice;%0A%0A
+import java.util.ArrayList;%0A
 import j
@@ -772,28 +772,62 @@
     
-// clearPrevious
+List%3CEntryPathData%3E res = new ArrayList%3CEntryPath
 Data
+%3E
 ();%0A
@@ -869,16 +869,33 @@
 ing data
+ ON SPRING_METHOD
 %22);%0A    
@@ -902,19 +902,30 @@
     
-g
+for(EntryP
 ath
-er
 Data
-(
+ e : 
 inco
@@ -929,16 +929,242 @@
 ncoming)
+ %7B%0A            if(e.getUri().startsWith(%22%5B%22))%7B%0A                e.setUri(e.getUri().replace(%22%5B%22,%22%22));%0A                e.setUri(e.getUri().replace(%22%5D%22,%22%22));%0A            %7D%0A            res.add(e);%0A        %7D%0A        gatherData(res)
 ;%0A      

replace character for springMethod