[jira] Created: (COLLECTIONS-271) org.apache.commons.collections.ExtendedProperties#combine don't import string properly

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (COLLECTIONS-271) org.apache.commons.collections.ExtendedProperties#combine don't import string properly

ASF GitHub Bot (Jira)
org.apache.commons.collections.ExtendedProperties#combine don't import string properly
--------------------------------------------------------------------------------------

                 Key: COLLECTIONS-271
                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-271
             Project: Commons Collections
          Issue Type: Bug
          Components: Collection
    Affects Versions: 3.2
            Reporter: Alexander Borovsky


When we set property with escaped characters, after combine propertySets we got them unescaped.

Simple Example

ExtendedProperties props = new ExtendedProperties();
props.setProperty("test", "\\\\\\\\192.168.1.91\\\\test");
props.getProperty("test"); // => \\192.168.1.91\test

ExtendedProperties props2 = new ExtendedProperties();
props2.combine(props);
props.getProperty("test"); // => \192.168.1.91\test -- Wrong!

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (COLLECTIONS-271) org.apache.commons.collections.ExtendedProperties#combine don't import string properly

ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/COLLECTIONS-271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Borovsky updated COLLECTIONS-271:
-------------------------------------------

    Attachment: fix.patch

Possible fix attached

> org.apache.commons.collections.ExtendedProperties#combine don't import string properly
> --------------------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-271
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-271
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Collection
>    Affects Versions: 3.2
>            Reporter: Alexander Borovsky
>         Attachments: fix.patch
>
>
> When we set property with escaped characters, after combine propertySets we got them unescaped.
> Simple Example
> ExtendedProperties props = new ExtendedProperties();
> props.setProperty("test", "\\\\\\\\192.168.1.91\\\\test");
> props.getProperty("test"); // => \\192.168.1.91\test
> ExtendedProperties props2 = new ExtendedProperties();
> props2.combine(props);
> props.getProperty("test"); // => \192.168.1.91\test -- Wrong!

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (COLLECTIONS-271) org.apache.commons.collections.ExtendedProperties#combine don't import string properly

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/COLLECTIONS-271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell updated COLLECTIONS-271:
--------------------------------------

    Fix Version/s: 3.3

> org.apache.commons.collections.ExtendedProperties#combine don't import string properly
> --------------------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-271
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-271
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Collection
>    Affects Versions: 3.2
>            Reporter: Alexander Borovsky
>             Fix For: 3.3
>
>         Attachments: fix.patch
>
>
> When we set property with escaped characters, after combine propertySets we got them unescaped.
> Simple Example
> ExtendedProperties props = new ExtendedProperties();
> props.setProperty("test", "\\\\\\\\192.168.1.91\\\\test");
> props.getProperty("test"); // => \\192.168.1.91\test
> ExtendedProperties props2 = new ExtendedProperties();
> props2.combine(props);
> props.getProperty("test"); // => \192.168.1.91\test -- Wrong!

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (COLLECTIONS-271) org.apache.commons.collections.ExtendedProperties#combine don't import string properly

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/COLLECTIONS-271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12579107#action_12579107 ]

Henri Yandell commented on COLLECTIONS-271:
-------------------------------------------

Bug confirmed - but the fix doesn't pass the unit test so might need something more.

> org.apache.commons.collections.ExtendedProperties#combine don't import string properly
> --------------------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-271
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-271
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Collection
>    Affects Versions: 3.2
>            Reporter: Alexander Borovsky
>             Fix For: 3.3
>
>         Attachments: fix.patch
>
>
> When we set property with escaped characters, after combine propertySets we got them unescaped.
> Simple Example
> ExtendedProperties props = new ExtendedProperties();
> props.setProperty("test", "\\\\\\\\192.168.1.91\\\\test");
> props.getProperty("test"); // => \\192.168.1.91\test
> ExtendedProperties props2 = new ExtendedProperties();
> props2.combine(props);
> props.getProperty("test"); // => \192.168.1.91\test -- Wrong!

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (COLLECTIONS-271) org.apache.commons.collections.ExtendedProperties#combine don't import string properly

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/COLLECTIONS-271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed COLLECTIONS-271.
-------------------------------------

    Resolution: Fixed

svn ci -m "Applying the patch from Alexander Borovsky for COLLECTIONS-271" src
Sending        src/java/org/apache/commons/collections/ExtendedProperties.java
Sending        src/test/org/apache/commons/collections/TestExtendedProperties.java
Transmitting file data ..
Committed revision 637503.

