Skip to content

Commit 217c110

Browse files
author
dlsmith
committed
Updates plt.jar and platform.jar to their latest versions; fixes a compiler bug in which the Java 5 compiler did not allow for-each to be used with Iterables; modifies compiler interfaces slightly and provides a detailed description of the compiler in the compiler error pane; allows JDK installations to be located in a /opt directory
git-svn-id: file:///tmp/test-svn/trunk@4156 fe72c1cf-3628-48e9-8b72-1c46755d3cff
1 parent e4d6291 commit 217c110

File tree

13 files changed

+126
-40
lines changed

13 files changed

+126
-40
lines changed

drjava/lib/bcel-5.1-pruned.jar

119 KB
Binary file not shown.

drjava/lib/javalanglevels.jar

-493 KB
Binary file not shown.

drjava/lib/platform.jar

-260 Bytes
Binary file not shown.

drjava/lib/plt.jar

252 Bytes
Binary file not shown.

drjava/lib/readme.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Contents:
2+
*.jar: Binaries that should be part of the distribution
3+
buildlib/*.jar: Binaries used in the build process, but that should not be part
4+
of the distribution.
5+
6+
VERSIONS:
7+
8+
bcel-5.1-pruned.jar: BCEL 5.1; unneeded class files removed (see javalanglevels)
9+
docs.jar: docs-20060901-2010
10+
dynamicjava.jar: Updated 2005-10-11
11+
javalanglevels.jar: javalanglevels-20070213-2052
12+
junit.jar: JUnit 3.8.1
13+
platform.jar: platform-20070213-2003
14+
plt.jar: plt-20070213-2138
15+
retroweaver-rt-1.2.3.jar: Retroweaver 1.2.3
16+
winlaf-0.5.1.jar: WinLAF 0.5.1
17+
18+
buildlib/ant-contrib.jar: ANT Contrib 1.0b2
19+
buildlib/cenquatasks.jar: Distributed with Clover 1.3.9
20+
buildlib/junit.jar: JUnit 3.8.1
21+
buildlib/plt-ant.jar: plt-ant-20070212-2001
22+
buildlib/retroweaver-all-1.2.3.jar: Retroweaver 1.2.3

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@ public static void main(final String[] args) {
114114
// Platform-specific UI setup.
115115
PlatformFactory.ONLY.beforeUISetup();
116116

117-
DebugUtil.error.log("This is the error log");
118-
DebugUtil.debug.log("This is the debug log");
119-
120117
new SplashScreen().flash();
121118
// Utilities.showDebug("Calling configureAndLoadDrJavaRoot with args = " + args);
122119
configureAndLoadDrJavaRoot(args);

drjava/src/edu/rice/cs/drjava/model/JDKToolsLibrary.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ public static JDKToolsLibrary makeFromRuntime(GlobalModel model) {
6565
String bootProp = System.getProperty("sun.boot.class.path");
6666
if (bootProp != null) { bootClassPath = IterUtil.asList(IOUtil.parsePath(bootProp)); }
6767
try {
68-
CompilerInterface attempt = (CompilerInterface)
69-
ReflectUtil.loadObject(compilerAdapter, new Class[]{FullVersion.class, List.class}, version, bootClassPath);
68+
Class[] sig = new Class[]{ FullVersion.class, String.class, List.class };
69+
Object[] args = new Object[]{ version, "the runtime class path", bootClassPath };
70+
CompilerInterface attempt = (CompilerInterface) ReflectUtil.loadObject(compilerAdapter, sig, args);
7071
if (attempt.isAvailable()) { compiler = attempt; }
7172
}
7273
catch (ReflectException e) { /* can't load */ }

