File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
plugins/sources/src/org/graalvm/visualvm/sources Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 114
114
"SourcesOptionsPanel_SubdirectoriesChoice=S&ubdirectories:" , // NOI18N
115
115
"SourcesOptionsPanel_SubdirectoriesToolTip=Sources are in the selected subdirectories of the source root(s)" , // NOI18N
116
116
"SourcesOptionsPanel_CustomSubpathsChoice=&Custom subpaths:" , // NOI18N
117
- "SourcesOptionsPanel_CustomSubpathsToolTip=Sources are in the defined subdirectories of the source root(s) - no wildcards allowed" , // NOI18N
117
+ "SourcesOptionsPanel_CustomSubpathsToolTip=Sources are in the defined subpaths of the source root(s) - no wildcards allowed" , // NOI18N
118
118
"SourcesOptionsPanel_SourcesEncoding=Sources Encoding:" // NOI18N
119
119
})
120
120
final class SourcesOptionsPanel extends JPanel {
Original file line number Diff line number Diff line change 27
27
import java .io .IOException ;
28
28
import java .util .ArrayList ;
29
29
import java .util .List ;
30
- import java .util .StringTokenizer ;
30
+ import java .util .regex .Matcher ;
31
+ import java .util .regex .Pattern ;
31
32
import org .graalvm .visualvm .core .datasource .Storage ;
32
33
33
34
/**
34
35
* @author Jiri Sedlacek
35
36
*/
36
37
class ExternalViewerLauncher implements Runnable {
37
38
39
+ private static final String COMMAND_STRINGS_REGEX = "\" [^\" ]*\" |\\ S+" ; // NOI18N
40
+
41
+
38
42
private final String command ;
39
43
40
44
@@ -57,9 +61,12 @@ protected void failed(IOException e) {}
57
61
58
62
59
63
public static List <String > getCommandStrings (String commandString ) {
60
- StringTokenizer tokenizer = new StringTokenizer (commandString );
61
64
List <String > command = new ArrayList ();
62
- while (tokenizer .hasMoreTokens ()) command .add (tokenizer .nextToken ());
65
+
66
+ Pattern pattern = Pattern .compile (COMMAND_STRINGS_REGEX );
67
+ Matcher matcher = pattern .matcher (commandString );
68
+ while (matcher .find ()) command .add (matcher .group ());
69
+
63
70
return command ;
64
71
}
65
72
You can’t perform that action at this time.
0 commit comments