FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Merge branch 'jshell-min-set' into java9+ · DrJavaAtRice/drjava@4fb90e2 · GitHub

Repository navigation

Commit 4fb90e2

Browse files
committed
Merge branch 'jshell-min-set' into java9+
This inserts the patches regarding the progress bar into java9+ which were cluelessly omitted. Conflicts: drjava/build.xml drjava/src/edu/rice/cs/drjava/model/compiler/JavaxToolsCompiler.java Your branch and 'origin/jshell-min-set' have diverged, and have 2 and 10 different commits each, respectively. All conflicts fixed but you are still merging. Changes to be committed: new file: ../drjava.jar modified: build.xml new file: extlib/java-atk-wrapper.jar modified: src/edu/rice/cs/drjava/model/compiler/JavacCompiler.java modified: src/edu/rice/cs/drjava/model/compiler/JavaxToolsCompiler.java modified: src/edu/rice/cs/drjava/model/junit/JUnitTestRunner.java modified: src/edu/rice/cs/drjava/model/repl/newjvm/InterpreterJVM.java modified: src/edu/rice/cs/drjava/model/repl/newjvm/MainJVM.java new file: src/edu/rice/cs/drjava/model/repl/newjvm/jshell-min-set_documentation.md modified: src/edu/rice/cs/drjava/ui/ErrorPanel.java modified: src/edu/rice/cs/drjava/ui/GenerateCustomDrJavaJarFrame.java modified: src/edu/rice/cs/drjava/ui/JUnitPanel.java modified: src/edu/rice/cs/drjava/ui/MainFrame.java modified: src/edu/rice/cs/drjava/ui/NewJavaClassDialog.java modified: ../platform/src-openjdk6/edu/rice/cs/drjava/model/compiler/Javac160OpenJDKCompiler.java Changes not staged for commit: modified: src/edu/rice/cs/drjava/model/compiler/JavaxToolsCompiler.java
2 parents ca0531d + 7b11da3 commit 4fb90e2

15 files changed

Lines changed: 204 additions & 128 deletions

File tree

‎drjava.jar‎

10.5 MB
Binary file not shown.

‎drjava/build.xml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<property name="drjava.test.config" value="testFiles/drjava.basic.config" />
3737

3838
<property environment="env" />
39+
3940
<property name="java-home" value="${env.JAVA_HOME}" />
4041
<property name="findbugs-home" value="${env.FINDBUGS_HOME}" />
4142

@@ -69,6 +70,7 @@
6970
<fileset id="jrelibs" dir="${java.home}/lib" includes="*.jar" />
7071
<fileset id="extlibs" dir="extlib" includes="*.jar" />
7172
<echo message="extlibs = ${toString:extlibs}" level="verbose"/>
73+
7274
<!-- ************
7375
Help Targets
7476
************ -->

‎drjava/extlib/java-atk-wrapper.jar‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../../share/java/java-atk-wrapper.jar

‎drjava/src/edu/rice/cs/drjava/model/compiler/JavacCompiler.java‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,10 @@ public abstract class JavacCompiler implements CompilerInterface {
6060
/** The set of class names that are run as ACM Java Task Force library programs. */
6161
protected static final Set<String> ACM_PROGRAM_CLASSES = new HashSet<String>();
6262
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"});
6764
}
6865

