FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Bugs
   Bug Fixes, Implemented Suggestions
(Moderator: fry)
   inner class constructor
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: inner class constructor  (Read 362 times)
nashdj


inner class constructor
« on: Aug 14th, 2002, 3:49am »

Something very strange happens when I attempt to call proce55ing methods from an inner classes constructor.
 
For example, this works correctly:
 
void setup()
{
  new Test();
}
 
class Test
{
  Test()
  {
    float f = cos(10);
  }
}
 
 
Whereas this, causes the error "Exception occurred during event dispatching" to be displayed, and locks up the editor (to the point where I have to manually kill it - winxp).
 
void setup()
{
  new Test(10);
}
 
class Test
{
  Test(float testvalue)
  {
    float i = cos(10);
  }
}
 
 
Strangely, this example does work:
 
void setup()
{
  new Test(10);
}
 
class Test
{
  Test(float testvalue)
  {
    float i = mycos(10);
  }
 
  float mycos(float v)
  {
    return cos(v);
  }
}
 
My use of cos here is just an example, the problem seems to occur with all the ususal methods. At least all the ones I have tried.
 
- nashdj
 
fry


WWW
Re: inner class constructor
« Reply #1 on: Aug 15th, 2002, 12:30am »

hmm.. this is outside the scope of anything we mess with directly, so it's either a 1) kjc problem (the compiler we're using), 2) a java language spec problem, or 3) a vm problem.  
 
#1 seems a likely suspect, #2 seems less so, and #3 would be likely because of the nature of the newer sun vms, which can be a little flakey. in addition, the fact that it causes an exception at runtime (as opposed to compile time) seems awfully suspect.
 
have you tried similar code w/ another java compiler?
 
fry


WWW
Re: inner class constructor
« Reply #2 on: Aug 15th, 2003, 6:48pm »

fixed in 57/58.
 
Pages: 1 

« Previous topic | Next topic »