45 lines
659 B
Plaintext
45 lines
659 B
Plaintext
|
public class Bug307 {
|
||
|
public void main() {
|
||
|
IVisitor v = new Visitor();
|
||
|
Impl2 f = new Impl2();
|
||
|
|
||
|
f.accept(v);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
interface IVisitor {
|
||
|
void visit(Impl1 f);
|
||
|
void visit(Impl2 fb);
|
||
|
}
|
||
|
|
||
|
interface IAcceptor {
|
||
|
void accept(IVisitor v);
|
||
|
}
|
||
|
|
||
|
class Visitor implements IVisitor {
|
||
|
|
||
|
@Override
|
||
|
public void visit(Impl1 f) {
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void visit(Impl2 fb) {
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class Impl1 implements IAcceptor {
|
||
|
|
||
|
@Override
|
||
|
public void accept(IVisitor v) {
|
||
|
v.visit(this);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class Impl2 implements IAcceptor {
|
||
|
|
||
|
@Override
|
||
|
public void accept(IVisitor v) {
|
||
|
v.visit(this);
|
||
|
}
|
||
|
}
|