Skip to content

Java10 support #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@
*.new
*.mine
*.alt
*.DS_Store
*.backup
codecoverage
drjava/classes
drjava/drjava.jar
drjava/build.xml.*
drjava/coverage_report
scratch
platform/classes/lib/
platform/classes/test-mac/
scratch
92,013 changes: 92,013 additions & 0 deletions drjava/JDKToolsLibrary.txt.back

Large diffs are not rendered by default.

7,598 changes: 7,598 additions & 0 deletions drjava/JDKToolsLibrary.txt.back1

Large diffs are not rendered by default.

168 changes: 159 additions & 9 deletions drjava/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,17 @@
</taskdef>
<property name="coverage-report-dir" value="coverage_report"/>
<property name="coverage-exec" value="jacoco.exec"/>

<!--property name="TestParallel" value="${arg0}"/>
<property name="ThreadCount" value="${arg1}"/-->
<condition property="Thread" value="${ThreadCount}" else="4">
<isset property="ThreadCount"/>
</condition>
<fileset id="libs" dir="lib" includes="*.jar" /> <!-- Only include jars that are at the top level (not in buildlib) -->
<fileset id="jrelibs" dir="${java.home}/lib" includes="*.jar" />
<echo message="libs = ${toString:libs}" />
<echo message="jrelibs = ${toString:jrelibs}" />
<echo message="libs = ${toString:libs}" level="verbose" />
<echo message="jrelibs = ${toString:jrelibs}" level="verbose"/>
<fileset id="extlibs" dir="${java.home}/lib/ext" includes="*.jar" />
<echo message="extlibs = ${toString:extlibs}" />
<!--echo message="extlibs = ${toString:extlibs}" level="verbose"/-->
<!-- ************
Help Targets
************ -->
Expand Down Expand Up @@ -183,10 +187,64 @@
******************* -->

<!-- The following target assumes that javac resolves to a Java 8 compiler -->
<target name="compile" depends="generate-source, do-compile, copy-resources, unjar-libs"
<target name="compile" depends="generate-source, do-compile-7-to-10, copy-resources, unjar-libs"
description="Compile all source files (after generating the source)">
</target>


<!--target name="do-compile-7-to-10" depends="resolve-java8-runtime, resolve-java8-tools"-->
<target name="do-compile-7-to-10">

<echo message="Compiling src directory to classes/base and classes/test with command 'javac'" />

<mkdir dir="classes/base" />
<mkdir dir="classes/test" />

<!-- Move any test classes back to base to prevent recompilation -->
<move todir="classes/base">
<fileset dir="classes/test" includes="**/*" />
</move>
<echo message="jrelibs=${toString:jrelibs}" />
<echo message="libs=${toString:libs}" />
<javac srcdir="src" destdir="classes/base" release="10"
sourcepath="" includeAntRuntime="no"
fork="yes" memoryMaximumSize="1024M"
debug="on" optimize="off" deprecation="on" >
<classpath>
<!-- TODO: Remove this dependency on tools.jar by refactoring and moving all the dependent
debugger code into the "platform" module -->
<pathelement location="lib/buildlib/junit.jar" />
<fileset refid="libs" />
<fileset refid="jrelibs" />
<pathelement location="lib/buildlib/netbeans-memory-leak-utils.jar" />
<!-- <pathelement location="classes/base" /> THIS directory is typically empty at the start of this step -->
</classpath>
<compilerarg value="-Xlint" />
<!-- Ignore serial warnings, because they occur for every Throwable definition (among others) -->
<compilerarg value="-Xlint:-serial" />
<!-- Use the next line to compile against other sources, ignoring any unneeded classes.
This can be useful in creating a pruned version of a jar file for the lib directory.
(You must also clear the sourcepath="" option.)
<include name="${src-working-dir}/**/*.java" /> -->
</javac>

<mkdir dir="classes/test" /> <!-- May be deleted by the previous move -->
<move todir="classes/test">
<fileset dir="classes/base">
<include name="**/*Test.class" />
<include name="**/*Test$*.class" />
<include name="**/*TestCase.class" />
<include name="**/*TestCase$*.class" />
<!-- Additional test classes should be listed here -->
</fileset>
</move>

</target>





