Skip to content

Commit

Permalink
Quick-fix for Import-Package resolution failure: Edits
Browse files Browse the repository at this point in the history
  • Loading branch information
alshamams committed Sep 5, 2023
1 parent 8775417 commit 34d8f24
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ private void validateImportPackage(IProgressMonitor monitor) {
List<ExportPackageDescription> exports = exported.getOrDefault(name, List.of());
if (!exports.isEmpty()) {
exports.sort(RESOLVED_FIRST);
ExportPackageDescription export = exports.get(0);
for (ExportPackageDescription export : exports) {
if (export.getSupplier().isResolved()) {
Version version = export.getVersion();
org.eclipse.osgi.service.resolver.VersionRange range = importSpec.getVersionRange();
Expand All @@ -1247,7 +1247,7 @@ private void validateImportPackage(IProgressMonitor monitor) {
if (importValue == null || !importValue.equals(exportValue)) {
VirtualMarker marker = report(
NLS.bind(PDECoreMessages.BundleErrorReporter_MissingMandatoryDirective,
name, mandatory),
new String[] { name, mandatory, export.getExporter().getName() }),
getPackageLine(header, element), severity,
PDEMarkerFactory.M_NO_MANDATORY_ATTR_IMPORT_PACKAGE,
PDEMarkerFactory.CAT_FATAL);
Expand All @@ -1259,7 +1259,6 @@ private void validateImportPackage(IProgressMonitor monitor) {
marker.setAttribute("mandatoryAttrName", mandatory); //$NON-NLS-1$
marker.setAttribute("mandatoryAttrValue", exportValue); //$NON-NLS-1$
}
return;
}
}
}
Expand All @@ -1269,6 +1268,8 @@ private void validateImportPackage(IProgressMonitor monitor) {
return;
}
}
return;
}

VirtualMarker marker = report(NLS.bind(PDECoreMessages.BundleErrorReporter_PackageNotExported, name),
getPackageLine(header, element), severity, PDEMarkerFactory.M_IMPORT_PKG_NOT_AVAILABLE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Builders_Manifest_useless_file = A plug-in manifest must contain at least one ex
BuildErrorReporter_missingEntry = ''{0}'' build entry is missing
AddMandatoryAttrResolution_label=Adds mandatory attribute ''{0}'' with value ''{1}''
AddMandatoryAttrResolution_description=Add mandatory attribute value
BundleErrorReporter_MissingMandatoryDirective=The imported package ''{0}'' is missing the mandatory attribute ''{1}'' with a exported value.
BundleErrorReporter_MissingMandatoryDirective=The imported package ''{0}'' is missing the mandatory attribute ''{1}'' with a exported value from ''{2}'' bundle

Builders_Convert_missingAttribute = ''{0}'' attribute is missing
Builders_Convert_illegalValue = Illegal value for ''{0}'' attribute
Expand Down

0 comments on commit 34d8f24

Please sign in to comment.