|
Lines 407-412
Link Here
|
| 407 |
|
407 |
|
| 408 |
Properties profileProps = null; |
408 |
Properties profileProps = null; |
| 409 |
boolean added = false; |
409 |
boolean added = false; |
|
|
410 |
String lastPackage = null; |
| 410 |
//javaProfiles are sorted, go in reverse order, and if when we hit 0 we haven't added any yet, |
411 |
//javaProfiles are sorted, go in reverse order, and if when we hit 0 we haven't added any yet, |
| 411 |
//then add that last profile so we have something. |
412 |
//then add that last profile so we have something. |
| 412 |
for (int j = javaProfiles.length - 1; j >= 0; j--) { |
413 |
for (int j = javaProfiles.length - 1; j >= 0; j--) { |
|
Lines 420-430
Link Here
|
| 420 |
|
421 |
|
| 421 |
prop = new Hashtable<>(); |
422 |
prop = new Hashtable<>(); |
| 422 |
prop.put(ProfileManager.SYSTEM_PACKAGES, systemPackages); |
423 |
prop.put(ProfileManager.SYSTEM_PACKAGES, systemPackages); |
|
|
424 |
lastPackage = systemPackages; |
| 423 |
prop.put(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, ee); |
425 |
prop.put(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, ee); |
| 424 |
properties.add(prop); |
426 |
properties.add(prop); |
| 425 |
added = true; |
427 |
added = true; |
| 426 |
} |
428 |
} |
| 427 |
} |
429 |
} |
|
|
430 |
} |
| 431 |
|
| 432 |
// from java 10 and beyond |
| 433 |
String[] java10AndBeyond = {"JavaSE-10", "JavaSE-11"}; //$NON-NLS-1$//$NON-NLS-2$ |
| 434 |
String eej10 = "OSGi/Minimum-1.0,OSGi/Minimum-1.1,OSGi/Minimum-1.2,JRE-1.1,J2SE-1.2,J2SE-1.3,J2SE-1.4,J2SE-1.5,JavaSE-1.6,JavaSE-1.7,JavaSE-1.8,JavaSE-9,JavaSE-10"; //$NON-NLS-1$ |
| 435 |
String eej11 = "OSGi/Minimum-1.0,OSGi/Minimum-1.1,OSGi/Minimum-1.2,JRE-1.1,J2SE-1.2,J2SE-1.3,J2SE-1.4,J2SE-1.5,JavaSE-1.6,JavaSE-1.7,JavaSE-1.8,JavaSE-9,JavaSE-10,JavaSE-11"; //$NON-NLS-1$ |
| 436 |
|
| 437 |
prop = new Hashtable<>(); |
| 438 |
for (String string : java10AndBeyond) { |
| 439 |
prop = new Hashtable<>(); |
| 440 |
if (string.equals("JavaSE-10")) { //$NON-NLS-1$ |
| 441 |
prop.put(ProfileManager.SYSTEM_PACKAGES, lastPackage); |
| 442 |
prop.put(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, eej10); |
| 443 |
} |
| 444 |
if (string.equals("JavaSE-11")) { //$NON-NLS-1$ |
| 445 |
prop.put(ProfileManager.SYSTEM_PACKAGES, lastPackage); |
| 446 |
prop.put(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, eej11); |
| 447 |
} |
| 448 |
properties.add(prop); |
| 428 |
} |
449 |
} |
| 429 |
|
450 |
|
| 430 |
Dictionary<String, Object>[] stateProperties = properties.toArray(new Dictionary[properties.size()]); |
451 |
Dictionary<String, Object>[] stateProperties = properties.toArray(new Dictionary[properties.size()]); |
|
Lines 487-492
Link Here
|
| 487 |
} |
508 |
} |
| 488 |
Version parsedVersion = Version.parseVersion(version); |
509 |
Version parsedVersion = Version.parseVersion(version); |
| 489 |
BundleDescription description = getState().getBundle(bundleId, parsedVersion); |
510 |
BundleDescription description = getState().getBundle(bundleId, parsedVersion); |
|
|
511 |
|
| 512 |
// ResolverError[] resolutionErrors = state.getResolverErrors(description); |
| 513 |
// if (resolutionErrors.length == 1) { |
| 514 |
// ResolverError resolverError = resolutionErrors[0]; |
| 515 |
// String data = resolverError.getData(); |
| 516 |
// if (data.startsWith("Bundle-RequiredExecutionEnvironment: JavaSE")) { //$NON-NLS-1$ |
| 517 |
// resolved = false; |
| 518 |
// } |
| 519 |
// } |
| 520 |
|
| 490 |
if (description != null && (!resolved || description.isResolved())) |
521 |
if (description != null && (!resolved || description.isResolved())) |
| 491 |
return description; |
522 |
return description; |
| 492 |
|
523 |
|