Jump to content
  • Advertisement
Sign in to follow this  
Guest m41q

weird error when calling a method

This topic is 2476 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Guest m41q
Hi,

I encountered a very strange error (in my opinion), when I tried to call a method using arguments from a simple object,
but see for yourself:


Here I call the method:

//"waiters" is an ArrayList: ArrayList<CSoundPlayerWaiter> waiters
if (waiters.size()>0) {
CSoundPlayerWaiter acW = waiters.remove(0);
playSample(acW.getPath(),acW.getSourcePos(),acW.getSourceVel(),acW.getLoop());
}


The method itself looks like this:

public void playSample(String path, FloatBuffer sourcePos, FloatBuffer sourceVel, boolean loop) {
//what it does do here is not of importance because I checked if he even executes it (System.out.println) and it does not even reach this point
}


Finally, the ArrayList above is from the type CSoundPlayerWaiter, wich is an inner class, in the same class as the method and the first piece of code, declared like this:

public class CSoundPlayerWaiter {
private String path;
private FloatBuffer sourcePos;
private FloatBuffer sourceVel;
private boolean loop;

public CSoundPlayerWaiter(String path, FloatBuffer sourcePos, FloatBuffer sourceVel, boolean loop) {
this.path=path;
this.sourcePos=sourcePos;
this.sourceVel=sourceVel;
this.loop=loop;
}

public String getPath() {return path;}
public FloatBuffer getSourcePos() {return sourcePos;}
public FloatBuffer getSourceVel() {return sourceVel;}
public boolean getLoop() {return loop;}
}

This inner class is just here to store the data conveniently and play a bit around with it.


As you can see, I try to call the method with the values that are contained by the inner class (the values were filled previously).

The strange thing about this error now is, that it throws no Exception, it just stops (the background music continues playing though).
For me it looks like an infinite loop, but I don´t see anythig like this in the code, it is proven that the program works fine before calling the method AND when it calls the method it is not even excuted.

Any ideas?
Thx in advance


btw, the variables are not null, I checked that


SOLVED:
sry, I failed with testing the method properly; without knowing it, I used the same variable twice for two different tests,
So: It indeed was an infinte loop (i should have known -.-)

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!