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 3434import java .util .jar .Attributes ;
3535import java .util .jar .JarFile ;
3636import java .util .logging .Logger ;
37+ import java .util .regex .Pattern ;
3738import org .openide .util .NbBundle ;
3839
3940/**
@@ -50,6 +51,8 @@ public abstract class JvmJvmstatModel extends Model {
5051
5152 private static final String JAR_SUFFIX = ".jar" ; // NOI18N
5253
54+ private static final Pattern MODULE_MAIN_CLASS_PATTERN = Pattern .compile ("^(\\ w+\\ .)*\\ w+/(\\ w+\\ .)+\\ w+$" );
55+
5356 protected Application application ;
5457 protected JvmstatModel jvmstat ;
5558 protected MonitoredValue loadedClasses ;
@@ -253,6 +256,8 @@ public String getMainClass() {
253256 if (index != -1 ) {
254257 mainClassName = mainClassName .substring (index + 1 );
255258 }
259+ } else if (MODULE_MAIN_CLASS_PATTERN .matcher (mainClassName ).find ()) {
260+ return mainClassName .substring (mainClassName .indexOf ('/' )+1 );
256261 }
257262 mainClassName = mainClassName .replace ('\\' , '/' ).replace ('/' , '.' );
258263 return mainClassName ;
You can’t perform that action at this time.
0 commit comments