Skip to content

Commit

Permalink
Remove wrong validation error about forbidden import of java.* packages
Browse files Browse the repository at this point in the history
java.* packages are not forbidden to import (with modular JDKs one is
even encouraged to list java.* packages).
Even though this error only showed up if any imported package could not
be resolved, but since it is (now) perfectly fine to import them as
well, there should not be a special error message for that case.
This could even cause a false positive if another package is not
resolved.
  • Loading branch information
HannesWell committed Aug 12, 2023
1 parent 8435fdd commit da1488e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,6 @@ public class PDECoreMessages extends NLS {

public static String BundleErrorReporter_exportNoJRE;

public static String BundleErrorReporter_importNoJRE;

public static String ManifestConsistencyChecker_0;

public static String ManifestConsistencyChecker_buildDoesNotExist;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1206,19 +1206,10 @@ private void validateImportPackage(IProgressMonitor monitor) {
int length = element.getValueComponents().length;
for (int j = 0; j < length; j++) {
ImportPackageSpecification importSpec = imports[index++];
String name = importSpec.getName();
if (name.equals("java") || name.startsWith("java.")) { //$NON-NLS-1$ //$NON-NLS-2$
IHeader jreHeader = getHeader(ICoreConstants.ECLIPSE_JREBUNDLE);
if (jreHeader == null || !"true".equals(jreHeader.getValue())) { //$NON-NLS-1$
report(PDECoreMessages.BundleErrorReporter_importNoJRE, getPackageLine(header, element), CompilerFlags.ERROR, PDEMarkerFactory.M_JAVA_PACKAGE__PORTED, PDEMarkerFactory.CAT_FATAL);
continue;
}
}

if (importSpec.isResolved() || !isCheckUnresolvedImports()) {
continue;
}

String name = importSpec.getName();
boolean optional = isOptional(element);
int severity = getRequireBundleSeverity(element, optional);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,9 @@ BundleErrorReporter_NotExistPDE=Bundle ''{0}'' cannot be resolved
BundleErrorReporter_EmptyTargetPlatform=Target Platform is not set
BundleErrorReporter_ExecEnv_tooLow=Execution environment is lower than one of the plug-in''s dependencies ({1}) which has an execution environment of {0}.
BundleErrorReporter_exportNoJRE=Cannot export packages prefixed with 'java'
BundleErrorReporter_importNoJRE=Cannot import packages prefixed with 'java'
BundleErrorReporter_HostNotExistPDE=Host bundle ''{0}'' cannot be resolved
BundleErrorReporter_HostNeeded=Fragment-Host must be defined for this fragment
BundleErrorReporter_PackageNotExported=No available bundle exports package ''{0}''
BundleErrorReporter_PackageNotExported=Neither an available bundle nor the associated JRE export package ''{0}''
BundleErrorReporter_unresolvedExporter=Bundle ''{0}'' exporting package ''{1}'' is unresolved
BundleErrorReporter_reqExecEnv_unknown=''{0}'' is not a valid Execution Environment
BundleErrorReporter_InvalidSymbolicName=Bundle symbolic name contains illegal characters. Legal characters are A-Z a-z 0-9 . _ -
Expand Down

0 comments on commit da1488e

Please sign in to comment.