-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor clean-ups and simplifications in ExecutionEnvironment #436
base: master
Are you sure you want to change the base?
Conversation
.../launching/org/eclipse/jdt/internal/launching/environments/DefaultAccessRuleParticipant.java
Outdated
Show resolved
Hide resolved
@iloveeclipse is there anything left that should be adjusted or is this ready for submission? |
@@ -453,7 +401,6 @@ private Properties getJavaProfileProperties(Bundle bundle, String path) { | |||
URL profileURL = bundle.getEntry(path); | |||
if (profileURL != null) { | |||
try (InputStream is = profileURL.openStream()) { | |||
profileURL = FileLocator.resolve(profileURL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original code seem to be unnecessary and actually it is a regression from de25fe2 where the profileURL = FileLocator.resolve(profileURL);
was re-resolved before opening the stream.
I would move this line above "try" instead of removing it.
"OSGi/Minimum-1.0", //$NON-NLS-1$ | ||
"OSGi/Minimum-1.1", //$NON-NLS-1$ | ||
"OSGi/Minimum-1.2", //$NON-NLS-1$ | ||
"JavaSE/compact2-1.8", //$NON-NLS-1$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JavaSE/compact1-1.8
is missing now, compared to original code.
for (int major = 9; major <= targetMajor; major++) { | ||
environments.add(JAVASE + '-' + major); | ||
} | ||
for (int minor = 1; minor <= javaVersion.getMinor(); minor++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this loop can be removed, as I haven't seen or heard about JavaSE-10.1, JavaSE-17.2 etc. With that, the code will be much clearer what it is supposed to do.
} | ||
for (int i = 0; i < participants.length; i++) { | ||
IAccessRuleParticipant participant = participants[i]; | ||
List<List<IAccessRule>> libLists = IntStream.range(0, libraries.length) // array of lists of access rules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally have to read the new code more than once to understand what it is supposed to do.
I'm not sure it is worth to refactor it to streams, as this is not a hotspot or whatever what would benefit from the new code, but reading is harder now (IMO).
@HannesWell do you plan to finish this one? |
What it does
Clean-up the code in the
org.eclipse.jdt.internal.launching.environments
package in order to simplify it.Author checklist