Skip to content

Commit f6fc0c2

Browse files
author
rcartwright
committed
When the interactions pane is reset, the working directory is set to a
plausible location. If a project is open, then working directory is the declared working diretory of the project if one exists; otherwise it is the sourceroot for the project. If no project is open, the working directory is the source root for one of the open files (they should all have the same root) provided WORKING_DIRECTORY is not set in the DrJava profile. In flat file mode when WORKING_DIRECTORY is set in the DrJava preferences, the working directory for the interactions pane is the specified directory. When the interactions pane is reset, a banner giving the working directory for the new interpreter appears at the top of the pane. I also changed all names of the form "classpath" to "classPath" and names of the form "Classpath" to "ClassPath". In the previous code base, there was no consistency concerning capitalizing "Path" in "classPath" or "ClassPath". I also eliminated IGetDocuments in favor of GlobalModel (which has many more methods) which forced the renaming of several classes concerning the IGetDocuments interface. There is now a DummyGlobalModel class in which all methods from GlobalModel throw UnsupportedOperation exceptions. ---------------------------------------------------------------------- src/edu/rice/cs/drjava/DrJava.java CVS: src/edu/rice/cs/drjava/config/FileOption.java CVS: src/edu/rice/cs/drjava/config/IntegerOptionTest.java CVS: src/edu/rice/cs/drjava/config/KeyStrokeOptionTest.java CVS: src/edu/rice/cs/drjava/config/OptionConstants.java CVS: src/edu/rice/cs/drjava/config/OptionParser.java CVS: src/edu/rice/cs/drjava/config/VectorOptionTest.java CVS: src/edu/rice/cs/drjava/model/AbstractGlobalModel.java CVS: src/edu/rice/cs/drjava/model/DefaultGlobalModel.java CVS: src/edu/rice/cs/drjava/model/DefaultJavadocModel.java CVS: src/edu/rice/cs/drjava/model/DummyGlobalModelListener.java CVS: src/edu/rice/cs/drjava/model/FileGroupingState.java CVS: src/edu/rice/cs/drjava/model/GlobalEventNotifier.java CVS: src/edu/rice/cs/drjava/model/GlobalModel.java CVS: src/edu/rice/cs/drjava/model/GlobalModelCompileErrorsTest.java CVS: src/edu/rice/cs/drjava/model/GlobalModelCompileIOTest.java CVS: src/edu/rice/cs/drjava/model/GlobalModelCompileSuccessTest.java CVS: src/edu/rice/cs/drjava/model/GlobalModelCompileTest.java CVS: src/edu/rice/cs/drjava/model/GlobalModelJUnitTest.java CVS: src/edu/rice/cs/drjava/model/GlobalModelListener.java CVS: src/edu/rice/cs/drjava/model/GlobalModelOtherTest.java CVS: src/edu/rice/cs/drjava/model/GlobalModelTestCase.java CVS: src/edu/rice/cs/drjava/model/JavadocModel.java CVS: src/edu/rice/cs/drjava/model/JavadocModelTest.java CVS: src/edu/rice/cs/drjava/model/TestDocGetter.java CVS: src/edu/rice/cs/drjava/model/cache/DocumentCache.java CVS: src/edu/rice/cs/drjava/model/cache/DocumentCacheTest.java CVS: src/edu/rice/cs/drjava/model/compiler/CompilerErrorModel.java CVS: src/edu/rice/cs/drjava/model/compiler/CompilerEventNotifier.java CVS: src/edu/rice/cs/drjava/model/compiler/CompilerInterface.java CVS: src/edu/rice/cs/drjava/model/compiler/CompilerListener.java CVS: src/edu/rice/cs/drjava/model/compiler/CompilerProxy.java CVS: src/edu/rice/cs/drjava/model/compiler/CompilerRegistryTest.java CVS: src/edu/rice/cs/drjava/model/compiler/DefaultCompilerModel.java CVS: src/edu/rice/cs/drjava/model/compiler/NoCompilerAvailable.java CVS: src/edu/rice/cs/drjava/model/debug/DebugTest.java CVS: src/edu/rice/cs/drjava/model/junit/DefaultJUnitModel.java CVS: src/edu/rice/cs/drjava/model/junit/DrJavaTestCaseClassLoader.java CVS: src/edu/rice/cs/drjava/model/junit/DrJavaTestSuiteLoader.java CVS: src/edu/rice/cs/drjava/model/junit/JUnitErrorModel.java CVS: src/edu/rice/cs/drjava/model/junit/JUnitErrorModelTest.java CVS: src/edu/rice/cs/drjava/model/junit/JUnitModelCallback.java CVS: src/edu/rice/cs/drjava/model/repl/DefaultInteractionsModel.java CVS: src/edu/rice/cs/drjava/model/repl/DynamicJavaAdapter.java CVS: src/edu/rice/cs/drjava/model/repl/InteractionsDJDocumentTest.java CVS: src/edu/rice/cs/drjava/model/repl/InteractionsDocument.java CVS: src/edu/rice/cs/drjava/model/repl/InteractionsDocumentTest.java CVS: src/edu/rice/cs/drjava/model/repl/InteractionsEventNotifier.java CVS: src/edu/rice/cs/drjava/model/repl/InteractionsListener.java CVS: src/edu/rice/cs/drjava/model/repl/InteractionsModel.java CVS: src/edu/rice/cs/drjava/model/repl/InteractionsModelCallback.java CVS: src/edu/rice/cs/drjava/model/repl/InteractionsModelTest.java CVS: src/edu/rice/cs/drjava/model/repl/JavaDebugInterpreter.java CVS: src/edu/rice/cs/drjava/model/repl/JavaInterpreter.java CVS: src/edu/rice/cs/drjava/model/repl/JavaInterpreterTest.java CVS: src/edu/rice/cs/drjava/model/repl/RMIInteractionsModel.java CVS: src/edu/rice/cs/drjava/model/repl/SimpleInteractionsModel.java CVS: src/edu/rice/cs/drjava/model/repl/newjvm/InterpreterJVM.java CVS: src/edu/rice/cs/drjava/model/repl/newjvm/InterpreterJVMRemoteI.java src/edu/rice/cs/drjava/model/repl/newjvm/NewJVMTest.java CVS: src/edu/rice/cs/drjava/project/DocumentInfoGetter.java CVS: src/edu/rice/cs/drjava/project/ProjectFileBuilder.java CVS: src/edu/rice/cs/drjava/project/ProjectFileIR.java CVS: src/edu/rice/cs/drjava/project/ProjectFileParser.java CVS: src/edu/rice/cs/drjava/project/ProjectTest.java CVS: src/edu/rice/cs/drjava/ui/CompilerErrorPanel.java CVS: src/edu/rice/cs/drjava/ui/InteractionsController.java CVS: src/edu/rice/cs/drjava/ui/InteractionsPaneTest.java CVS: src/edu/rice/cs/drjava/ui/JUnitPanel.java CVS: src/edu/rice/cs/drjava/ui/JarOptionsDialog.java CVS: src/edu/rice/cs/drjava/ui/MainFrame.java CVS: src/edu/rice/cs/drjava/ui/MainFrameTest.java CVS: src/edu/rice/cs/drjava/ui/ProjectPropertiesFrame.java CVS: src/edu/rice/cs/drjava/ui/SimpleInteractionsWindow.java CVS: src/edu/rice/cs/drjava/ui/config/ConfigFrame.java CVS: src/edu/rice/cs/drjava/ui/config/VectorFileOptionComponent.java CVS: src/edu/rice/cs/drjava/ui/config/VectorFileOptionComponentTest.java src/edu/rice/cs/util/FileOpsTest.java CVS: src/edu/rice/cs/util/classloader/StrictURLClassLoaderTest.java CVS: src/edu/rice/cs/util/classloader/ToolsJarClassLoader.java CVS: src/edu/rice/cs/util/docnavigation/IDocumentNavigator.java CVS: src/edu/rice/cs/util/jar/JarCreationTest.java CVS: src/edu/rice/cs/util/jar/ManifestWriter.java CVS: src/edu/rice/cs/util/newjvm/AbstractMasterJVM.java CVS: src/edu/rice/cs/util/newjvm/ExecJVM.java CVS: src/edu/rice/cs/util/newjvm/ExecJVMTest.java CVS: src/edu/rice/cs/util/newjvm/IntegratedMasterSlaveTest.java CVS: src/edu/rice/cs/util/swing/DirectorySelectorComponent.java CVS: src/edu/rice/cs/util/swing/HighlightManager.java CVS: src/edu/rice/cs/util/text/ConsoleDocument.java CVS: Added Files: CVS: src/edu/rice/cs/drjava/config/ClassPathOption.java CVS: src/edu/rice/cs/drjava/model/ClassPathEntry.java CVS: src/edu/rice/cs/drjava/model/DummyGlobalModel.java CVS: src/edu/rice/cs/drjava/model/DummyGlobalModelTest.java CVS: src/edu/rice/cs/drjava/model/compiler/Javac141FromClassPath.java CVS: src/edu/rice/cs/drjava/model/compiler/JavacFromClassPath.java CVS: src/edu/rice/cs/drjava/model/repl/newjvm/ClassPathManager.java CVS: src/edu/rice/cs/drjava/ui/ClassPathFilter.java CVS: src/edu/rice/cs/util/ClassPathVector.java CVS: src/edu/rice/cs/util/ClassPathVectorTest.java CVS: Removed Files: CVS: src/edu/rice/cs/drjava/config/ClasspathOption.java CVS: src/edu/rice/cs/drjava/model/ClasspathEntry.java CVS: src/edu/rice/cs/drjava/model/DummyGetDocuments.java CVS: src/edu/rice/cs/drjava/model/DummyGetDocumentsTest.java CVS: src/edu/rice/cs/drjava/model/IGetDocuments.java CVS: src/edu/rice/cs/drjava/model/compiler/Javac141FromClasspath.java CVS: src/edu/rice/cs/drjava/model/compiler/Javac150FromClasspath.java CVS: src/edu/rice/cs/drjava/model/compiler/JavacFromClasspath.java CVS: src/edu/rice/cs/drjava/model/repl/newjvm/ClasspathManager.java CVS: src/edu/rice/cs/drjava/ui/ClasspathFilter.java CVS: src/edu/rice/cs/util/ClasspathVector.java CVS: src/edu/rice/cs/util/ClasspathVectorTest.java CVS: ---------------------------------------------------------------------- git-svn-id: file:///tmp/test-svn/trunk@3519 fe72c1cf-3628-48e9-8b72-1c46755d3cff
1 parent 66cf5c1 commit f6fc0c2