> org.apache.commons.collections.ExtendedProperties#combine don't import string properly
> --------------------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-271
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-271
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Collection
>    Affects Versions: 3.2
>            Reporter: Alexander Borovsky
>             Fix For: 3.3
>
>         Attachments: COLLECTIONS-271.patch, fix.patch
>
>
> When we set property with escaped characters, after combine propertySets we got them unescaped.
> Simple Example
> ExtendedProperties props = new ExtendedProperties();
> props.setProperty("test", "\\\\\\\\192.168.1.91\\\\test");
> props.getProperty("test"); // => \\192.168.1.91\test
> ExtendedProperties props2 = new ExtendedProperties();
> props2.combine(props);
> props.getProperty("test"); // => \192.168.1.91\test -- Wrong!

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (COLLECTIONS-271) org.apache.commons.collections.ExtendedProperties#combine don't import string properly

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/COLLECTIONS-271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell updated COLLECTIONS-271:
--------------------------------------

    Attachment: COLLECTIONS-271.patch

Unit test and fix attached. Needed to make it super.put and not put in the fix.

> org.apache.commons.collections.ExtendedProperties#combine don't import string properly
> --------------------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-271
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-271
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Collection
>    Affects Versions: 3.2
>            Reporter: Alexander Borovsky
>             Fix For: 3.3
>
>         Attachments: COLLECTIONS-271.patch, fix.patch
>
>
> When we set property with escaped characters, after combine propertySets we got them unescaped.
> Simple Example
> ExtendedProperties props = new ExtendedProperties();
> props.setProperty("test", "\\\\\\\\192.168.1.91\\\\test");
> props.getProperty("test"); // => \\192.168.1.91\test
> ExtendedProperties props2 = new ExtendedProperties();
> props2.combine(props);
> props.getProperty("test"); // => \192.168.1.91\test -- Wrong!

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (COLLECTIONS-271) org.apache.commons.collections.ExtendedProperties#combine don't import string properly

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/COLLECTIONS-271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12628816#action_12628816 ]

Nathan Bubna commented on COLLECTIONS-271:
------------------------------------------

I think your patch for this breaks getKeys() after a combine() call.  It appears to make combine() not track new keys, which breaks both getKeys() and subset().  Because combine() then subset() is broken, Velocity has been experiencing frustratingly mysterious failures for months now.  For more on the symptoms, see:

http://tinyurl.com/5hjxrq

I suspect instead of super.put(), the patch for this should have used clearProperty() followed by addPropertyDirect().  Of course, i haven't tested that...

> org.apache.commons.collections.ExtendedProperties#combine don't import string properly
> --------------------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-271
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-271
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Collection
>    Affects Versions: 3.2
>            Reporter: Alexander Borovsky
>             Fix For: 3.3
>
>         Attachments: COLLECTIONS-271.patch, fix.patch
>
>
> When we set property with escaped characters, after combine propertySets we got them unescaped.
> Simple Example
> ExtendedProperties props = new ExtendedProperties();
> props.setProperty("test", "\\\\\\\\192.168.1.91\\\\test");
> props.getProperty("test"); // => \\192.168.1.91\test
> ExtendedProperties props2 = new ExtendedProperties();
> props2.combine(props);
> props.getProperty("test"); // => \192.168.1.91\test -- Wrong!

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Reopened: (COLLECTIONS-271) org.apache.commons.collections.ExtendedProperties#combine don't import string properly

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/COLLECTIONS-271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niall Pemberton reopened COLLECTIONS-271:
-----------------------------------------


> org.apache.commons.collections.ExtendedProperties#combine don't import string properly
> --------------------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-271
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-271
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Collection
>    Affects Versions: 3.2
>            Reporter: Alexander Borovsky
>             Fix For: 3.3
>
>         Attachments: COLLECTIONS-271.patch, fix.patch
>
>
> When we set property with escaped characters, after combine propertySets we got them unescaped.
> Simple Example
> ExtendedProperties props = new ExtendedProperties();
> props.setProperty("test", "\\\\\\\\192.168.1.91\\\\test");
> props.getProperty("test"); // => \\192.168.1.91\test
> ExtendedProperties props2 = new ExtendedProperties();
> props2.combine(props);
> props.getProperty("test"); // => \192.168.1.91\test -- Wrong!

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (COLLECTIONS-271) org.apache.commons.collections.ExtendedProperties#combine don't import string properly

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/COLLECTIONS-271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Bubna updated COLLECTIONS-271:
-------------------------------------

    Attachment: COLLECTIONS-271.patch

here's a patch that fixes the previous bad patch so that subset() works again.

> org.apache.commons.collections.ExtendedProperties#combine don't import string properly
> --------------------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-271
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-271
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Collection
>    Affects Versions: 3.2
>            Reporter: Alexander Borovsky
>             Fix For: 3.3
>
>         Attachments: COLLECTIONS-271.patch, COLLECTIONS-271.patch, fix.patch
>
>
> When we set property with escaped characters, after combine propertySets we got them unescaped.
> Simple Example
> ExtendedProperties props = new ExtendedProperties();
> props.setProperty("test", "\\\\\\\\192.168.1.91\\\\test");
> props.getProperty("test"); // => \\192.168.1.91\test
> ExtendedProperties props2 = new ExtendedProperties();
> props2.combine(props);
> props.getProperty("test"); // => \192.168.1.91\test -- Wrong!

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (COLLECTIONS-271) org.apache.commons.collections.ExtendedProperties#combine don't import string properly

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/COLLECTIONS-271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641454#action_12641454 ]

James Carman commented on COLLECTIONS-271:
------------------------------------------

Is there a test case that shows that subset() is broken as a result of the previously-applied patch?

> org.apache.commons.collections.ExtendedProperties#combine don't import string properly
> --------------------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-271
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-271
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Collection
>    Affects Versions: 3.2
>            Reporter: Alexander Borovsky
>             Fix For: 3.3
>
>         Attachments: COLLECTIONS-271.patch, COLLECTIONS-271.patch, fix.patch
>
>
> When we set property with escaped characters, after combine propertySets we got them unescaped.
> Simple Example
> ExtendedProperties props = new ExtendedProperties();
> props.setProperty("test", "\\\\\\\\192.168.1.91\\\\test");
> props.getProperty("test"); // => \\192.168.1.91\test
> ExtendedProperties props2 = new ExtendedProperties();
> props2.combine(props);
> props.getProperty("test"); // => \192.168.1.91\test -- Wrong!

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (COLLECTIONS-271) org.apache.commons.collections.ExtendedProperties#combine don't import string properly

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/COLLECTIONS-271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641462#action_12641462 ]

Nathan Bubna commented on COLLECTIONS-271:
------------------------------------------

Yep.  That's the first part of the patch i just attached.

> org.apache.commons.collections.ExtendedProperties#combine don't import string properly
> --------------------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-271
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-271
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Collection
>    Affects Versions: 3.2
>            Reporter: Alexander Borovsky
>             Fix For: 3.3
>
>         Attachments: COLLECTIONS-271.patch, COLLECTIONS-271.patch, fix.patch
>
>
> When we set property with escaped characters, after combine propertySets we got them unescaped.
> Simple Example
> ExtendedProperties props = new ExtendedProperties();
> props.setProperty("test", "\\\\\\\\192.168.1.91\\\\test");
> props.getProperty("test"); // => \\192.168.1.91\test
> ExtendedProperties props2 = new ExtendedProperties();
> props2.combine(props);
> props.getProperty("test"); // => \192.168.1.91\test -- Wrong!

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (COLLECTIONS-271) org.apache.commons.collections.ExtendedProperties#combine don't import string properly

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/COLLECTIONS-271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed COLLECTIONS-271.
-------------------------------------

    Resolution: Fixed

svn ci -m "Applying Nathan Bubna's patch from COLLECTIONS-271 to fix the bug introduced in the last patch where getKeys() breaks after a combine() or subset() call. " src

Sending        src/java/org/apache/commons/collections/ExtendedProperties.java
Sending        src/test/org/apache/commons/collections/TestExtendedProperties.java
Transmitting file data ..
Committed revision 710200.

> org.apache.commons.collections.ExtendedProperties#combine don't import string properly
> --------------------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-271
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-271
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Collection
>    Affects Versions: 3.2
>            Reporter: Alexander Borovsky
>             Fix For: 3.3
>
>         Attachments: COLLECTIONS-271.patch, COLLECTIONS-271.patch, fix.patch
>
>
> When we set property with escaped characters, after combine propertySets we got them unescaped.
> Simple Example
> ExtendedProperties props = new ExtendedProperties();
> props.setProperty("test", "\\\\\\\\192.168.1.91\\\\test");
> props.getProperty("test"); // => \\192.168.1.91\test
> ExtendedProperties props2 = new ExtendedProperties();
> props2.combine(props);
> props.getProperty("test"); // => \192.168.1.91\test -- Wrong!

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.