Commit 07d1b647 authored by ekuleshov's avatar ekuleshov
Browse files

issues around null values

[[Split portion of a mixed commit.]]
parent 140bee8b
......@@ -215,7 +215,7 @@ public class CheckClassAdapter extends ClassAdapter {
+ Opcodes.ACC_ANNOTATION + Opcodes.ACC_ENUM
+ Opcodes.ACC_DEPRECATED);
CheckMethodAdapter.checkInternalName(name, "class name");
if (name.equals("java/lang/Object")) {
if ("java/lang/Object".equals(name)) {
if (superName != null) {
throw new IllegalArgumentException("The super class name of the Object class must be 'null'");
}
......@@ -226,7 +226,7 @@ public class CheckClassAdapter extends ClassAdapter {
// TODO
}
if ((access & Opcodes.ACC_INTERFACE) != 0) {
if (!superName.equals("java/lang/Object")) {
if (!"java/lang/Object".equals(superName)) {
throw new IllegalArgumentException("The super class name of interfaces must be 'java/lang/Object'");
}
}
......
......@@ -286,11 +286,7 @@ public class TraceMethodVisitor extends TraceAbstractVisitor implements
buf.setLength(0);
buf.append(tab2).append("LDC ");
if (cst instanceof String) {
if (cst == null) {
buf.append("null");
} else if (cst instanceof String) {
AbstractVisitor.appendString(buf, (String) cst);
}
AbstractVisitor.appendString(buf, (String) cst);
} else if (cst instanceof Type) {
buf.append(((Type) cst).getDescriptor() + ".class");
} else {
......@@ -479,7 +475,7 @@ public class TraceMethodVisitor extends TraceAbstractVisitor implements
*
* @param l a label.
*/
protected void appendLabel(final Label l) {
public void appendLabel(final Label l) {
String name = (String) labelNames.get(l);
if (name == null) {
name = "L" + labelNames.size();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment