// Initialize the contribution imports
for (Import import_: contribution.getImports()) {
boolean initialized = false;
if(import_ instanceof JavaImport) {
JavaImport javaImport = (JavaImport) import_;
//Find a matching contribution
if(javaImport.getLocation() != null) {
Contribution targetContribution = repository.getContribution(javaImport.getLocation());
if (targetContribution != null) {
// Find a matching contribution export
for (Export export: targetContribution.getExports()) {
if (export instanceof JavaExport) {
JavaExport javaExport = (JavaExport)export;
if (javaImport.getPackage().equals(javaExport.getPackage())) {
List<Contribution> exportingContributions = new ArrayList<Contribution>();
exportingContributions.add(targetContribution);
javaImport.setModelResolver(new JavaImportModelResolver(exportingContributions, javaExport.getModelResolver()));
initialized = true;
break;
}
}
}