public MethodVisitor visitMethod(int arg0, String arg1, String arg2, String arg3, String[] arg4) { return new EmptyVisitor(); }
int line; public AppMethodVisitor() { super(new EmptyVisitor()); } public String methodDesc; public AppClassVisitor() { super(new EmptyVisitor()); }
final ClassVisitor inner = new EmptyVisitor(); final RemappingClassAdapter visitor = new RemappingClassAdapter(inner, remapper);
public DependencyVisitor() { super(new EmptyVisitor()); }
public MethodVisitor visitMethod(int access, String methodName, String desc, String signature, String[] exceptions) { if (methodName.equals("<init>") && desc.equals(md)) return new EmptyVisitor() { @Override public void visitLocalVariable(String name, String desc, String signature, Label start, Label end, int index) { if (index>0) // 0 is 'this' localVars.put(index, name); } }; else return null; // ignore this method } }, false);
@Override public MethodVisitor visitMethod(int access, String methodName, String desc, String signature, String[] exceptions) { if (methodName.equals(m.getName()) && desc.equals(md)) return new EmptyVisitor() { @Override public void visitLocalVariable(String name, String desc, String signature, Label start, Label end, int index) { if (index >= limit) localVars.put(index, name); } }; else return null; // ignore this method } }, false);
super(new EmptyVisitor());
mv.visitMaxs(1, 1); mv.visitEnd(); return new EmptyVisitor(); } else { return super.visitMethod(access, name, desc, signature, exceptions);
ClassReader classReader = new ClassReader(classFileStream); classReader.accept( new EmptyVisitor() { @Override public MethodVisitor visitMethod(int access, final String name, final String desc, String signature, String[] exceptions) { return new EmptyVisitor() { @Override public void visitLineNumber(int line, Label start) {
return new EmptyVisitor();
reader.accept(new ClassAdapter(new EmptyVisitor()) { @Override public MethodVisitor visitMethod(final int access, final String name, final String desc, final String signature, final String[] exceptions) { return new MethodAdapter(new EmptyVisitor()) { @Override public void visitMethodInsn(int opcode, String owner, String nameCode, String descCode) {
public void run() { Cursor oldCursor = getTopLevelAncestor().getCursor(); getTopLevelAncestor().setCursor( Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); try { status.setText("Running"); RetroWeaver weaver = new RetroWeaver(version); messages.setText(""); weaver.setListener(RetroWeaverGui.this); String refCp = refClassPath.getText(); if (refCp.length() != 0) { java.util.List<String> classpath = new ArrayList<String>(); StringTokenizer st = new StringTokenizer(refCp, File.pathSeparator); while (st.hasMoreTokens()) { classpath.add(st.nextToken()); } RefVerifier verifier = new RefVerifier(version, new EmptyVisitor(), classpath, RetroWeaverGui.this); weaver.setVerifier(verifier); } weaver.weave(path); status.setText("Done"); } catch (Exception ex) { status.setText("Error: " + ex.getMessage()); } finally { getTopLevelAncestor().setCursor(oldCursor); } } });
paths.add(st.nextToken()); RefVerifier rv = new RefVerifier(target, new EmptyVisitor(), paths, new RefVerifier.DefaultListener(verbose)); weaver.setVerifier(rv);
public void test1() throws Throwable { // call a class that's only available on DummyClassLoader, so that on the remote channel // it will be fetched from this class loader and not from the system classloader. Callable c = (Callable) DummyClassLoader.apply(TestCallable.class); Object[] r = (Object[]) channel.call(c); System.out.println(r[0]); assertTrue(r[0].toString().startsWith("hudson.remoting.RemoteClassLoader@")); // make sure the bytes are what we are expecting System.out.println("Resource is "+((byte[])r[1]).length+" bytes"); ClassReader cr = new ClassReader((byte[])r[1]); cr.accept(new EmptyVisitor(),false); // make sure cache is taking effect System.out.println(r[2]); System.out.println(r[3]); assertEquals(r[2],r[3]); }