File tree

100 files changed

+2074
-2373
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+2074
-2373
lines changed

drjava/src/edu/rice/cs/drjava/DrJava.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262

6363
import edu.rice.cs.drjava.ui.MainFrame;
6464
import edu.rice.cs.drjava.ui.SplashScreen;
65-
import edu.rice.cs.drjava.ui.ClasspathFilter;
65+
import edu.rice.cs.drjava.ui.ClassPathFilter;
6666
import edu.rice.cs.drjava.ui.AWTExceptionHandler;
6767
import edu.rice.cs.drjava.ui.SimpleInteractionsWindow;
6868
import edu.rice.cs.drjava.model.*;
@@ -92,7 +92,7 @@ public class DrJava implements OptionConstants {
9292
// private static PreventExitSecurityManager _manager = null;
9393

9494
private static String[] _filesToOpen = new String[0];
95-
private static boolean _attemptingAugmentedClasspath = false;
95+
private static boolean _attemptingAugmentedClassPath = false;
9696
private static boolean _showDrJavaDebugConsole = false;
9797
private static boolean _usingJSR14v20 = false;
9898
private static SimpleInteractionsWindow _debugConsole = null;
@@ -205,7 +205,7 @@ static boolean handleCommandLineArgs(String[] args) {
205205
}
206206

207207
else if (args[i].equals("-attemptingAugmentedClasspath"))
208-
_attemptingAugmentedClasspath = true;
208+
_attemptingAugmentedClassPath = true;
209209

210210
else if (args[i].equals("-debugConsole")) _showDrJavaDebugConsole = true;
211211

@@ -339,7 +339,7 @@ private static boolean checkJSR14JarForClass(String checkClass, String msg, Stri
339339
if (System.getProperty("java.specification.version").equals("1.3") ||
340340
System.getProperty("java.runtime.version").startsWith("1.4.0")) {
341341
// Show a warning message, but only if we haven't restarted
342-
if (!_attemptingAugmentedClasspath)
342+
if (!_attemptingAugmentedClassPath)
343343
JOptionPane.showMessageDialog(null, msg, title, JOptionPane.WARNING_MESSAGE);
344344
return false;
345345
}
@@ -387,7 +387,7 @@ public static boolean checkForJSR14v20() {
387387
* @param args Command line argument array, in case we need to restart
388388
*/
389389
static void checkForCompilersAndDebugger(String[] args) {
390-
if (_attemptingAugmentedClasspath) {
390+
if (_attemptingAugmentedClassPath) {
391391
// We're on our second attempt-- just load DrJava
392392
return;
393393
}
@@ -489,7 +489,7 @@ public static boolean classLoadersCanFindDebugger() {
489489
catch (UnsupportedClassVersionError ucve) { return false; }
490490
}
491491

492-
public static boolean bootClasspathHasJSR14v24() {
492+
public static boolean bootClassPathHasJSR14v24() {
493493
try {
494494
Class.forName("com.sun.javadoc.ParameterizedType");
495495
return true;
@@ -501,7 +501,7 @@ public static boolean bootClasspathHasJSR14v24() {
501501
* helper method to determine if jsr14 v2.0 jar is on the boot classpath.
502502
* @return true iff java.lang.Enum can be loaded successfully.
503503
*/
504-
public static boolean bootClasspathHasJSR14v20() {
504+
public static boolean bootClassPathHasJSR14v20() {
505505
try {
506506
Class.forName("java.lang.Enum");
507507
return true;
@@ -526,13 +526,13 @@ public static boolean bootClasspathHasJSR14v20() {
526526
*/
527527
public static void restartIfNecessary(boolean forToolsJar, String[] args) {
528528
//JOptionPane.showMessageDialog(null, "forToolsJar = " + forToolsJar);
529-
if (!forToolsJar && (!_usingJSR14v20 || bootClasspathHasJSR14v20())) return;
529+
if (!forToolsJar && (!_usingJSR14v20 || bootClassPathHasJSR14v20())) return;
530530

531531
//System.out.println("restarting with debugger...");
532532

533533
// get the path separator and the class path this instance of Drjava was started with
534534
String pathSep = System.getProperty("path.separator");
535-
String classpath = edu.rice.cs.util.FileOps.convertToAbsolutePathEntries(System.getProperty("java.class.path"));
535+
String classPath = edu.rice.cs.util.FileOps.convertToAbsolutePathEntries(System.getProperty("java.class.path"));
536536

537537
// Class arguments
538538
String[] classArgs = new String[args.length + 1];
@@ -551,22 +551,22 @@ public static void restartIfNecessary(boolean forToolsJar, String[] args) {
551551

552552
if (forToolsJar) {
553553
// Try to restart with tools.jar on the classpath
554-
classpath += pathSep;
554+
classPath += pathSep;
555555

556556
// Add tools.jar from preferences if specified
557557
File toolsFromConfig = getConfig().getSetting(JAVAC_LOCATION);
558558
if (toolsFromConfig != FileOption.NULL_FILE) {
559-
classpath += toolsFromConfig.getAbsolutePath() + pathSep;
559+
classPath += toolsFromConfig.getAbsolutePath() + pathSep;
560560
}
561561

562562
// Fall back on guesses from ToolsJarClassLoader
563-
classpath += ToolsJarClassLoader.getToolsJarClasspath();
563+
classPath += ToolsJarClassLoader.getToolsJarClassPath();
564564
}
565565

566566
// Run a new copy of DrJava and exit
567567
try {
568568
//System.out.println(classpath);
569-
ExecJVM.runJVM("edu.rice.cs.drjava.DrJava", classArgs, classpath, jvmArgs);
569+
ExecJVM.runJVM("edu.rice.cs.drjava.DrJava", classArgs, classPath, jvmArgs, FileOption.NULL_FILE);
570570
System.exit(0);
571571
}
572572
catch (IOException ioe) {
@@ -629,7 +629,7 @@ public static boolean promptForToolsJar(boolean needCompiler,
629629

630630
if (result == JOptionPane.YES_OPTION) {
631631
JFileChooser chooser = new JFileChooser();
632-
chooser.setFileFilter(new ClasspathFilter() {
632+
chooser.setFileFilter(new ClassPathFilter() {
633633
public boolean accept(File f) {
634634
if (f.isDirectory()) {
635635
return true;

drjava/src/edu/rice/cs/drjava/config/ClasspathOption.java renamed to drjava/src/edu/rice/cs/drjava/config/ClassPathOption.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
* Generate vector options separately to appease javadoc.
5252
* (It didn't like anonymous inner classes with generics in interfaces in Java 1.3.)
5353
*/
54-
class ClasspathOption {
54+
class ClassPathOption {
5555
private String warning =
5656
"WARNING: Configurability interface only supports path separators"+
5757
" of maximum length 1 character as of this moment.";

drjava/src/edu/rice/cs/drjava/config/FileOption.java

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -53,49 +53,29 @@
5353
*/
5454
public class FileOption extends Option<File> {
5555

56-
/**
57-
* Special sentinal file indicating that this option is not set.
58-
*/
56+
/** Special sentinal file indicating that this option is not set. */
5957
public static final File NULL_FILE = new File("") {
60-
public String getAbsolutePath() {
61-
return "";
62-
}
63-
public String getName() {
64-
return "";
65-
}
66-
public String toString() {
67-
return "";
68-
}
69-
public boolean exists() {
70-
return true;
71-
}
58+
public String getAbsolutePath() { return ""; }
59+
public String getName() { return ""; }
60+
public String toString() { return ""; }
61+
public boolean exists() { return true; }
7262
};
7363

74-
/**
75-
* @param key The name of this option.
76-
*/
64+
/** @param key The name of this option. */
7765
public FileOption(String key, File def) { super(key,def); }
7866

79-
/**
80-
* @param s The String to be parsed, must represent
81-
* the absolute path of the File to be created.
82-
* @return The File object corresponding to path "p".
67+
/** @param s The String to be parsed, must represent the absolute path of the File to be created.
68+
* @return The File object corresponding to path "p".
8369
*/
8470
public File parse(String s) {
8571
if (s.trim().equals("")) return NULL_FILE;
8672

87-
try {
88-
return new File(s).getAbsoluteFile();
89-
}
90-
catch (NullPointerException e) {
91-
throw new OptionParseException(name, s,
92-
"Must have a legal filename.");
93-
}
73+
try { return new File(s).getAbsoluteFile(); }
74+
catch (NullPointerException e) { throw new OptionParseException(name, s, "Must have a legal filename."); }
9475
}
9576

96-
/**
97-
* @param f The instance of class File to be formatted.
98-
* @return A String representing the absolute path of "f".
77+
/** @param f The instance of class File to be formatted.
78+
* @return A String representing the absolute path of "f".
9979
*/
10080
public String format(File f) { return f.getAbsolutePath(); }
10181
}

drjava/src/edu/rice/cs/drjava/config/IntegerOptionTest.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,26 +52,21 @@
5252
* the proper functionality of the class IntegerOption.
5353
* @version $Id$
5454
*/
55-
public final class IntegerOptionTest extends TestCase
56-
{
57-
/**
58-
* @param name The name of this test case.
59-
*/
55+
public final class IntegerOptionTest extends TestCase {
56+
/** @param name The name of this test case. */
6057
public IntegerOptionTest(String name) { super(name); }
6158

6259
public void setUp() { }
6360

64-
public void testGetName()
65-
{
61+
public void testGetName() {
6662
IntegerOption io1 = new IntegerOption("indent_size",null);
6763
IntegerOption io2 = new IntegerOption("max_files",null);
6864

6965
assertEquals("indent_size", io1.getName());
7066
assertEquals("max_files", io2.getName());
7167
}
7268

73-
public void testParse()
74-
{
69+
public void testParse() {
7570
IntegerOption io = new IntegerOption("max_files",null);
7671

7772
assertEquals(new Integer(3), io.parse("3"));
@@ -84,8 +79,7 @@ public void testParse()
8479
catch (OptionParseException e) { }
8580
}
8681

87-
public void testFormat()
88-
{
82+
public void testFormat() {
8983
IntegerOption io1 = new IntegerOption("max_files",null);
9084
IntegerOption io2 = new IntegerOption("indent_size",null);
9185

drjava/src/edu/rice/cs/drjava/config/KeyStrokeOptionTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
import java.io.IOException;
5252
import java.util.Locale;
5353
import junit.framework.*;
54+
import edu.rice.cs.drjava.config.FileOption;
5455
import edu.rice.cs.util.newjvm.ExecJVM;
5556

5657
/**
@@ -152,8 +153,7 @@ public void testLocaleSpecificFormat()
152153
String className = "edu.rice.cs.drjava.config.KeyStrokeOptionTest";
153154
String[] args = new String[0];
154155

155-
Process process = ExecJVM.
156-
runJVMPropagateClassPath(className, args);
156+
Process process = ExecJVM.runJVMPropagateClassPath(className, args, FileOption.NULL_FILE);
157157
int status = process.waitFor();
158158
assertEquals("Local specific keystroke test failed!",
159159
0, status);

drjava/src/edu/rice/cs/drjava/config/OptionConstants.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public interface OptionConstants {
9595
new FileOption("jsr14.collectionspath", FileOption.NULL_FILE);
9696

9797
public static final VectorOption<File> EXTRA_CLASSPATH =
98-
new ClasspathOption().evaluate("extra.classpath");
98+
new ClassPathOption().evaluate("extra.classpath");
9999

100100
public static final VectorOption<String> EXTRA_COMPILERS =
101101
new VectorOption<String>("extra.compilers", new StringOption("",""), new Vector<String>());
@@ -809,7 +809,7 @@ public static ArrayList<String> getLookAndFeels() {
809809
* while stepping in the debugger.
810810
*/
811811
public static final VectorOption<File> DEBUG_SOURCEPATH =
812-
new ClasspathOption().evaluate("debug.sourcepath");
812+
new ClassPathOption().evaluate("debug.sourcepath");
813813

814814
/**
815815
* Whether stepping should step through Java's source files

drjava/src/edu/rice/cs/drjava/config/OptionParser.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@
4545

4646
package edu.rice.cs.drjava.config;
4747
import java.util.Hashtable;
48-
/**
49-
* the association of an OptionName with the ability to parse something to type T
50-
* the special property is that if U extends T, then OptionParser<U> extends OptionParser<T>.
48+
/** The association of an OptionName with the ability to parse something to type T; the intended type
49+
* parameterization is covariant: if U extends T, then OptionParser<U> extends OptionParser<T>.
5150
*/
5251
public abstract class OptionParser<T> implements ParseStrategy<T> {
5352

drjava/src/edu/rice/cs/drjava/config/VectorOptionTest.java

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -74,34 +74,25 @@ public void testParse() {
7474
assertTrue(_ivo.parse("[]").isEmpty());
7575
assertTrue(_bvo.parse("[]").isEmpty());
7676

77-
try {
78-
_ivo.parse("[,]"); fail("Comma at beginning.");
79-
} catch (OptionParseException e) {
80-
}
81-
try {
82-
_ivo.parse("[11"); fail("Missing footer.");
83-
} catch (OptionParseException e) {
84-
}
85-
try {
86-
_ivo.parse("[11,]"); fail("Comma w/o following list element.");
87-
} catch (OptionParseException e) {
88-
}
89-
try {
90-
_ivo.parse("11]"); fail("Missing header.");
91-
} catch (OptionParseException e) {
92-
}
93-
try {
94-
_ivo.parse("[11,,22]"); fail("Missing list element.");
95-
} catch (OptionParseException e) {
96-
}
97-
try {
98-
_ivo.parse("{11,22}"); fail("Illegal header and footer.");
99-
} catch (OptionParseException e) {
100-
}
101-
try {
102-
_ivo.parse("[11;22]"); fail("Illegal delimiter.");
103-
} catch (OptionParseException e) {
104-
}
77+
try { _ivo.parse("[,]"); fail("Comma at beginning."); }
78+
catch (OptionParseException e) { }
79+
80+
try { _ivo.parse("[11"); fail("Missing footer."); }
81+
catch (OptionParseException e) { }
82+
try { _ivo.parse("[11,]"); fail("Comma w/o following list element."); }
83+
catch (OptionParseException e) { }
84+
85+
try { _ivo.parse("11]"); fail("Missing header."); }
86+
catch (OptionParseException e) { }
87+
88+
try { _ivo.parse("[11,,22]"); fail("Missing list element."); }
89+
catch (OptionParseException e) { }
90+
91+
try { _ivo.parse("{11,22}"); fail("Illegal header and footer."); }
92+
catch (OptionParseException e) { }
93+
94+
try { _ivo.parse("[11;22]"); fail("Illegal delimiter."); }
95+
catch (OptionParseException e) { }
10596

10697
Vector<Boolean> bv = _bvo.parse("[true]");
10798

@@ -116,10 +107,8 @@ public void testParse() {
116107
assertEquals(Boolean.TRUE, bv.get(2));
117108
assertEquals(Boolean.TRUE, bv.get(3));
118109

119-
try {
120-
_bvo.parse("[11]"); fail("Number instead of boolean.");
121-
} catch (OptionParseException e) {
122-
}
110+
try { _bvo.parse("[11]"); fail("Number instead of boolean."); }
111+
catch (OptionParseException e) { }
123112
}
124113

125114
public void testFormat() {

0 commit comments

Comments
 (0)