Browse Source

spring cleaning in advance of 1.2 enhancements:

removed unused imports, local variables, and private methods
(still there, just commented out).
tags/v_preCompileLoopAlteration
acolyer 20 years ago
parent
commit
14908174fc
37 changed files with 301 additions and 301 deletions
  1. 1
    1
      testing-client/src/org/aspectj/testing/Tester.java
  2. 90
    90
      testing/src/org/aspectj/internal/tools/ant/taskdefs/Ajctest.java
  3. 6
    6
      testing/src/org/aspectj/testing/ajde/CompileCommand.java
  4. 20
    20
      testing/src/org/aspectj/testing/harness/bridge/AbstractRunSpec.java
  5. 1
    1
      testing/src/org/aspectj/testing/harness/bridge/AjcMessageHandler.java
  6. 3
    3
      testing/src/org/aspectj/testing/harness/bridge/AjcTest.java
  7. 16
    16
      testing/src/org/aspectj/testing/harness/bridge/CompilerRun.java
  8. 4
    4
      testing/src/org/aspectj/testing/harness/bridge/DirChanges.java
  9. 1
    1
      testing/src/org/aspectj/testing/harness/bridge/FlatSuiteReader.java
  10. 1
    1
      testing/src/org/aspectj/testing/harness/bridge/Globals.java
  11. 11
    11
      testing/src/org/aspectj/testing/harness/bridge/IncCompilerRun.java
  12. 1
    1
      testing/src/org/aspectj/testing/harness/bridge/RunSpecIterator.java
  13. 1
    1
      testing/src/org/aspectj/testing/harness/bridge/Validator.java
  14. 2
    2
      testing/src/org/aspectj/testing/run/Runner.java
  15. 4
    4
      testing/src/org/aspectj/testing/taskdefs/AjcTaskCompileCommand.java
  16. 4
    4
      testing/src/org/aspectj/testing/util/BridgeUtil.java
  17. 6
    6
      testing/src/org/aspectj/testing/util/LangUtil.java
  18. 19
    19
      testing/src/org/aspectj/testing/util/LinkCheck.java
  19. 1
    1
      testing/src/org/aspectj/testing/util/RunUtils.java
  20. 1
    1
      testing/src/org/aspectj/testing/util/StreamsHandler.java
  21. 1
    1
      testing/src/org/aspectj/testing/util/TestDiffs.java
  22. 3
    3
      testing/src/org/aspectj/testing/util/options/Option.java
  23. 2
    2
      testing/src/org/aspectj/testing/util/options/Options.java
  24. 1
    1
      testing/src/org/aspectj/testing/util/options/Values.java
  25. 59
    59
      testing/src/org/aspectj/testing/xml/AjcSpecXmlReader.java
  26. 21
    21
      testing/src/org/aspectj/testing/xml/MessageListXmlReader.java
  27. 2
    2
      testing/src/org/aspectj/testing/xml/SoftMessage.java
  28. 1
    1
      testing/src/org/aspectj/testing/xml/XMLWriter.java
  29. 1
    1
      testing/testsrc/org/aspectj/testing/harness/bridge/AjcSpecTest.java
  30. 2
    2
      testing/testsrc/org/aspectj/testing/harness/bridge/CompilerRunSpecTest.java
  31. 4
    4
      testing/testsrc/org/aspectj/testing/harness/bridge/CompilerRunTest.java
  32. 3
    3
      testing/testsrc/org/aspectj/testing/harness/bridge/ParseTestCase.java
  33. 1
    1
      testing/testsrc/org/aspectj/testing/taskdefs/AjcTaskCompileCommandTest.java
  34. 1
    1
      testing/testsrc/org/aspectj/testing/util/LangUtilTest.java
  35. 3
    3
      testing/testsrc/org/aspectj/testing/util/options/OptionChecker.java
  36. 1
    1
      testing/testsrc/org/aspectj/testing/util/options/OptionsTest.java
  37. 2
    2
      testing/testsrc/org/aspectj/testing/xml/AjcSpecXmlReaderTest.java

+ 1
- 1
testing-client/src/org/aspectj/testing/Tester.java View File

@@ -960,7 +960,7 @@ public class Tester {
final boolean failed = fail || (null != thrown);
IMessage.Kind kind = (failed ? IMessage.FAIL : IMessage.INFO);
IMessage m = new Message(message, kind, thrown, null);
final boolean handled = messageHandler.handleMessage(m);
/*final boolean handled = */messageHandler.handleMessage(m);
}
// private static void resofhandle(String message, Throwable thrown, boolean fail) {
// /* If FAIL and the message handler returns false (normally),

+ 90
- 90
testing/src/org/aspectj/internal/tools/ant/taskdefs/Ajctest.java View File

