File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
visualvm/tools/src/com/sun/tools/visualvm/tools/jvmstat Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 34
34
import java .util .jar .Attributes ;
35
35
import java .util .jar .JarFile ;
36
36
import java .util .logging .Logger ;
37
+ import java .util .regex .Pattern ;
37
38
import org .openide .util .NbBundle ;
38
39
39
40
/**
@@ -50,6 +51,8 @@ public abstract class JvmJvmstatModel extends Model {
50
51
51
52
private static final String JAR_SUFFIX = ".jar" ; // NOI18N
52
53
54
+ private static final Pattern MODULE_MAIN_CLASS_PATTERN = Pattern .compile ("^(\\ w+\\ .)*\\ w+/(\\ w+\\ .)+\\ w+$" );
55
+
53
56
protected Application application ;
54
57
protected JvmstatModel jvmstat ;
55
58
protected MonitoredValue loadedClasses ;
@@ -253,6 +256,8 @@ public String getMainClass() {
253
256
if (index != -1 ) {
254
257
mainClassName = mainClassName .substring (index + 1 );
255
258
}
259
+ } else if (MODULE_MAIN_CLASS_PATTERN .matcher (mainClassName ).find ()) {
260
+ return mainClassName .substring (mainClassName .indexOf ('/' )+1 );
256
261
}
257
262
mainClassName = mainClassName .replace ('\\' , '/' ).replace ('/' , '.' );
258
263
return mainClassName ;
You can’t perform that action at this time.
0 commit comments