import jmc-7.1.1-5.module+el8.2.1+6408+a7ca4662

This commit is contained in:
CentOS Sources 2020-07-21 11:05:39 -04:00 committed by Andrew Lukoshko
parent 56486c8104
commit d0c91851d3
20 changed files with 1574 additions and 249 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/9871e02a9e40.tar.gz
SOURCES/e67446b5fc9d.tar.gz

View File

@ -1 +1 @@
f204e02359b91f8158edb5dc2934e6506567bce1 SOURCES/9871e02a9e40.tar.gz
676ac85e3a33296288129c09e1b898a9d460d36f SOURCES/e67446b5fc9d.tar.gz

View File

@ -0,0 +1,29 @@
# HG changeset patch
# Parent 9696af3e434734700a8c37680ce3742ab940eccb
diff --git a/application/org.openjdk.jmc.feature.core/feature.xml b/application/org.openjdk.jmc.feature.core/feature.xml
--- a/application/org.openjdk.jmc.feature.core/feature.xml
+++ b/application/org.openjdk.jmc.feature.core/feature.xml
@@ -161,13 +161,6 @@
unpack="false"/>
<plugin
- id="com.sun.mail.jakarta.mail"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
id="com.sun.activation.jakarta.activation"
download-size="0"
install-size="0"
@@ -175,7 +168,7 @@
unpack="false"/>
<plugin
- id="javax.mail.dsn"
+ id="com.sun.mail.javax.mail"
download-size="0"
install-size="0"
version="0.0.0"

View File