@@ -35,7 +35,7 @@ import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.text.DateFormat;
import java.util.Collection;
//import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
@@ -67,7 +67,7 @@ import org.apache.tools.ant.Project;
import org.apache.tools.ant.Target;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.Delete;
import org.apache.tools.ant.taskdefs.ExecTask;
//import org.apache.tools.ant.taskdefs.ExecTask;
import org.apache.tools.ant.taskdefs.Java;
import org.apache.tools.ant.taskdefs.LogOutputStream;
import org.apache.tools.ant.taskdefs.Mkdir;
@@ -117,7 +117,7 @@ public class Ajctest extends Task implements PropertyChangeListener {
private Stats ajdocStats = new Stats();
private Stats ajcStats = new Stats();
private Stats runStats = new Stats();
private Stats errorStats = new Stats();
// private Stats errorStats = new Stats();
private static final String NO_TESTID = "NONE";
private File workingdir = new File("ajworkingdir"); //XXX

@@ -1067,22 +1067,22 @@ public class Ajctest extends Task implements PropertyChangeListener {
// class Run
// todo: need to run in a wrapper which report non-zero int on exception
// todo: unused method? see executeJava above.
private int java(String classname, Collection args) throws BuildException {
Java java = (Java)project.createTask("java");
java.setClassname(classname);
for (Iterator i = args.iterator(); i.hasNext();) {
Object o = i.next();
Commandline.Argument arg = java.createArg();
if (o instanceof File) {
arg.setFile((File)o);
} else if (o instanceof Path) {
arg.setPath((Path)o);
} else {
arg.setValue(o+"");
}
}
return java.executeJava();
}
// private int java(String classname, Collection args) throws BuildException {
// Java java = (Java)project.createTask("java");
// java.setClassname(classname);
// for (Iterator i = args.iterator(); i.hasNext();) {
// Object o = i.next();
// Commandline.Argument arg = java.createArg();
// if (o instanceof File) {
// arg.setFile((File)o);
// } else if (o instanceof Path) {
// arg.setPath((Path)o);
// } else {
// arg.setValue(o+"");
// }
// }
// return java.executeJava();
// }

private static List allErrors = new Vector();
private List errors = new Vector();
@@ -1547,77 +1547,77 @@ public class Ajctest extends Task implements PropertyChangeListener {
}

/** implement invocation of ajc */
private void java(Testset testset, List args) throws BuildException {
Java java = (Java)project.createTask("java");
java.setClassname("org.aspectj.tools.ajc.Main");
if (classpath != null) {
java.setClasspath(classpath);
}
for (Iterator iter = args.iterator(); iter.hasNext();) {
Arg arg = (Arg)iter.next();
if (arg.isj) {
java.createJvmarg().setValue(arg.name);
if (!arg.value.equals("")) {
java.createJvmarg().setValue(arg.value);
}
}
}
for (Iterator iter = args.iterator(); iter.hasNext();) {
Arg arg = (Arg)iter.next();
if (!arg.isj) {
java.createArg().setValue(arg.name);
if (!arg.value.equals("")) {
java.createArg().setValue(arg.value);
}
}
}
for (Iterator iter = testset.files.iterator(); iter.hasNext();) {
java.createArg().setFile((File)iter.next());
}
for (Iterator iter = testset.argfiles.iterator(); iter.hasNext();) {
java.createArg().setValue("-argfile");
java.createArg().setFile((File)iter.next());
}
java.setFork(true);
java.execute();
}
private void exec(Testset testset, List args) throws BuildException {
ExecTask exec = (ExecTask)project.createTask("exec");
exec.setExecutable("java");
if (classpath != null) {
exec.createArg().setValue("-classpath");
exec.createArg().setPath(classpath);
}
for (Iterator iter = args.iterator(); iter.hasNext();) {
Arg arg = (Arg)iter.next();
if (arg.isj) {
exec.createArg().setValue(arg.name);
if (!arg.value.equals("")) {
exec.createArg().setValue(arg.value);
}
}
}
exec.createArg().setValue("org.aspectj.tools.ajc.Main");
for (Iterator iter = args.iterator(); iter.hasNext();) {
Arg arg = (Arg)iter.next();
if (!arg.isj) {
exec.createArg().setValue(arg.name);
if (!arg.value.equals("")) {
exec.createArg().setValue(arg.value);
}
}
}
for (Iterator iter = testset.files.iterator(); iter.hasNext();) {
exec.createArg().setFile((File)iter.next());
}
for (Iterator iter = testset.argfiles.iterator(); iter.hasNext();) {
exec.createArg().setValue("-argfile");
exec.createArg().setFile((File)iter.next());
}
exec.execute();
}
// private void java(Testset testset, List args) throws BuildException {
// Java java = (Java)project.createTask("java");
// java.setClassname("org.aspectj.tools.ajc.Main");
// if (classpath != null) {
// java.setClasspath(classpath);
// }
// for (Iterator iter = args.iterator(); iter.hasNext();) {
// Arg arg = (Arg)iter.next();
// if (arg.isj) {
// java.createJvmarg().setValue(arg.name);
// if (!arg.value.equals("")) {
// java.createJvmarg().setValue(arg.value);
// }
// }
// }
// for (Iterator iter = args.iterator(); iter.hasNext();) {
// Arg arg = (Arg)iter.next();
// if (!arg.isj) {
// java.createArg().setValue(arg.name);
// if (!arg.value.equals("")) {
// java.createArg().setValue(arg.value);
// }
// }
// }
// for (Iterator iter = testset.files.iterator(); iter.hasNext();) {
// java.createArg().setFile((File)iter.next());
// }
// for (Iterator iter = testset.argfiles.iterator(); iter.hasNext();) {
// java.createArg().setValue("-argfile");
// java.createArg().setFile((File)iter.next());
// }
// java.setFork(true);
// java.execute();
// }
//
// private void exec(Testset testset, List args) throws BuildException {
// ExecTask exec = (ExecTask)project.createTask("exec");
// exec.setExecutable("java");
// if (classpath != null) {
// exec.createArg().setValue("-classpath");
// exec.createArg().setPath(classpath);
// }
// for (Iterator iter = args.iterator(); iter.hasNext();) {
// Arg arg = (Arg)iter.next();
// if (arg.isj) {
// exec.createArg().setValue(arg.name);
// if (!arg.value.equals("")) {
// exec.createArg().setValue(arg.value);
// }
// }
// }
// exec.createArg().setValue("org.aspectj.tools.ajc.Main");
// for (Iterator iter = args.iterator(); iter.hasNext();) {
// Arg arg = (Arg)iter.next();
// if (!arg.isj) {
// exec.createArg().setValue(arg.name);
// if (!arg.value.equals("")) {
// exec.createArg().setValue(arg.value);
// }
// }
// }
// for (Iterator iter = testset.files.iterator(); iter.hasNext();) {
// exec.createArg().setFile((File)iter.next());
// }
// for (Iterator iter = testset.argfiles.iterator(); iter.hasNext();) {
// exec.createArg().setValue("-argfile");
// exec.createArg().setFile((File)iter.next());
// }
// exec.execute();
// }
//
public void handle(Throwable t) {
log("handling " + t);
if (t != null) t.printStackTrace();

+ 6
- 6
testing/src/org/aspectj/testing/ajde/CompileCommand.java View File

@@ -200,12 +200,12 @@ public class CompileCommand implements ICommand {
}
}

private Object makeLoggingProxy(Class interfac) {
return Proxy.newProxyInstance(
interfac.getClassLoader(),
new Class[] { interfac },
loggingProxy);
}
// private Object makeLoggingProxy(Class interfac) {
// return Proxy.newProxyInstance(
// interfac.getClassLoader(),
// new Class[] { interfac },
// loggingProxy);
// }
private Object makeProxy(Class interfac) {
return Proxy.newProxyInstance(

+ 20
- 20
testing/src/org/aspectj/testing/harness/bridge/AbstractRunSpec.java View File

@@ -30,7 +30,7 @@ import org.aspectj.bridge.ISourceLocation;
import org.aspectj.bridge.MessageHandler;
import org.aspectj.bridge.MessageUtil;
import org.aspectj.testing.run.IRunIterator;
import org.aspectj.testing.util.*;
//import org.aspectj.testing.util.*;
import org.aspectj.testing.util.BridgeUtil;
import org.aspectj.testing.util.options.*;
import org.aspectj.testing.util.options.Option.InvalidInputException;
@@ -576,23 +576,23 @@ abstract public class AbstractRunSpec implements IRunSpec { // XXX use MessageHa
}
}
/** @return null if value is null or name="{value}" otherwise */
private String makeAttr(XMLWriter out, String name, String value) {
if (null == value) {
return null;
}
return XMLWriter.makeAttribute(name, value);
}
/** @return null if list is null or empty or name="{flattenedList}" otherwise */
private String makeAttr(XMLWriter out, String name, List list) {
if (LangUtil.isEmpty(list)) {
return null;
}
String flat = XMLWriter.flattenList(list);
return XMLWriter.makeAttribute(name, flat);
}
// /** @return null if value is null or name="{value}" otherwise */
// private String makeAttr(XMLWriter out, String name, String value) {
// if (null == value) {
// return null;
// }
// return XMLWriter.makeAttribute(name, value);
// }
//
// /** @return null if list is null or empty or name="{flattenedList}" otherwise */
// private String makeAttr(XMLWriter out, String name, List list) {
// if (LangUtil.isEmpty(list)) {
// return null;
// }
// String flat = XMLWriter.flattenList(list);
// return XMLWriter.makeAttribute(name, flat);
// }
//
/** @return true if writeAttributes(..) will produce any output */
protected boolean haveAttributes() {
return ((!LangUtil.isEmpty(xmlNames.descriptionName)
@@ -981,7 +981,7 @@ abstract public class AbstractRunSpec implements IRunSpec { // XXX use MessageHa
if (LangUtil.isEmpty(parentOptions)) {
return result;
}
boolean haveOption = false;
// boolean haveOption = false;
String[] parents = (String[]) parentOptions.toArray(new String[0]);
try {
result = validOptions.acceptInput(parents);
@@ -1031,7 +1031,7 @@ abstract public class AbstractRunSpec implements IRunSpec { // XXX use MessageHa
return new String[0];
}
ArrayList result = new ArrayList();
boolean haveOption = false;
// boolean haveOption = false;
for (int i = 0; i < validOptions.length; i++) {
String option = validOptions[i];
if (LangUtil.isEmpty(option)) {

+ 1
- 1
testing/src/org/aspectj/testing/harness/bridge/AjcMessageHandler.java View File

@@ -25,7 +25,7 @@ import org.aspectj.bridge.IMessageHandler;
import org.aspectj.bridge.IMessageHolder;
import org.aspectj.bridge.MessageHandler;
import org.aspectj.bridge.MessageUtil;
import org.aspectj.bridge.IMessage.Kind;
//import org.aspectj.bridge.IMessage.Kind;
import org.aspectj.testing.util.BridgeUtil;
import org.aspectj.testing.util.Diffs;
import org.aspectj.util.LangUtil;

+ 3
- 3
testing/src/org/aspectj/testing/harness/bridge/AjcTest.java View File

@@ -21,7 +21,7 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.List;

import org.aspectj.bridge.*;
//import org.aspectj.bridge.*;
import org.aspectj.bridge.IMessageHandler;
import org.aspectj.bridge.ISourceLocation;
import org.aspectj.testing.run.IRunIterator;
@@ -525,8 +525,8 @@ public class AjcTest extends RunSpecIterator {
* skip dirChanges, skip messages and do children
* (though we do children directly).
*/
private static final XMLNames NAMES = new XMLNames(XMLNames.DEFAULT,
null, null, null, null, "", null, "", "", true, true, false);
// private static final XMLNames NAMES = new XMLNames(XMLNames.DEFAULT,
// null, null, null, null, "", null, "", "", true, true, false);
File suiteDir;
public Spec() {
super(XMLNAME, false); // do not skip this even if children skip

+ 16
- 16
testing/src/org/aspectj/testing/harness/bridge/CompilerRun.java View File

@@ -413,9 +413,9 @@ public class CompilerRun implements IAjcRun {
MessageUtil.abort(status, spec.testSetup.failureReason);
return false;
}
boolean ignoreWarnings =
(spec.testSetup.ignoreWarningsSet
&& spec.testSetup.ignoreWarnings);
// boolean ignoreWarnings =
// (spec.testSetup.ignoreWarningsSet
// && spec.testSetup.ignoreWarnings);
AjcMessageHandler handler =
new AjcMessageHandler(spec.getMessages());
handler.init();
@@ -688,18 +688,18 @@ public class CompilerRun implements IAjcRun {
}

/** @return true if javac is available on the classpath */
private static boolean haveJavac() { // XXX copy/paste from JavaCWrapper.java
Class compilerClass = null;
try {
compilerClass = Class.forName("com.sun.tools.javac.Main");
} catch (ClassNotFoundException ce1) {
try {
compilerClass = Class.forName("sun.tools.javac.Main");
} catch (ClassNotFoundException ce2) {
}
}
return (null != compilerClass);
}
// private static boolean haveJavac() { // XXX copy/paste from JavaCWrapper.java
// Class compilerClass = null;
// try {
// compilerClass = Class.forName("com.sun.tools.javac.Main");
// } catch (ClassNotFoundException ce1) {
// try {
// compilerClass = Class.forName("sun.tools.javac.Main");
// } catch (ClassNotFoundException ce2) {
// }
// }
// return (null != compilerClass);
// }

protected String compiler;

@@ -1035,7 +1035,7 @@ public class CompilerRun implements IAjcRun {
if (null != source) {
String sourceVersion = source.unflatten()[1];
ArrayList toAdd = new ArrayList();
String err =
/*String err =*/
updateBootclasspathForSourceVersion(
sourceVersion,
spec.compiler,

+ 4
- 4
testing/src/org/aspectj/testing/harness/bridge/DirChanges.java View File

@@ -190,7 +190,7 @@ public class DirChanges {
boolean exists,
List pathList,
boolean doCompare) {
boolean expectStartEarlier = true;
// boolean expectStartEarlier = true;
return exists(label, exists, pathList,doCompare, true);
}
protected boolean exists(
@@ -201,9 +201,9 @@ public class DirChanges {
boolean expectStartEarlier) {
boolean result = true;
if (!LangUtil.isEmpty(pathList)) {
final File expDir = ((!doCompare || (null == spec.expDir))
? null
: new File(baseDir, spec.expDir));
// final File expDir = ((!doCompare || (null == spec.expDir))
// ? null
// : new File(baseDir, spec.expDir));
for (Iterator iter = pathList.iterator(); iter.hasNext();) {
final String entry = (String) iter.next() ;
String path = entry ;

+ 1
- 1
testing/src/org/aspectj/testing/harness/bridge/FlatSuiteReader.java View File

@@ -104,7 +104,7 @@ public class FlatSuiteReader implements SFileReader.Maker {
//final String baseDir = reader.getFile().getParent();
String line;
String[] words;
boolean isRequired = true;
// boolean isRequired = true;

final int startLine = reader.getLineNumber() - 1;


+ 1
- 1
testing/src/org/aspectj/testing/harness/bridge/Globals.java View File

@@ -58,7 +58,7 @@ public class Globals {
J2SE14_RTJAR =
getRtJarFor(J2SE14_RTJAR_NAME, "c:/home/apps/jdk14");

String forkSpec = getSystemProperty(FORK_NAME, null);
// String forkSpec = getSystemProperty(FORK_NAME, null);
globalsValid =
(FileUtil.canReadFile(F_testingclient_jar)
&& FileUtil.canReadFile(F_aspectjrt_jar)

+ 11
- 11
testing/src/org/aspectj/testing/harness/bridge/IncCompilerRun.java View File

@@ -16,14 +16,14 @@ package org.aspectj.testing.harness.bridge;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.util.*;
//import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
//import java.util.Collections;
//import java.util.List;

import org.aspectj.bridge.ICommand;
import org.aspectj.bridge.IMessage;
//import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.MessageUtil;
import org.aspectj.testing.ajde.CompileCommand;
import org.aspectj.testing.run.IRunIterator;
@@ -224,7 +224,7 @@ public class IncCompilerRun implements IAjcRun {
MessageUtil.info(handler, "fresh not supported by compiler: " + compiler);
}
}
final long startTime = System.currentTimeMillis();
// final long startTime = System.currentTimeMillis();
commandResult = compiler.repeatCommand(handler);
// XXX disabled LangUtil.throwIaxIfNotAllAssignable(actualRecompiled, File.class, "recompiled");
report = true;
@@ -258,9 +258,9 @@ public class IncCompilerRun implements IAjcRun {
return result;
}

private boolean hasFile(ArrayList changed, File f) {
return changed.contains(f); // d
}
// private boolean hasFile(ArrayList changed, File f) {
// return changed.contains(f); // d
// }


public String toString() {
@@ -285,9 +285,9 @@ public class IncCompilerRun implements IAjcRun {
* skip staging (always true), skip badInput (irrelevant)
* do dirChanges, do messages but skip children.
*/
private static final XMLNames NAMES = new XMLNames(XMLNames.DEFAULT,
"", "", null, "", "classes", null, "", "", false, false, true);
// private static final XMLNames NAMES = new XMLNames(XMLNames.DEFAULT,
// "", "", null, "", "classes", null, "", "", false, false, true);
//
/** identifies files this run owns, so {name}.{tag}.java maps to {name}.java */
String tag;


+ 1
- 1
testing/src/org/aspectj/testing/harness/bridge/RunSpecIterator.java View File

@@ -68,7 +68,7 @@ public class RunSpecIterator implements IRunIterator {

private final IMessage.Kind failureKind;

private boolean didCleanup;
// private boolean didCleanup;
/**
* Create a RunSpecIterator.

+ 1
- 1
testing/src/org/aspectj/testing/harness/bridge/Validator.java View File

@@ -487,7 +487,7 @@ public class Validator {
fail(failMessage + ": unable to get parent " + dir);
}
} else {
File result = FileUtil.makeNewChildDir(dir, name);
FileUtil.makeNewChildDir(dir, name);
if (deleteContents) {
FileUtil.deleteContents(dir);
}

+ 2
- 2
testing/src/org/aspectj/testing/run/Runner.java View File

@@ -63,8 +63,8 @@ public class Runner {

private static final IMessage FAIL_NORUN
= MessageUtil.fail("Null IRun parameter to Runner.run(IRun..)");
private static final IMessage FAIL_NORUN_ITERATOR
= MessageUtil.fail("Null IRunterator parameter to Runner.run(IRunterator...)");
// private static final IMessage FAIL_NORUN_ITERATOR
// = MessageUtil.fail("Null IRunterator parameter to Runner.run(IRunterator...)");
public Runner() {
}

+ 4
- 4
testing/src/org/aspectj/testing/taskdefs/AjcTaskCompileCommand.java View File

@@ -12,11 +12,11 @@

package org.aspectj.testing.taskdefs;

import java.awt.Frame;
//import java.awt.Frame;
import java.io.*;
import java.lang.reflect.*;
//import java.lang.reflect.*;
import java.util.*;
import java.util.List;
//import java.util.List;

import org.apache.tools.ant.*;
import org.apache.tools.ant.Project;
@@ -71,7 +71,7 @@ public class AjcTaskCompileCommand implements ICommand {
}
long curTime = System.currentTimeMillis();
final long timeout = curTime + (timeoutSeconds*1000);
final Thread thread = Thread.currentThread();
// final Thread thread = Thread.currentThread();
final long targetQuietTime = 1000 * seconds;
int numMessages = holder.numMessages(null, true);
long numMessagesTime = curTime;

+ 4
- 4
testing/src/org/aspectj/testing/util/BridgeUtil.java View File

@@ -31,7 +31,7 @@ import org.aspectj.util.LineReader;
*/
public class BridgeUtil {

private static final String INDENT = " ";
// private static final String INDENT = " ";

/** result value when writeMessage is passed null */
private static final String NULL_MESSAGE_OUTPUT = "<null message output>";
@@ -298,7 +298,7 @@ public class BridgeUtil {
* file:#:# - file, line, column
* file:#:#:? - file, line, column, message
*/
SourceLocation result = null;
// SourceLocation result = null;
if ((null == input) || (0 == input.length())) {
if (null == defaultFile) {
return null;
@@ -312,7 +312,7 @@ public class BridgeUtil {
int line = 0;
int endLine = 0;
int column = 0;
String message = null;
// String message = null;
// first try line only
line = convert(input);
@@ -355,7 +355,7 @@ public class BridgeUtil {
//col = "expecting col(number) at \"" + col + "\" in " + input;
//throw new IllegalArgumentException(col);
} else if (-1 != colon3) { // 3 colon => message
message = input.substring(colon3+1); // do not trim message
input.substring(colon3+1); // do not trim message
}
}
}

+ 6
- 6
testing/src/org/aspectj/testing/util/LangUtil.java View File

@@ -244,7 +244,7 @@ public class LangUtil {
}
StringBuffer result = new StringBuffer();
final String cname = LangUtil.unqualifiedClassName(superType);
int index = 0;
// int index = 0;
for (int i = 0; i < ra.length; i++) {
if (null == ra[i]) {
result.append(", [" + i + "] null");
@@ -354,8 +354,8 @@ public class LangUtil {
String emptyUnflattened) {
throwIaxIfNull(input, "input");
final boolean haveDelim = (!isEmpty(delim));
final boolean haveNullFlattened = (null != nullFlattened);
final boolean escaping = (haveDelim && (null != escape));
// final boolean haveNullFlattened = (null != nullFlattened);
// final boolean escaping = (haveDelim && (null != escape));
if (!isEmpty(prefix)) {
if (input.startsWith(prefix)) {
input = input.substring(prefix.length());
@@ -383,9 +383,9 @@ public class LangUtil {
}
StringTokenizer st = new StringTokenizer(input, delim, true);
StringBuffer cur = new StringBuffer();
boolean lastEndedWithEscape = false;
boolean lastWasDelim = false;
// StringBuffer cur = new StringBuffer();
// boolean lastEndedWithEscape = false;
// boolean lastWasDelim = false;
while (st.hasMoreTokens()) {
String token = st.nextToken();
System.out.println("reading " + token);

+ 19
- 19
testing/src/org/aspectj/testing/util/LinkCheck.java View File

@@ -23,7 +23,7 @@ import javax.swing.text.html.HTML.Tag;
import org.aspectj.bridge.*;
import org.aspectj.bridge.IMessageHandler;
import org.aspectj.util.LangUtil;
import org.aspectj.util.FileUtil;
//import org.aspectj.util.FileUtil;

/**
* Quick and dirty link checker.
@@ -146,14 +146,14 @@ public class LinkCheck {
}
}

private static boolean isCheckedFileType(URL url) {
if (null == url) {
return false;
}
String file = url.getFile();
return !FileUtil.hasZipSuffix(file)
&& !file.endsWith(".pdf");
}
// private static boolean isCheckedFileType(URL url) {
// if (null == url) {
// return false;
// }
// String file = url.getFile();
// return !FileUtil.hasZipSuffix(file)
// && !file.endsWith(".pdf");
// }
private final Messages messages;
private final HTMLEditorKit.Parser parser; // XXX untested - stateful
@@ -353,13 +353,13 @@ public class LinkCheck {
info("uncommentedReference", link); // XXX bug?
}

private void addingNullLinkFrom(URL doc) {
info("addingNullLinkFrom", doc);
}
private void noContentCheck(Link link) {
info("noContentCheck", link);
}
// private void addingNullLinkFrom(URL doc) {
// info("addingNullLinkFrom", doc);
// }
//
// private void noContentCheck(Link link) {
// info("noContentCheck", link);
// }

private void notTextContentType(Link link) {
info("notTextContentType", link);
@@ -381,9 +381,9 @@ public class LinkCheck {
info("acceptingUncheckedLink", "doc=" + doc + " link=" + link);
}

private void cantHandleRefsYet(Link link) {
info("cantHandleRefsYet", link.url);
}
// private void cantHandleRefsYet(Link link) {
// info("cantHandleRefsYet", link.url);
// }

private void namedReferenceNotFound(String ref) {
// XXX find all references to this unfound named reference

+ 1
- 1
testing/src/org/aspectj/testing/util/RunUtils.java View File

@@ -65,7 +65,7 @@ public class RunUtils {
return 1;
}
} else {
int i = 0;
// int i = 0;
for (int j = 0; j < children.length; j++) {
if (recurse) {
numFails += numFailures(children[j], recurse);

+ 1
- 1
testing/src/org/aspectj/testing/util/StreamsHandler.java View File

@@ -90,7 +90,7 @@ public class StreamsHandler {
outDelegate = new ProxyPrintStream(System.out);
errDelegate = new ProxyPrintStream(System.err);
this.listening = listen;
final PrintStream HIDE = NullPrintStream.NULL_PrintStream;
// final PrintStream HIDE = NullPrintStream.NULL_PrintStream;
outSniffer = new StreamSniffer(outDelegate);
System.setOut(new PrintStream(outSniffer));
errSniffer = new StreamSniffer(errDelegate);

+ 1
- 1
testing/src/org/aspectj/testing/util/TestDiffs.java View File

@@ -121,7 +121,7 @@ public class TestDiffs { // XXX pretty dumb implementation
if ((null == out) || LangUtil.isEmpty(list)) {
return;
}
int i = 0;
// int i = 0;
final String suffix = " " + label;
final String LABEL = list.size() + suffix;
out.println("## START " + LABEL);

+ 3
- 3
testing/src/org/aspectj/testing/util/options/Option.java View File

@@ -478,9 +478,9 @@ public class Option implements Comparable {
return Factory.class.getName() + ": " + factoryName;
}

private void checkUnique(Option result) {
String name = result.family + "." + result.name;
}
// private void checkUnique(Option result) {
// String name = result.family + "." + result.name;
// }
}

/**

+ 2
- 2
testing/src/org/aspectj/testing/util/options/Options.java View File

@@ -25,7 +25,7 @@ import org.aspectj.util.LangUtil;
public class Options {

/** if true, then perform extra checks to debug problems */
private static final boolean verifying = false;
// private static final boolean verifying = false;
private static final boolean FROZEN = true;

/**
@@ -139,7 +139,7 @@ public class Options {

private Option.Value firstMatch(String value) {
LangUtil.throwIaxIfNull(value, "value");
ArrayList list = new ArrayList();
// ArrayList list = new ArrayList();
for (Iterator iter = options.iterator(); iter.hasNext();) {
Option option = (Option) iter.next();
Option.Value result = option.acceptValue(value);

+ 1
- 1
testing/src/org/aspectj/testing/util/options/Values.java View File

@@ -170,7 +170,7 @@ public class Values {
private static String resolve(Option.Value[] input, int[] matches) {
String err = null;
// seek force-off
Option.Value forceOff = null;
// Option.Value forceOff = null;
Option option = null;
// find and remove any force-off
for (int i = 0;(null == err) && (i < matches.length); i++) {

+ 59
- 59
testing/src/org/aspectj/testing/xml/AjcSpecXmlReader.java View File

@@ -16,7 +16,7 @@
package org.aspectj.testing.xml;

import java.io.*;
import java.util.Vector;
//import java.util.Vector;

import org.apache.commons.digester.Digester;
import org.aspectj.bridge.AbortException;
@@ -61,7 +61,7 @@ public class AjcSpecXmlReader {
* - property read-only (?)
*/
private static final String EOL = "\n";
// private static final String EOL = "\n";
/** presumed relative-path to dtd file for any XML files written by writeSuiteToXmlFile */
public static final String DTD_PATH = "../tests/ajcTestSuite.dtd";
@@ -318,63 +318,63 @@ public class AjcSpecXmlReader {
* The property setter checks are redundant with tests based on
* expectedProperties().
*/
private static void setupDigesterCompileTimeCheck() {
if (true) { throw new Error("never invoked"); }
AjcTest.Suite.Spec suite = new AjcTest.Suite.Spec();
AjcTest.Spec test = new AjcTest.Spec();
// AjcTest test = new AjcTest();
// test.addRunSpec((AbstractRunSpec) null);
//// test.makeIncCompilerRun((IncCompilerRun.Spec) null);
//// test.makeJavaRun((JavaRun.Spec) null);
// test.setDescription((String) null);
// test.setTestBaseDirOffset((String) null);
// test.setBugId((String) null);
// test.setTestSourceLocation((ISourceLocation) null);
CompilerRun.Spec crunSpec = new CompilerRun.Spec();
crunSpec.addMessage((IMessage) null);
// XXX crunSpec.addSourceLocation((ISourceLocation) null);
crunSpec.addWrapFile((AbstractRunSpec.WrapFile) null);
crunSpec.setOptions((String) null);
crunSpec.setPaths((String) null);
crunSpec.setIncludeClassesDir(false);
crunSpec.setReuseCompiler(false);
IncCompilerRun.Spec icrunSpec = new IncCompilerRun.Spec();
icrunSpec.addMessage((IMessage) null);
icrunSpec.setTag((String) null);
icrunSpec.setFresh(false);
JavaRun.Spec jrunspec = new JavaRun.Spec();
jrunspec.addMessage((IMessage) null);
jrunspec.setClassName((String) null);
jrunspec.addMessage((IMessage) null);
// input s.b. interpretable by Boolean.valueOf(String)
jrunspec.setSkipTester(true);
jrunspec.setErrStreamIsError(true);
jrunspec.setOutStreamIsError(true);
DirChanges.Spec dcspec = new DirChanges.Spec();
dcspec.setAdded((String) null);
dcspec.setRemoved((String) null);
dcspec.setUpdated((String) null);
dcspec.setDefaultSuffix((String) null);
dcspec.setDirToken((String) null);
SoftMessage m = new SoftMessage();
m.setSourceLocation((ISourceLocation) null);
m.setText((String) null);
m.setKindAsString((String) null);
m.setDetails((String) null);
SoftSourceLocation sl = new SoftSourceLocation();
sl.setFile((String) null);
sl.setLine((String) null);
sl.setColumn((String) null);
sl.setEndLine((String) null);
// add attribute setters to validate?
}
// private static void setupDigesterCompileTimeCheck() {
// if (true) { throw new Error("never invoked"); }
// AjcTest.Suite.Spec suite = new AjcTest.Suite.Spec();
// AjcTest.Spec test = new AjcTest.Spec();
//// AjcTest test = new AjcTest();
//// test.addRunSpec((AbstractRunSpec) null);
////// test.makeIncCompilerRun((IncCompilerRun.Spec) null);
////// test.makeJavaRun((JavaRun.Spec) null);
//// test.setDescription((String) null);
//// test.setTestBaseDirOffset((String) null);
//// test.setBugId((String) null);
//// test.setTestSourceLocation((ISourceLocation) null);
//
// CompilerRun.Spec crunSpec = new CompilerRun.Spec();
// crunSpec.addMessage((IMessage) null);
// // XXX crunSpec.addSourceLocation((ISourceLocation) null);
// crunSpec.addWrapFile((AbstractRunSpec.WrapFile) null);
// crunSpec.setOptions((String) null);
// crunSpec.setPaths((String) null);
// crunSpec.setIncludeClassesDir(false);
// crunSpec.setReuseCompiler(false);
//
// IncCompilerRun.Spec icrunSpec = new IncCompilerRun.Spec();
// icrunSpec.addMessage((IMessage) null);
// icrunSpec.setTag((String) null);
// icrunSpec.setFresh(false);
//
// JavaRun.Spec jrunspec = new JavaRun.Spec();
// jrunspec.addMessage((IMessage) null);
// jrunspec.setClassName((String) null);
// jrunspec.addMessage((IMessage) null);
// // input s.b. interpretable by Boolean.valueOf(String)
// jrunspec.setSkipTester(true);
// jrunspec.setErrStreamIsError(true);
// jrunspec.setOutStreamIsError(true);
//
// DirChanges.Spec dcspec = new DirChanges.Spec();
// dcspec.setAdded((String) null);
// dcspec.setRemoved((String) null);
// dcspec.setUpdated((String) null);
// dcspec.setDefaultSuffix((String) null);
// dcspec.setDirToken((String) null);
//
// SoftMessage m = new SoftMessage();
// m.setSourceLocation((ISourceLocation) null);
// m.setText((String) null);
// m.setKindAsString((String) null);
// m.setDetails((String) null);
//
// SoftSourceLocation sl = new SoftSourceLocation();
// sl.setFile((String) null);
// sl.setLine((String) null);
// sl.setColumn((String) null);
// sl.setEndLine((String) null);
//
// // add attribute setters to validate?
// }
/** top element on Digester stack holds the test suite */
public static class SuiteHolder {

+ 21
- 21
testing/src/org/aspectj/testing/xml/MessageListXmlReader.java View File

@@ -166,27 +166,27 @@ public class MessageListXmlReader {
* The property setter checks are redundant with tests based on
* expectedProperties().
*/
private static void setupDigesterCompileTimeCheck() {
if (true) { throw new Error("never invoked"); }
MessageListHolder holder = new MessageListHolder();
MessageList ml = new MessageList();
SoftMessage m = new SoftMessage();
SoftSourceLocation sl = new SoftSourceLocation();
holder.setMessageList(ml);
ml.addMessage((IMessage) null);
m.setSourceLocation(sl);
m.setText((String) null);
m.setKindAsString((String) null);
sl.setFile((String) null);
sl.setLine((String) null);
sl.setColumn((String) null);
sl.setEndLine((String) null);
// add attribute setters to validate?
}
// private static void setupDigesterCompileTimeCheck() {
// if (true) { throw new Error("never invoked"); }
//
// MessageListHolder holder = new MessageListHolder();
// MessageList ml = new MessageList();
// SoftMessage m = new SoftMessage();
// SoftSourceLocation sl = new SoftSourceLocation();
//
// holder.setMessageList(ml);
// ml.addMessage((IMessage) null);
// m.setSourceLocation(sl);
// m.setText((String) null);
// m.setKindAsString((String) null);
//
// sl.setFile((String) null);
// sl.setLine((String) null);
// sl.setColumn((String) null);
// sl.setEndLine((String) null);
//
// // add attribute setters to validate?
// }

// inner classes, to make public for bean utilities
/** a list of messages */

+ 2
- 2
testing/src/org/aspectj/testing/xml/SoftMessage.java View File

@@ -15,7 +15,7 @@ package org.aspectj.testing.xml;

import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
//import java.util.Collections;
import java.util.Iterator;
import java.util.List;

@@ -124,7 +124,7 @@ public class SoftMessage implements IMessage {
if (!LangUtil.isEmpty(extras)) {
out.endAttributes();
for (Iterator iter = extras.iterator(); iter.hasNext();) {
ISourceLocation element = (ISourceLocation) iter.next();
/*ISourceLocation element = (ISourceLocation)*/ iter.next();
SoftSourceLocation.writeXml(out, sl);
}
}

+ 1
- 1
testing/src/org/aspectj/testing/xml/XMLWriter.java View File

@@ -261,7 +261,7 @@ public class XMLWriter {
* @throws IllegalStateException if start element does not match
*/
public void endElement(String name) {
int level = stack.size();
// int level = stack.size();
String err = null;
StackElement element = null;
if (0 == stack.size()) {

+ 1
- 1
testing/testsrc/org/aspectj/testing/harness/bridge/AjcSpecTest.java View File

@@ -193,7 +193,7 @@ public class AjcSpecTest extends TestCase {
// }

public static void sameIAjcRun(IAjcRun lhs, IAjcRun rhs, Assert reporter) {
Assert a = reporter;
// Assert a = reporter;
assertTrue(lhs != null);
assertTrue(rhs != null);
Class c = lhs.getClass();

+ 2
- 2
testing/testsrc/org/aspectj/testing/harness/bridge/CompilerRunSpecTest.java View File

@@ -240,7 +240,7 @@ public class CompilerRunSpecTest extends TestCase {
assertTrue(spec != null);
AbstractRunSpec.RT parentRuntime = new AbstractRunSpec.RT();
String result;
String expResult;
// String expResult;

if (null != arg) {
parentRuntime.setOptions(new String[] { arg });
@@ -342,7 +342,7 @@ public class CompilerRunSpecTest extends TestCase {
String resultContains =
!expectPass ? null : "[-" + name + ", 1." + i;
String messagesContain = expectedErr;
MessageHandler handler =
/*MessageHandler handler =*/
runTest(
specOptions,
globalOptions,

+ 4
- 4
testing/testsrc/org/aspectj/testing/harness/bridge/CompilerRunTest.java View File

@@ -35,9 +35,9 @@ public class CompilerRunTest extends TestCase {
dummyReports.add("run: " + Arrays.asList(args));
}
private static void dummyRepeating(String[] args) {
dummyReports.add("repeat: " + Arrays.asList(args));
}
// private static void dummyRepeating(String[] args) {
// dummyReports.add("repeat: " + Arrays.asList(args));
// }

private File testBaseDir;
@@ -67,7 +67,7 @@ public class CompilerRunTest extends TestCase {
}
public void testExtDirs() {
String[] globals = null;
// String[] globals = null;
CompilerRun.Spec spec = new CompilerRun.Spec();
spec.setExtdirs("one,two");
spec.setFiles("Foo.java");

+ 3
- 3
testing/testsrc/org/aspectj/testing/harness/bridge/ParseTestCase.java View File

@@ -112,7 +112,7 @@ public class ParseTestCase extends TestCase {
System.out.println(test);
List ret = new ArrayList();
// List ret = new ArrayList();
NodeList children = node.getChildNodes();
for (int i=0; i < children.getLength(); i++) {
@@ -127,7 +127,7 @@ public class ParseTestCase extends TestCase {
String kind = node.getNodeName();
if (kind.equals("compile")) {
List args = parseChildrenStrings(node, "arg");
List files = parseChildrenStrings(node, "file");
/*List files = */parseChildrenStrings(node, "file");
List expectedMessages = parseChildrenMessages(node);
CompilerRun.Spec spec = new CompilerRun.Spec();
spec.addOptions((String[]) args.toArray(new String[0]));
@@ -139,7 +139,7 @@ public class ParseTestCase extends TestCase {
JavaRun.Spec spec = new JavaRun.Spec();
spec.className = getAttributeString(node, "class");
spec.addOptions(new String[0]); //??? could add support here
JavaRun run = new JavaRun(spec);
/*JavaRun run = */new JavaRun(spec);
return spec;
}

+ 1
- 1
testing/testsrc/org/aspectj/testing/taskdefs/AjcTaskCompileCommandTest.java View File

@@ -231,7 +231,7 @@ class MessageAdder implements Runnable {
final long waitBetweenAdds = interval * 1000l;
long curTime = System.currentTimeMillis();
final long timeout = curTime + MAX_MILLIS;
final Thread thread = Thread.currentThread();
// final Thread thread = Thread.currentThread();
int numAdded = 0;
while (!stop && (timeout > curTime)
&& (numAdded < numToAdd)) {

+ 1
- 1
testing/testsrc/org/aspectj/testing/util/LangUtilTest.java View File

@@ -70,7 +70,7 @@ public class LangUtilTest extends TestCase {

public void skiptestUnflatten() {
LangUtil.FlattenSpec COMMA = LangUtil.FlattenSpec.COMMA;
// LangUtil.FlattenSpec COMMA = LangUtil.FlattenSpec.COMMA;
LangUtil.FlattenSpec LIST = LangUtil.FlattenSpec.LIST;
FTest[] tests = new FTest[]

+ 3
- 3
testing/testsrc/org/aspectj/testing/util/options/OptionChecker.java View File

@@ -129,9 +129,9 @@ public class OptionChecker {
options);
}

private Values getValues(String[] input, Options options) {
return getValuesNegative(input, null, options);
}
// private Values getValues(String[] input, Options options) {
// return getValuesNegative(input, null, options);
// }

private Values getValues(String[] input) {
return getValuesNegative(input, null);

+ 1
- 1
testing/testsrc/org/aspectj/testing/util/options/OptionsTest.java View File

@@ -105,7 +105,7 @@ public class OptionsTest extends TestCase {
return OPTIONS;
}

private boolean verbose;
// private boolean verbose;
private OptionChecker localOptionChecker;

public void testDebugCase() {

+ 2
- 2
testing/testsrc/org/aspectj/testing/xml/AjcSpecXmlReaderTest.java View File

@@ -22,7 +22,7 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;

import junit.framework.*;
//import junit.framework.*;
import junit.framework.TestCase;

import org.aspectj.testing.harness.bridge.AjcSpecTest;
@@ -62,7 +62,7 @@ public class AjcSpecXmlReaderTest extends TestCase {
/** test that all AjcSpecXmlReader.me.expectedProperties() are bean-writable */
public void testBeanInfo() throws IntrospectionException {
AjcSpecXmlReader me = AjcSpecXmlReader.getReader();
// AjcSpecXmlReader me = AjcSpecXmlReader.getReader();
AjcSpecXmlReader.BProps[] expected
= AjcSpecXmlReader.expectedProperties();
PropertyDescriptor[] des;

Loading…
Cancel
Save