<target name="do-compile" depends="resolve-java8-runtime, resolve-java8-tools">

<echo message="Compiling src directory to classes/base and classes/test with command 'javac'" />
Expand Down Expand Up @@ -326,7 +384,7 @@
Testing Targets
*************** -->

<target name="test" depends="compile, resolve-current-tools" unless="skip-test"
<target name="test" depends="compile" unless="skip-test"
description="Run all tests (after compiling); use -Dtest-spec=... to filter">
<antcall target="iterate-tests">
<param name="test-jvm" value="java" />
Expand All @@ -345,7 +403,19 @@
<target name="iterate-tests" depends="resolve-test-formatter-class">
<!-- Calls do-test, unless that is overridden by the caller -->
<echo message="Executing iterate-tests" />
<property name="do-test-target" value="do-test" />
<if>
<equals arg1="${TestParallel}" arg2="true" />
<then>
<echo message="Test in Parallel with ${Thread} threads" />
<property name="do-test-target" value="do-test-for" />
</then>
<else>
<echo message="Test in Sequential" />
<property name="do-test-target" value="do-test" />
</else>
</if>


<condition property="test-iteration-message">
<not>
<equals arg1="${test-repeat}" arg2="1" />
Expand Down Expand Up @@ -425,8 +495,50 @@
</if>

</target>




<target name="do-test-for" depends="resolve-jvm-args">
<echo message="Running all tests matching '${test-filter-string}' with command '${test-jvm}', using '${junit-jar}' and '${test-tools}'" />
<for param="fileFullName" parallel= "true" threadCount="${Thread}">
<path>
<fileset dir="classes/test">
<!--include name="**/*${test-filter-string}*/**" /-->
<include name="**/*Test.class" />
</fileset>
</path>
<sequential>
<echo message="file= @{fileFullName}" level="verbose"/>
<antcall target="execute-one-test" inheritRefs="true" inheritall="true">
<param name="fileFullName" value="@{fileFullName}"/>
</antcall>
</sequential>
</for>
<antcall target="generate-cover" />
</target>

<target name="do-test-foreach" depends="resolve-jvm-args">
<echo message="Running all tests matching '${test-filter-string}' with command '${test-jvm}', using '${junit-jar}' and '${test-tools}'" />
<foreach
target="execute-one-test"
maxthreads="16"
inheritall="true"
inheritrefs="true"
parallel="true"
param="fileFullName">
<path>
<fileset dir="classes/test">
<!--include name="**/*${test-filter-string}*/**" /-->
<include name="**/*Test.class" />
</fileset>
</path>
</foreach>
<antcall target="generate-cover" />
</target>



<target name="do-test" depends="resolve-jvm-args">
<echo message="Running all tests matching '${test-filter-string}' with command '${test-jvm}', using '${junit-jar}' and '${test-tools}'" />
<jacoco:coverage xmlns:jacoco="antlib:org.jacoco.ant">
Expand Down Expand Up @@ -454,7 +566,7 @@
<batchtest fork="true">
<fileset dir="classes/test">
<filename name="**/*${test-filter-string}*/**" />
<filename name="**/*Test.class" />
<include name="**/*Test.class" />
</fileset>
</batchtest>
</junit>
Expand All @@ -463,6 +575,44 @@
<antcall target="generate-cover" />
</target>

<target name="execute-one-test">
<sequential>
<basename property="filename" file="${fileFullName}"/>
<echo message="In execute-one-test, we are running '${fileFullName}' with testname ${filename}" level="verbose" />
<jacoco:coverage xmlns:jacoco="antlib:org.jacoco.ant">
<junit haltonfailure="${test-halt}" failureproperty="test-failed"
fork="yes" forkmode="perTest" maxmemory="2G" jvm="${test-jvm}" dir="${basedir}">
<classpath>
<pathelement location="${test-tools}" />
<pathelement location="${junit-jar}" />
<pathelement location="lib/buildlib/plt-ant.jar" /> <!-- required for custom formatter -->
<pathelement location="lib/buildlib/netbeans-memory-leak-utils.jar" />
<pathelement location="classes/test" />
<pathelement location="classes/base" />
<pathelement location="classes/lib" />
</classpath>
<assertions>
<enable />
</assertions>
<syspropertyset>
<propertyref prefix="plt." />
<propertyref prefix="drjava." />
<!-- Add any properties that should be passed on -->
</syspropertyset>
<jvmarg line="${jvm-args}" />
<formatter classname="${test-formatter-class}" usefile="${test-output-to-file}" />
<!--test name="${test.source.absolute}"/-->
<batchtest fork="true">
<fileset dir="classes/test">
<include name="**/${filename}*" />
</fileset>
</batchtest>
</junit>
</jacoco:coverage>
<fail if="test-failed" message="One unit test failed."/>
</sequential>
</target>