@ -0,0 +1,358 @@
# HG changeset patch
# Parent 37a493c3f60b2015c37630807015b217b98106cf
diff -r 37a493c3f60b -r bbf0648beb5c application/org.openjdk.jmc.flightrecorder.flameview/.classpath
--- a/application/org.openjdk.jmc.flightrecorder.flameview/.classpath Tue Nov 12 16:25:24 2019 +0100
+++ b/application/org.openjdk.jmc.flightrecorder.flameview/.classpath Mon Nov 25 17:57:23 2019 -0500
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
diff -r 37a493c3f60b -r bbf0648beb5c application/org.openjdk.jmc.flightrecorder.flameview/build.properties
--- a/application/org.openjdk.jmc.flightrecorder.flameview/build.properties Tue Nov 12 16:25:24 2019 +0100
+++ b/application/org.openjdk.jmc.flightrecorder.flameview/build.properties Mon Nov 25 17:57:23 2019 -0500
@@ -1,5 +1,4 @@
-source.. = src/main/java/,\
- src/main/resources/
+source.. = src/main/java/
output.. = target/classes/
bin.includes = META-INF/,\
.,\
diff -r 37a493c3f60b -r bbf0648beb5c application/org.openjdk.jmc.flightrecorder.flameview/pom.xml
--- a/application/org.openjdk.jmc.flightrecorder.flameview/pom.xml Tue Nov 12 16:25:24 2019 +0100
+++ b/application/org.openjdk.jmc.flightrecorder.flameview/pom.xml Mon Nov 25 17:57:23 2019 -0500
@@ -41,94 +41,4 @@
</parent>
<artifactId>org.openjdk.jmc.flightrecorder.flameview</artifactId>
<packaging>eclipse-plugin</packaging>
-
- <properties>
- <download.maven.plugin.version>1.4.2</download.maven.plugin.version>
- <download-maven-plugin.phase>process-resources</download-maven-plugin.phase>
- <download-maven-plugin.output>${project.basedir}/src/main/resources/jslibs</download-maven-plugin.output>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <groupId>com.googlecode.maven-download-plugin</groupId>
- <artifactId>download-maven-plugin</artifactId>
- <version>${download.maven.plugin.version}</version>
- <executions>
- <execution>
- <id>d3-flamegraph-css</id>
- <phase>${download-maven-plugin.phase}</phase>
- <goals>
- <goal>wget</goal>
- </goals>
- <configuration>
- <url>https://cdn.jsdelivr.net/gh/spiermar/d3-flame-graph@2.0.3/dist/d3-flamegraph.css</url>
- <unpack>false</unpack>
- <outputDirectory>${download-maven-plugin.output}</outputDirectory>
- </configuration>
- </execution>
- <execution>
- <id>ie-html5shiv-js</id>
- <phase>${download-maven-plugin.phase}</phase>
- <goals>
- <goal>wget</goal>
- </goals>
- <configuration>
- <url>https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js</url>
- <unpack>false</unpack>
- <outputDirectory>${download-maven-plugin.output}</outputDirectory>
- </configuration>
- </execution>
- <execution>
- <id>ie-respond-js</id>
- <phase>${download-maven-plugin.phase}</phase>
- <goals>
- <goal>wget</goal>
- </goals>
- <configuration>
- <url>https://oss.maxcdn.com/respond/1.4.2/respond.min.js</url>
- <unpack>false</unpack>
- <outputDirectory>${download-maven-plugin.output}</outputDirectory>
- </configuration>
- </execution>
- <execution>
- <id>d3-v4-js</id>
- <phase>${download-maven-plugin.phase}</phase>
- <goals>
- <goal>wget</goal>
- </goals>
- <configuration>
- <url>https://d3js.org/d3.v4.min.js</url>
- <unpack>false</unpack>
- <outputDirectory>${download-maven-plugin.output}</outputDirectory>
- </configuration>
- </execution>
- <execution>
- <id>d3-tip-js</id>
- <phase>${download-maven-plugin.phase}</phase>
- <goals>
- <goal>wget</goal>
- </goals>
- <configuration>
- <url>https://cdnjs.cloudflare.com/ajax/libs/d3-tip/0.9.1/d3-tip.min.js</url>
- <unpack>false</unpack>
- <outputDirectory>${download-maven-plugin.output}</outputDirectory>
- </configuration>
- </execution>
- <execution>
- <id>d3-flamegraph-js</id>
- <phase>${download-maven-plugin.phase}</phase>
- <goals>
- <goal>wget</goal>
- </goals>
- <configuration>
- <url>https://cdn.jsdelivr.net/gh/spiermar/d3-flame-graph@2.0.3/dist/d3-flamegraph.min.js</url>
- <unpack>false</unpack>
- <outputDirectory>${download-maven-plugin.output}</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
</project>
diff -r 37a493c3f60b -r bbf0648beb5c application/org.openjdk.jmc.flightrecorder.flameview/src/main/java/org/openjdk/jmc/flightrecorder/flameview/views/FlameGraphView.java
--- a/application/org.openjdk.jmc.flightrecorder.flameview/src/main/java/org/openjdk/jmc/flightrecorder/flameview/views/FlameGraphView.java Tue Nov 12 16:25:24 2019 +0100
+++ b/application/org.openjdk.jmc.flightrecorder.flameview/src/main/java/org/openjdk/jmc/flightrecorder/flameview/views/FlameGraphView.java Mon Nov 25 17:57:23 2019 -0500
@@ -34,14 +34,11 @@
package org.openjdk.jmc.flightrecorder.flameview.views;
import java.io.IOException;
-
-import java.text.MessageFormat;
import java.util.concurrent.CancellationException;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.logging.Level;
-import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.eclipse.jface.action.Action;
@@ -77,32 +74,7 @@
import org.openjdk.jmc.ui.misc.DisplayToolkit;
public class FlameGraphView extends ViewPart implements ISelectionListener {
- private static final String HTML_PAGE;
- static {
- // from: https://cdn.jsdelivr.net/gh/spiermar/d3-flame-graph@2.0.3/dist/d3-flamegraph.css
- String cssD3Flamegraph = "jslibs/d3-flamegraph.css";
- // from: https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js
- String jsHtml5shiv = "jslibs/html5shiv.min.js";
- // from: https://oss.maxcdn.com/respond/1.4.2/respond.min.js
- String jsRespond = "jslibs/respond.min.js";
- // from: https://d3js.org/d3.v4.min.js
- String jsD3V4 = "jslibs/d3.v4.min.js";
- // from: https://cdnjs.cloudflare.com/ajax/libs/d3-tip/0.9.1/d3-tip.min.js
- String jsD3Tip = "jslibs/d3-tip.min.js";
- // from: https://cdn.jsdelivr.net/gh/spiermar/d3-flame-graph@2.0.3/dist/d3-flamegraph.min.js
- String jsD3FlameGraph = "jslibs/d3-flamegraph.min.js";
-
- String jsIeLibraries = loadLibraries(jsHtml5shiv, jsRespond);
- String jsD3Libraries = loadLibraries(jsD3V4, jsD3Tip, jsD3FlameGraph);
-
- // formatter arguments for the template: %1 - CSSs, %2 - IE9 specific scripts, %3 - 3rd party scripts
- HTML_PAGE = String.format(fileContent("page.template"),
- fileContent(cssD3Flamegraph),
- jsIeLibraries,
- jsD3Libraries);
- }
-
- private static final ExecutorService MODEL_EXECUTOR = Executors.newFixedThreadPool(1);
+ private static ExecutorService MODEL_EXECUTOR = Executors.newFixedThreadPool(1);
private FrameSeparator frameSeparator;
private Browser browser;
@@ -207,6 +179,13 @@
}, MODEL_EXECUTOR);
}
+ private static Void handleModelBuildException(Throwable ex) {
+ if (!(ex.getCause() instanceof CancellationException)) {
+ FlightRecorderUI.getDefault().getLogger().log(Level.SEVERE, "Failed to build stacktrace view model", ex); //$NON-NLS-1$
+ }
+ return null;
+ }
+
private void setModel(TraceNode root) {
if (!browser.isDisposed() && !root.equals(currentRoot)) {
currentRoot = root;
@@ -215,21 +194,19 @@
}
private void setViewerInput(TraceNode root) {
- browser.setText(HTML_PAGE);
- browser.addProgressListener(new ProgressAdapter() {
- @Override
- public void completed(ProgressEvent event) {
- browser.removeProgressListener(this);
- browser.execute(String.format("processGraph(%s);", toJSon(root)));
- }
- });
- }
-
- private static Void handleModelBuildException(Throwable ex) {
- if (!(ex.getCause() instanceof CancellationException)) {
- FlightRecorderUI.getDefault().getLogger().log(Level.SEVERE, "Failed to build stacktrace view model", ex); //$NON-NLS-1$
+ try {
+ browser.setText(StringToolkit.readString(FlameGraphView.class.getResourceAsStream("page.html")));
+ browser.addProgressListener(new ProgressAdapter() {
+ @Override
+ public void completed(ProgressEvent event) {
+ browser.removeProgressListener(this);
+ browser.execute(String.format("processGraph(%s);", toJSon(root)));
+ }
+ });
+ } catch (IOException e) {
+ browser.setText(e.getMessage());
+ e.printStackTrace();
}
- return null;
}
private static String toJSon(TraceNode root) {
@@ -261,23 +238,4 @@
private static String toJSonKeyValue(String key, String value) {
return "\"" + key + "\": " + "\"" + value + "\"";
}
-
- private static String loadLibraries(String... libs) {
- if(libs == null || libs.length == 0) {
- return "";
- } else {
- return Stream.of(libs).map(FlameGraphView::fileContent).collect(Collectors.joining("\n"));
- }
- }
-
- private static String fileContent(String fileName){
- try {
- return StringToolkit.readString(FlameGraphView.class.getClassLoader().getResourceAsStream(fileName));
- } catch (IOException e) {
- FlightRecorderUI.getDefault().getLogger()
- .log(Level.WARNING, MessageFormat
- .format("Could not load script \"{0}\",\"{1}\"", fileName, e.getMessage())); //$NON-NLS-1$
- return "";
- }
- }
}
diff -r 37a493c3f60b -r bbf0648beb5c application/org.openjdk.jmc.flightrecorder.flameview/src/main/java/org/openjdk/jmc/flightrecorder/flameview/views/page.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/application/org.openjdk.jmc.flightrecorder.flameview/src/main/java/org/openjdk/jmc/flightrecorder/flameview/views/page.html Mon Nov 25 17:57:23 2019 -0500
@@ -0,0 +1,54 @@
+<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/spiermar/d3-flame-graph@2.0.3/dist/d3-flamegraph.css">
+ <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
+ <!--[if lt IE 9]>
+ <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
+ <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
+ <![endif]-->
+</head>
+
+<body onresize="resizeFlameGraph()">
+ <div id="chart"></div>
+
+ <script type="text/javascript" src="https://d3js.org/d3.v4.min.js"></script>
+ <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3-tip/0.9.1/d3-tip.min.js"></script>
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/gh/spiermar/d3-flame-graph@2.0.3/dist/d3-flamegraph.min.js"></script>
+ <script type="text/javascript">
+
+ var flameGraph;
+ var currentJson;
+
+ function processGraph(jsonObj) {
+ flameGraph = d3.flamegraph()
+ .width(windowSize() * 0.9)
+ .transitionDuration(500)
+ .transitionEase(d3.easeCubic)
+ .sort(true)
+ .title("");
+ currentJson = jsonObj;
+ d3.select("#chart")
+ .datum(currentJson)
+ .call(flameGraph);
+ }
+
+ function windowSize() {
+ return Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
+ }
+
+ function resizeFlameGraph() {
+ if (flameGraph) {
+ flameGraph.width(windowSize() * 0.9);
+ d3.select("#chart")
+ .datum(currentJson)
+ .call(flameGraph);
+ }
+ }
+
+ </script>
+</body>
+
+</html>
diff -r 37a493c3f60b -r bbf0648beb5c application/org.openjdk.jmc.flightrecorder.flameview/src/main/resources/page.template
--- a/application/org.openjdk.jmc.flightrecorder.flameview/src/main/resources/page.template Tue Nov 12 16:25:24 2019 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
- <style type="text/css">%1$s</style>
- <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
- <!--[if lt IE 9]>
- <script>%2$s</script>
- <![endif]-->
-</head>
-
-<body onresize="resizeFlameGraph()">
- <div id="chart"></div>
- <script type="text/javascript">%3$s</script>
- <script type="text/javascript">
-
- var flameGraph;
- var currentJson;
-
- function processGraph(jsonObj) {
- flameGraph = d3.flamegraph()
- .width(windowSize() * 0.9)
- .transitionDuration(500)
- .transitionEase(d3.easeCubic)
- .sort(true)
- .title("");
- currentJson = jsonObj;
- d3.select("#chart")
- .datum(currentJson)
- .call(flameGraph);
- }
-
- function windowSize() {
- return Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
- }
-
- function resizeFlameGraph() {
- if (flameGraph) {
- flameGraph.width(windowSize() * 0.9);
- d3.select("#chart")
- .datum(currentJson)
- .call(flameGraph);
- }
- }
-
- </script>
-</body>
-</html>
\ No newline at end of file

697
SOURCES/11-6554.patch Normal file
View File

@ -0,0 +1,697 @@
diff --git a/application/org.openjdk.jmc.browser.attach/src/main/java/org/openjdk/jmc/browser/attach/LocalJVMToolkit.java b/application/org.openjdk.jmc.browser.attach/src/main/java/org/openjdk/jmc/browser/attach/LocalJVMToolkit.java
--- a/application/org.openjdk.jmc.browser.attach/src/main/java/org/openjdk/jmc/browser/attach/LocalJVMToolkit.java
+++ b/application/org.openjdk.jmc.browser.attach/src/main/java/org/openjdk/jmc/browser/attach/LocalJVMToolkit.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -199,6 +199,8 @@
String address = null;
String version = null;
String jvmArgs = null;
+ String jvmVendor = null;
+
try {
// This used to leak one \BaseNamedObjects\hsperfdata_* Section handle on Windows
MonitoredVm mvm = host.getMonitoredVm(new VmIdentifier(name));
@@ -235,6 +237,12 @@
if (sm != null) {
isDebug = isDebug(sm.stringValue());
}
+
+ sm = (StringMonitor) mvm.findByName("java.property.java.vm.vendor"); //$NON-NLS-1$
+ if (sm != null) {
+ jvmVendor = sm.stringValue();
+ }
+
// NOTE: isAttachable seems to return true even if a real attach is not possible.
// attachable = MonitoredVmUtil.isAttachable(mvm);
@@ -260,7 +268,7 @@
} catch (Exception x) {
// ignore
}
- connDesc = createDescriptor(name, jvmArgs, vmid, connectable, type, jvmArch, address, version, isDebug);
+ connDesc = createDescriptor(name, jvmArgs, jvmVendor, vmid, connectable, type, jvmArch, address, version, isDebug);
return connDesc;
}
});
@@ -359,6 +367,7 @@
String javaArgs = null;
String jvmArgs = null;
String jvmVersion = null;
+ String jvmVendor = null;
VirtualMachine vm = null;
try {
// Attach creates one process handle on Windows.
@@ -379,6 +388,7 @@
jvmType = getJVMType(vmName);
version = props.getProperty("java.version"); //$NON-NLS-1$
jvmVersion = props.getProperty("java.vm.version"); //$NON-NLS-1$
+ jvmVendor = props.getProperty("java.vm.vendor");
isDebug = isDebug(jvmVersion);
jvmArch = JVMArch.getJVMArch(props);
}
@@ -396,7 +406,7 @@
}
}
if (connectable.isAttachable()) {
- connDesc = createDescriptor(javaArgs, jvmArgs, Integer.parseInt(vmd.id()), connectable, jvmType, jvmArch,
+ connDesc = createDescriptor(javaArgs, jvmArgs, jvmVendor, Integer.parseInt(vmd.id()), connectable, jvmType, jvmArch,
address, version, isDebug);
}
BrowserAttachPlugin.getPluginLogger().info("Done resolving PID " + vmd); //$NON-NLS-1$
@@ -461,9 +471,10 @@
}
private static DiscoveryEntry createDescriptor(
- String javaCommand, String jvmArgs, int pid, Connectable connectable, JVMType type, JVMArch arch,
- String address, String version, boolean isDebug) {
- JVMDescriptor jvmInfo = new JVMDescriptor(version, type, arch, javaCommand, jvmArgs, pid, isDebug, connectable);
+ String javaCommand, String jvmArgs, String jvmVendor, int pid, Connectable connectable, JVMType type,
+ JVMArch arch, String address, String version, boolean isDebug) {
+ JVMDescriptor jvmInfo = new JVMDescriptor(version, type, arch, javaCommand, jvmArgs, jvmVendor, pid, isDebug,
+ connectable);
LocalConnectionDescriptor lcd = new LocalConnectionDescriptor(pid, address, connectable == ATTACHABLE);
String guid = "Local-[PID:" + pid + ", seq:" + (SEQ_NUMBER++) + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
IServerDescriptor sd = IServerDescriptor.create(guid, null, jvmInfo);
diff --git a/application/org.openjdk.jmc.browser.jdp/src/main/java/org/openjdk/jmc/browser/jdp/JDPDescriptorProvider.java b/application/org.openjdk.jmc.browser.jdp/src/main/java/org/openjdk/jmc/browser/jdp/JDPDescriptorProvider.java
--- a/application/org.openjdk.jmc.browser.jdp/src/main/java/org/openjdk/jmc/browser/jdp/JDPDescriptorProvider.java
+++ b/application/org.openjdk.jmc.browser.jdp/src/main/java/org/openjdk/jmc/browser/jdp/JDPDescriptorProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -89,9 +89,9 @@
String url = map.get(JMXDataKeys.KEY_JMX_SERVICE_URL);
String commandLine = map.get(JMXDataKeys.KEY_JAVA_COMMAND);
String pid = map.get(JMXDataKeys.KEY_PID);
- // NOTE: We would like to have the JVM type and architecture included in the JDP payload. We should probably file an enhancement request on JDK for this.
+ // NOTE: We would like to have the JVM type, architecture and vendor included in the JDP payload. We should probably file an enhancement request on JDK for this.
JVMDescriptor jvmInfo = new JVMDescriptor(null, JVMType.UNKNOWN, JVMArch.UNKNOWN, commandLine, null,
- pid == null ? null : Integer.parseInt(pid), false, Connectable.MGMNT_AGENT_STARTED);
+ null, pid == null ? null : Integer.parseInt(pid), false, Connectable.MGMNT_AGENT_STARTED);
String path = null;
if (name == null) {
} else if (name.endsWith(PATH_SEPARATOR)) {
diff --git a/application/org.openjdk.jmc.rjmx.services.jfr/src/main/java/org/openjdk/jmc/rjmx/services/jfr/internal/FlightRecorderServiceV2.java b/application/org.openjdk.jmc.rjmx.services.jfr/src/main/java/org/openjdk/jmc/rjmx/services/jfr/internal/FlightRecorderServiceV2.java
--- a/application/org.openjdk.jmc.rjmx.services.jfr/src/main/java/org/openjdk/jmc/rjmx/services/jfr/internal/FlightRecorderServiceV2.java
+++ b/application/org.openjdk.jmc.rjmx.services.jfr/src/main/java/org/openjdk/jmc/rjmx/services/jfr/internal/FlightRecorderServiceV2.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -104,17 +104,14 @@
}
private boolean isDynamicFlightRecorderSupported(IConnectionHandle handle) {
- return ConnectionToolkit.isHotSpot(handle)
- && ConnectionToolkit.isJavaVersionAboveOrEqual(handle, JavaVersionSupport.DYNAMIC_JFR_SUPPORTED);
- }
-
- private boolean isFlightRecorderCommercial() {
- return ConnectionToolkit.isHotSpot(connection)
- && !ConnectionToolkit.isJavaVersionAboveOrEqual(connection, JavaVersionSupport.JFR_NOT_COMMERCIAL);
+ // All OpenJDK versions of JFR support dynamic enablement of JFR, so if there are no commercial features in play
+ // all is A-OK.
+ return !cfs.hasCommercialFeatures() || (ConnectionToolkit.isHotSpot(handle)
+ && ConnectionToolkit.isJavaVersionAboveOrEqual(handle, JavaVersionSupport.DYNAMIC_JFR_SUPPORTED));
}
private boolean isFlightRecorderDisabled(IConnectionHandle handle) {
- if (cfs != null && isFlightRecorderCommercial()) {
+ if (cfs != null && cfs.hasCommercialFeatures()) {
return !cfs.isCommercialFeaturesEnabled() || JVMSupportToolkit.isFlightRecorderDisabled(handle, false);
} else {
return JVMSupportToolkit.isFlightRecorderDisabled(handle, false);
@@ -127,6 +124,7 @@
public FlightRecorderServiceV2(IConnectionHandle handle) throws ConnectionException, ServiceNotAvailableException {
cfs = handle.getServiceOrThrow(ICommercialFeaturesService.class);
+
if (!isDynamicFlightRecorderSupported(handle) && isFlightRecorderDisabled(handle)) {
throw new ServiceNotAvailableException(""); //$NON-NLS-1$
}
@@ -481,7 +479,7 @@
@Override
public boolean isEnabled() {
if (!wasEnabled) {
- boolean isEnabled = isFlightRecorderCommercial() ? cfs.isCommercialFeaturesEnabled()
+ boolean isEnabled = cfs.hasCommercialFeatures() ? cfs.isCommercialFeaturesEnabled()
: isAvailable(connection);
if (isEnabled) {
wasEnabled = true;
diff --git a/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/ConnectionToolkit.java b/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/ConnectionToolkit.java
--- a/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/ConnectionToolkit.java
+++ b/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/ConnectionToolkit.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -56,6 +56,7 @@
import org.openjdk.jmc.common.version.JavaVMVersionToolkit;
import org.openjdk.jmc.common.version.JavaVersion;
import org.openjdk.jmc.rjmx.internal.RJMXConnection;
+import org.openjdk.jmc.ui.common.jvm.JVMDescriptor;
/**
* Toolkit providing utility methods to retrieve MBean proxy objects, invoke JMX operations and
@@ -346,7 +347,6 @@
* otherwise.
*/
public static boolean isJRockit(IConnectionHandle connectionHandle) {
-
String vmName = getVMName(connectionHandle);
return JavaVMVersionToolkit.isJRockitJVMName(vmName);
}
@@ -366,6 +366,38 @@
}
/**
+ * Returns {@code true} if the connection handle is associated with an Oracle built JVM,
+ * {@code false} otherwise. If the information is already present in the {@link JVMDescriptor},
+ * this method will not cause any JMXRMI calls. If the information is lacking, an attempt will
+ * be made to look it up in the connected JVM. If the attempt fails, false will be returned.
+ *
+ * @return {@code true} if the connection handle describes an Oracle JVM, or {@code false}
+ * otherwise or if it could not be determined.
+ */
+ public static boolean isOracle(IConnectionHandle handle) {
+ JVMDescriptor descriptor = handle.getServerDescriptor().getJvmInfo();
+ // This should normally not happen for discovered JVMs, but users can create custom connections
+ String vendor = null;
+ if (descriptor != null) {
+ vendor = descriptor.getJvmVendor();
+ } else {
+ // We try checking if connected
+ if (handle.isConnected()) {
+ MBeanServerConnection connection = handle.getServiceOrNull(MBeanServerConnection.class);
+ if (connection != null) {
+ try {
+ vendor = getRuntimeBean(connection).getVmVendor();
+ } catch (IOException e) {
+ // Worst case we classify JVM vendor wrong
+ RJMXPlugin.getDefault().getLogger().log(Level.WARNING, "Could not check if Oracle JVM", e);
+ }
+ }
+ }
+ }
+ return vendor != null && vendor.contains("Oracle");
+ }
+
+ /**
* This will return true if the java version is above or equal the supplied value. (For example
* 1.7.0_40).
*
@@ -411,5 +443,4 @@
}
return null;
}
-
}
diff --git a/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/JVMSupportToolkit.java b/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/JVMSupportToolkit.java
--- a/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/JVMSupportToolkit.java
+++ b/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/JVMSupportToolkit.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -137,7 +137,7 @@
}
/**
- * Returns information about whether to server denoted by the handle supports Flight Recorder
+ * Returns information about whether the server supports Flight Recorder.
*
* @param handle
* the server to check
diff --git a/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/services/ICommercialFeaturesService.java b/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/services/ICommercialFeaturesService.java
--- a/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/services/ICommercialFeaturesService.java
+++ b/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/services/ICommercialFeaturesService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -52,4 +52,9 @@
*/
void enableCommercialFeatures() throws Exception;
+ /**
+ * @return true if there are commercial features available, or false if this JVM doesn't have
+ * commercial features.
+ */
+ boolean hasCommercialFeatures();
}
diff --git a/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/services/internal/CommercialFeaturesServiceFactory.java b/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/services/internal/CommercialFeaturesServiceFactory.java
--- a/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/services/internal/CommercialFeaturesServiceFactory.java
+++ b/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/services/internal/CommercialFeaturesServiceFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -34,6 +34,7 @@
import org.openjdk.jmc.common.version.JavaVersion;
import org.openjdk.jmc.rjmx.ConnectionException;
+import org.openjdk.jmc.rjmx.ConnectionToolkit;
import org.openjdk.jmc.rjmx.IConnectionHandle;
import org.openjdk.jmc.rjmx.ServiceNotAvailableException;
import org.openjdk.jmc.rjmx.services.ICommercialFeaturesService;
@@ -52,10 +53,16 @@
if (descriptor != null) {
JavaVersion version = new JavaVersion(descriptor.getJavaVersion());
if (version.getMajorVersion() >= 11) {
- return new Jdk11CommercialFeaturesService();
+ return new NoCommercialFeaturesService();
}
}
- return new HotSpot23CommercialFeaturesService(handle);
+
+ // Funnily enough, OpenJDK built JVMs for unknown reasons also have the unlock commercial features flag,
+ // so we'll just check if Oracle is the JVM vendor. Any other vendor will not have JFR protected by commercial flags.
+ if (ConnectionToolkit.isOracle(handle)) {
+ return new HotSpot23CommercialFeaturesService(handle);
+ }
+ return new NoCommercialFeaturesService();
}
@Override
diff --git a/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/services/internal/HotSpot23CommercialFeaturesService.java b/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/services/internal/HotSpot23CommercialFeaturesService.java
--- a/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/services/internal/HotSpot23CommercialFeaturesService.java
+++ b/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/services/internal/HotSpot23CommercialFeaturesService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -43,7 +43,7 @@
import javax.management.ObjectName;
public class HotSpot23CommercialFeaturesService implements ICommercialFeaturesService {
- private final static String VM_FLAG = "UnlockCommercialFeatures"; //$NON-NLS-1$
+ private final static String UNLOCK_COMMERCIAL_FEATURES_FLAG = "UnlockCommercialFeatures"; //$NON-NLS-1$
private final static String UNLOCK_COMMAND = "VM.unlock_commercial_features"; //$NON-NLS-1$
private final MBeanServerConnection server;
private final IDiagnosticCommandService dcs;
@@ -54,7 +54,7 @@
server = handle.getServiceOrThrow(MBeanServerConnection.class);
dcs = handle.getServiceOrNull(IDiagnosticCommandService.class);
try {
- HotspotManagementToolkit.getVMOption(server, VM_FLAG); // Will fail if option is not available
+ HotspotManagementToolkit.getVMOption(server, UNLOCK_COMMERCIAL_FEATURES_FLAG); // Will fail if option is not available
} catch (Exception e) {
// Commercial Feature option is not available but Flight Recorder is.
if (!isJfrMBeanAvailable()) {
@@ -66,7 +66,8 @@
@Override
public boolean isCommercialFeaturesEnabled() {
try {
- return ((String) HotspotManagementToolkit.getVMOption(server, VM_FLAG)).contains("true"); //$NON-NLS-1$
+ return ((String) HotspotManagementToolkit.getVMOption(server, UNLOCK_COMMERCIAL_FEATURES_FLAG))
+ .contains("true"); //$NON-NLS-1$
} catch (Exception e) {
return false;
}
@@ -78,7 +79,7 @@
dcs.runCtrlBreakHandlerWithResult(UNLOCK_COMMAND);
}
if (!isCommercialFeaturesEnabled()) {
- HotspotManagementToolkit.setVMOption(server, VM_FLAG, "true"); //$NON-NLS-1$
+ HotspotManagementToolkit.setVMOption(server, UNLOCK_COMMERCIAL_FEATURES_FLAG, "true"); //$NON-NLS-1$
}
}
@@ -96,4 +97,9 @@
server.getMBeanInfo(candidateObjectName);
return candidateObjectName;
}
+
+ @Override
+ public boolean hasCommercialFeatures() {
+ return true;
+ }
}
diff --git a/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/services/internal/Jdk11CommercialFeaturesService.java b/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/services/internal/Jdk11CommercialFeaturesService.java
deleted file mode 100644
--- a/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/services/internal/Jdk11CommercialFeaturesService.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * The contents of this file are subject to the terms of either the Universal Permissive License
- * v 1.0 as shown at http://oss.oracle.com/licenses/upl
- *
- * or the following license:
- *
- * Redistribution and use in source and binary forms, with or without modification, are permitted
- * provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this list of conditions
- * and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other materials provided with
- * the distribution.
- *
- * 3. Neither the name of the copyright holder nor the names of its contributors may be used to
- * endorse or promote products derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
- * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.openjdk.jmc.rjmx.services.internal;
-
-import org.openjdk.jmc.rjmx.services.ICommercialFeaturesService;
-
-public class Jdk11CommercialFeaturesService implements ICommercialFeaturesService {
-
- @Override
- public boolean isCommercialFeaturesEnabled() {
- return true;
- }
-
- @Override
- public void enableCommercialFeatures() throws Exception {
- // Noop
- }
-}
diff --git a/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/services/internal/NoCommercialFeaturesService.java b/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/services/internal/NoCommercialFeaturesService.java
new file mode 100644
--- /dev/null
+++ b/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/services/internal/NoCommercialFeaturesService.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * The contents of this file are subject to the terms of either the Universal Permissive License
+ * v 1.0 as shown at http://oss.oracle.com/licenses/upl
+ *
+ * or the following license:
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are permitted
+ * provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of conditions
+ * and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list of
+ * conditions and the following disclaimer in the documentation and/or other materials provided with
+ * the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its contributors may be used to
+ * endorse or promote products derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
+ * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openjdk.jmc.rjmx.services.internal;
+
+import org.openjdk.jmc.rjmx.services.ICommercialFeaturesService;
+
+/**
+ * Used by JVMs with no commercial features, e.g. OpenJDK 8 and JDK 11+ JVMs.
+ */
+public class NoCommercialFeaturesService implements ICommercialFeaturesService {
+
+ @Override
+ public boolean isCommercialFeaturesEnabled() {
+ return true;
+ }
+
+ @Override
+ public void enableCommercialFeatures() throws Exception {
+ // Noop
+ }
+
+ @Override
+ public boolean hasCommercialFeatures() {
+ return false;
+ }
+}
diff --git a/application/org.openjdk.jmc.ui.common/src/main/java/org/openjdk/jmc/ui/common/jvm/JVMDescriptor.java b/application/org.openjdk.jmc.ui.common/src/main/java/org/openjdk/jmc/ui/common/jvm/JVMDescriptor.java
--- a/application/org.openjdk.jmc.ui.common/src/main/java/org/openjdk/jmc/ui/common/jvm/JVMDescriptor.java
+++ b/application/org.openjdk.jmc.ui.common/src/main/java/org/openjdk/jmc/ui/common/jvm/JVMDescriptor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -38,6 +38,7 @@
public class JVMDescriptor {
private final String javaVersion;
private final JVMType jvmType;
+ private final String jvmVendor;
private final JVMArch jvmArch;
private final String javaCommand;
private final String jvmArguments;
@@ -46,13 +47,14 @@
private final Connectable connectable;
public JVMDescriptor(String javaVersion, JVMType jvmType, JVMArch jvmArch, String javaCommand, String jvmArguments,
- Integer pid, boolean debug, Connectable attachable) {
+ String jvmVendor, Integer pid, boolean debug, Connectable attachable) {
super();
this.javaVersion = javaVersion;
this.jvmType = jvmType;
this.jvmArch = jvmArch;
this.javaCommand = javaCommand;
this.jvmArguments = jvmArguments;
+ this.jvmVendor = jvmVendor;
this.pid = pid;
this.debug = debug;
connectable = attachable;
@@ -78,6 +80,10 @@
return jvmArguments;
}
+ public String getJvmVendor() {
+ return jvmVendor;
+ }
+
public Integer getPid() {
return pid;
}
diff --git a/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/JVMSupportToolkitTest.java b/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/JVMSupportToolkitTest.java
--- a/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/JVMSupportToolkitTest.java
+++ b/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/JVMSupportToolkitTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -33,6 +33,7 @@
package org.openjdk.jmc.rjmx.test;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import org.junit.Test;
import org.openjdk.jmc.rjmx.ConnectionDescriptorBuilder;
@@ -46,7 +47,8 @@
@SuppressWarnings("nls")
public class JVMSupportToolkitTest {
-
+ private static final String VENDOR_OPEN_JDK = "OpenJDK";
+ private static final String VENDOR_ORACLE = "Oracle";
// FIXME: Add tests for the methods that take IConnectionHandle as a parameter.
private static final String SUPPORTED_MESSAGE = null;
@@ -63,7 +65,8 @@
public void testJfr17U40HotSpotSupported() {
ServerHandle server = new ServerHandle(
new ServerDescriptor(null, null,
- new JVMDescriptor("1.7.0_40", JVMType.HOTSPOT, JVMArch.UNKNOWN, null, null, null, false, null)),
+ new JVMDescriptor("1.7.0_40", JVMType.HOTSPOT, JVMArch.UNKNOWN, VENDOR_ORACLE, null, null, null,
+ false, null)),
new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(), null);
String errorMessage = JVMSupportToolkit.checkFlightRecorderSupport(server, false);
assertEquals(SUPPORTED_MESSAGE, errorMessage);
@@ -73,7 +76,8 @@
public void testJfr17U4HotSpotNotFullySupported() {
ServerHandle server = new ServerHandle(
new ServerDescriptor(null, null,
- new JVMDescriptor("1.7.0_04", JVMType.HOTSPOT, JVMArch.UNKNOWN, null, null, null, false, null)),
+ new JVMDescriptor("1.7.0_04", JVMType.HOTSPOT, JVMArch.UNKNOWN, VENDOR_ORACLE, null, null, null,
+ false, null)),
new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(), null);
String errorMessage = JVMSupportToolkit.checkFlightRecorderSupport(server, false);
assertEquals(Messages.JVMSupport_FLIGHT_RECORDER_NOT_FULLY_SUPPORTED_OLD_HOTSPOT, errorMessage);
@@ -83,7 +87,8 @@
public void testJfr17HotSpotNotSupported() {
ServerHandle server = new ServerHandle(
new ServerDescriptor(null, null,
- new JVMDescriptor("1.7.0", JVMType.HOTSPOT, JVMArch.UNKNOWN, null, null, null, false, null)),
+ new JVMDescriptor("1.7.0", JVMType.HOTSPOT, JVMArch.UNKNOWN, VENDOR_ORACLE, null, null, null,
+ false, null)),
new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(), null);
String errorMessage = JVMSupportToolkit.checkFlightRecorderSupport(server, false);
assertEquals(Messages.JVMSupport_FLIGHT_RECORDER_NOT_SUPPORTED_OLD_HOTSPOT, errorMessage);
@@ -93,7 +98,8 @@
public void testJfrJRockitNotSupported() {
ServerHandle server = new ServerHandle(
new ServerDescriptor(null, null,
- new JVMDescriptor("1.6", JVMType.JROCKIT, JVMArch.UNKNOWN, null, null, null, false, null)),
+ new JVMDescriptor("1.6", JVMType.JROCKIT, JVMArch.UNKNOWN, VENDOR_ORACLE, null, null, null,
+ false, null)),
new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(), null);
String errorMessage = JVMSupportToolkit.checkFlightRecorderSupport(server, false);
assertEquals(Messages.JVMSupport_JROCKIT_NO_LONGER_SUPPORTED, errorMessage);
@@ -103,7 +109,8 @@
public void testJfrOldHotSpotNotSupported() {
ServerHandle server = new ServerHandle(
new ServerDescriptor(null, null,
- new JVMDescriptor("1.6", JVMType.HOTSPOT, JVMArch.UNKNOWN, null, null, null, false, null)),
+ new JVMDescriptor("1.6", JVMType.HOTSPOT, JVMArch.UNKNOWN, VENDOR_ORACLE, null, null, null,
+ false, null)),
new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(), null);
String errorMessage = JVMSupportToolkit.checkFlightRecorderSupport(server, false);
assertEquals(Messages.JVMSupport_FLIGHT_RECORDER_NOT_SUPPORTED_OLD_HOTSPOT, errorMessage);
@@ -112,8 +119,8 @@
@Test
public void testJfrNonHotSpotNotSupported() {
ServerHandle server = new ServerHandle(
- new ServerDescriptor(null, null,
- new JVMDescriptor("1.7", JVMType.OTHER, JVMArch.UNKNOWN, null, null, null, false, null)),
+ new ServerDescriptor(null, null, new JVMDescriptor("1.7", JVMType.OTHER, JVMArch.UNKNOWN, VENDOR_ORACLE,
+ null, null, null, false, null)),
new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(), null);
String errorMessage = JVMSupportToolkit.checkFlightRecorderSupport(server, false);
assertEquals(Messages.JVMSupport_FLIGHT_RECORDER_NOT_SUPPORTED_NOT_HOTSPOT, errorMessage);
@@ -123,10 +130,32 @@
public void testJfrUnknownNoWarning() {
ServerHandle server = new ServerHandle(
new ServerDescriptor(null, null,
- new JVMDescriptor("1.7", JVMType.UNKNOWN, JVMArch.UNKNOWN, null, null, null, false, null)),
+ new JVMDescriptor("1.7", JVMType.UNKNOWN, JVMArch.UNKNOWN, VENDOR_ORACLE, null, null, null,
+ false, null)),
new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(), null);
String errorMessage = JVMSupportToolkit.checkFlightRecorderSupport(server, false);
assertEquals(SUPPORTED_MESSAGE, errorMessage);
}
+ @Test
+ public void testJfr8HotSpotOpenJDKSupported() {
+ ServerHandle server = new ServerHandle(
+ new ServerDescriptor(null, null,
+ new JVMDescriptor("1.8.0", JVMType.HOTSPOT, JVMArch.UNKNOWN, VENDOR_OPEN_JDK, null, null, null,
+ false, null)),
+ new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(), null);
+ String errorMessage = JVMSupportToolkit.checkFlightRecorderSupport(server, false);
+ assertEquals(SUPPORTED_MESSAGE, errorMessage);
+ }
+
+ @Test
+ public void testJdk7HotSpotOpenJDKNotSupported() {
+ ServerHandle server = new ServerHandle(
+ new ServerDescriptor(null, null,
+ new JVMDescriptor("1.7.0", JVMType.HOTSPOT, JVMArch.UNKNOWN, VENDOR_OPEN_JDK, null, null, null,
+ false, null)),
+ new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(), null);
+ String errorMessage = JVMSupportToolkit.checkFlightRecorderSupport(server, false);
+ assertNotNull(errorMessage);
+ }
}
diff --git a/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/services/CommercialFeaturesServiceTest.java b/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/services/CommercialFeaturesServiceTest.java
--- a/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/services/CommercialFeaturesServiceTest.java
+++ b/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/services/CommercialFeaturesServiceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -36,7 +36,6 @@
import static org.junit.Assert.assertTrue;
import org.junit.Test;
-
import org.openjdk.jmc.rjmx.ConnectionException;
import org.openjdk.jmc.rjmx.IConnectionHandle;
import org.openjdk.jmc.rjmx.services.ICommercialFeaturesService;
@@ -63,18 +62,17 @@
public void testSetCommercialFeaturesState() throws Exception {
ICommercialFeaturesService service = getCommercialFeaturesService();
// Check state. Any state is okay, but we want to catch exceptions.
- if (!service.isCommercialFeaturesEnabled()) {
+ if (service.hasCommercialFeatures() && !service.isCommercialFeaturesEnabled()) {
service.enableCommercialFeatures();
}
- assertTrue("Commercial features should now be enabled!", service.isCommercialFeaturesEnabled());
+ if (service.hasCommercialFeatures()) {
+ assertTrue("Commercial features should now be enabled!", service.isCommercialFeaturesEnabled());
+ }
}
private ICommercialFeaturesService getCommercialFeaturesService() throws ConnectionException {
- IConnectionHandle handle = getConnectionHandle();
-
- // LocalRJMXTestToolkit.createDefaultConnectionHandle(getConnectionManager());
+ IConnectionHandle handle = getDefaultServer().connect("Connection handle for test");
assumeHotSpot7u4OrLater(handle);
-
ICommercialFeaturesService service = handle.getServiceOrNull(ICommercialFeaturesService.class);
assertNotNull(
diff --git a/configuration/spotbugs/spotbugs-exclude.xml b/configuration/spotbugs/spotbugs-exclude.xml
--- a/configuration/spotbugs/spotbugs-exclude.xml
+++ b/configuration/spotbugs/spotbugs-exclude.xml
@@ -566,6 +566,13 @@
<Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD" />
</Match>
+ <!-- Spotbugs says exception can't be thrown, but many of the attach API calls
+ before are declaring exceptions. -->
+ <Match>
+ <Class name="org.openjdk.jmc.browser.attach.LocalJVMToolkit$2" />
+ <Bug pattern="REC_CATCH_EXCEPTION" />
+ </Match>
+
<!-- Spotbugs says vm is guaranteed to be null at L394. Perhaps it depends on
JDK version, but it should indeed be able to be non-null. -->
<Match>

326
SOURCES/12-6692.patch Normal file
View File

@ -0,0 +1,326 @@
diff --git a/application/org.openjdk.jmc.browser.attach/src/main/java/org/openjdk/jmc/browser/attach/LocalJVMToolkit.java b/application/org.openjdk.jmc.browser.attach/src/main/java/org/openjdk/jmc/browser/attach/LocalJVMToolkit.java
--- a/application/org.openjdk.jmc.browser.attach/src/main/java/org/openjdk/jmc/browser/attach/LocalJVMToolkit.java
+++ b/application/org.openjdk.jmc.browser.attach/src/main/java/org/openjdk/jmc/browser/attach/LocalJVMToolkit.java
@@ -199,6 +199,7 @@
String address = null;
String version = null;
String jvmArgs = null;
+ String jvmName = null;
String jvmVendor = null;
try {
@@ -210,6 +211,7 @@
jvmArgs = MonitoredVmUtil.jvmArgs(mvm);
StringMonitor sm = (StringMonitor) mvm.findByName("java.property.java.vm.name"); //$NON-NLS-1$
if (sm != null) {
+ jvmName = sm.stringValue();
type = getJVMType(sm.stringValue());
}
@@ -268,7 +270,7 @@
} catch (Exception x) {
// ignore
}
- connDesc = createDescriptor(name, jvmArgs, jvmVendor, vmid, connectable, type, jvmArch, address, version, isDebug);
+ connDesc = createDescriptor(name, jvmArgs, jvmName, jvmVendor, vmid, connectable, type, jvmArch, address, version, isDebug);
return connDesc;
}
});
@@ -367,6 +369,7 @@
String javaArgs = null;
String jvmArgs = null;
String jvmVersion = null;
+ String jvmName = null;
String jvmVendor = null;
VirtualMachine vm = null;
try {
@@ -384,8 +387,8 @@
+ vmd + ": " + e.getMessage()); //$NON-NLS-1$
}
if (props != null) {
- String vmName = props.getProperty("java.vm.name"); //$NON-NLS-1$
- jvmType = getJVMType(vmName);
+ jvmName = props.getProperty("java.vm.name"); //$NON-NLS-1$
+ jvmType = getJVMType(jvmName);
version = props.getProperty("java.version"); //$NON-NLS-1$
jvmVersion = props.getProperty("java.vm.version"); //$NON-NLS-1$
jvmVendor = props.getProperty("java.vm.vendor");
@@ -406,7 +409,7 @@
}
}
if (connectable.isAttachable()) {
- connDesc = createDescriptor(javaArgs, jvmArgs, jvmVendor, Integer.parseInt(vmd.id()), connectable, jvmType, jvmArch,
+ connDesc = createDescriptor(javaArgs, jvmArgs, jvmName, jvmVendor, Integer.parseInt(vmd.id()), connectable, jvmType, jvmArch,
address, version, isDebug);
}
BrowserAttachPlugin.getPluginLogger().info("Done resolving PID " + vmd); //$NON-NLS-1$
@@ -471,10 +474,10 @@
}
private static DiscoveryEntry createDescriptor(
- String javaCommand, String jvmArgs, String jvmVendor, int pid, Connectable connectable, JVMType type,
- JVMArch arch, String address, String version, boolean isDebug) {
- JVMDescriptor jvmInfo = new JVMDescriptor(version, type, arch, javaCommand, jvmArgs, jvmVendor, pid, isDebug,
- connectable);
+ String javaCommand, String jvmArgs, String jvmName, String jvmVendor, int pid, Connectable connectable,
+ JVMType type, JVMArch arch, String address, String version, boolean isDebug) {
+ JVMDescriptor jvmInfo = new JVMDescriptor(version, type, arch, javaCommand, jvmArgs, jvmName, jvmVendor, pid,
+ isDebug, connectable);
LocalConnectionDescriptor lcd = new LocalConnectionDescriptor(pid, address, connectable == ATTACHABLE);
String guid = "Local-[PID:" + pid + ", seq:" + (SEQ_NUMBER++) + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
IServerDescriptor sd = IServerDescriptor.create(guid, null, jvmInfo);
diff --git a/application/org.openjdk.jmc.browser.jdp/src/main/java/org/openjdk/jmc/browser/jdp/JDPDescriptorProvider.java b/application/org.openjdk.jmc.browser.jdp/src/main/java/org/openjdk/jmc/browser/jdp/JDPDescriptorProvider.java
--- a/application/org.openjdk.jmc.browser.jdp/src/main/java/org/openjdk/jmc/browser/jdp/JDPDescriptorProvider.java
+++ b/application/org.openjdk.jmc.browser.jdp/src/main/java/org/openjdk/jmc/browser/jdp/JDPDescriptorProvider.java
@@ -91,7 +91,7 @@
String pid = map.get(JMXDataKeys.KEY_PID);
// NOTE: We would like to have the JVM type, architecture and vendor included in the JDP payload. We should probably file an enhancement request on JDK for this.
JVMDescriptor jvmInfo = new JVMDescriptor(null, JVMType.UNKNOWN, JVMArch.UNKNOWN, commandLine, null,
- null, pid == null ? null : Integer.parseInt(pid), false, Connectable.MGMNT_AGENT_STARTED);
+ null, null, pid == null ? null : Integer.parseInt(pid), false, Connectable.MGMNT_AGENT_STARTED);
String path = null;
if (name == null) {
} else if (name.endsWith(PATH_SEPARATOR)) {
diff --git a/application/org.openjdk.jmc.rjmx.services.jfr/src/main/java/org/openjdk/jmc/rjmx/services/jfr/internal/FlightRecorderServiceV1.java b/application/org.openjdk.jmc.rjmx.services.jfr/src/main/java/org/openjdk/jmc/rjmx/services/jfr/internal/FlightRecorderServiceV1.java
--- a/application/org.openjdk.jmc.rjmx.services.jfr/src/main/java/org/openjdk/jmc/rjmx/services/jfr/internal/FlightRecorderServiceV1.java
+++ b/application/org.openjdk.jmc.rjmx.services.jfr/src/main/java/org/openjdk/jmc/rjmx/services/jfr/internal/FlightRecorderServiceV1.java
@@ -131,6 +131,9 @@
public FlightRecorderServiceV1(IConnectionHandle handle) throws ConnectionException, ServiceNotAvailableException {
cfs = handle.getServiceOrThrow(ICommercialFeaturesService.class);
+ if (!JVMSupportToolkit.hasFlightRecorder(handle)) {
+ throw new ServiceNotAvailableException(""); //$NON-NLS-1$
+ }
if (!isDynamicFlightRecorderSupported(handle) && isFlightRecorderDisabled(handle)) {
throw new ServiceNotAvailableException(""); //$NON-NLS-1$
}
diff --git a/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/ConnectionToolkit.java b/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/ConnectionToolkit.java
--- a/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/ConnectionToolkit.java
+++ b/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/ConnectionToolkit.java
@@ -377,24 +377,24 @@
public static boolean isOracle(IConnectionHandle handle) {
JVMDescriptor descriptor = handle.getServerDescriptor().getJvmInfo();
// This should normally not happen for discovered JVMs, but users can create custom connections
- String vendor = null;
+ String name = null;
if (descriptor != null) {
- vendor = descriptor.getJvmVendor();
+ name = descriptor.getJvmName();
} else {
// We try checking if connected
if (handle.isConnected()) {
MBeanServerConnection connection = handle.getServiceOrNull(MBeanServerConnection.class);
if (connection != null) {
try {
- vendor = getRuntimeBean(connection).getVmVendor();
+ name = getRuntimeBean(connection).getVmName();
} catch (IOException e) {
- // Worst case we classify JVM vendor wrong
+ // Worst case we classify JVM name wrong
RJMXPlugin.getDefault().getLogger().log(Level.WARNING, "Could not check if Oracle JVM", e);
}
}
}
}
- return vendor != null && vendor.contains("Oracle");
+ return name != null && (name.contains("Java HotSpot"));
}
/**
diff --git a/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/JVMSupportToolkit.java b/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/JVMSupportToolkit.java
--- a/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/JVMSupportToolkit.java
+++ b/application/org.openjdk.jmc.rjmx/src/main/java/org/openjdk/jmc/rjmx/JVMSupportToolkit.java
@@ -85,6 +85,27 @@
}
/**
+ * Checks if Flight Recorder is available for use
+ *
+ * @param connection
+ * @return If it is an Oracle JVM or there is a FlightRecorder VM option, then return true.
+ * Otherwise, return false. This is used for verifying JDK 8 JVMs that are not built
+ * with JFR enabled, e.g., OpenJDK 8
+ */
+ public static boolean hasFlightRecorder(IConnectionHandle connection) {
+ if (ConnectionToolkit.isOracle(connection)) {
+ return true;
+ }
+ MBeanServerConnection server = connection.getServiceOrNull(MBeanServerConnection.class);
+ try {
+ HotspotManagementToolkit.getVMOption(server, "FlightRecorder");
+ return true;
+ } catch (Exception e) { // RuntimeMBeanException thrown if FlightRecorder is not present
+ return false;
+ }
+ }
+
+ /**
* Checks if Flight Recorder is disabled.
*
* @param connection
diff --git a/application/org.openjdk.jmc.rjmx/src/main/resources/org/openjdk/jmc/rjmx/messages/internal/messages.properties b/application/org.openjdk.jmc.rjmx/src/main/resources/org/openjdk/jmc/rjmx/messages/internal/messages.properties
--- a/application/org.openjdk.jmc.rjmx/src/main/resources/org/openjdk/jmc/rjmx/messages/internal/messages.properties
+++ b/application/org.openjdk.jmc.rjmx/src/main/resources/org/openjdk/jmc/rjmx/messages/internal/messages.properties
@@ -54,7 +54,7 @@
JVMSupport_FLIGHT_RECORDER_NOT_FULLY_SUPPORTED_OLD_HOTSPOT_SHORT=Flight Recorder is not fully supported for JVMs with Java versions below 7u40
JVMSupport_FLIGHT_RECORDER_NOT_SUPPORTED_NOT_HOTSPOT=Flight Recorder is not supported for non HotSpot JVMs
JVMSupport_FLIGHT_RECORDER_NOT_SUPPORTED_NOT_HOTSPOT_SHORT=Flight Recorder is not supported for non HotSpot JVMs
-JVMSupport_FLIGHT_RECORDER_NOT_ENABLED=Flight Recorder features are not enabled. To enable this you need to use an Oracle JDK 7u4 or later JVM started with -XX:+UnlockCommercialFeatures -XX:+FlightRecorder or an OpenJDK 11+ JVM.
+JVMSupport_FLIGHT_RECORDER_NOT_ENABLED=Flight Recorder features are not enabled. To enable this you need to use an Oracle JDK 7u4 or later JVM started with -XX:+UnlockCommercialFeatures -XX:+FlightRecorder, an OpenJDK 8 JFR-enabled JVM, or an OpenJDK 11+ JVM.
JVMSupport_FLIGHT_RECORDER_NOT_ENABLED_SHORT=Flight Recorder features are not enabled
JVMSupport_FLIGHT_RECORDER_DISABLED=Flight Recorder is explicitly disabled. To enable the Flight Recorder, remove -XX:-FlightRecorder from the command line.
JVMSupport_FLIGHT_RECORDER_DISABLED_SHORT=Flight Recorder is explicitly disabled
diff --git a/application/org.openjdk.jmc.ui.common/src/main/java/org/openjdk/jmc/ui/common/jvm/JVMDescriptor.java b/application/org.openjdk.jmc.ui.common/src/main/java/org/openjdk/jmc/ui/common/jvm/JVMDescriptor.java
--- a/application/org.openjdk.jmc.ui.common/src/main/java/org/openjdk/jmc/ui/common/jvm/JVMDescriptor.java
+++ b/application/org.openjdk.jmc.ui.common/src/main/java/org/openjdk/jmc/ui/common/jvm/JVMDescriptor.java
@@ -38,6 +38,7 @@
public class JVMDescriptor {
private final String javaVersion;
private final JVMType jvmType;
+ private final String jvmName;
private final String jvmVendor;
private final JVMArch jvmArch;
private final String javaCommand;
@@ -47,13 +48,14 @@
private final Connectable connectable;
public JVMDescriptor(String javaVersion, JVMType jvmType, JVMArch jvmArch, String javaCommand, String jvmArguments,
- String jvmVendor, Integer pid, boolean debug, Connectable attachable) {
+ String jvmName, String jvmVendor, Integer pid, boolean debug, Connectable attachable) {
super();
this.javaVersion = javaVersion;
this.jvmType = jvmType;
this.jvmArch = jvmArch;
this.javaCommand = javaCommand;
this.jvmArguments = jvmArguments;
+ this.jvmName = jvmName;
this.jvmVendor = jvmVendor;
this.pid = pid;
this.debug = debug;
@@ -80,6 +82,10 @@
return jvmArguments;
}
+ public String getJvmName() {
+ return jvmName;
+ }
+
public String getJvmVendor() {
return jvmVendor;
}
diff --git a/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/JVMSupportToolkitTest.java b/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/JVMSupportToolkitTest.java
--- a/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/JVMSupportToolkitTest.java
+++ b/application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/JVMSupportToolkitTest.java
@@ -47,8 +47,10 @@
@SuppressWarnings("nls")
public class JVMSupportToolkitTest {
- private static final String VENDOR_OPEN_JDK = "OpenJDK";
- private static final String VENDOR_ORACLE = "Oracle";
+ private static final String NAME_OPEN_JDK = "OpenJDK 64-Bit Server VM";
+ private static final String NAME_ORACLE = "Java HotSpot(TM) 64-Bit Server VM";
+ private static final String VENDOR_OPEN_JDK = "Oracle Corporation";
+ private static final String VENDOR_ORACLE = "Oracle Corporation";
// FIXME: Add tests for the methods that take IConnectionHandle as a parameter.
private static final String SUPPORTED_MESSAGE = null;
@@ -65,8 +67,8 @@
public void testJfr17U40HotSpotSupported() {
ServerHandle server = new ServerHandle(
new ServerDescriptor(null, null,
- new JVMDescriptor("1.7.0_40", JVMType.HOTSPOT, JVMArch.UNKNOWN, VENDOR_ORACLE, null, null, null,
- false, null)),
+ new JVMDescriptor("1.7.0_40", JVMType.HOTSPOT, JVMArch.UNKNOWN, null, null, NAME_ORACLE,
+ VENDOR_ORACLE, null, false, null)),
new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(), null);
String errorMessage = JVMSupportToolkit.checkFlightRecorderSupport(server, false);
assertEquals(SUPPORTED_MESSAGE, errorMessage);
@@ -76,8 +78,8 @@
public void testJfr17U4HotSpotNotFullySupported() {
ServerHandle server = new ServerHandle(
new ServerDescriptor(null, null,
- new JVMDescriptor("1.7.0_04", JVMType.HOTSPOT, JVMArch.UNKNOWN, VENDOR_ORACLE, null, null, null,
- false, null)),
+ new JVMDescriptor("1.7.0_04", JVMType.HOTSPOT, JVMArch.UNKNOWN, null, null, NAME_ORACLE,
+ VENDOR_ORACLE, null, false, null)),
new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(), null);
String errorMessage = JVMSupportToolkit.checkFlightRecorderSupport(server, false);
assertEquals(Messages.JVMSupport_FLIGHT_RECORDER_NOT_FULLY_SUPPORTED_OLD_HOTSPOT, errorMessage);
@@ -87,8 +89,8 @@
public void testJfr17HotSpotNotSupported() {
ServerHandle server = new ServerHandle(
new ServerDescriptor(null, null,
- new JVMDescriptor("1.7.0", JVMType.HOTSPOT, JVMArch.UNKNOWN, VENDOR_ORACLE, null, null, null,
- false, null)),
+ new JVMDescriptor("1.7.0", JVMType.HOTSPOT, JVMArch.UNKNOWN, null, null, NAME_ORACLE,
+ VENDOR_ORACLE, null, false, null)),
new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(), null);
String errorMessage = JVMSupportToolkit.checkFlightRecorderSupport(server, false);
assertEquals(Messages.JVMSupport_FLIGHT_RECORDER_NOT_SUPPORTED_OLD_HOTSPOT, errorMessage);
@@ -98,8 +100,8 @@
public void testJfrJRockitNotSupported() {
ServerHandle server = new ServerHandle(
new ServerDescriptor(null, null,
- new JVMDescriptor("1.6", JVMType.JROCKIT, JVMArch.UNKNOWN, VENDOR_ORACLE, null, null, null,
- false, null)),
+ new JVMDescriptor("1.6", JVMType.JROCKIT, JVMArch.UNKNOWN, null, null, NAME_ORACLE,
+ VENDOR_ORACLE, null, false, null)),
new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(), null);
String errorMessage = JVMSupportToolkit.checkFlightRecorderSupport(server, false);
assertEquals(Messages.JVMSupport_JROCKIT_NO_LONGER_SUPPORTED, errorMessage);
@@ -109,8 +111,8 @@
public void testJfrOldHotSpotNotSupported() {
ServerHandle server = new ServerHandle(
new ServerDescriptor(null, null,
- new JVMDescriptor("1.6", JVMType.HOTSPOT, JVMArch.UNKNOWN, VENDOR_ORACLE, null, null, null,
- false, null)),
+ new JVMDescriptor("1.6", JVMType.HOTSPOT, JVMArch.UNKNOWN, null, null, NAME_ORACLE,
+ VENDOR_ORACLE, null, false, null)),
new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(), null);
String errorMessage = JVMSupportToolkit.checkFlightRecorderSupport(server, false);
assertEquals(Messages.JVMSupport_FLIGHT_RECORDER_NOT_SUPPORTED_OLD_HOTSPOT, errorMessage);
@@ -119,8 +121,9 @@
@Test
public void testJfrNonHotSpotNotSupported() {
ServerHandle server = new ServerHandle(
- new ServerDescriptor(null, null, new JVMDescriptor("1.7", JVMType.OTHER, JVMArch.UNKNOWN, VENDOR_ORACLE,
- null, null, null, false, null)),
+ new ServerDescriptor(null, null,
+ new JVMDescriptor("1.7", JVMType.OTHER, JVMArch.UNKNOWN, null, null, NAME_ORACLE, VENDOR_ORACLE,
+ null, false, null)),
new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(), null);
String errorMessage = JVMSupportToolkit.checkFlightRecorderSupport(server, false);
assertEquals(Messages.JVMSupport_FLIGHT_RECORDER_NOT_SUPPORTED_NOT_HOTSPOT, errorMessage);
@@ -130,8 +133,8 @@
public void testJfrUnknownNoWarning() {
ServerHandle server = new ServerHandle(
new ServerDescriptor(null, null,
- new JVMDescriptor("1.7", JVMType.UNKNOWN, JVMArch.UNKNOWN, VENDOR_ORACLE, null, null, null,
- false, null)),
+ new JVMDescriptor("1.7", JVMType.UNKNOWN, JVMArch.UNKNOWN, null, null, NAME_ORACLE,
+ VENDOR_ORACLE, null, false, null)),
new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(), null);
String errorMessage = JVMSupportToolkit.checkFlightRecorderSupport(server, false);
assertEquals(SUPPORTED_MESSAGE, errorMessage);
@@ -141,8 +144,8 @@
public void testJfr8HotSpotOpenJDKSupported() {
ServerHandle server = new ServerHandle(
new ServerDescriptor(null, null,
- new JVMDescriptor("1.8.0", JVMType.HOTSPOT, JVMArch.UNKNOWN, VENDOR_OPEN_JDK, null, null, null,
- false, null)),
+ new JVMDescriptor("1.8.0", JVMType.HOTSPOT, JVMArch.UNKNOWN, null, null, NAME_OPEN_JDK,
+ VENDOR_OPEN_JDK, null, false, null)),
new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(), null);
String errorMessage = JVMSupportToolkit.checkFlightRecorderSupport(server, false);
assertEquals(SUPPORTED_MESSAGE, errorMessage);
@@ -152,8 +155,8 @@
public void testJdk7HotSpotOpenJDKNotSupported() {
ServerHandle server = new ServerHandle(
new ServerDescriptor(null, null,
- new JVMDescriptor("1.7.0", JVMType.HOTSPOT, JVMArch.UNKNOWN, VENDOR_OPEN_JDK, null, null, null,
- false, null)),
+ new JVMDescriptor("1.7.0", JVMType.HOTSPOT, JVMArch.UNKNOWN, null, null, NAME_OPEN_JDK,
+ VENDOR_OPEN_JDK, null, false, null)),
new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(), null);
String errorMessage = JVMSupportToolkit.checkFlightRecorderSupport(server, false);
assertNotNull(errorMessage);

View File

@ -1,7 +1,8 @@
diff --git a/application/org.openjdk.jmc.console.ui/META-INF/MANIFEST.MF b/application/org.openjdk.jmc.console.ui/META-INF/MANIFEST.MF
index a0bd643..926c1b3 100644
--- a/application/org.openjdk.jmc.console.ui/META-INF/MANIFEST.MF
+++ b/application/org.openjdk.jmc.console.ui/META-INF/MANIFEST.MF
@@ -10,7 +10,7 @@
@@ -10,7 +10,7 @@ Bundle-Localization: plugin
Require-Bundle: org.openjdk.jmc.rjmx.ui;visibility:=reexport,
org.eclipse.e4.core.contexts;bundle-version="1.3.0",
org.eclipse.e4.core.di;bundle-version="1.3.0";visibility:=reexport,
@ -10,9 +11,9 @@ diff --git a/application/org.openjdk.jmc.console.ui/META-INF/MANIFEST.MF b/appli
javax.inject;bundle-version="1.0.0";visibility:=reexport,
org.openjdk.jmc.commands
Bundle-ActivationPolicy: lazy
@@ -22,7 +22,7 @@
org.openjdk.jmc.console.ui.editor,
org.openjdk.jmc.console.ui.editor.internal;x-friends:="org.openjdk.jmc.console.ui.mbeanbrowser,org.openjdk.jmc.rcp.intro"
@@ -24,7 +24,7 @@ Export-Package: org.openjdk.jmc.console.ui.actions;
org.openjdk.jmc.console.ui.messages.internal;x-friends:="org.openjdk.jmc.console.uitest",
org.openjdk.jmc.console.ui.preferences;x-friends:="org.openjdk.jmc.console.uitest"
Bundle-ClassPath: .
-Import-Package: javax.annotation;version="1.0.0",
+Import-Package: javax.annotation;version="1.2.0",
@ -20,6 +21,7 @@ diff --git a/application/org.openjdk.jmc.console.ui/META-INF/MANIFEST.MF b/appli
Automatic-Module-Name: org.openjdk.jmc.console.ui
diff --git a/application/org.openjdk.jmc.feature.rcp/feature.xml b/application/org.openjdk.jmc.feature.rcp/feature.xml
index 828c3f2..cf4b462 100644
--- a/application/org.openjdk.jmc.feature.rcp/feature.xml
+++ b/application/org.openjdk.jmc.feature.rcp/feature.xml
@@ -84,7 +84,8 @@

View File

@ -1,13 +1,13 @@
diff --git a/pom.xml b/pom.xml
--- a/pom.xml
+++ b/pom.xml
@@ -99,95 +99,6 @@
diff -r c34e9deef71f pom.xml
--- a/pom.xml Fri Apr 17 15:53:00 2020 -0400
+++ b/pom.xml Fri Apr 17 16:01:41 2020 -0400
@@ -105,137 +105,6 @@
<url>${snapshot.repo}</url>
</snapshotRepository>
</distributionManagement>
- <profiles>
- <profile>
- <id>2019-03</id>
- <id>2019-09</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
@ -21,8 +21,50 @@ diff --git a/pom.xml b/pom.xml
- <target>
- <artifact>
- <groupId>org.openjdk.jmc</groupId>
- <artifactId>platform-definition-2019-09</artifactId>
- <version>7.1.1-SNAPSHOT</version>
- </artifact>
- </target>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>2019-06</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>target-platform-configuration</artifactId>
- <version>${tycho.version}</version>
- <configuration>
- <target>
- <artifact>
- <groupId>org.openjdk.jmc</groupId>
- <artifactId>platform-definition-2019-06</artifactId>
- <version>7.1.1-SNAPSHOT</version>
- </artifact>
- </target>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>2019-03</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>target-platform-configuration</artifactId>
- <version>${tycho.version}</version>
- <configuration>
- <target>
- <artifact>
- <groupId>org.openjdk.jmc</groupId>
- <artifactId>platform-definition-2019-03</artifactId>
- <version>7.0.0-SNAPSHOT</version>
- <version>7.1.1-SNAPSHOT</version>
- </artifact>
- </target>
- </configuration>
@ -43,7 +85,7 @@ diff --git a/pom.xml b/pom.xml
- <artifact>
- <groupId>org.openjdk.jmc</groupId>
- <artifactId>platform-definition-2018-12</artifactId>
- <version>7.0.0-SNAPSHOT</version>
- <version>7.1.1-SNAPSHOT</version>
- </artifact>
- </target>
- </configuration>
@ -64,7 +106,7 @@ diff --git a/pom.xml b/pom.xml
- <artifact>
- <groupId>org.openjdk.jmc</groupId>
- <artifactId>platform-definition-2018-09</artifactId>
- <version>7.0.0-SNAPSHOT</version>
- <version>7.1.1-SNAPSHOT</version>
- </artifact>
- </target>
- </configuration>
@ -85,7 +127,7 @@ diff --git a/pom.xml b/pom.xml
- <artifact>
- <groupId>org.openjdk.jmc</groupId>
- <artifactId>platform-definition-photon</artifactId>
- <version>7.0.0-SNAPSHOT</version>
- <version>7.1.1-SNAPSHOT</version>
- </artifact>
- </target>
- </configuration>

View File

@ -1,29 +1,31 @@
diff --git a/application/org.openjdk.jmc.feature.rcp/feature.xml b/application/org.openjdk.jmc.feature.rcp/feature.xml
index 1e295ca..9687dd4 100644
--- a/application/org.openjdk.jmc.feature.rcp/feature.xml
+++ b/application/org.openjdk.jmc.feature.rcp/feature.xml
@@ -52,18 +52,10 @@
@@ -51,18 +51,10 @@
id="org.openjdk.jmc.feature.console"
version="0.0.0"/>
<includes
- <includes
- id="org.openjdk.jmc.feature.rcp.ja"
- version="0.0.0"/>
-
- <includes
<includes
id="org.openjdk.jmc.feature.core"
version="0.0.0"/>
<includes
- <includes
- id="org.openjdk.jmc.feature.rcp.zh_CN"
- version="0.0.0"/>
-
- <includes
<includes
id="org.openjdk.jmc.feature.flightrecorder"
version="0.0.0"/>
@@ -105,24 +97,6 @@
@@ -104,24 +96,6 @@
version="0.0.0"
unpack="false"/>
<plugin
- <plugin
- id="org.openjdk.jmc.rcp.application.ja"
- nl="ja_JP,ja"
- download-size="0"
@ -41,7 +43,6 @@ diff --git a/application/org.openjdk.jmc.feature.rcp/feature.xml b/application/o
- fragment="true"
- unpack="false"/>
-
- <plugin
<plugin
id="org.openjdk.jmc.rcp.intro"
download-size="0"
install-size="0"

View File

@ -1,4 +1,5 @@
diff --git a/application/org.openjdk.jmc.feature.ide/feature.xml b/application/org.openjdk.jmc.feature.ide/feature.xml
index cd3dc7e..128cd0b 100644
--- a/application/org.openjdk.jmc.feature.ide/feature.xml
+++ b/application/org.openjdk.jmc.feature.ide/feature.xml
@@ -65,11 +65,4 @@
@ -15,9 +16,10 @@ diff --git a/application/org.openjdk.jmc.feature.ide/feature.xml b/application/o
</feature>
\ No newline at end of file
diff --git a/application/pom.xml b/application/pom.xml
index d185d9d..89fd033 100644
--- a/application/pom.xml
+++ b/application/pom.xml
@@ -79,7 +79,6 @@
@@ -77,7 +77,6 @@
<module>org.openjdk.jmc.flightrecorder.ui</module>
<module>org.openjdk.jmc.greychart</module>
<module>org.openjdk.jmc.greychart.ui</module>

View File

@ -1,4 +1,5 @@
diff --git a/application/org.openjdk.jmc.rcp.product/pom.xml b/application/org.openjdk.jmc.rcp.product/pom.xml
index 8e6b303..8060da9 100644
--- a/application/org.openjdk.jmc.rcp.product/pom.xml
+++ b/application/org.openjdk.jmc.rcp.product/pom.xml
@@ -141,11 +141,4 @@

View File

@ -1,7 +1,8 @@
diff --git a/application/tests/org.openjdk.jmc.rjmx.services.jfr.test/META-INF/MANIFEST.MF b/application/tests/org.openjdk.jmc.rjmx.services.jfr.test/META-INF/MANIFEST.MF
index bf02b43..a4d5a67 100644
--- a/application/tests/org.openjdk.jmc.rjmx.services.jfr.test/META-INF/MANIFEST.MF
+++ b/application/tests/org.openjdk.jmc.rjmx.services.jfr.test/META-INF/MANIFEST.MF
@@ -12,7 +12,9 @@
@@ -12,7 +12,9 @@ Require-Bundle: org.junit,
org.openjdk.jmc.rjmx.services.jfr,
org.openjdk.jmc.rjmx,
org.openjdk.jmc.common,

View File

@ -1,15 +1,17 @@
diff --git a/pom.xml b/pom.xml
index 59f292a..2985869 100644
--- a/pom.xml
+++ b/pom.xml
@@ -116,20 +116,10 @@
@@ -117,21 +117,11 @@
<version>${tycho.version}</version>
<configuration>
<environments>
<environment>
- <environment>
- <os>win32</os>
- <ws>win32</ws>
- <arch>x86_64</arch>
- </environment>
- <environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>

View File

@ -0,0 +1,15 @@
diff -r 07b99eac9056 application/pom.xml
--- a/application/pom.xml Fri Apr 17 17:57:23 2020 -0400
+++ b/application/pom.xml Fri Apr 17 17:58:31 2020 -0400
@@ -160,11 +160,6 @@
<artifactId>flightrecorder.rules.jdk</artifactId>
<version>7.1.1</version>
</dependency>
- <dependency>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- <version>0.8.3</version>
- </dependency>
</dependencies>
<build>
<plugins>

View File

@ -1,64 +0,0 @@
# HG changeset patch
# Parent 9696af3e434734700a8c37680ce3742ab940eccb
diff --git a/application/org.openjdk.jmc.feature.core/feature.xml b/application/org.openjdk.jmc.feature.core/feature.xml
--- a/application/org.openjdk.jmc.feature.core/feature.xml
+++ b/application/org.openjdk.jmc.feature.core/feature.xml
@@ -161,13 +161,6 @@
unpack="false"/>
<plugin
- id="com.sun.mail.jakarta.mail"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
id="com.sun.activation.jakarta.activation"
download-size="0"
install-size="0"
@@ -175,7 +168,7 @@
unpack="false"/>
<plugin
- id="javax.mail.dsn"
+ id="com.sun.mail.javax.mail"
download-size="0"
install-size="0"
version="0.0.0"
diff --git a/application/org.openjdk.jmc.osgi.extension/.project b/application/org.openjdk.jmc.osgi.extension/.project
--- a/application/org.openjdk.jmc.osgi.extension/.project
+++ b/application/org.openjdk.jmc.osgi.extension/.project
@@ -20,8 +20,14 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
diff --git a/releng/platform-definitions/platform-definition-2018-09/.project b/releng/platform-definitions/platform-definition-2018-09/.project
--- a/releng/platform-definitions/platform-definition-2018-09/.project
+++ b/releng/platform-definitions/platform-definition-2018-09/.project
@@ -5,7 +5,13 @@
<projects>
</projects>
<buildSpec>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

View File

@ -1,12 +0,0 @@
diff --git a/application/org.openjdk.jmc.rjmx/src/main/resources/org/openjdk/jmc/rjmx/messages/internal/messages.properties b/application/org.openjdk.jmc.rjmx/src/main/resources/org/openjdk/jmc/rjmx/messages/internal/messages.properties
--- a/application/org.openjdk.jmc.rjmx/src/main/resources/org/openjdk/jmc/rjmx/messages/internal/messages.properties
+++ b/application/org.openjdk.jmc.rjmx/src/main/resources/org/openjdk/jmc/rjmx/messages/internal/messages.properties
@@ -54,7 +54,7 @@
JVMSupport_FLIGHT_RECORDER_NOT_FULLY_SUPPORTED_OLD_HOTSPOT_SHORT=Flight Recorder is not fully supported for JVMs with Java versions below 7u40
JVMSupport_FLIGHT_RECORDER_NOT_SUPPORTED_NOT_HOTSPOT=Flight Recorder is not supported for non HotSpot JVMs
JVMSupport_FLIGHT_RECORDER_NOT_SUPPORTED_NOT_HOTSPOT_SHORT=Flight Recorder is not supported for non HotSpot JVMs
-JVMSupport_FLIGHT_RECORDER_NOT_ENABLED=Flight Recorder features are not enabled. To enable this you need to use a Java 7u4 or later JVM started with -XX:+UnlockCommercialFeatures -XX:+FlightRecorder.
+JVMSupport_FLIGHT_RECORDER_NOT_ENABLED=Flight Recorder features are not enabled. To enable this the target application needs to use OpenJDK 11+ or Oracle Java 7u4+ started with -XX:+UnlockCommercialFeatures -XX:+FlightRecorder.
JVMSupport_FLIGHT_RECORDER_NOT_ENABLED_SHORT=Flight Recorder features are not enabled
JVMSupport_FLIGHT_RECORDER_DISABLED=Flight Recorder is explicitly disabled. To enable the Flight Recorder, remove -XX:-FlightRecorder from the command line.
JVMSupport_FLIGHT_RECORDER_DISABLED_SHORT=Flight Recorder is explicitly disabled

View File

@ -1,74 +0,0 @@
diff --git a/application/org.openjdk.jmc.feature.flightrecorder/feature.xml b/application/org.openjdk.jmc.feature.flightrecorder/feature.xml
--- a/application/org.openjdk.jmc.feature.flightrecorder/feature.xml
+++ b/application/org.openjdk.jmc.feature.flightrecorder/feature.xml
@@ -94,13 +94,6 @@
unpack="false"/>
<plugin
- id="org.openjdk.jmc.javafx.osgi"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
id="org.openjdk.jmc.flightrecorder.rules.extensionprovider"
download-size="0"
install-size="0"
diff --git a/application/org.openjdk.jmc.flightrecorder.ui/META-INF/MANIFEST.MF b/application/org.openjdk.jmc.flightrecorder.ui/META-INF/MANIFEST.MF
--- a/application/org.openjdk.jmc.flightrecorder.ui/META-INF/MANIFEST.MF
+++ b/application/org.openjdk.jmc.flightrecorder.ui/META-INF/MANIFEST.MF
@@ -9,7 +9,6 @@
Require-Bundle: org.openjdk.jmc.rjmx,
org.openjdk.jmc.flightrecorder;visibility:=reexport,
org.openjdk.jmc.ui;visibility:=reexport,
- org.openjdk.jmc.javafx.osgi,
org.openjdk.jmc.flightrecorder.rules,
org.openjdk.jmc.flightrecorder.rules.jdk,
org.openjdk.jmc.flightrecorder.configuration,
diff --git a/application/pom.xml b/application/pom.xml
--- a/application/pom.xml
+++ b/application/pom.xml
@@ -61,12 +61,10 @@
<module>org.openjdk.jmc.feature.core</module>
<module>org.openjdk.jmc.feature.flightrecorder</module>
<module>org.openjdk.jmc.feature.flightrecorder.ext.g1</module>
- <module>org.openjdk.jmc.feature.flightrecorder.ext.jfx</module>
<module>org.openjdk.jmc.feature.flightrecorder.metadata</module>
<module>org.openjdk.jmc.feature.ide</module>
<module>org.openjdk.jmc.feature.ide.launch</module>
<module>org.openjdk.jmc.feature.jconsole</module>
- <module>org.openjdk.jmc.feature.joverflow</module>
<module>org.openjdk.jmc.feature.license</module>
<module>org.openjdk.jmc.feature.pde</module>
<module>org.openjdk.jmc.feature.rcp</module>
@@ -75,7 +73,6 @@
<module>org.openjdk.jmc.flightrecorder.controlpanel.ui</module>
<module>org.openjdk.jmc.flightrecorder.controlpanel.ui.configuration</module>
<module>org.openjdk.jmc.flightrecorder.ext.g1</module>
- <module>org.openjdk.jmc.flightrecorder.ext.jfx</module>
<module>org.openjdk.jmc.flightrecorder.metadata</module>
<module>org.openjdk.jmc.flightrecorder.pde</module>
<module>org.openjdk.jmc.flightrecorder.rules.extensionprovider</module>
@@ -85,10 +82,7 @@
<module>org.openjdk.jmc.ide.jdt</module>
<module>org.openjdk.jmc.ide.launch</module>
<module>org.openjdk.jmc.ide.ui</module>
- <module>org.openjdk.jmc.javafx.osgi</module>
<module>org.openjdk.jmc.jdp</module>
- <module>org.openjdk.jmc.joverflow</module>
- <module>org.openjdk.jmc.joverflow.ui</module>
<module>org.openjdk.jmc.osgi.extension</module>
<module>org.openjdk.jmc.pde</module>
<module>org.openjdk.jmc.rcp.application</module>
diff --git a/application/tests/pom.xml b/application/tests/pom.xml
--- a/application/tests/pom.xml
+++ b/application/tests/pom.xml
@@ -48,7 +48,6 @@
<module>org.openjdk.jmc.greychart.test</module>
<module>org.openjdk.jmc.ide.launch.test</module>
<module>org.openjdk.jmc.jdp.test</module>
- <module>org.openjdk.jmc.joverflow.test</module>
<module>org.openjdk.jmc.rjmx.services.jfr.test</module>
<module>org.openjdk.jmc.rjmx.test</module>
<module>org.openjdk.jmc.ui.common.test</module>

View File

@ -27,27 +27,13 @@ function _sym {
fi
}
pushd $1
# owasp-java-encoder
_sym org.owasp.encoder_1.2.2.jar /usr/share/java/owasp-java-encoder/encoder.jar
# jaf
_sym com.sun.activation.jakarta.activation_1.2.1.jar /usr/share/java/jaf/jakarta.activation.jar
_sym jakarta.activation-api_1.2.1.jar /usr/share/java/jaf/jakarta.activation-api.jar
# jmc-core
_sym org.openjdk.jmc.common_7.0.0.jar /usr/share/java/jmc-core/common.jar
_sym org.openjdk.jmc.flightrecorder_7.0.0.jar /usr/share/java/jmc-core/flightrecorder.jar
_sym org.openjdk.jmc.flightrecorder.rules_7.0.0.jar /usr/share/java/jmc-core/flightrecorder.rules.jar
_sym org.openjdk.jmc.flightrecorder.rules.jdk_7.0.0.jar /usr/share/java/jmc-core/flightrecorder.rules.jdk.jar
popd
function _symlink {
_f=$(ls | grep -e "^$1" || :)
if [ -n "$_f" ] ; then
rm -rf $_f
for SCL_JAVA_DIR in ${SCL_JAVA_DIRS}; do
if [ -f ${SCL_JAVA_DIR}/$2 ]; then
echo "found ${SCL_JAVA_DIR}/$2"
echo "linking $1 to $2"
echo "linking ${_f%.jar}.jar to ${SCL_JAVA_DIR}/$2"
ln -s ${SCL_JAVA_DIR}/$2 ${_f%.jar}.jar
return 0
fi
@ -57,26 +43,17 @@ function _symlink {
fi
}
# pushd $1
# _symlink javax.annotation-api_ glassfish-annotation-api.jar
# _symlink com.sun.el.javax.el_ glassfish-el.jar
# _symlink javax.el-api_ glassfish-el-api.jar
# _symlink javax.inject_ atinject.jar
# _symlink javax.servlet.jsp_ glassfish-jsp-api/javax.servlet.jsp-api.jar
# _symlink javax.servlet-api_ glassfish-servlet-api.jar
# _symlink org.apache.commons.codec_ commons-codec.jar
# _symlink org.apache.commons.io_ commons-io.jar
# _symlink org.apache.commons.jxpath_ commons-jxpath.jar
# _symlink org.apache.commons.logging_ commons-logging.jar
# _symlink org.apache.httpcomponents.httpcore_ httpcomponents/httpcore.jar
# _symlink org.apache.httpcomponents.httpclient_ httpcomponents/httpclient.jar
# _symlink org.tukaani.xz_ xz-java.jar
# _symlink org.w3c.dom.svg_ xml-commons-apis-ext.jar
# _symlink org.xmlpull_ xpp3.jar
# popd
pushd $1
# owasp-java-encoder
_sym org.owasp.encoder_1.2.2.jar /usr/share/java/owasp-java-encoder/encoder.jar
# jaf
_sym com.sun.activation.jakarta.activation_1.2.1.jar /usr/share/java/jaf/jakarta.activation.jar
_sym jakarta.activation-api_1.2.1.jar /usr/share/java/jaf/jakarta.activation-api.jar
# HdrHistogram
_sym org.hdrhistogram.HdrHistogram_2.1.11.jar /usr/share/java/HdrHistogram.jar
# jmc-core
_symlink org.openjdk.jmc.common_ common.jar
_symlink org.openjdk.jmc.flightrecorder_ flightrecorder.jar
_symlink org.openjdk.jmc.flightrecorder.rules_ flightrecorder.rules.jar
_symlink org.openjdk.jmc.flightrecorder.rules.jdk_ flightrecorder.rules.jdk.jar
popd

View File

@ -1,17 +1,16 @@
# Version
%global major 7
%global minor 0
%global patchlevel 0
%global minor 1
%global patchlevel 1
# Revision
%global revnum 4
%global revnum 5
# set to 1 for hg snapshots, 0 for release
%global usesnapshot 0
# SNAPSHOT version
%global hgrevhash 9871e02a9e40
%global hgrevdate 20190528
%global hgrevhash e67446b5fc9d
%global hgrevdate 20200422
%global tarball_name jmc7-%{hgrevhash}
@ -51,37 +50,42 @@ Summary: JDK Mission Control is a profiling and diagnostics tool
License: UPL
URL: http://openjdk.java.net/projects/jmc/
Source0: https://hg.openjdk.java.net/jmc/jmc7/archive/9871e02a9e40.tar.gz
Source0: https://hg.openjdk.java.net/jmc/jmc7/archive/%{hgrevhash}.tar.gz
Source1: %{name}.desktop
Source2: %{name}.1
Source3: symlink_libs.sh
# Remove optional twitter related functionality
Patch0: remove-twitter.patch
Patch0: 0-remove-twitter.patch
# Update javamail dependency names
Patch1: 1-fix-javamail.patch
# Update javax dependency names to match what is found in Fedora
Patch1: javax.patch
Patch2: 2-javax.patch
# Remove maven build profiles that won't be used in local build
Patch2: remove-profiles.patch
Patch3: 3-remove-profiles.patch
# Remove localization files that currently cannot be supported
# due to a packaging issue for Eclipse language packs
# eclipse-nls-ja and eclipse-nls-zh
# They currently provide multiple archs within the same package
# and the local build system cannot fulfill dependencies from them
Patch3: remove-localization.patch
# Remove optional openjfx related functionality
Patch4: remove-jfx.patch
Patch4: 4-remove-localization.patch
# Remove unused module org.openjdk.jmc.ide.jdt
Patch5: remove-ide-jdt.patch
Patch5: 5-remove-ide-jdt.patch
# Remove unused remote repository definition
Patch6: remove-buchen-repo.patch
Patch6: 6-remove-buchen-repo.patch
# Add dependency on org. hamcrest-core to provide class used in unit tests
Patch7: add-hamcrest.patch
Patch7: 7-add-hamcrest.patch
# Remove windows and mac arches
Patch8: remove-arch.patch
# Updates message for Java versions that support JFR
Patch9: fix-jfr-message.patch
# Fix javamail plugin listing
Patch10: fix-javamail.patch
Patch8: 8-remove-arch.patch
# Remove unnecessary dependency
Patch9: 9-remove-jacoco-dep.patch
# Revert downloading of flameview assets from the web
Patch10: 10-revert-flameview.patch
# Backport of JMC-6554 to add jvm vendor information retrieval and commercial features checks
Patch11: 11-6554.patch
# Backport of JMC-6692 to prevent JMC from prompting the user
# to enable commercial features when using a JDK8 JFR-enabled JVM
Patch12: 12-6692.patch
ExclusiveArch: x86_64
@ -96,6 +100,7 @@ BuildRequires: javamail
BuildRequires: mvn(org.commonjava.maven.plugins:directory-maven-plugin)
BuildRequires: mvn(com.sun.activation:jakarta.activation)
BuildRequires: mvn(org.openjdk.jmc:common)
BuildRequires: HdrHistogram >= 2.1.11
Requires: java-openjdk >= 1:1.8
@ -105,6 +110,7 @@ Requires: osgi(org.openjdk.jmc.flightrecorder)
Requires: osgi(org.openjdk.jmc.flightrecorder.rules)
Requires: osgi(org.openjdk.jmc.flightrecorder.rules.jdk)
Requires: osgi(org.owasp.encoder)
Requires: osgi(org.hdrhistogram.HdrHistogram) >= 2.1.11
Requires: gtk3
Requires: webkitgtk4
@ -131,6 +137,8 @@ applications running locally or deployed in production environments.
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%pom_disable_module releng
%pom_disable_module l10n application
@ -140,6 +148,10 @@ applications running locally or deployed in production environments.
%pom_remove_plugin com.github.spotbugs:spotbugs-maven-plugin
%pom_remove_plugin :maven-enforcer-plugin
%pom_remove_plugin :jacoco-maven-plugin application/tests
%pom_remove_plugin :jacoco-maven-plugin application/uitests
%pom_disable_module coverage application
# Info.plist are mac files and we only build for Linux
%pom_remove_plugin name.abuchen:fix-info-plist-maven-plugin application/org.openjdk.jmc.rcp.product
@ -180,7 +192,7 @@ install -d -m 755 %{buildroot}%{_bindir}
ln -s %{_jmcdir}/%{name} %{buildroot}%{_bindir}/%{name}
# replace jars with symlinks to installed libraries
bash %{SOURCE3} %{buildroot}%{_jmcdir}/plugins %{_javadir} %{_jnidir} %{_javadir_maven} %{_jnidir_maven}
bash %{SOURCE3} %{buildroot}%{_jmcdir}/plugins %{_javadir} %{_jnidir} %{_javadir_maven} %{_jnidir_maven} %{_javadir}/jmc-core
# create application launcher in desktop menu
install -d -m 755 %{buildroot}%{_datadir}/pixmaps
@ -210,6 +222,16 @@ sed -i "/.SH FILES/a .I %{_sysconfdir}/%{name}.ini" %{buildroot}%{_mandir}/man1/
%{_datadir}/applications/%{name}.desktop
%changelog
* Thu Apr 23 2020 Alex Macdonald <almacdon@redhat.com> - 7.1.1-5
- Update jacoco removal patch
* Thu Apr 23 2020 Alex Macdonald <almacdon@redhat.com> - 7.1.1-4
- Update to latest commit e67446b5fc9d
* Fri Apr 17 2020 Alex Macdonald <almacdon@redhat.com> - 7.1.1-3
- include jmc-core in the directories to search in symlink_libs.sh
* Fri Apr 17 2020 Alex Macdonald <almacdon@redhat.com> - 7.1.1-2
- Remove jacoco from the pom and disable coverage
* Thu Apr 16 2020 Alex Macdonald <almacdon@redhat.com> - 7.1.1-1
- Updated to version 7.1.1
* Thu Nov 14 2019 Jie Kang <jkang@redhat.com> - 7.0.0-4
- Fix requires
* Wed Nov 13 2019 Jie Kang <jkang@redhat.com> - 7.0.0-3