// here we use the actual name & the temporary name which is converted to lower case for comparison
//purposes. We are doing the same operations to both the Strings.
for(FeatureWrapper featureWrapper : featureList){
Feature currentFeature=featureWrapper.getWrappedFeature();
String featureName=currentFeature.getFeatureName();
String tempStr=currentFeature.getFeatureName().toLowerCase();
if(tempStr.startsWith(prefix1)){ // if the name starts with the wso2; we test for minor changes
tempStr=tempStr.substring(prefix1.length()).trim();
featureName=featureName.substring(prefix1.length()).trim();
}
else if(tempStr.startsWith(prefix2)){
tempStr= tempStr.substring(prefix2.length()).trim();
featureName=featureName.substring(prefix2.length()).trim();
}else if(tempStr.startsWith(prefix3)){
tempStr= tempStr.substring(prefix3.length()).trim();
featureName=featureName.substring(prefix3.length()).trim();
}
// eliminating the first character if it is a '-'
if(tempStr.startsWith("-")){
tempStr=tempStr.substring(1).trim();
featureName=featureName.substring(1).trim();
}
if(tempStr.endsWith(suffix)){
int tempIndex=tempStr.lastIndexOf(suffix);
tempStr=tempStr.substring(0,tempIndex);
featureName=featureName.substring(0,tempIndex);
}
currentFeature.setFeatureName(featureName.trim());
}
return featureList;
}