Commit 7ca1b9eb authored by ekuleshov's avatar ekuleshov
Browse files

fixed issue with SourceDebugExtension attribute

parent 837657f5
......@@ -556,8 +556,7 @@ public class ClassWriter implements ClassVisitor {
sourceFile = newUTF8(file);
}
if (debug != null) {
sourceDebug = new ByteVector();
sourceDebug.putUTF8(debug);
sourceDebug = new ByteVector().putUTF8(debug);
}
}
......@@ -676,7 +675,7 @@ public class ClassWriter implements ClassVisitor {
}
if (sourceDebug != null) {
++attributeCount;
size += sourceDebug.length;
size += sourceDebug.length + 4;
newUTF8("SourceDebugExtension");
}
if (enclosingMethodOwner != 0) {
......@@ -758,9 +757,9 @@ public class ClassWriter implements ClassVisitor {
out.putShort(newUTF8("SourceFile")).putInt(2).putShort(sourceFile);
}
if (sourceDebug != null) {
int len = sourceDebug.length;
int len = sourceDebug.length - 2;
out.putShort(newUTF8("SourceDebugExtension")).putInt(len);
out.putByteArray(sourceDebug.data, 0, len);
out.putByteArray(sourceDebug.data, 2, len);
}
if (enclosingMethodOwner != 0) {
out.putShort(newUTF8("EnclosingMethod")).putInt(4);
......
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