Skip to content
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

section name for imported libraries #277

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2020, Gluon and/or its affiliates.
* Copyright (c) 2017, 2021, Gluon and/or its affiliates.
* Copyright (c) 2012, 2014, Oracle and/or its affiliates.
* All rights reserved. Use is subject to license terms.
*
Expand Down Expand Up @@ -438,15 +438,22 @@ private Collection<LibraryItem> makeLibraryItems(JarReport jarOrFolderReport) th
if (!excludedItems.contains(canonicalName) &&
!artifactsFilter.contains(canonicalName)) {
final String name = e.getKlass().getSimpleName();
final String sectionName = createSectionName(jarOrFolderReport);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be outside the for loop

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, José!

final String fxmlText = BuiltinLibrary.makeFxmlText(e.getKlass());
result.add(new LibraryItem(name, UserLibrary.TAG_USER_DEFINED, fxmlText, iconURL, library));
result.add(new LibraryItem(name, sectionName, fxmlText, iconURL, library));
}
}
}

return result;
}

private String createSectionName(JarReport jarReport) {
try {
return jarReport.getJar().toFile().getName().replace(".jar", "");
} catch (Exception e) {
return UserLibrary.TAG_USER_DEFINED;
}
}

private URL[] makeURLArrayFromPaths(Collection<Path> paths) {
final URL[] result = new URL[paths.size()];
Expand Down