Generics overkill in visitor pattern
问题 I am working on a project where I am converting an old java 1.2 code written ten years ago to java 7. That project heavily (over)uses a particular visitor. To keep things conceptually simple, lets say that the visitor is something like this: public interface RobotVisitor { public Object visitHead(Head p, Object arg); public Object visitNeck(Neck p, Object arg); public Object visitShoulder(Shoulder p, Object arg); public Object visitArm(Arm p, Object arg); public Object visitHand(Hand p,