weird error when calling a method

Started by
-1 comments, last by GameDev.net 12 years, 1 month ago
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 -.-)

This topic is closed to new replies.

Advertisement