eliminate some use of raw types

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1206 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
sjfink 2007-05-30 20:52:57 +00:00
parent 6f2273f48a
commit ea9c4a2f93
4 changed files with 29 additions and 20 deletions

View File

@ -1,4 +1,4 @@
#Wed May 30 11:45:21 EDT 2007
#Wed May 30 15:37:12 EDT 2007
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
@ -49,7 +49,7 @@ org.eclipse.jdt.core.compiler.problem.nullReference=ignore
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled

View File

@ -52,8 +52,8 @@ public class ExtractMatchingClasses {
matches[i] = new JarFile(match[i]);
}
for (Enumeration e = inJar.entries(); e.hasMoreElements();) {
JarEntry entry = (JarEntry) e.nextElement();
for (Enumeration<JarEntry> e = inJar.entries(); e.hasMoreElements();) {
JarEntry entry = e.nextElement();
if (matchEntry(matches, entry)) {
outJar.putNextEntry(entry);

View File

@ -191,7 +191,7 @@ public final class Util {
* "void", etc are also converted to their JVM type names.
* @throws IllegalArgumentException if c is null
*/
public static String makeType(Class c) {
public static String makeType(Class<?> c) {
if (c == null) {
throw new IllegalArgumentException("c is null");
}
@ -353,7 +353,7 @@ public final class Util {
/**
* Given a Java Method, compute the VM-style type signature.
*/
public static String computeSignature(Class[] params, Class result) {
public static String computeSignature(Class[] params, Class<?> result) {
StringBuffer buf = new StringBuffer();
buf.append("(");
for (int i = 0; i < params.length; i++) {
@ -369,7 +369,7 @@ public final class Util {
* Java Class. The field type is obtained using reflection.
* @throws IllegalArgumentException if c is null
*/
public static GetInstruction makeGet(Class c, String name) {
public static GetInstruction makeGet(Class<?> c, String name) {
if (c == null) {
throw new IllegalArgumentException("c is null");
}
@ -388,7 +388,7 @@ public final class Util {
* Java Class. The field type is obtained using reflection.
* @throws IllegalArgumentException if c is null
*/
public static PutInstruction makePut(Class c, String name) {
public static PutInstruction makePut(Class<?> c, String name) {
if (c == null) {
throw new IllegalArgumentException("c is null");
}
@ -419,11 +419,11 @@ public final class Util {
}
}
public static Method findMethod(Class c, String name) {
public static Method findMethod(Class<?> c, String name) {
return findMethod(c, name, null);
}
public static Method findMethod(Class c, String name, Class[] paramTypes) {
public static Method findMethod(Class<?> c, String name, Class[] paramTypes) {
if (c == null) {
throw new IllegalArgumentException("c is null");
}
@ -447,7 +447,7 @@ public final class Util {
* information is obtained using reflection.
* @throws IllegalArgumentException if name is null
*/
public static InvokeInstruction makeInvoke(Class c, String name, Class[] paramTypes) {
public static InvokeInstruction makeInvoke(Class<?> c, String name, Class[] paramTypes) {
if (name == null) {
throw new IllegalArgumentException("name is null");
}
@ -456,7 +456,7 @@ public final class Util {
if (name.equals("<init>")) {
Constructor[] cs = c.getConstructors();
for (int i = 0; i < cs.length; i++) {
Constructor con = cs[i];
Constructor<?> con = cs[i];
if (paramTypes == null || Arrays.equals(con.getParameterTypes(), paramTypes)) {
if (result != null) {
throw new IllegalArgumentException("Constructor " + makeName(name, paramTypes) + " is ambiguous in class " + c);
@ -490,10 +490,8 @@ public final class Util {
* Method information is obtained using reflection. If there is more than one
* method with the given name, an error will be thrown.
* @throws IllegalArgumentException if name is null
* @throws IllegalArgumentException if name is null
* @throws IllegalArgumentException if name is null
*/
public static InvokeInstruction makeInvoke(Class c, String name) {
public static InvokeInstruction makeInvoke(Class<?> c, String name) {
return makeInvoke(c, name, null);
}

View File

@ -36,15 +36,21 @@ import java.util.zip.ZipEntry;
*/
public abstract class OfflineInstrumenterBase {
private int inputIndex;
private HashSet<String> entryNames = new HashSet<String>();
private ArrayList<Input> inputs = new ArrayList<Input>();
private BitSet ignoringInputs = new BitSet();
private File outputFile;
private boolean passUnmodifiedClasses = false;
private JarOutputStream outputJar;
private JarFile cachedJar;
private File cachedJarFile;
private ManifestBuilder manifestBuilder;
@ -106,6 +112,7 @@ public abstract class OfflineInstrumenterBase {
*/
final class JarInput extends Input {
private File file;
private String name;
/**
@ -206,8 +213,8 @@ public abstract class OfflineInstrumenterBase {
*/
final public void addInputJar(File f) throws IOException {
JarFile jf = new JarFile(f);
for (Enumeration e = jf.entries(); e.hasMoreElements();) {
JarEntry entry = (JarEntry) e.nextElement();
for (Enumeration<JarEntry> e = jf.entries(); e.hasMoreElements();) {
JarEntry entry = e.nextElement();
if (!entry.isDirectory()) {
String name = entry.getName();
inputs.add(new JarInput(f, name));
@ -233,7 +240,9 @@ public abstract class OfflineInstrumenterBase {
/**
* Add a directory containing class files to instrument. All subdirectories
* are also scanned.
* @throws IllegalArgumentException if d is null
*
* @throws IllegalArgumentException
* if d is null
*/
final public void addInputDirectory(File d) throws IOException, IllegalArgumentException {
if (d == null) {
@ -261,7 +270,9 @@ public abstract class OfflineInstrumenterBase {
* Add something to instrument --- the name of a JAR file, a class file, a
* directory or an entry within a jar file (as filename#entryname). If we
* can't identify it, nothing is added and we return false.
* @throws IllegalArgumentException if a is null
*
* @throws IllegalArgumentException
* if a is null
*/
final public boolean addInputElement(String a) throws IOException {
if (a == null) {
@ -519,7 +530,7 @@ public abstract class OfflineInstrumenterBase {
* entry to the JAR file *after* the unmodified classes. This will only ever
* be called once per output JAR.
*/
final public void writeUnmodifiedClasses() throws IOException, IllegalStateException {
final public void writeUnmodifiedClasses() throws IOException, IllegalStateException {
passUnmodifiedClasses = false;
makeOutputJar();
for (int i = 0; i < inputs.size(); i++) {