Ok, I cannot figure this out.
I have a method that returns a String array;
public String[] getstatusSelectedFromFragments(){
int jobCounter = 0;
String[] podSelectedLines = new String[fragArray.length]; //length will be 1 for testing
for(PodStatusFragment f : fragArray){
System.out.println("Job " + (jobCounter+1) + " ;;; ");
String [] selects = f.getSelections();
for(String s : selects){ //there are 6 to go through
podSelectedLines[jobCounter] += s.substring(0, Globals.getPodCodeLen());
System.out.println(s.substring(0, Globals.getPodCodeLen()));
}
jobCounter++;
}
return podSelectedLines; //this should contain 6 repeated codes
}
If I System.out the above as it is being populated, it is correct and return the result; "EPODEPODEPODEPODEPODEPOD"
If I then output the contents after they are returned (below), I get the result; "nullEPODEPODEPODEPODEPODEPOD"
int tryer = 0;
String[] testStats = getstatusSelectedFromFragments();
while(tryer<testStats.length){ //length is 1 for testing
System.out.print("TESTINSTAT::: " + testStats[tryer]);
tryer++;
}
there is nothing in between, it is only the return of the method being output, but at that point it differs. How am I getting an extra entry, and how is it appearing at the beginning? Am I missing something obvious?