You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Hartmut Obendorf (JIRA)" <ji...@codehaus.org> on 2010/04/22 14:05:18 UTC

[jira] Created: (MPMD-121) Download of PMD ruleset from URL fails if URL contains characters not valid in file name

Download of PMD ruleset from URL fails if URL contains characters not valid in file name
----------------------------------------------------------------------------------------

                 Key: MPMD-121
                 URL: http://jira.codehaus.org/browse/MPMD-121
             Project: Maven 2.x PMD Plugin
          Issue Type: Bug
          Components: PMD
    Affects Versions: 2.4
         Environment: win32
            Reporter: Hartmut Obendorf




    private String getLocationTemp( String name )
    {
        String loc = name;
        if ( loc.indexOf( '/' ) != -1 )
        {
            loc = loc.substring( loc.lastIndexOf( '/' ) + 1 );
        }
        if ( loc.indexOf( '\\' ) != -1 )
        {
            loc = loc.substring( loc.lastIndexOf( '\\' ) + 1 );
        }
        getLog().debug( "Before: " + name + " After: " + loc );
        return loc;
    }

should encode the URL, so that characters such as ? or & do not prevent creating a local file

Fix suggestion: add following code line before log output:

loc = URLEncoder.encode(loc, "UTF-8");


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MPMD-121) Download of PMD ruleset from URL fails if URL contains characters not valid in file name

Posted by "Herve Boutemy (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MPMD-121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Herve Boutemy updated MPMD-121:
-------------------------------

    Description: 
{code:java}
    private String getLocationTemp( String name )
    {
        String loc = name;
        if ( loc.indexOf( '/' ) != -1 )
        {
            loc = loc.substring( loc.lastIndexOf( '/' ) + 1 );
        }
        if ( loc.indexOf( '\\' ) != -1 )
        {
            loc = loc.substring( loc.lastIndexOf( '\\' ) + 1 );
        }
        getLog().debug( "Before: " + name + " After: " + loc );
        return loc;
    }
{code}
should encode the URL, so that characters such as ? or & do not prevent creating a local file

Fix suggestion: add following code line before log output:
{code:java}
loc = URLEncoder.encode(loc, "UTF-8");
{code}

  was:


    private String getLocationTemp( String name )
    {
        String loc = name;
        if ( loc.indexOf( '/' ) != -1 )
        {
            loc = loc.substring( loc.lastIndexOf( '/' ) + 1 );
        }
        if ( loc.indexOf( '\\' ) != -1 )
        {
            loc = loc.substring( loc.lastIndexOf( '\\' ) + 1 );
        }
        getLog().debug( "Before: " + name + " After: " + loc );
        return loc;
    }

should encode the URL, so that characters such as ? or & do not prevent creating a local file

Fix suggestion: add following code line before log output:

loc = URLEncoder.encode(loc, "UTF-8");



> Download of PMD ruleset from URL fails if URL contains characters not valid in file name
> ----------------------------------------------------------------------------------------
>
>                 Key: MPMD-121
>                 URL: http://jira.codehaus.org/browse/MPMD-121
>             Project: Maven 2.x PMD Plugin
>          Issue Type: Bug
>          Components: PMD
>    Affects Versions: 2.4
>         Environment: win32
>            Reporter: Hartmut Obendorf
>
> {code:java}
>     private String getLocationTemp( String name )
>     {
>         String loc = name;
>         if ( loc.indexOf( '/' ) != -1 )
>         {
>             loc = loc.substring( loc.lastIndexOf( '/' ) + 1 );
>         }
>         if ( loc.indexOf( '\\' ) != -1 )
>         {
>             loc = loc.substring( loc.lastIndexOf( '\\' ) + 1 );
>         }
>         getLog().debug( "Before: " + name + " After: " + loc );
>         return loc;
>     }
> {code}
> should encode the URL, so that characters such as ? or & do not prevent creating a local file
> Fix suggestion: add following code line before log output:
> {code:java}
> loc = URLEncoder.encode(loc, "UTF-8");
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MPMD-121) Download of PMD ruleset from URL fails if URL contains characters not valid in file name

Posted by "Herve Boutemy (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MPMD-121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Herve Boutemy closed MPMD-121.
------------------------------

    Resolution: Cannot Reproduce
      Assignee: Herve Boutemy

please provide a unit test showing something failing that shouldn't

> Download of PMD ruleset from URL fails if URL contains characters not valid in file name
> ----------------------------------------------------------------------------------------
>
>                 Key: MPMD-121
>                 URL: http://jira.codehaus.org/browse/MPMD-121
>             Project: Maven 2.x PMD Plugin
>          Issue Type: Bug
>          Components: PMD
>    Affects Versions: 2.4
>         Environment: win32
>            Reporter: Hartmut Obendorf
>            Assignee: Herve Boutemy
>
> {code:java}
>     private String getLocationTemp( String name )
>     {
>         String loc = name;
>         if ( loc.indexOf( '/' ) != -1 )
>         {
>             loc = loc.substring( loc.lastIndexOf( '/' ) + 1 );
>         }
>         if ( loc.indexOf( '\\' ) != -1 )
>         {
>             loc = loc.substring( loc.lastIndexOf( '\\' ) + 1 );
>         }
>         getLog().debug( "Before: " + name + " After: " + loc );
>         return loc;
>     }
> {code}
> should encode the URL, so that characters such as ? or & do not prevent creating a local file
> Fix suggestion: add following code line before log output:
> {code:java}
> loc = URLEncoder.encode(loc, "UTF-8");
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MPMD-121) Download of PMD ruleset from URL fails if URL contains characters not valid in file name

Posted by "Hartmut Obendorf (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MPMD-121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=218591#action_218591 ] 

Hartmut Obendorf commented on MPMD-121:
---------------------------------------

error occurs in class

org.apache.maven.plugin.pmd.PMDReport

> Download of PMD ruleset from URL fails if URL contains characters not valid in file name
> ----------------------------------------------------------------------------------------
>
>                 Key: MPMD-121
>                 URL: http://jira.codehaus.org/browse/MPMD-121
>             Project: Maven 2.x PMD Plugin
>          Issue Type: Bug
>          Components: PMD
>    Affects Versions: 2.4
>         Environment: win32
>            Reporter: Hartmut Obendorf
>
>     private String getLocationTemp( String name )
>     {
>         String loc = name;
>         if ( loc.indexOf( '/' ) != -1 )
>         {
>             loc = loc.substring( loc.lastIndexOf( '/' ) + 1 );
>         }
>         if ( loc.indexOf( '\\' ) != -1 )
>         {
>             loc = loc.substring( loc.lastIndexOf( '\\' ) + 1 );
>         }
>         getLog().debug( "Before: " + name + " After: " + loc );
>         return loc;
>     }
> should encode the URL, so that characters such as ? or & do not prevent creating a local file
> Fix suggestion: add following code line before log output:
> loc = URLEncoder.encode(loc, "UTF-8");

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira