Bug 49394 - Classcast Exception in ActionRouter.postActionPerformed
Classcast Exception in ActionRouter.postActionPerformed
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: Main
Nightly (Please specify date)
All Linux
: P2 normal (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2010-06-06 12:54 UTC by Dave Brosius
Modified: 2010-08-17 12:51 UTC (History)
0 users



Attachments
patch for class cast exception (1.41 KB, patch)
2010-06-06 12:54 UTC, Dave Brosius
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Brosius 2010-06-06 12:54:14 UTC
Created attachment 25533 [details]
patch for class cast exception

code uses the reflective version of toArray to convert a HashSet to an array, and casts it to the real type of the hashset. However, because of type erasure, there's no way for toArray to know what the correct type is, and instead returns an Object[] instead of an ActionListener[]. Changed code to use the non-reflective version of toArray which correctly returns the real type of the array.

Also changed preActionPerformed to use the non-reflective version as well, even though that code was correct. (But using this version is more performant).
Comment 1 Sebb 2010-06-06 15:58:11 UTC
Thanks, patch applied:

URL: http://svn.apache.org/viewvc?rev=951940&view=rev
Log:
Bug 49394 - Classcast Exception in ActionRouter.postActionPerformed

Modified:
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/gui/action/ActionRouter.java
   jakarta/jmeter/trunk/xdocs/changes.xml


BTW, did you get a CCE, or was this a bug found by Findbugs?