<target name = "generate-cover" xmlns:jacoco="antlib:org.jacoco.ant">
<jacoco:report>

Expand Down
6 changes: 6 additions & 0 deletions drjava/lib/backup/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.10.5
Created-By: 10.0.1+10 ("Oracle Corporation")
Built-By: zhexinxiao
Build-Version: platform-20181120-0343

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added drjava/lib/backup/platform.jar
Binary file not shown.
Binary file modified drjava/lib/jacocoant.jar
Binary file not shown.
Binary file modified drjava/lib/platform.jar
Binary file not shown.
Binary file modified drjava/lib/plt.jar
Binary file not shown.
Binary file added drjava/lib/plt.jar.bak
Binary file not shown.
2 changes: 1 addition & 1 deletion drjava/src/edu/rice/cs/drjava/CommandLineTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -435,4 +435,4 @@ private void checkFile(File relativeFile, String funnyName)
// Close this doc to clean up after ourselves for the next check.
_mf.getModel().closeFile(doc);
}
}
}
11 changes: 6 additions & 5 deletions drjava/src/edu/rice/cs/drjava/DrJava.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
* @version $Id$
*/
public class DrJava {
public static volatile Log _log = new Log("DrJava.txt", false);
public static volatile Log _log = new Log("DrJava.txt", true);

private static final String DEFAULT_MAX_HEAP_SIZE_ARG = "-Xmx128M";

Expand Down Expand Up @@ -242,9 +242,9 @@ public static void main(final String[] args) {
if (handleCommandLineArgs(args)) {
// Platform-specific UI setup.
PlatformFactory.ONLY.beforeUISetup();

_log.log("before configureAndLoadDrJavaRoot");
// Utilities.showDebug("Calling configureAndLoadDrJavaRoot with args = " + args);
configureAndLoadDrJavaRoot(args);
configureAndLoadDrJavaRoot(args);
}
}

Expand Down Expand Up @@ -286,7 +286,7 @@ public static void configureAndLoadDrJavaRoot(String[] args) {
clearFilesToOpen();
_log.log("_filesToOpen copied into class arguments, clearing _filesToOpen");
}

_log.log("_doRestart before if statement: "+_doRestart);
if (_doRestart) {
if (DrJava.getConfig().getSetting(OptionConstants.REMOTE_CONTROL_ENABLED)) {
// at this time, OUR remote control server hasn't been started yet
Expand Down Expand Up @@ -403,7 +403,8 @@ static boolean handleCommandLineArgs(String[] args) {
int argIndex = 0;
int len = args.length;
_log.log("handleCommandLineArgs. _filesToOpen: " + _filesToOpen);

_log.log("handleCommandLineArgs args are : " + java.util.Arrays.toString(args));

while(argIndex < len) {
String arg = args[argIndex++];

Expand Down
9 changes: 7 additions & 2 deletions drjava/src/edu/rice/cs/drjava/DrJavaRoot.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

import javax.swing.UIManager;
import javax.swing.*;

import edu.rice.cs.util.Log;
import edu.rice.cs.plt.lambda.Runnable1;
import edu.rice.cs.util.FileOpenSelector;
import edu.rice.cs.util.UnexpectedException;
Expand All @@ -71,7 +71,9 @@
/** Main class for DrJava.
* @version $Id$
*/
public class DrJavaRoot {
public class DrJavaRoot {
public static volatile Log _log = new Log("DrJava.txt", true);

/** Class to probe to see if the debugger is available */
public static final String TEST_DEBUGGER_CLASS = "com.sun.jdi.Bootstrap";

Expand All @@ -95,6 +97,8 @@ public class DrJavaRoot {

public static void main(final String[] args) {
debug.log("Starting up");
_log.log("Starting up DrJavaRoot.main");

// Platform-specific UI setup.
PlatformFactory.ONLY.beforeUISetup();

Expand Down Expand Up @@ -191,6 +195,7 @@ public void run(){
// Utilities.showDebug("showDebugConsole flag = " + DrJava.getShowDebugConsole());
// Show debug console if enabled
if (DrJava.getShowDebugConsole()) showDrJavaDebugConsole(_mainFrame);
_log.log("end try in DrJavaRoot.main");
}
catch(Throwable t) {
error.log(t);
Expand Down
2 changes: 1 addition & 1 deletion drjava/src/edu/rice/cs/drjava/DrJavaTestCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ public void run() {
});
Utilities.clearEventQueue(); // ensure that all listener actions triggered by this document update have completed
}
}
}
16 changes: 16 additions & 0 deletions drjava/src/edu/rice/cs/drjava/config/OptionConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -431,10 +431,16 @@ public static Vector<KeyStroke> vector(KeyStroke... ks) {
public static final VectorOption<KeyStroke> KEY_COMPILE_PROJECT =
new VectorOption<KeyStroke>("key.compile.project", new KeyStrokeOption("",null), to.vector());

/** The key binding for testing a project in parallel. */
public static final VectorOption<KeyStroke> KEY_JUNIT_PROJECT_PARALLEL =
new VectorOption<KeyStroke>("key.junit.project", new KeyStrokeOption("",null), to.vector());


/** The key binding for testing a project. */
public static final VectorOption<KeyStroke> KEY_JUNIT_PROJECT =
new VectorOption<KeyStroke>("key.junit.project", new KeyStrokeOption("",null), to.vector());


/** The key binding for running a project. */
public static final VectorOption<KeyStroke> KEY_RUN_PROJECT =
new VectorOption<KeyStroke>("key.run.project", new KeyStrokeOption("",null), to.vector());
Expand Down Expand Up @@ -764,12 +770,20 @@ public static Vector<KeyStroke> vector(KeyStroke... ks) {
new VectorOption<KeyStroke>("key.test",
new KeyStrokeOption("",null),
to.vector(KeyStroke.getKeyStroke(KeyEvent.VK_T, MASK|SHIFT_MASK)));
/** The key binding for testing the current document in parallel. */
public static final VectorOption<KeyStroke> KEY_TEST_PARALLEL =
new VectorOption<KeyStroke>("key.reset.interactions", new KeyStrokeOption("",null), to.vector());


/** The key binding for testing all open JUnit test cases. */
public static final VectorOption<KeyStroke> KEY_TEST_ALL =
new VectorOption<KeyStroke>("key.test.all",
new KeyStrokeOption("",null),
to.vector(KeyStroke.getKeyStroke(KeyEvent.VK_T, MASK)));
/** The key binding for testing all open JUnit test cases in parallel. */
public static final VectorOption<KeyStroke> KEY_TEST_ALL_PARALLEL =
new VectorOption<KeyStroke>("key.reset.interactions", new KeyStrokeOption("",null), to.vector());


/** The key binding for generating javadoc for all documents */
public static final VectorOption<KeyStroke> KEY_JAVADOC_ALL =
Expand Down Expand Up @@ -807,6 +821,8 @@ public static Vector<KeyStroke> vector(KeyStroke... ks) {
public static final VectorOption<KeyStroke> KEY_RESET_INTERACTIONS =
new VectorOption<KeyStroke>("key.reset.interactions", new KeyStrokeOption("",null), to.vector());



/** The key binding for viewing the interactions classpath. */
public static final VectorOption<KeyStroke> KEY_VIEW_INTERACTIONS_CLASSPATH =
new VectorOption<KeyStroke>("key.view.interactions.classpath", new KeyStrokeOption("",null), to.vector());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
*/
public class AbstractGlobalModel implements SingleDisplayModel, OptionConstants, DocumentIterator {

public static final Log _log = new Log("GlobalModel.txt", false);
public static final Log _log = new Log("GlobalModel.txt", true);

/** A document cache that manages how many unmodified documents are open at once. */
protected final DocumentCache _cache;
Expand Down
Loading