[ 
https://issues.apache.org/jira/browse/VFS-658?focusedWorklogId=235995&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-235995
 ]

ASF GitHub Bot logged work on VFS-658:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/May/19 20:45
            Start Date: 01/May/19 20:45
    Worklog Time Spent: 10m 
      Work Description: markt-asf commented on pull request #34: VFS-658 
org.apache.commons.vfs2.util.CombinedResources.getKeys() fail
URL: https://github.com/apache/commons-vfs/pull/34
 
 
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

            Worklog Id:     (was: 235995)
            Time Spent: 10m
    Remaining Estimate: 0h

> org.apache.commons.vfs2.util.CombinedResources.getKeys() fail
> -------------------------------------------------------------
>
>                 Key: VFS-658
>                 URL: https://issues.apache.org/jira/browse/VFS-658
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.2
>            Reporter: binchen
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Invoke CombinedResource.getKeys() could lead to a dead cycle. source code :
> @Override
>  public Enumeration<String> getKeys() {
>  if (!inited)
> { init(); }
> *return new Enumeration<String>() {*
>  *@Override*
>  *public boolean hasMoreElements() {*
>  *return properties.keys().hasMoreElements();*
>  *}*
> *@Override*
>  *public String nextElement() {*
>  *// We know that our properties will only ever contain Strings*
>  *return (String) properties.keys().nextElement();*
>  *}*
> *}*;
>  }
> The bold code above has bugs, the right code may be like below:
> _return new Enumeration<String>() {_
>  _Enumeration<Object> proEnums = CombinedResources.this.properties.keys();_
> _@Override_
>  _public boolean hasMoreElements() {_
>  _return this.proEnums.hasMoreElements();_
>  _}_
> _@Override_
>  _public String nextElement() {_
>  _// We know that our properties will only ever contain Strings_
>  _return (String) this.proEnums.nextElement();_
>  _}_
>  _};_
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to