logger.debug("aPackArray="+aPackArray.length);
Collection<CrawlResultPackage> aCrawlCollTemp2=new ArrayList<CrawlResultPackage>();
for (int i=0+aInt10Percent;i<=aCrawlCollTemp.size()-aInt10Percent-1;i++){
CrawlResultPackage aPack=(CrawlResultPackage)aPackArray[i];
logger.debug("aPack="+aPack.getPriceOfItem());
aCrawlCollTemp2.add(aPack);
}
logger.debug("aCrawlCollTemp2="+aCrawlCollTemp2.size());
Object[] aPackArrayRet=aCrawlCollTemp2.toArray();
logger.info("aPackArrayRet.length="+aPackArrayRet.length);
Collection<CrawlResultPackage> aCrawlCollRet=new ArrayList<CrawlResultPackage>();
int littleEqual=aPackArrayRet.length-this.howManyOffersToReturn;
// Check if it turn to minus and if yes set it to 0
if (littleEqual<0){
littleEqual=0;
}
logger.debug("aPackArrayRet.length="+aPackArrayRet.length);
logger.debug(aPackArrayRet.length-1+">="+littleEqual);
try {
for (int i = littleEqual; i < aPackArrayRet.length; i++){
logger.debug("ArrayLength="+aPackArrayRet.length+" ["+i+"]>="+littleEqual+"************************");
CrawlResultPackage aPack2=(CrawlResultPackage)aPackArrayRet[i];
logger.debug(i+". aPack2="+aPack2.getPriceOfItem());
aCrawlCollRet.add(aPack2);
}
} catch (ArrayIndexOutOfBoundsException e){
logger.fatal(e.toString());
e.printStackTrace();