<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>531</bug_id>
          
          <creation_ts>2011-12-02 11:39:04 +0100</creation_ts>
          <short_desc>get*Listeners methods from GLWindow throw ClassCast exceptions</short_desc>
          <delta_ts>2011-12-18 17:11:28 +0100</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Newt</product>
          <component>core</component>
          <version>1</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sebastien Schneider">sebastien.schneider</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>gouessej</cc>
    
    <cc>sebastien.schneider</cc>
    
    <cc>sgothel</cc>
          
          <cf_type>---</cf_type>
          <cf_scm_refs>jogl 927521af10162f2bf8c02b12cce75bd7de71dafe</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1239</commentid>
    <comment_count>0</comment_count>
    <who name="Sebastien Schneider">sebastien.schneider</who>
    <bug_when>2011-12-02 11:39:04 +0100</bug_when>
    <thetext>When I call getMouseListeners or getWindowListeners or getKeyListeners ... on a NEWT GLWindow I get a java ClassCastException that says that a Java Object array cannot be cast to a NEWT Listener array:
[Ljava.lang.Object; cannot be cast to [Lcom.jogamp.newt.event.MouseListener; in the case of the GLWindow.getMouseListeners()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240</commentid>
    <comment_count>1</comment_count>
    <who name="Sebastien Schneider">sebastien.schneider</who>
    <bug_when>2011-12-02 11:42:28 +0100</bug_when>
    <thetext>change JOGL product to NEWT product</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1282</commentid>
    <comment_count>2</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2011-12-15 21:21:20 +0100</bug_when>
    <thetext>Hi

For example, getWindowListeners() should not use toArray() because it returns Object[] instead of WindowListener[].

This method:
public WindowListener[] getWindowListeners() {
    return (WindowListener[]) windowListeners.toArray();
}

should be replaced by this one:
public WindowListener[] getWindowListeners() {
    return windowListeners.toArray(new WindowListener[windowListeners.size]);
}

There is the same bug with getKeyListeners(). If you don&apos;t want to use &lt;T&gt; T[] toArray(T[] a), just use a simple loop. Best regards.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1288</commentid>
    <comment_count>3</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2011-12-18 17:11:28 +0100</bug_when>
    <thetext>fixed - thx.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>