mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[platform] fixes noisy nested .jar logging
This commit is contained in:
@@ -28,6 +28,8 @@ import java.util.jar.JarOutputStream;
|
||||
import java.util.jar.Manifest;
|
||||
|
||||
public class CommandLineWrapperUtil {
|
||||
public static final Attributes.Name IJ_CLASS_PATH_JAR = new Attributes.Name("IntellijJ-Class-Path-Jar");
|
||||
|
||||
@NotNull
|
||||
public static File createClasspathJarFile(Manifest manifest, List<String> pathList) throws IOException {
|
||||
return createClasspathJarFile(manifest, pathList, false);
|
||||
@@ -47,6 +49,8 @@ public class CommandLineWrapperUtil {
|
||||
}
|
||||
manifest.getMainAttributes().put(Attributes.Name.CLASS_PATH, classPath.toString());
|
||||
|
||||
manifest.getMainAttributes().put(IJ_CLASS_PATH_JAR, "true");
|
||||
|
||||
File jarFile = FileUtil.createTempFile("classpath", ".jar", true);
|
||||
new JarOutputStream(new BufferedOutputStream(new FileOutputStream(jarFile)), manifest).close();
|
||||
return jarFile;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.util.lang;
|
||||
|
||||
import com.intellij.execution.CommandLineWrapperUtil;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.ShutDownTracker;
|
||||
@@ -220,7 +221,7 @@ public class ClassPath {
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
Logger.getInstance(ClassPath.class).info("url: " + url + " / " + referencedJar, e);
|
||||
Logger.getInstance(ClassPath.class).warn("url: " + url + " / " + referencedJar, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -430,11 +431,14 @@ public class ClassPath {
|
||||
try {
|
||||
JarInputStream inputStream = new JarInputStream(new FileInputStream(file));
|
||||
try {
|
||||
final Manifest manifest = inputStream.getManifest();
|
||||
Manifest manifest = inputStream.getManifest();
|
||||
if (manifest != null) {
|
||||
final String classPath = manifest.getMainAttributes().getValue(Attributes.Name.CLASS_PATH);
|
||||
if (classPath != null) {
|
||||
return classPath.split(" ");
|
||||
String signature = manifest.getMainAttributes().getValue(CommandLineWrapperUtil.IJ_CLASS_PATH_JAR);
|
||||
if (Boolean.parseBoolean(signature)) {
|
||||
String classPath = manifest.getMainAttributes().getValue(Attributes.Name.CLASS_PATH);
|
||||
if (classPath != null) {
|
||||
return classPath.split(" ");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user