[GitHub] jmeter pull request #293: Prevent use of the same array in CollectionPropert...
Github user asfgit closed the pull request at: https://github.com/apache/jmeter/pull/293 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
Re: [GitHub] jmeter pull request #293: Prevent use of the same array in CollectionPropert...
I'm also on the mailing list if somebody has anything to remark about this patch. --emi On Wed, Apr 26, 2017 at 6:04 PM, emilianbold wrote: > GitHub user emilianbold opened a pull request: > > https://github.com/apache/jmeter/pull/293 > > Prevent use of the same array in CollectionProperty (close #58743) > > CollectionProperty constructor receives an empty ObjectTableModel.objects > collection but normalizeList will return it as-is instead of creating a > new empty collection. > > The two classes share the same array but add different kind of classes. > > NOTE: Basically the bug is in AbstractProperty.normalizeList because it > should never reuse the same instance. I've done the patch as you see it > because it has the lowest impact and does not change the normalizeList API > (perhaps reusing is expected in some cases?) > > Let me know if I should redo the patch by just changing normalizeList! > > Constructor stacktrace: > at > org.apache.jmeter.testelement.property.CollectionProperty.(CollectionProperty.java:40) > at > org.apache.jmeter.testelement.property.AbstractProperty.makeProperty(AbstractProperty.java:395) > at > org.apache.jmeter.testelement.property.AbstractProperty.createProperty(AbstractProperty.java:368) > at > org.apache.jmeter.testbeans.gui.TestBeanGUI.setPropertyInElement(TestBeanGUI.java:277) > at > org.apache.jmeter.testbeans.gui.TestBeanGUI.modifyTestElement(TestBeanGUI.java:266) > at > org.apache.jmeter.gui.tree.JMeterTreeModel.addComponent(JMeterTreeModel.java:148) > at org.apache.jmeter.gui.action.AddToTree.doAction(AddToTree.java:70) > at > org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:74) > at > org.apache.jmeter.gui.action.ActionRouter.lambda$actionPerformed$28(ActionRouter.java:59) > at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) > > > You can merge this pull request into a Git repository by running: > > $ git pull https://github.com/emilianbold/jmeter trunk > > Alternatively you can review and apply these changes as the patch at: > > https://github.com/apache/jmeter/pull/293.patch > > To close this pull request, make a commit to your master/trunk branch > with (at least) the following in the commit message: > > This closes #293 > > > commit 2b829035f144c49e565d99ed0ca8f83ba6f85cf4 > Author: Emilian Bold > Date: 2017-04-26T14:57:58Z > > Prevent use of the same array in CollectionProperty (close #58743) > > CollectionProperty constructor receives an empty ObjectTableModel.objects > collection but normalizeList will return it as-is instead of creating a > new empty collection. > > The two classes share the same array but add different kind of classes. > > > > > --- > If your project is set up for it, you can reply to this email and have your > reply appear on GitHub as well. If your project does not have this feature > enabled and wishes so, or if the feature is enabled but not working, please > contact infrastructure at infrastruct...@apache.org or file a JIRA ticket > with INFRA. > ---
[GitHub] jmeter pull request #293: Prevent use of the same array in CollectionPropert...
GitHub user emilianbold opened a pull request: https://github.com/apache/jmeter/pull/293 Prevent use of the same array in CollectionProperty (close #58743) CollectionProperty constructor receives an empty ObjectTableModel.objects collection but normalizeList will return it as-is instead of creating a new empty collection. The two classes share the same array but add different kind of classes. NOTE: Basically the bug is in AbstractProperty.normalizeList because it should never reuse the same instance. I've done the patch as you see it because it has the lowest impact and does not change the normalizeList API (perhaps reusing is expected in some cases?) Let me know if I should redo the patch by just changing normalizeList! Constructor stacktrace: at org.apache.jmeter.testelement.property.CollectionProperty.(CollectionProperty.java:40) at org.apache.jmeter.testelement.property.AbstractProperty.makeProperty(AbstractProperty.java:395) at org.apache.jmeter.testelement.property.AbstractProperty.createProperty(AbstractProperty.java:368) at org.apache.jmeter.testbeans.gui.TestBeanGUI.setPropertyInElement(TestBeanGUI.java:277) at org.apache.jmeter.testbeans.gui.TestBeanGUI.modifyTestElement(TestBeanGUI.java:266) at org.apache.jmeter.gui.tree.JMeterTreeModel.addComponent(JMeterTreeModel.java:148) at org.apache.jmeter.gui.action.AddToTree.doAction(AddToTree.java:70) at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:74) at org.apache.jmeter.gui.action.ActionRouter.lambda$actionPerformed$28(ActionRouter.java:59) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) You can merge this pull request into a Git repository by running: $ git pull https://github.com/emilianbold/jmeter trunk Alternatively you can review and apply these changes as the patch at: https://github.com/apache/jmeter/pull/293.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #293 commit 2b829035f144c49e565d99ed0ca8f83ba6f85cf4 Author: Emilian Bold Date: 2017-04-26T14:57:58Z Prevent use of the same array in CollectionProperty (close #58743) CollectionProperty constructor receives an empty ObjectTableModel.objects collection but normalizeList will return it as-is instead of creating a new empty collection. The two classes share the same array but add different kind of classes. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---