| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
15 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,6 +36,7 @@ | |||
| 36 | 36 | <property name="drjava.test.config" value="testFiles/drjava.basic.config" /> | |
| 37 | 37 | ||
| 38 | 38 | <property environment="env" /> | |
| 39 | + | ||
| 39 | 40 | <property name="java-home" value="${env.JAVA_HOME}" /> | |
| 40 | 41 | <property name="findbugs-home" value="${env.FINDBUGS_HOME}" /> | |
| 41 | 42 | ||
@@ -69,6 +70,7 @@ | |||
| 69 | 70 | <fileset id="jrelibs" dir="${java.home}/lib" includes="*.jar" /> | |
| 70 | 71 | <fileset id="extlibs" dir="extlib" includes="*.jar" /> | |
| 71 | 72 | <echo message="extlibs = ${toString:extlibs}" level="verbose"/> | |
| 73 | + | ||
| 72 | 74 | <!-- ************ | |
| 73 | 75 | Help Targets | |
| 74 | 76 | ************ --> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + ../../../../../../share/java/java-atk-wrapper.jar | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,12 +60,10 @@ public abstract class JavacCompiler implements CompilerInterface { | |||
| 60 | 60 | /** The set of class names that are run as ACM Java Task Force library programs. */ | |
| 61 | 61 | protected static final Set<String> ACM_PROGRAM_CLASSES = new HashSet<String>(); | |
| 62 | 62 | static { | |
| 63 | - Collections.addAll(ACM_PROGRAM_CLASSES, new String[] { | ||
| 64 | - "acm.program.Program", | ||
| 65 | - "acm.graphics.GTurtle" | ||
| 66 | - }); | ||
| 63 | + Collections.addAll(ACM_PROGRAM_CLASSES, new String[] {"acm.program.Program", "acm.graphics.GTurtle"}); | ||
| 67 | 64 | } | |
| 68 | 65 | ||
| 66 | + /** Standard Constructor */ | ||
| 69 | 67 | protected JavacCompiler(JavaVersion.FullVersion version, String location, List<? extends File> defaultBootClassPath) { | |
| 70 | 68 | _version = version; | |
| 71 | 69 | _location = location; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,9 @@ | |||
| 1 | 1 | package edu.rice.cs.drjava.model.compiler; | |
| 2 | 2 | ||
| 3 | + import edu.rice.cs.drjava.DrJava; | ||
| 4 | + import edu.rice.cs.drjava.config.OptionConstants; | ||
| 3 | 5 | import edu.rice.cs.drjava.model.DJError; | |
| 6 | + import edu.rice.cs.drjava.model.DrJavaFileUtils; | ||
| 4 | 7 | import edu.rice.cs.drjava.ui.SmartSourceFilter; | |
| 5 | 8 | import edu.rice.cs.plt.reflect.JavaVersion; | |
| 6 | 9 | import edu.rice.cs.util.ArgumentTokenizer; | |
@@ -35,7 +38,6 @@ public boolean isAvailable() { | |||
| 35 | 38 | public List<? extends DJError> compile(List<? extends File> files, List<? extends File> classPath, | |
| 36 | 39 | List<? extends File> sourcePath, File destination, | |
| 37 | 40 | List<? extends File> bootClassPath, String sourceVersion, boolean showWarnings) { | |
| 38 | - // TODO: enforce using java8 | ||
| 39 | 41 | // Check if compiler is available | |
| 40 | 42 | if (compiler == null) { | |
| 41 | 43 | List<DJError> errors = new ArrayList<>(); | |
@@ -67,6 +69,7 @@ public List<? extends DJError> compile(List<? extends File> files, List<? extend | |||
| 67 | 69 | Iterable<? extends JavaFileObject> compilationUnits = fileManager.getJavaFileObjectsFromFiles(files); | |
| 68 | 70 | ||
| 69 | 71 | // Prepare the compilation options | |
| 72 | + | ||
| 70 | 73 | List<String> optionList = new ArrayList<>(); | |
| 71 | 74 | if (sourceVersion != null) { | |
| 72 | 75 | optionList.add("-source"); | |
@@ -112,33 +115,22 @@ public List<? extends DJError> compile(List<? extends File> files, List<? extend | |||
| 112 | 115 | ||
| 113 | 116 | return errors; | |
| 114 | 117 | } | |
| 118 | + | ||
| 115 | 119 | ||
| 116 | - public JavaVersion version() { | ||
| 117 | - return JavaVersion.JAVA_8; | ||
| 118 | - } | ||
| 120 | + public String getName() { return "javax.tools"; } | ||
| 119 | 121 | ||
| 120 | - public String getName() { | ||
| 121 | - return "javax.tools"; | ||
| 122 | - } | ||
| 122 | + public String getDescription() { return "Standard compiler in javax.tools"; } | ||
| 123 | 123 | ||
| 124 | - public String getDescription() { | ||
| 125 | - return "Custom compiler implementation using javax.tools"; | ||
| 126 | - } | ||
| 124 | + public String toString() { return getName(); } | ||
| 127 | 125 | ||
| 128 | - public String toString() { | ||
| 129 | - return getName(); | ||
| 130 | - } | ||
| 131 | - | ||
| 132 | - public List<File> additionalBootClassPathForInteractions() { | ||
| 133 | - return Collections.emptyList(); | ||
| 134 | - } | ||
| 126 | + public List<File> additionalBootClassPathForInteractions() { return Collections.emptyList(); } | ||
| 135 | 127 | ||
| 136 | 128 | /** Transform the command line to be interpreted into something the Interactions JVM can use. | |
| 137 | - * This replaces "java MyClass a b c" with Java code to call MyClass.main(new String[]{"a","b","c"}). | ||
| 138 | - * "import MyClass" is not handled here. | ||
| 139 | - * transformCommands should support at least "run", "java" and "applet". | ||
| 140 | - * @param interactionsString unprocessed command line | ||
| 141 | - * @return command line with commands transformed */ | ||
| 129 | + * This replaces "java MyClass a b c" with Java code to call MyClass.main(new String[]{"a","b","c"}). | ||
| 130 | + * "import MyClass" is not handled here. | ||
| 131 | + * transformCommands should support at least "run", "java" and "applet". | ||
| 132 | + * @param interactionsString unprocessed command line | ||
| 133 | + * @return command line with commands transformed */ | ||
| 142 | 134 | public String transformCommands(String interactionsString) { | |
| 143 | 135 | if (interactionsString.startsWith("java ")) { | |
| 144 | 136 | interactionsString = transformJavaCommand(interactionsString); | |
@@ -341,30 +333,30 @@ public String transformRunCommand(String s) { | |||
| 341 | 333 | } | |
| 342 | 334 | ||
| 343 | 335 | /** Assumes a trimmed String. Returns a string of the call that the interpreter can use. | |
| 344 | - * The arguments get formatted as comma-separated list of strings enclosed in quotes. | ||
| 345 | - * Example: _transformCommand("java MyClass arg1 arg2 arg3", "{0}.main(new String[]'{'{1}'}');") | ||
| 346 | - * returns "MyClass.main(new String[]{\"arg1\",\"arg2\",\"arg3\"});" | ||
| 347 | - * NOTE: the command to run is constructed using {@link java.text.MessageFormat}. That means that certain characters, | ||
| 348 | - * single quotes and curly braces, for example, are special. To write single quotes, you need to double them. | ||
| 349 | - * To write curly braces, you need to enclose them in single quotes. Example: | ||
| 350 | - * MessageFormat.format("Abc {0} ''foo'' '{'something'}'", "def") returns "Abc def 'foo' {something}". | ||
| 351 | - * @param s the command line, either "java MyApp arg1 arg2 arg3" or "applet MyApplet arg1 arg2 arg3" | ||
| 352 | - * @param command the command to execute, with {0} marking the place for the class name and {1} the place for the arguments | ||
| 353 | - * @return the transformed command | ||
| 354 | - */ | ||
| 336 | + * The arguments get formatted as comma-separated list of strings enclosed in quotes. | ||
| 337 | + * Example: _transformCommand("java MyClass arg1 arg2 arg3", "{0}.main(new String[]'{'{1}'}');") | ||
| 338 | + * returns "MyClass.main(new String[]{\"arg1\",\"arg2\",\"arg3\"});" | ||
| 339 | + * NOTE: the command to run is constructed using {@link java.text.MessageFormat}. That means that certain characters, | ||
| 340 | + * single quotes and curly braces, for example, are special. To write single quotes, you need to double them. | ||
| 341 | + * To write curly braces, you need to enclose them in single quotes. Example: | ||
| 342 | + * MessageFormat.format("Abc {0} ''foo'' '{'something'}'", "def") returns "Abc def 'foo' {something}". | ||
| 343 | + * @param s the command line, either "java MyApp arg1 arg2 arg3" or "applet MyApplet arg1 arg2 arg3" | ||
| 344 | + * @param command the command to execute, with {0} marking the place for the class name and {1} the place for the arguments | ||
| 345 | + * @return the transformed command | ||
| 346 | + */ | ||
| 355 | 347 | protected static String _transformCommand(String s, String command) { | |
| 356 | - if (s.endsWith(";")) s = _deleteSemiColon(s); | ||
| 357 | - List<String> args = ArgumentTokenizer.tokenize(s, true); | ||
| 358 | - final String classNameWithQuotes = args.get(1); // this is "MyClass" | ||
| 359 | - final String className = classNameWithQuotes.substring(1, classNameWithQuotes.length() - 1); // removes quotes, becomes MyClass | ||
| 360 | - final StringBuilder argsString = new StringBuilder(); | ||
| 361 | - boolean seenArg = false; | ||
| 362 | - for (int i = 2; i < args.size(); i++) { | ||
| 363 | - if (seenArg) argsString.append(","); | ||
| 364 | - else seenArg = true; | ||
| 365 | - argsString.append(args.get(i)); | ||
| 366 | - } | ||
| 367 | - return java.text.MessageFormat.format(command, className, argsString.toString()); | ||
| 348 | + if (s.endsWith(";")) s = _deleteSemiColon(s); | ||
| 349 | + List<String> args = ArgumentTokenizer.tokenize(s, true); | ||
| 350 | + final String classNameWithQuotes = args.get(1); // this is "MyClass" | ||
| 351 | + final String className = classNameWithQuotes.substring(1, classNameWithQuotes.length() - 1); // removes quotes, becomes MyClass | ||
| 352 | + final StringBuilder argsString = new StringBuilder(); | ||
| 353 | + boolean seenArg = false; | ||
| 354 | + for (int i = 2; i < args.size(); i++) { | ||
| 355 | + if (seenArg) argsString.append(","); | ||
| 356 | + else seenArg = true; | ||
| 357 | + argsString.append(args.get(i)); | ||
| 358 | + } | ||
| 359 | + return java.text.MessageFormat.format(command, className, argsString.toString()); | ||
| 368 | 360 | } | |
| 369 | 361 | ||
| 370 | 362 | /** Deletes the last character of a string. Assumes semicolon at the end, but does not check. Helper | |
@@ -419,8 +411,6 @@ public String getOpenAllFilesInFolderExtension() { | |||
| 419 | 411 | Collections.addAll(JAVA_KEYWORDS, words); | |
| 420 | 412 | } | |
| 421 | 413 | ||
| 422 | - public boolean supportsLanguageLevels() { | ||
| 423 | - // TODO: should we support LanguageLevels? | ||
| 424 | - return false; | ||
| 425 | - } | ||
| 426 | - } | ||
| 414 | + /** @return true since this compiler can be used in conjunction with the language level facility. */ | ||
| 415 | + public boolean supportsLanguageLevels() { return true; } | ||
| 416 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,8 +34,9 @@ | |||
| 34 | 34 | import edu.rice.cs.util.Log; | |
| 35 | 35 | import edu.rice.cs.util.UnexpectedException; | |
| 36 | 36 | ||
| 37 | - /** DrJava's own testrunner. It updates the document in the JUnit pane as error and failure events are fired. | ||
| 38 | - * These methods run inan auxiliary thread. | ||
| 37 | + /** Runs in the InterpreterJVM. It uses RMI calls to update the the JUnitPanel as test results are reported. Some methods are | ||
| 38 | + * synchronized to maintain the consistency of local state. These methods run in an auxiliary thread. | ||
| 39 | + * GUI actions must be transferred to the event handling thread (DispatchThread). | ||
| 39 | 40 | * @version $Id$ | |
| 40 | 41 | */ | |
| 41 | 42 | public class JUnitTestRunner extends BaseTestRunner { | |
@@ -56,8 +57,6 @@ public class JUnitTestRunner extends BaseTestRunner { | |||
| 56 | 57 | ||
| 57 | 58 | /** The current number of failures in the result. */ | |
| 58 | 59 | private int _failureCount; | |
| 59 | - | ||
| 60 | - | ||
| 61 | 60 | ||
| 62 | 61 | /** Standard constructor. | |
| 63 | 62 | * @param jmc a JUnitModelCallback | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,6 +40,7 @@ | |||
| 40 | 40 | import java.io.*; | |
| 41 | 41 | ||
| 42 | 42 | import java.rmi.*; | |
| 43 | + import java.awt.EventQueue; | ||
| 43 | 44 | ||
| 44 | 45 | // NOTE: Do NOT import/use the config framework in this class! | |
| 45 | 46 | // (This class runs in a different JVM, and will not share the config object) | |
@@ -655,7 +656,7 @@ public void classFileError(ClassFileError e) { | |||
| 655 | 656 | catch (RemoteException re) { error.log(re); } | |
| 656 | 657 | } | |
| 657 | 658 | ||
| 658 | - /** Notifies that a suite of tests has started running. Unsynchronized because it contains a remote call and does | ||
| 659 | + /** Notifies the Main JVM that a suite of tests has started running. Unsynchronized because it contains a remote call and does | ||
| 659 | 660 | * not involve mutable local state. | |
| 660 | 661 | * @param numTests The number of tests in the suite to be run. | |
| 661 | 662 | */ | |
@@ -664,7 +665,7 @@ public void testSuiteStarted(int numTests) { | |||
| 664 | 665 | catch (RemoteException re) { error.log(re); } | |
| 665 | 666 | } | |
| 666 | 667 | ||
| 667 | - /** Notifies that a particular test has started. Unsynchronized because it contains a remote call and does not | ||
| 668 | + /** Notifies the Main JVM that a particular test has started. Unsynchronized because it contains a remote call and does not | ||
| 668 | 669 | * involve mutable local state. | |
| 669 | 670 | * @param testName The name of the test being started. | |
| 670 | 671 | */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,9 +28,10 @@ | |||
| 28 | 28 | * END_COPYRIGHT_BLOCK*/ | |
| 29 | 29 | package edu.rice.cs.drjava.model.repl.newjvm; | |
| 30 | 30 | ||
| 31 | - import java.rmi.*; | ||
| 31 | + import java.awt.EventQueue; | ||
| 32 | 32 | import java.io.*; | |
| 33 | 33 | import java.net.SocketException; | |
| 34 | + import java.rmi.*; | ||
| 34 | 35 | ||
| 35 | 36 | import java.util.List; | |
| 36 | 37 | import java.util.ArrayList; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments