You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Niall Pemberton (JIRA)" <ji...@apache.org> on 2007/04/19 17:11:15 UTC

[jira] Created: (JCI-45) ReloadingClassLoader's removeResourceStore() method doesn't work

ReloadingClassLoader's removeResourceStore() method doesn't work
----------------------------------------------------------------

                 Key: JCI-45
                 URL: https://issues.apache.org/jira/browse/JCI-45
             Project: Commons JCI
          Issue Type: Bug
          Components: core
    Affects Versions: 1.0RC2
            Reporter: Niall Pemberton


There are a number of bugs in ReloadingClassLoader's removeResourceStore() method:

1) While Loop
The While loop that searches for the ResourceStore to remove throws an ArrayOutOfBoundsException if the ResourceStore is not found

2) Removing the last ResourceStore fails to update the delegate ClassLoader
If the ResourceStore being removed is the last one an empty array is created, but the delegate ResourceStoreClassLoader is not updated - which means calling loadClass() for a class in that store still returns the Class rather than throwing a ClassNotFoundException

3) Removing a ResourceStore when there is more than one in the array doesn't work at all
The two System.arraycopy() statements used to create a new array without the ResourceStore being removed doesn't work. The position and length parameters are wrong and result in either a ArrayOutOfBoundsException being thrown or the wrong ResourceStore(s) being removed.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Updated: (JCI-45) ReloadingClassLoader's removeResourceStore() method doesn't work

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCI-45?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niall Pemberton updated JCI-45:
-------------------------------

    Attachment: JCI-45-ReloadingClassLoader-remove.patch
                ReloadingClassLoaderRemoveTestCase.java

Attaching two files:

1) ReloadingClassLoaderRemoveTestCase - new test case to demonstrate the problems with the removeResourceStore method

2) Patch for ReloadingClassLoader which fixes the issues

> ReloadingClassLoader's removeResourceStore() method doesn't work
> ----------------------------------------------------------------
>
>                 Key: JCI-45
>                 URL: https://issues.apache.org/jira/browse/JCI-45
>             Project: Commons JCI
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.0RC2
>            Reporter: Niall Pemberton
>         Attachments: JCI-45-ReloadingClassLoader-remove.patch, ReloadingClassLoaderRemoveTestCase.java
>
>
> There are a number of bugs in ReloadingClassLoader's removeResourceStore() method:
> 1) While Loop
> The While loop that searches for the ResourceStore to remove throws an ArrayOutOfBoundsException if the ResourceStore is not found
> 2) Removing the last ResourceStore fails to update the delegate ClassLoader
> If the ResourceStore being removed is the last one an empty array is created, but the delegate ResourceStoreClassLoader is not updated - which means calling loadClass() for a class in that store still returns the Class rather than throwing a ClassNotFoundException
> 3) Removing a ResourceStore when there is more than one in the array doesn't work at all
> The two System.arraycopy() statements used to create a new array without the ResourceStore being removed doesn't work. The position and length parameters are wrong and result in either a ArrayOutOfBoundsException being thrown or the wrong ResourceStore(s) being removed.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Closed: (JCI-45) ReloadingClassLoader's removeResourceStore() method doesn't work

Posted by "Torsten Curdt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCI-45?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Torsten Curdt closed JCI-45.
----------------------------

    Resolution: Fixed

applied. thanks!

> ReloadingClassLoader's removeResourceStore() method doesn't work
> ----------------------------------------------------------------
>
>                 Key: JCI-45
>                 URL: https://issues.apache.org/jira/browse/JCI-45
>             Project: Commons JCI
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.0RC2
>            Reporter: Niall Pemberton
>             Fix For: 1.0
>
>         Attachments: JCI-45-ReloadingClassLoader-remove.patch, ReloadingClassLoaderRemoveTestCase.java
>
>
> There are a number of bugs in ReloadingClassLoader's removeResourceStore() method:
> 1) While Loop
> The While loop that searches for the ResourceStore to remove throws an ArrayOutOfBoundsException if the ResourceStore is not found
> 2) Removing the last ResourceStore fails to update the delegate ClassLoader
> If the ResourceStore being removed is the last one an empty array is created, but the delegate ResourceStoreClassLoader is not updated - which means calling loadClass() for a class in that store still returns the Class rather than throwing a ClassNotFoundException
> 3) Removing a ResourceStore when there is more than one in the array doesn't work at all
> The two System.arraycopy() statements used to create a new array without the ResourceStore being removed doesn't work. The position and length parameters are wrong and result in either a ArrayOutOfBoundsException being thrown or the wrong ResourceStore(s) being removed.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Updated: (JCI-45) ReloadingClassLoader's removeResourceStore() method doesn't work

Posted by "Torsten Curdt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCI-45?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Torsten Curdt updated JCI-45:
-----------------------------

    Fix Version/s: 1.0

> ReloadingClassLoader's removeResourceStore() method doesn't work
> ----------------------------------------------------------------
>
>                 Key: JCI-45
>                 URL: https://issues.apache.org/jira/browse/JCI-45
>             Project: Commons JCI
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.0RC2
>            Reporter: Niall Pemberton
>             Fix For: 1.0
>
>         Attachments: JCI-45-ReloadingClassLoader-remove.patch, ReloadingClassLoaderRemoveTestCase.java
>
>
> There are a number of bugs in ReloadingClassLoader's removeResourceStore() method:
> 1) While Loop
> The While loop that searches for the ResourceStore to remove throws an ArrayOutOfBoundsException if the ResourceStore is not found
> 2) Removing the last ResourceStore fails to update the delegate ClassLoader
> If the ResourceStore being removed is the last one an empty array is created, but the delegate ResourceStoreClassLoader is not updated - which means calling loadClass() for a class in that store still returns the Class rather than throwing a ClassNotFoundException
> 3) Removing a ResourceStore when there is more than one in the array doesn't work at all
> The two System.arraycopy() statements used to create a new array without the ResourceStore being removed doesn't work. The position and length parameters are wrong and result in either a ArrayOutOfBoundsException being thrown or the wrong ResourceStore(s) being removed.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org