66+
/** Standard Constructor */
6967
protected JavacCompiler(JavaVersion.FullVersion version, String location, List<? extends File> defaultBootClassPath) {
7068
_version = version;
7169
_location = location;

‎drjava/src/edu/rice/cs/drjava/model/compiler/JavaxToolsCompiler.java‎

Lines changed: 40 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package edu.rice.cs.drjava.model.compiler;
22

3+
import edu.rice.cs.drjava.DrJava;
4+
import edu.rice.cs.drjava.config.OptionConstants;
35
import edu.rice.cs.drjava.model.DJError;
6+
import edu.rice.cs.drjava.model.DrJavaFileUtils;
47
import edu.rice.cs.drjava.ui.SmartSourceFilter;
58
import edu.rice.cs.plt.reflect.JavaVersion;
69
import edu.rice.cs.util.ArgumentTokenizer;
@@ -35,7 +38,6 @@ public boolean isAvailable() {
3538
public List<? extends DJError> compile(List<? extends File> files, List<? extends File> classPath,
3639
List<? extends File> sourcePath, File destination,
3740
List<? extends File> bootClassPath, String sourceVersion, boolean showWarnings) {
38-
// TODO: enforce using java8
3941
// Check if compiler is available
4042
if (compiler == null) {
4143
List<DJError> errors = new ArrayList<>();
@@ -67,6 +69,7 @@ public List<? extends DJError> compile(List<? extends File> files, List<? extend
6769
Iterable<? extends JavaFileObject> compilationUnits = fileManager.getJavaFileObjectsFromFiles(files);
6870

6971
// Prepare the compilation options
72+
7073
List<String> optionList = new ArrayList<>();
7174
if (sourceVersion != null) {
7275
optionList.add("-source");
@@ -112,33 +115,22 @@ public List<? extends DJError> compile(List<? extends File> files, List<? extend
112115

113116
return errors;
114117
}
118+
115119

116-
public JavaVersion version() {
117-
return JavaVersion.JAVA_8;
118-
}
120+
public String getName() { return "javax.tools"; }
119121

120-
public String getName() {
121-
return "javax.tools";
122-
}
122+
public String getDescription() { return "Standard compiler in javax.tools"; }
123123

124-
public String getDescription() {
125-
return "Custom compiler implementation using javax.tools";
126-
}
124+
public String toString() { return getName(); }
127125

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(); }
135127

136128
/** 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 */
142134
public String transformCommands(String interactionsString) {
143135
if (interactionsString.startsWith("java ")) {
144136
interactionsString = transformJavaCommand(interactionsString);
@@ -341,30 +333,30 @@ public String transformRunCommand(String s) {
341333
}
342334

343335
/** 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+
*/
355347
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());
368360
}
369361

370362
/** Deletes the last character of a string. Assumes semicolon at the end, but does not check. Helper
@@ -419,8 +411,6 @@ public String getOpenAllFilesInFolderExtension() {
419411
Collections.addAll(JAVA_KEYWORDS, words);
420412
}
421413

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+
}

‎drjava/src/edu/rice/cs/drjava/model/junit/JUnitTestRunner.java‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@
3434
import edu.rice.cs.util.Log;
3535
import edu.rice.cs.util.UnexpectedException;
3636

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).
3940
* @version $Id$
4041
*/
4142
public class JUnitTestRunner extends BaseTestRunner {
@@ -56,8 +57,6 @@ public class JUnitTestRunner extends BaseTestRunner {
5657

5758
/** The current number of failures in the result. */
5859
private int _failureCount;
59-
60-
6160

6261
/** Standard constructor.
6362
* @param jmc a JUnitModelCallback

‎drjava/src/edu/rice/cs/drjava/model/repl/newjvm/InterpreterJVM.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import java.io.*;
4141

4242
import java.rmi.*;
43+
import java.awt.EventQueue;
4344

4445
// NOTE: Do NOT import/use the config framework in this class!
4546
// (This class runs in a different JVM, and will not share the config object)
@@ -655,7 +656,7 @@ public void classFileError(ClassFileError e) {
655656
catch (RemoteException re) { error.log(re); }
656657
}
657658

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
659660
* not involve mutable local state.
660661
* @param numTests The number of tests in the suite to be run.
661662
*/
@@ -664,7 +665,7 @@ public void testSuiteStarted(int numTests) {
664665
catch (RemoteException re) { error.log(re); }
665666
}
666667

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
668669
* involve mutable local state.
669670
* @param testName The name of the test being started.
670671
*/

‎drjava/src/edu/rice/cs/drjava/model/repl/newjvm/MainJVM.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@
2828
* END_COPYRIGHT_BLOCK*/
2929
package edu.rice.cs.drjava.model.repl.newjvm;
3030

31-
import java.rmi.*;
31+
import java.awt.EventQueue;
3232
import java.io.*;
3333
import java.net.SocketException;
34+
import java.rmi.*;
3435

3536
import java.util.List;
3637
import java.util.ArrayList;

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL