Fork me on GitHub

Résultats CPD

Le document suivant contient les résultats de l'inspection CPD CPD 5.3.5.

Duplicatas

Fichier Ligne
fr/paris/lutece/plugins/address/service/WebServiceAddressService.java 329
fr/paris/lutece/plugins/address/service/WebServiceAddressService.java 481
                    null, getDateSearch(  ) );

            // check null result and then return null list
            if ( responseWebService == null )
            {
                return null;
            }
        }
        catch ( ServiceException e )
        {
            AppLogService.error( e.getMessage(  ), e );
        }

        //traitement du flux xml		
        Adresses adresses = null;

        JAXBContext jc;

        try
        {
            jc = JAXBContext.newInstance( JAXB_CONTEXT_WS_SEARCH_ADDRESS );

            Unmarshaller u = jc.createUnmarshaller(  );
            StringBuffer xmlStr = new StringBuffer( responseWebService );
            adresses = (Adresses) u.unmarshal( new StreamSource( new StringReader( xmlStr.toString(  ) ) ) );
        }
        catch ( JAXBException e )
        {
            AppLogService.error( e.getMessage(  ), e );
        }

        List<fr.paris.lutece.plugins.address.business.jaxb.wsSearchAdresse.Adresse> listAdresses = adresses.getAdresse(  );

        ReferenceList refList = null;

        //      Added for filter the double adresse
        Set<AdresseElement> eltSet = null;

        //build the list choice
        if ( ( listAdresses != null ) && !listAdresses.isEmpty(  ) )
        {
            refList = new ReferenceList(  );

            //Added for filter the double adresse
            eltSet = new HashSet<AdresseElement>(  );

            for ( fr.paris.lutece.plugins.address.business.jaxb.wsSearchAdresse.Adresse currentAdresse : listAdresses )
            {
                String suffixe = "";

                if ( currentAdresse.getSuffixe(  ) != null )
                {
                    suffixe = currentAdresse.getSuffixe(  );
                }

                String strCurrentAdresse = "";

                if ( currentAdresse.getTypeVoie(  ) == null )
                {
                    strCurrentAdresse = currentAdresse.getNumero(  ) + " " + suffixe + " " +
                        currentAdresse.getNomVoie(  ) + " " + currentAdresse.getCommune(  );
                }
                else if ( LibraryAddressUtils.isTerminateByApostrophe( currentAdresse.getTypeVoie(  ) ) )
                {
                    strCurrentAdresse = currentAdresse.getNumero(  ) + " " + suffixe + " " +
                        currentAdresse.getTypeVoie(  ) + currentAdresse.getNomVoie(  ) + " " +
                        currentAdresse.getCommune(  );
                }
                else
                {
                    strCurrentAdresse = currentAdresse.getNumero(  ) + " " + suffixe + " " +
                        currentAdresse.getTypeVoie(  ) + " " + currentAdresse.getNomVoie(  ) + " " +
                        currentAdresse.getCommune(  );
                }

                String strIdAdresse = currentAdresse.getIdentifiant(  ).toString(  );
Fichier Ligne
fr/paris/lutece/plugins/address/service/DummyAddressService.java 88
fr/paris/lutece/plugins/address/service/DummyAddressService.java 166
    public ReferenceList searchAddress( HttpServletRequest request, String labeladresse )
    {
        String strFluxAddress = null;

        String strFilePath = AppPathService.getPath( PROPERTY_XML_PATH_DIRECTORY );
        String strFileName = AppPropertiesService.getProperty( PROPERTY_XML_FILE_SEARCH_ADDRESS );

        byte[] out = new byte[128];

        try
        {
            out = read( strFilePath + strFileName );
        }
        catch ( Exception e )
        {
            AppLogService.error( e.getMessage(  ), e );
        }

        strFluxAddress = new String( out );

        //traitement du flux xml		
        Adresses adresses = null;

        JAXBContext jc;

        try
        {
            jc = JAXBContext.newInstance( JAXB_CONTEXT_WS_SEARCH_ADDRESS );

            Unmarshaller u = jc.createUnmarshaller(  );
            StringBuffer xmlStr = new StringBuffer( strFluxAddress );
            adresses = (Adresses) u.unmarshal( new StreamSource( new StringReader( xmlStr.toString(  ) ) ) );
        }
        catch ( JAXBException e )
        {
            AppLogService.error( e.getMessage(  ), e );
        }

        List<fr.paris.lutece.plugins.address.business.jaxb.wsSearchAdresse.Adresse> listAdresses = adresses.getAdresse(  );

        ReferenceList refList = null;

        //build the list choice
        if ( ( listAdresses != null ) && !listAdresses.isEmpty(  ) )
        {
            refList = new ReferenceList(  );

            for ( fr.paris.lutece.plugins.address.business.jaxb.wsSearchAdresse.Adresse currentAdresse : listAdresses )
            {
                String suffixe = "";

                if ( currentAdresse.getSuffixe(  ) != null )
                {
                    suffixe = currentAdresse.getSuffixe(  );
                }

                String strCurrentAdresse = currentAdresse.getNumero(  ) + " " + suffixe + " " +
                    currentAdresse.getTypeVoie(  ) + " " + currentAdresse.getNomVoie(  ) + " " +
                    currentAdresse.getCommune(  );

                String strIdAdresse = currentAdresse.getIdentifiant(  ).toString(  );

                refList.addItem( strIdAdresse, strCurrentAdresse );
            }

            _listAdresses = adresses;
        }

        return refList;
    }

    /**
     * @param request Request
     * @param labeladresse the  label adress
     * @param strArrondissement Arrondissement
     * @return the XML flux of all adress corresponding
     *
     */
    public ReferenceList searchAddress( HttpServletRequest request, String labeladresse, String strArrondissement )
Fichier Ligne
fr/paris/lutece/plugins/address/service/DummyAddressService.java 245
fr/paris/lutece/plugins/address/service/DummyAddressService.java 326
    public Adresse getGeolocalisation( HttpServletRequest request, long id, String strAddress, String strDate,
        boolean bIsTest )
    {
        String strFluxAddress = null;

        String strFilePath = AppPathService.getPath( PROPERTY_XML_PATH_DIRECTORY );
        String strFileName = AppPropertiesService.getProperty( PROPERTY_XML_FILE_ADDRESS_INFO );

        byte[] out = new byte[128];

        try
        {
            out = read( strFilePath + strFileName );
        }
        catch ( Exception e )
        {
            AppLogService.error( e.getMessage(  ), e );
        }

        strFluxAddress = new String( out );

        //traitement du flux xml
        fr.paris.lutece.plugins.address.business.jaxb.wsFicheAdresse.Adresse adresse = null;

        JAXBContext jc;

        try
        {
            jc = JAXBContext.newInstance( JAXB_CONTEXT_WS_FICHE_ADDRESS );

            Unmarshaller u = jc.createUnmarshaller(  );
            StringBuffer xmlStr = new StringBuffer( strFluxAddress );
            adresse = (fr.paris.lutece.plugins.address.business.jaxb.wsFicheAdresse.Adresse) u.unmarshal( new StreamSource( 
                        new StringReader( xmlStr.toString(  ) ) ) );
        }
        catch ( JAXBException e )
        {
            AppLogService.error( e.getMessage(  ), e );
        }

        Adresse adresseReturn = new Adresse(  );

        adresseReturn.setIadresse( adresse.getIdentifiant(  ) );
        adresseReturn.setDunumero( adresse.getNumero(  ) );
        adresseReturn.setDubis( adresse.getSuffixe1(  ) );
        adresseReturn.setCodeCommune( adresse.getCodeInsee(  ).toString(  ) );
Fichier Ligne
fr/paris/lutece/plugins/address/service/WebServiceAddressService.java 293
fr/paris/lutece/plugins/address/service/WebServiceAddressService.java 446
    public ReferenceList searchAddress( HttpServletRequest request, String labeladresse )
        throws RemoteException
    {
        String responseWebService = null;
        AdresseService adresseService = new AdresseServiceLocator(  );

        try
        {
            URL urlWS = null;

            Stub portType = null;

            if ( ( getUrlWS(  ) == null ) || getUrlWS(  ).equals( "" ) )
            {
                portType = (Stub) adresseService.getAdresseServiceHttpPort(  );
            }
            else
            {
                try
                {
                    urlWS = new URL( getUrlWS(  ) );
                }
                catch ( MalformedURLException e )
                {
                    AppLogService.error( e.getMessage(  ), e );
                }

                portType = (Stub) adresseService.getAdresseServiceHttpPort( urlWS );
            }

            portType.setUsername( getUserName(  ) );
            portType.setPassword( getPassword(  ) );

            setTimeout( portType );

            responseWebService = ( (AdresseServicePortType) portType ).searchAddress( getDefaultCity(  ), labeladresse,
Fichier Ligne
fr/paris/lutece/plugins/address/service/WebServiceAddressService.java 128
fr/paris/lutece/plugins/address/service/WebServiceAddressService.java 188
    public Adresse getGeolocalisation( HttpServletRequest request, long id, String addresse, String date,
        boolean bIsTest ) throws RemoteException
    {
        String responseWebService = null;
        AdresseService adresseService = new AdresseServiceLocator(  );

        try
        {
            URL urlWS = null;

            Stub portType = null;

            if ( ( getUrlWS(  ) == null ) || getUrlWS(  ).equals( "" ) )
            {
                portType = (Stub) adresseService.getAdresseServiceHttpPort(  );
            }
            else
            {
                try
                {
                    urlWS = new URL( getUrlWS(  ) );
                }
                catch ( MalformedURLException e )
                {
                    AppLogService.error( e.getMessage(  ), e );
                }

                portType = (Stub) adresseService.getAdresseServiceHttpPort( urlWS );
            }

            portType.setUsername( getUserName(  ) );
            portType.setPassword( getPassword(  ) );

            setTimeout( portType );

            responseWebService = ( (AdresseServicePortType) portType ).geolocalization( getDefaultCity(  ), addresse,
Fichier Ligne
fr/paris/lutece/plugins/address/service/WebServiceAddressService.java 129
fr/paris/lutece/plugins/address/service/WebServiceAddressService.java 188
fr/paris/lutece/plugins/address/service/WebServiceAddressService.java 293
fr/paris/lutece/plugins/address/service/WebServiceAddressService.java 446
        boolean bIsTest ) throws RemoteException
    {
        String responseWebService = null;
        AdresseService adresseService = new AdresseServiceLocator(  );

        try
        {
            URL urlWS = null;

            Stub portType = null;

            if ( ( getUrlWS(  ) == null ) || getUrlWS(  ).equals( "" ) )
            {
                portType = (Stub) adresseService.getAdresseServiceHttpPort(  );
            }
            else
            {
                try
                {
                    urlWS = new URL( getUrlWS(  ) );
                }
                catch ( MalformedURLException e )
                {
                    AppLogService.error( e.getMessage(  ), e );
                }

                portType = (Stub) adresseService.getAdresseServiceHttpPort( urlWS );
            }

            portType.setUsername( getUserName(  ) );
            portType.setPassword( getPassword(  ) );

            setTimeout( portType );

            responseWebService = ( (AdresseServicePortType) portType ).geolocalization( getDefaultCity(  ), addresse,
Fichier Ligne
fr/paris/lutece/plugins/address/service/DummyAddressService.java 407
fr/paris/lutece/plugins/address/service/WebServiceAddressService.java 591
    }

    /**
    *
    * @return the date for parameter methodes of web service
    */
    public String getDateSearch(  )
    {
        return _strDateSearch;
    }

    /**
     *
     * @param strDateSearch the new date search
     */
    public void setDateSearch( String strDateSearch )
    {
        _strDateSearch = strDateSearch;
    }

    /**
     *
     * @return the default city for parameter methodes of web service
     */
    public String getDefaultCity(  )
    {
        return _strDefaultCity;
    }

    /**
     *
     * @param strDefaultCity the new default city
     */
    public void setDefaultCity( String strDefaultCity )
    {
        _strDefaultCity = strDefaultCity;
    }

    /**
     *
     * @return the url of the web service
     */
    public String getUrlWS(  )
    {
        return _strUrlWS;
    }

    /**
     *
     * @param strUrlWS the new web service url
     */
    public void setUrlWS( String strUrlWS )
    {
        _strUrlWS = strUrlWS;
    }

    /**
     *
     * @return the password
     */
    public String getPassword(  )
    {
        return _strPassword;
    }

    /**
     *
     * @param password the password
     */
    public void setPassword( String password )
    {
        _strPassword = password;
    }

    /**
     *
     * @return the user name
     */
    public String getUserName(  )
    {
        return _strUserName;
    }

    /**
     *
     * @param userName the user name
     */
    public void setUserName( String userName )
    {
        _strUserName = userName;
    }

    /**
    *
    * @return the timeout
    */
    public String getTimeOut(  )
    {
        return _strTimeOut;
    }

    /**
     *
     * @param timeOut the timeout
     */
    public void setTimeOut( String timeOut )
    {
        _strTimeOut = timeOut;
    }
Fichier Ligne
fr/paris/lutece/plugins/address/service/DummyAddressService.java 276
fr/paris/lutece/plugins/address/service/DummyAddressService.java 356
fr/paris/lutece/plugins/address/service/WebServiceAddressService.java 240
            StringBuffer xmlStr = new StringBuffer( strFluxAddress );
            adresse = (fr.paris.lutece.plugins.address.business.jaxb.wsFicheAdresse.Adresse) u.unmarshal( new StreamSource( 
                        new StringReader( xmlStr.toString(  ) ) ) );
        }
        catch ( JAXBException e )
        {
            AppLogService.error( e.getMessage(  ), e );
        }

        Adresse adresseReturn = new Adresse(  );

        adresseReturn.setIadresse( adresse.getIdentifiant(  ) );
        adresseReturn.setDunumero( adresse.getNumero(  ) );
        adresseReturn.setDubis( adresse.getSuffixe1(  ) );
        adresseReturn.setCodeCommune( adresse.getCodeInsee(  ).toString(  ) );
Fichier Ligne
fr/paris/lutece/plugins/address/service/DummyAddressService.java 298
fr/paris/lutece/plugins/address/service/DummyAddressService.java 370
                    responseWebService.length(  ) ) ) );

        if ( !bIsTest )
        {
            List<fr.paris.lutece.plugins.address.business.jaxb.wsSearchAdresse.Adresse> listAddress = _listAdresses.getAdresse(  );

            for ( fr.paris.lutece.plugins.address.business.jaxb.wsSearchAdresse.Adresse currentAdresse : listAddress )
            {
                if ( String.valueOf( currentAdresse.getIdentifiant(  ) ).equals( String.valueOf( id ) ) )
                {
                    adresseReturn.setTypeVoie( currentAdresse.getTypeVoie(  ) );
                    adresseReturn.setLibelleVoie( currentAdresse.getNomVoie(  ) );

                    break;
                }
            }
        }

        return adresseReturn;
    }