lbownik commented on code in PR #5091:
URL: https://github.com/apache/netbeans/pull/5091#discussion_r1047422345
##########
java/maven/src/org/netbeans/modules/maven/api/output/OutputUtils.java:
##########
@@ -241,8 +258,12 @@ public ProjectStacktraceOutputListener(Project project) {
protected ClassPath getClassPath() {
Project prj = ref.get();
if(prj != null) {
- ClassPath[] cp =
prj.getLookup().lookup(ProjectSourcesClassPathProvider.class).getProjectClassPaths(ClassPath.EXECUTE);
- return ClassPathSupport.createProxyClassPath(cp);
+ ProjectSourcesClassPathProvider prov =
prj.getLookup().lookup(ProjectSourcesClassPathProvider.class);
+ List<ClassPath> cp = Stream.concat(
+ Stream.of(prov.getProjectClassPaths(ClassPath.BOOT)),
+
Stream.of(prov.getProjectClassPaths(ClassPath.EXECUTE)))
+ .collect(Collectors.toList());
Review Comment:
it's a reallly overcomplicated (and not very efficient) way of cancatenating
arrays :)
how about using something like this
static <T> T[] concat(T[] array1, T[] array2) {
T[] result = Arrays.copyOf(array1, array1.length + array2.length);
System.arraycopy(array2, 0, result, array1.length, array2.length);
return result;
}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists