306422: Another code cleanup patch
http://forge.objectweb.org/tracker/?group_id=23&func=detail&atid=100023&aid=306422
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
index 6577f59..5b97d00 100644
--- a/.settings/org.eclipse.jdt.core.prefs
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Sun Apr 09 11:53:48 CEST 2006
+#Wed Nov 22 00:15:09 EST 2006
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
@@ -28,6 +28,7 @@
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
diff --git a/src/org/objectweb/asm/ClassWriter.java b/src/org/objectweb/asm/ClassWriter.java
index 73ba0d0..62c501d 100644
--- a/src/org/objectweb/asm/ClassWriter.java
+++ b/src/org/objectweb/asm/ClassWriter.java
@@ -153,7 +153,7 @@
/**
* The instruction types of all JVM opcodes.
*/
- static byte[] TYPE;
+ final static byte[] TYPE;
/**
* The type of CONSTANT_Class constant pool items.
diff --git a/src/org/objectweb/asm/tree/analysis/Analyzer.java b/src/org/objectweb/asm/tree/analysis/Analyzer.java
index 186e835..65817cd 100644
--- a/src/org/objectweb/asm/tree/analysis/Analyzer.java
+++ b/src/org/objectweb/asm/tree/analysis/Analyzer.java
@@ -131,7 +131,7 @@
List subroutineCalls = new ArrayList();
Map subroutineHeads = new HashMap();
findSubroutine(0, main, subroutineCalls);
- while (subroutineCalls.size() > 0) {
+ while (!subroutineCalls.isEmpty()) {
JumpInsnNode jsr = (JumpInsnNode) subroutineCalls.remove(0);
Subroutine sub = (Subroutine) subroutineHeads.get(jsr.label);
if (sub == null) {
diff --git a/src/org/objectweb/asm/xml/ASMContentHandler.java b/src/org/objectweb/asm/xml/ASMContentHandler.java
index ed34792..facb85c 100644
--- a/src/org/objectweb/asm/xml/ASMContentHandler.java
+++ b/src/org/objectweb/asm/xml/ASMContentHandler.java
@@ -53,10 +53,10 @@
* A {@link org.xml.sax.ContentHandler ContentHandler} that transforms XML
* document into Java class file. This class can be feeded by any kind of SAX
* 2.0 event producers, e.g. XML parser, XSLT or XPath engines, or custom code.
- *
+ *
* @see org.objectweb.asm.xml.SAXClassAdapter
* @see org.objectweb.asm.xml.Processor
- *
+ *
* @author Eugene Kuleshov
*/
public class ASMContentHandler extends DefaultHandler implements Opcodes {
@@ -329,7 +329,7 @@
/**
* Constructs a new {@link ASMContentHandler ASMContentHandler} object.
- *
+ *
* @param os output stream to write generated class.
* @param computeMax <tt>true</tt> if the maximum stack size and the
* maximum number of local variables must be automatically computed.
@@ -343,7 +343,7 @@
/**
* Returns the bytecode of the class that was build with underneath class
* writer.
- *
+ *
* @return the bytecode of the class that was build with underneath class
* writer or null if there are no classwriter created.
*/
@@ -353,7 +353,7 @@
/**
* Process notification of the start of an XML element being reached.
- *
+ *
* @param ns - The Namespace URI, or the empty string if the element has no
* Namespace URI or if Namespace processing is not being performed.
* @param lName - The local name (without prefix), or the empty string if
@@ -391,14 +391,14 @@
/**
* Process notification of the end of an XML element being reached.
- *
+ *
* @param ns - The Namespace URI, or the empty string if the element has no
* Namespace URI or if Namespace processing is not being performed.
* @param lName - The local name (without prefix), or the empty string if
* Namespace processing is not being performed.
* @param qName - The qualified XML 1.0 name (with prefix), or the empty
* string if qualified names are not available.
- *
+ *
* @exception SAXException if a parsing error is to be reported
*/
public final void endElement(
@@ -428,7 +428,7 @@
/**
* Process notification of the end of a document and write generated
* bytecode into output stream.
- *
+ *
* @exception SAXException if parsing or writing error is to be reported.
*/
public final void endDocument() throws SAXException {
@@ -442,26 +442,28 @@
/**
* Return the top object on the stack without removing it. If there are no
* objects on the stack, return <code>null</code>.
- *
+ *
* @return the top object on the stack without removing it.
*/
final Object peek() {
- return stack.size() == 0 ? null : stack.get(stack.size() - 1);
+ int size = stack.size();
+ return size == 0 ? null : stack.get(size - 1);
}
/**
* Pop the top object off of the stack, and return it. If there are no
* objects on the stack, return <code>null</code>.
- *
+ *
* @return the top object off of the stack.
*/
final Object pop() {
- return stack.size() == 0 ? null : stack.remove(stack.size() - 1);
+ int size = stack.size();
+ return size == 0 ? null : stack.remove(size - 1);
}
/**
* Push a new object onto the top of the object stack.
- *
+ *
* @param object The new object
*/
final void push(final Object object) {
diff --git a/src/org/objectweb/asm/xml/SAXCodeAdapter.java b/src/org/objectweb/asm/xml/SAXCodeAdapter.java
index 38aa753..f0f8538 100644
--- a/src/org/objectweb/asm/xml/SAXCodeAdapter.java
+++ b/src/org/objectweb/asm/xml/SAXCodeAdapter.java
@@ -53,7 +53,7 @@
*/
public final class SAXCodeAdapter extends SAXAdapter implements MethodVisitor {
- static String[] TYPES = {
+ final static String[] TYPES = {
"top",
"int",
"float",
diff --git a/test/conform/org/objectweb/asm/util/TraceSignatureVisitorUnitTest.java b/test/conform/org/objectweb/asm/util/TraceSignatureVisitorUnitTest.java
index 2f3e459..4740960 100644
--- a/test/conform/org/objectweb/asm/util/TraceSignatureVisitorUnitTest.java
+++ b/test/conform/org/objectweb/asm/util/TraceSignatureVisitorUnitTest.java
@@ -44,7 +44,7 @@
*/
public class TraceSignatureVisitorUnitTest extends TestCase {
- public static String[] DATA = {
+ public final static String[] DATA = {
"C|E|<E extends java.lang.Enum<E>> implements java.lang.Comparable<E>, java.io.Serializable"
+ "|<E:Ljava/lang/Enum<TE;>;>Ljava/lang/Object;Ljava/lang/Comparable<TE;>;Ljava/io/Serializable;",