drjava/src/edu/rice/cs/drjava/model/JarJDKToolsLibrary.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ public static JarJDKToolsLibrary makeFromFile(File f, GlobalModel model) {
7676
Debugger debugger = NoDebuggerAvailable.ONLY;
7777

7878
if (JavaVersion.CURRENT.supports(version.majorVersion())) {
79-
Iterable<File> path = IterUtil.singleton(f);
8079
// block tools.jar classes, so that references don't point to a different version of the classes
8180
ClassLoader loader = new ShadowingClassLoader(JarJDKToolsLibrary.class.getClassLoader(), TOOLS_PACKAGES);
81+
Iterable<File> path = IterUtil.singleton(f);
8282

8383
String compilerAdapter = adapterForCompiler(version.majorVersion());
8484
if (compilerAdapter != null) {
@@ -93,9 +93,10 @@ else if (f.getName().equals("tools.jar")) {
9393
}
9494
}
9595
try {
96-
Class[] sig = new Class[]{ FullVersion.class, List.class };
97-
CompilerInterface attempt = (CompilerInterface)
98-
ReflectUtil.loadLibraryAdapter(loader, path, compilerAdapter, sig, version, bootClassPath);
96+
Class[] sig = new Class[]{ FullVersion.class, String.class, List.class };
97+
Object[] args = new Object[]{ version, f.toString(), bootClassPath };
98+
CompilerInterface attempt = (CompilerInterface) ReflectUtil.loadLibraryAdapter(loader, path, compilerAdapter,
99+
sig, args);
99100
if (attempt.isAvailable()) { compiler = attempt; }
100101
}
101102
catch (ReflectException e) { /* can't load */ }

drjava/src/edu/rice/cs/drjava/model/compiler/CompilerInterface.java

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@
4242
*/
4343
public interface CompilerInterface {
4444

45+
/** Indicates whether this compiler is actually available. As in: Is it installed and located? This method
46+
* should load the compiler class, which should hopefully prove whether the class can load. If this
47+
* method returns true, the {@link #compile} method should not fail due to class not being found.
48+
*/
49+
boolean isAvailable();
50+
4551
/** Compile the given files.
4652
* @param files Source files to compile.
4753
* @param classPath Support jars or directories that should be on the classpath. If @code{null}, the default is used.
@@ -58,19 +64,16 @@ List<? extends CompilerError> compile(List<? extends File> files, List<? extends
5864
List<? extends File> sourcePath, File destination,
5965
List<? extends File> bootClassPath, String sourceVersion, boolean showWarnings);
6066

61-
/** Indicates whether this compiler is actually available. As in: Is it installed and located? This method
62-
* should load the compiler class, which should hopefully prove whether the class can load. If this
63-
* method returns true, the {@link #compile} method should not fail due to class not being found.
64-
*/
65-
boolean isAvailable();
66-
67-
/** Returns the name of this compiler, appropriate to show to the user. */
68-
String getName();
69-
7067
/** The latest version of Java supported by the compiler */
7168
JavaVersion version();
69+
70+
/** Returns the name of this compiler, appropriate to show to the user. */
71+
String getName();
7272

73-
/** Should return info about compiler, at least including name. */
73+
/** Returns a one-line description of the compiler (such as the name and file location) */
74+
String getDescription();
75+
76+
/** String to display in a combo box (generally {@code getName()}) */
7477
String toString();
7578

7679
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*BEGIN_COPYRIGHT_BLOCK
2+
*
3+
* This file is part of DrJava. Download the current version of this project from http://www.drjava.org/
4+
* or http://sourceforge.net/projects/drjava/
5+
*
6+
* DrJava Open Source License
7+
*
8+
* Copyright (C) 2001-2006 JavaPLT group at Rice University (javaplt@rice.edu). All rights reserved.
9+
*
10+
* Developed by: Java Programming Languages Team, Rice University, http://www.cs.rice.edu/~javaplt/
11+
*
12+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
13+
* documentation files (the "Software"), to deal with the Software without restriction, including without limitation
14+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
15+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
16+
*
17+
* - Redistributions of source code must retain the above copyright notice, this list of conditions and the
18+
* following disclaimers.
19+
* - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
20+
* following disclaimers in the documentation and/or other materials provided with the distribution.
21+
* - Neither the names of DrJava, the JavaPLT, Rice University, nor the names of its contributors may be used to
22+
* endorse or promote products derived from this Software without specific prior written permission.
23+
* - Products derived from this software may not be called "DrJava" nor use the term "DrJava" as part of their
24+
* names without prior written permission from the JavaPLT group. For permission, write to javaplt@rice.edu.
25+
*
26+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
27+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28+
* CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
29+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
30+
* WITH THE SOFTWARE.
31+
*
32+
*END_COPYRIGHT_BLOCK*/
33+
34+
package edu.rice.cs.drjava.model.compiler;
35+
36+
import java.util.List;
37+
import java.io.File;
38+
import edu.rice.cs.plt.reflect.JavaVersion;
39+
40+
/**
41+
* An abstract parent for all javac-based compiler interfaces. Manages the auxiliary naming methods.
42+
* To support loading via reflection, all subclasses are assumed to have a public constructor with
43+
* a matching signature.
44+
*
45+
* @version $Id$
46+
*/
47+
public abstract class JavacCompiler implements CompilerInterface {
48+
49+
private JavaVersion.FullVersion _version;
50+
private String _location;
51+
protected List<? extends File> _defaultBootClassPath;
52+
53+
protected JavacCompiler(JavaVersion.FullVersion version, String location, List<? extends File> defaultBootClassPath) {
54+
_version = version;
55+
_location = location;
56+
_defaultBootClassPath = defaultBootClassPath;
57+
}
58+
59+
public abstract boolean isAvailable();
60+
61+
public abstract List<? extends CompilerError> compile(List<? extends File> files, List<? extends File> classPath,
62+
List<? extends File> sourcePath, File destination,
63+
List<? extends File> bootClassPath, String sourceVersion,
64+
boolean showWarnings);
65+
66+
public JavaVersion version() { return _version.majorVersion(); }
67+
68+
public String getName() { return "JDK " + _version.versionString(); }
69+
70+
public String getDescription() { return getName() + " from " + _location; }
71+
72+
public String toString() { return getName(); }
73+
74+
}

0 commit comments

Comments
 (0)