Skip to content

Commit

Permalink
Correct whitespace in ASMTransformer.java.
Browse files Browse the repository at this point in the history
Let's stick to 2 spaces for indentation (and no tabs).
  • Loading branch information
gkossakowski authored and paulp committed Jan 24, 2013
1 parent f2e45fc commit 0a967e1
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions src/partest/scala/tools/partest/javaagent/ASMTransformer.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -28,33 +28,33 @@ private boolean shouldTransform(String className) {


public byte[] transform(final ClassLoader classLoader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) { public byte[] transform(final ClassLoader classLoader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) {
if (shouldTransform(className)) { if (shouldTransform(className)) {
ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS) { ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS) {
// this is copied verbatim from the superclass, // this is copied verbatim from the superclass,
// except that we use the outer class loader // except that we use the outer class loader
@Override protected String getCommonSuperClass(final String type1, final String type2) { @Override protected String getCommonSuperClass(final String type1, final String type2) {
Class<?> c, d; Class<?> c, d;
try { try {
c = Class.forName(type1.replace('/', '.'), false, classLoader); c = Class.forName(type1.replace('/', '.'), false, classLoader);
d = Class.forName(type2.replace('/', '.'), false, classLoader); d = Class.forName(type2.replace('/', '.'), false, classLoader);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e.toString()); throw new RuntimeException(e.toString());
} }
if (c.isAssignableFrom(d)) { if (c.isAssignableFrom(d)) {
return type1; return type1;
} }
if (d.isAssignableFrom(c)) { if (d.isAssignableFrom(c)) {
return type2; return type2;
} }
if (c.isInterface() || d.isInterface()) { if (c.isInterface() || d.isInterface()) {
return "java/lang/Object"; return "java/lang/Object";
} else { } else {
do { do {
c = c.getSuperclass(); c = c.getSuperclass();
} while (!c.isAssignableFrom(d)); } while (!c.isAssignableFrom(d));
return c.getName().replace('.', '/'); return c.getName().replace('.', '/');
} }
} }
}; };
ProfilerVisitor visitor = new ProfilerVisitor(writer); ProfilerVisitor visitor = new ProfilerVisitor(writer);
ClassReader reader = new ClassReader(classfileBuffer); ClassReader reader = new ClassReader(classfileBuffer);
reader.accept(visitor, 0); reader.accept(visitor, 0);
Expand Down

0 comments on commit 0a967e1

Please sign in to comment.