Blame SOURCES/8-revert-flameview.patch

6842c8
diff --git a/application/org.openjdk.jmc.flightrecorder.flameview/pom.xml b/application/org.openjdk.jmc.flightrecorder.flameview/pom.xml
6842c8
index 89cc5e9a..d61b28c6 100644
6842c8
--- a/application/org.openjdk.jmc.flightrecorder.flameview/pom.xml
6842c8
+++ b/application/org.openjdk.jmc.flightrecorder.flameview/pom.xml
6842c8
@@ -42,94 +42,4 @@
6842c8
 	</parent>
6842c8
 	<artifactId>org.openjdk.jmc.flightrecorder.flameview</artifactId>
6842c8
 	<packaging>eclipse-plugin</packaging>
6842c8
-
6842c8
-	<properties>
6842c8
-		<download.maven.plugin.version>1.6.0</download.maven.plugin.version>
6842c8
-		<download-maven-plugin.phase>process-resources</download-maven-plugin.phase>
6842c8
-		<download-maven-plugin.output>${project.basedir}/src/main/resources/jslibs</download-maven-plugin.output>
6842c8
-		<spotless.config.path>${basedir}/../../configuration/ide/eclipse/formatting/formatting.xml</spotless.config.path>
6842c8
-		<spotless.config.path.js>${basedir}/../../configuration/ide/eclipse/formatting/formattingjs.xml</spotless.config.path.js>
6842c8
-	</properties>
6842c8
-
6842c8
-	<build>
6842c8
-		<plugins>
6842c8
-			<plugin>
6842c8
-				<groupId>com.googlecode.maven-download-plugin</groupId>
6842c8
-				<artifactId>download-maven-plugin</artifactId>
6842c8
-				<version>${download.maven.plugin.version}</version>
6842c8
-				<executions>
6842c8
-					<execution>
6842c8
-						<id>d3-flamegraph-css</id>
6842c8
-						<phase>${download-maven-plugin.phase}</phase>
6842c8
-						<goals>
6842c8
-							<goal>wget</goal>
6842c8
-						</goals>
6842c8
-						<configuration>
6842c8
-							<url>https://cdn.jsdelivr.net/npm/d3-flame-graph@4.0.6/dist/d3-flamegraph.css</url>
6842c8
-							<unpack>false</unpack>
6842c8
-							<outputDirectory>${download-maven-plugin.output}</outputDirectory>
6842c8
-						</configuration>
6842c8
-					</execution>
6842c8
-					<execution>
6842c8
-						<id>d3-v6-js</id>
6842c8
-						<phase>${download-maven-plugin.phase}</phase>
6842c8
-						<goals>
6842c8
-							<goal>wget</goal>
6842c8
-						</goals>
6842c8
-						<configuration>
6842c8
-							<url>https://d3js.org/d3.v6.min.js</url>
6842c8
-							<unpack>false</unpack>
6842c8
-							<outputDirectory>${download-maven-plugin.output}</outputDirectory>
6842c8
-						</configuration>
6842c8
-					</execution>
6842c8
-					<execution>
6842c8
-						<id>d3-flamegraph-tooltip-js</id>
6842c8
-						<phase>${download-maven-plugin.phase}</phase>
6842c8
-						<goals>
6842c8
-							<goal>wget</goal>
6842c8
-						</goals>
6842c8
-						<configuration>
6842c8
-							<url>https://cdn.jsdelivr.net/npm/d3-flame-graph@4.0.6/dist/d3-flamegraph-tooltip.js</url>
6842c8
-							<unpack>false</unpack>
6842c8
-							<outputDirectory>${download-maven-plugin.output}</outputDirectory>
6842c8
-						</configuration>
6842c8
-					</execution>
6842c8
-					<execution>
6842c8
-						<id>d3-flamegraph-js</id>
6842c8
-						<phase>${download-maven-plugin.phase}</phase>
6842c8
-						<goals>
6842c8
-							<goal>wget</goal>
6842c8
-						</goals>
6842c8
-						<configuration>
6842c8
-							<url>https://cdn.jsdelivr.net/npm/d3-flame-graph@4.0.6/dist/d3-flamegraph.js</url>
6842c8
-							<unpack>false</unpack>
6842c8
-							<outputDirectory>${download-maven-plugin.output}</outputDirectory>
6842c8
-						</configuration>
6842c8
-					</execution>
6842c8
-				</executions>
6842c8
-			</plugin>
6842c8
-			
6842c8
-			<plugin>
6842c8
-				<groupId>com.diffplug.spotless</groupId>
6842c8
-				<artifactId>spotless-maven-plugin</artifactId>
6842c8
-				<version>${spotless.version}</version>
6842c8
-				<configuration>
6842c8
-					<formats>
6842c8
-						<format>
6842c8
-							<includes>
6842c8
-								<include>src/main/js/*.js</include>
6842c8
-							</includes>
6842c8
-							<eclipseWtp>
6842c8
-								<type>JS</type>
6842c8
-								<files>
6842c8
-									<file>${spotless.config.path.js}</file>
6842c8
-								</files>
6842c8
-							</eclipseWtp>
6842c8
-						</format>
6842c8
-					</formats>
6842c8
-				</configuration>
6842c8
-			</plugin>
6842c8
-			-->
6842c8
-		</plugins>
6842c8
-	</build>
6842c8
 </project>
6842c8
diff --git a/application/org.openjdk.jmc.flightrecorder.flameview/src/main/java/org/openjdk/jmc/flightrecorder/flameview/views/FlameGraphView.java b/application/org.openjdk.jmc.flightrecorder.flameview/src/main/java/org/openjdk/jmc/flightrecorder/flameview/views/FlameGraphView.java
6842c8
index dc43ba8c..a8b76b0c 100644
6842c8
--- a/application/org.openjdk.jmc.flightrecorder.flameview/src/main/java/org/openjdk/jmc/flightrecorder/flameview/views/FlameGraphView.java
6842c8
+++ b/application/org.openjdk.jmc.flightrecorder.flameview/src/main/java/org/openjdk/jmc/flightrecorder/flameview/views/FlameGraphView.java
6842c8
@@ -61,7 +61,6 @@ import java.util.concurrent.Executors;
6842c8
 import java.util.concurrent.ThreadFactory;
6842c8
 import java.util.concurrent.atomic.AtomicInteger;
6842c8
 import java.util.logging.Level;
6842c8
-import java.util.stream.Collectors;
6842c8
 import java.util.stream.Stream;
6842c8
 
6842c8
 import org.eclipse.jface.action.Action;
6842c8
@@ -120,27 +119,17 @@ public class FlameGraphView extends ViewPart implements ISelectionListener {
6842c8
 	private static final String TOOLTIP_DESCRIPTION = getFlameviewMessage(FLAMEVIEW_SELECT_HTML_TOOLTIP_DESCRIPTION);
6842c8
 	private static final String HTML_PAGE;
6842c8
 	static {
6842c8
-		// from: https://cdn.jsdelivr.net/npm/d3-flame-graph@4.0.6/dist/d3-flamegraph.css
6842c8
-		String cssD3Flamegraph = "jslibs/d3-flamegraph.css";
6842c8
-		// from: https://d3js.org/d3.v6.min.js
6842c8
-		String jsD3V6 = "jslibs/d3.v6.min.js";
6842c8
-		// from: https://cdn.jsdelivr.net/npm/d3-flame-graph@4.0.6/dist/d3-flamegraph-tooltip.js
6842c8
-		String jsD3Tip = "jslibs/d3-flamegraph-tooltip.js";
6842c8
-		// from: https://cdn.jsdelivr.net/npm/d3-flame-graph@4.0.6/dist/d3-flamegraph.js
6842c8
-		String jsD3FlameGraph = "jslibs/d3-flamegraph.js";
6842c8
-		// jmc flameview coloring, tooltip and other  functions
6842c8
 		String jsFlameviewName = "flameview.js";
6842c8
 		String cssFlameview = "flameview.css";
6842c8
 
6842c8
-		String jsD3 = loadLibraries(jsD3V6, jsD3FlameGraph, jsD3Tip);
6842c8
-		String styleheets = loadLibraries(cssD3Flamegraph, cssFlameview);
6842c8
+		String styleheets = fileContent(cssFlameview);
6842c8
 		String jsFlameviewColoring = fileContent(jsFlameviewName);
6842c8
 
6842c8
 		String magnifierIcon = getIconBase64(ImageConstants.ICON_MAGNIFIER);
6842c8
 
6842c8
 		// formatter arguments for the template: %1 - CSSs stylesheets,
6842c8
-		// %2 - Search Icon Base64, %3 - 3rd party scripts, %4 - Flameview Coloring,
6842c8
-		HTML_PAGE = String.format(fileContent("page.template"), styleheets, magnifierIcon, jsD3, jsFlameviewColoring);
6842c8
+		// %2 - Search Icon Base64, %3 - Flameview Coloring,
6842c8
+		HTML_PAGE = String.format(fileContent("page.template"), styleheets, magnifierIcon, jsFlameviewColoring);
6842c8
 	}
6842c8
 
6842c8
 	private static final int MODEL_EXECUTOR_THREADS_NUMBER = 3;
6842c8
@@ -490,14 +479,6 @@ public class FlameGraphView extends ViewPart implements ISelectionListener {
6842c8
 		}
6842c8
 	}
6842c8
 
6842c8
-	private static String loadLibraries(String ... libs) {
6842c8
-		if (libs == null || libs.length == 0) {
6842c8
-			return "";
6842c8
-		} else {
6842c8
-			return Stream.of(libs).map(FlameGraphView::fileContent).collect(Collectors.joining("\n"));
6842c8
-		}
6842c8
-	}
6842c8
-
6842c8
 	private static String fileContent(String fileName) {
6842c8
 		try {
6842c8
 			return StringToolkit.readString(FlameGraphView.class.getClassLoader().getResourceAsStream(fileName));
6842c8
diff --git a/application/org.openjdk.jmc.flightrecorder.flameview/src/main/resources/page.template b/application/org.openjdk.jmc.flightrecorder.flameview/src/main/resources/page.template
6842c8
index 67bc3c75..a01571d9 100644
6842c8
--- a/application/org.openjdk.jmc.flightrecorder.flameview/src/main/resources/page.template
6842c8
+++ b/application/org.openjdk.jmc.flightrecorder.flameview/src/main/resources/page.template
6842c8
@@ -3,6 +3,7 @@
6842c8
 
6842c8
 <head>
6842c8
 	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6842c8
+	<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/d3-flame-graph@4.0.6/dist/d3-flamegraph.css"></link>
6842c8
 	<style type="text/css">%1$s</style>
6842c8
 	<style type="text/css" media="print">
6842c8
 		body {
6842c8
@@ -21,12 +22,12 @@
6842c8
 		
6842c8
 	
6842c8
 	
6842c8
+	<script type="text/javascript" src="https://d3js.org/d3.v6.min.js"></script>
6842c8
+	<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/d3-flame-graph@4.0.6/dist/d3-flamegraph.js"></script>
6842c8
+	<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/d3-flame-graph@4.0.6/dist/d3-flamegraph-tooltip.js"></script>
6842c8
 	<script type="text/javascript">
6842c8
 	%3$s
6842c8
 	</script>
6842c8
-	<script type="text/javascript">
6842c8
-	%4$s
6842c8
-	</script>
6842c8
 	<script type="text/javascript">
6842c8
 		
6842c8
 		const minSearchTextSize = 3;