Community
Participate
Working Groups
I have some code that calls SystemRegistry.getLocalHost when my plugin is loaded. When eclipse starts up with this code, I get the following exception in the log: java.lang.ArrayStoreException at java.lang.System.arraycopy(Native Method) at java.util.ArrayList.toArray(ArrayList.java:330) at org.eclipse.rse.internal.core.filters.SystemFilter.getPersistableChildren(SystemFilter.java:1391) at org.eclipse.rse.internal.persistence.RSEPersistenceManager.cleanTree(RSEPersistenceManager.java:447) at org.eclipse.rse.internal.persistence.RSEPersistenceManager.cleanTree(RSEPersistenceManager.java:450) at org.eclipse.rse.internal.persistence.RSEPersistenceManager.cleanTree(RSEPersistenceManager.java:450) at org.eclipse.rse.internal.persistence.RSEPersistenceManager.load(RSEPersistenceManager.java:399) at org.eclipse.rse.internal.persistence.RSEPersistenceManager.loadProfiles(RSEPersistenceManager.java:374) at org.eclipse.rse.internal.persistence.RSEPersistenceManager.restoreProfiles(RSEPersistenceManager.java:233) at org.eclipse.rse.internal.persistence.RSEPersistenceManager.restoreProfiles(RSEPersistenceManager.java:219) at org.eclipse.rse.internal.core.model.SystemProfileManager.getDefault(SystemProfileManager.java:58) at org.eclipse.rse.ui.internal.model.SystemRegistry.getSystemProfileManager(SystemRegistry.java:464) at org.eclipse.rse.ui.internal.model.SystemRegistry.getHostPools(SystemRegistry.java:1357) at org.eclipse.rse.ui.internal.model.SystemRegistry.getHosts(SystemRegistry.java:1398) at org.eclipse.rse.ui.internal.model.SystemRegistry.getHostsBySystemType(SystemRegistry.java:1492) at org.eclipse.rse.ui.internal.model.SystemRegistry.getLocalHost(SystemRegistry.java:1388)
I believe this is happening because the profiles have not yet finished loading. See the reply to Bug 202040 and see if that helps.
I took a look at the RSE code. In getPersistableChildren() it does: if (filterStringVector != null) { children.addAll(filterStringVector); } children.addAll(Arrays.asList(getPropertySets())); IRSEPersistableContainer[] result = new IRSEPersistableContainer[children.size()]; children.toArray(result); return result; The "children" list is filled with the filterStringVector elements. These elements are strings. However, the children list is expected to contain elements of type IRSEPersistableContainer. I think that is the source of the problem. Please let me know if I am missing something.
I was wondering if there is any progress on this problem?
This is probably the direct cause of the exception. I'm having a hard time writing a test case to confirm a fix. Can you give some hints as to what sort of filter is causing this problem?
This bug was probably also caused by the SystemHostPool not being thread-safe. My fix in bug 206742 might thus also fix this issue -- the traceback in that bug was also rooted on SystemRegistry.getLocalHost(). Was this problem ever reproducable? Is it still reproducable with the latest TM I-build?
I am integrating changes that simplify the internal structure of the classes and that should take care of the initial problem that Ankit found. There is one API change in SystemFilterSimple -- some fields were changed from protected to private visibility. All method signatures remain the same. I will be cleanup up commented out code in both classes later today as [cleanup].