You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Dennis Lundberg (JIRA)" <ji...@codehaus.org> on 2011/01/05 09:45:57 UTC
[jira] Created: (MSHARED-179) FilteringUtils.escapeWindowsPath only
works if the Windows path is at the beginning of a property
FilteringUtils.escapeWindowsPath only works if the Windows path is at the beginning of a property
-------------------------------------------------------------------------------------------------
Key: MSHARED-179
URL: http://jira.codehaus.org/browse/MSHARED-179
Project: Maven Shared Components
Issue Type: Bug
Components: maven-filtering
Affects Versions: maven-filtering-1.0-beta-4
Reporter: Dennis Lundberg
If the Windows path is in the middle, like in a JDBC URL escaping is not done. Here's the code from FilteringUtils.java that causes it:
{code:java}
public static final String escapeWindowsPath( String val )
{
if ( !StringUtils.isEmpty( val ) && val.indexOf( ":\\" ) == 1 )
...
{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] Updated: (MSHARED-179) FilteringUtils.escapeWindowsPath only
works if the Windows path is at the beginning of a property
Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MSHARED-179?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dennis Lundberg updated MSHARED-179:
------------------------------------
Attachment: MSHARED-179.zip
Here is a sample project that highlights this problem.
Run 'mvn test' and have a look at the file "target/test-classes/database.properties".
Notice how the "logfile" property has escaped backslashes, but the "jdbc.url" property does not.
> FilteringUtils.escapeWindowsPath only works if the Windows path is at the beginning of a property
> -------------------------------------------------------------------------------------------------
>
> Key: MSHARED-179
> URL: http://jira.codehaus.org/browse/MSHARED-179
> Project: Maven Shared Components
> Issue Type: Bug
> Components: maven-filtering
> Affects Versions: maven-filtering-1.0-beta-4
> Reporter: Dennis Lundberg
> Attachments: MSHARED-179.zip
>
>
> If the Windows path is in the middle, like in a JDBC URL escaping is not done. Here's the code from FilteringUtils.java that causes it:
> {code:java}
> public static final String escapeWindowsPath( String val )
> {
> if ( !StringUtils.isEmpty( val ) && val.indexOf( ":\\" ) == 1 )
> ...
> {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: (MSHARED-179) FilteringUtils.escapeWindowsPath only
works if the Windows path is at the beginning of a property
Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MSHARED-179?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dennis Lundberg closed MSHARED-179.
-----------------------------------
Resolution: Fixed
Fix Version/s: maven-filtering-1.0
Assignee: Dennis Lundberg
Fixed in [r1061510|http://svn.apache.org/viewvc?view=revision&revision=1061510].
> FilteringUtils.escapeWindowsPath only works if the Windows path is at the beginning of a property
> -------------------------------------------------------------------------------------------------
>
> Key: MSHARED-179
> URL: http://jira.codehaus.org/browse/MSHARED-179
> Project: Maven Shared Components
> Issue Type: Bug
> Components: maven-filtering
> Affects Versions: maven-filtering-1.0-beta-4
> Reporter: Dennis Lundberg
> Assignee: Dennis Lundberg
> Fix For: maven-filtering-1.0
>
> Attachments: MSHARED-179.patch, MSHARED-179.zip
>
>
> If the Windows path is in the middle, like in a JDBC URL escaping is not done. Here's the code from FilteringUtils.java that causes it:
> {code:java}
> public static final String escapeWindowsPath( String val )
> {
> if ( !StringUtils.isEmpty( val ) && val.indexOf( ":\\" ) == 1 )
> ...
> {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] Updated: (MSHARED-179) FilteringUtils.escapeWindowsPath only
works if the Windows path is at the beginning of a property
Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MSHARED-179?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dennis Lundberg updated MSHARED-179:
------------------------------------
Attachment: MSHARED-179.patch
Attached a proposed patch for this issue. Please review.
> FilteringUtils.escapeWindowsPath only works if the Windows path is at the beginning of a property
> -------------------------------------------------------------------------------------------------
>
> Key: MSHARED-179
> URL: http://jira.codehaus.org/browse/MSHARED-179
> Project: Maven Shared Components
> Issue Type: Bug
> Components: maven-filtering
> Affects Versions: maven-filtering-1.0-beta-4
> Reporter: Dennis Lundberg
> Attachments: MSHARED-179.patch, MSHARED-179.zip
>
>
> If the Windows path is in the middle, like in a JDBC URL escaping is not done. Here's the code from FilteringUtils.java that causes it:
> {code:java}
> public static final String escapeWindowsPath( String val )
> {
> if ( !StringUtils.isEmpty( val ) && val.indexOf( ":\\" ) == 1 )
> ...
> {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: (MSHARED-179) FilteringUtils.escapeWindowsPath
only works if the Windows path is at the beginning of a property
Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MSHARED-179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=250496#action_250496 ]
Dennis Lundberg commented on MSHARED-179:
-----------------------------------------
In r1055383 I added a failing test case for this issue, that is commented out.
> FilteringUtils.escapeWindowsPath only works if the Windows path is at the beginning of a property
> -------------------------------------------------------------------------------------------------
>
> Key: MSHARED-179
> URL: http://jira.codehaus.org/browse/MSHARED-179
> Project: Maven Shared Components
> Issue Type: Bug
> Components: maven-filtering
> Affects Versions: maven-filtering-1.0-beta-4
> Reporter: Dennis Lundberg
> Attachments: MSHARED-179.zip
>
>
> If the Windows path is in the middle, like in a JDBC URL escaping is not done. Here's the code from FilteringUtils.java that causes it:
> {code:java}
> public static final String escapeWindowsPath( String val )
> {
> if ( !StringUtils.isEmpty( val ) && val.indexOf( ":\\" ) == 1 )
> ...
> {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] (MSHARED-179) FilteringUtils.escapeWindowsPath only works if
the Windows path is at the beginning of a property
Posted by "Jochen Wiedmann (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/MSHARED-179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=304538#comment-304538 ]
Jochen Wiedmann commented on MSHARED-179:
-----------------------------------------
Recommended workaround: Use property files in XML format and replace Properties.load with Properties.loadFromXML.
See http://www.ibm.com/developerworks/java/library/j-tiger02254/index.html
> FilteringUtils.escapeWindowsPath only works if the Windows path is at the beginning of a property
> -------------------------------------------------------------------------------------------------
>
> Key: MSHARED-179
> URL: https://jira.codehaus.org/browse/MSHARED-179
> Project: Maven Shared Components
> Issue Type: Bug
> Components: maven-filtering
> Affects Versions: maven-filtering-1.0-beta-4
> Reporter: Dennis Lundberg
> Assignee: Dennis Lundberg
> Fix For: maven-filtering-1.0
>
> Attachments: MSHARED-179.patch, MSHARED-179.zip
>
>
> If the Windows path is in the middle, like in a JDBC URL escaping is not done. Here's the code from FilteringUtils.java that causes it:
> {code:java}
> public static final String escapeWindowsPath( String val )
> {
> if ( !StringUtils.isEmpty( val ) && val.indexOf( ":\\" ) == 1 )
> ...
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira