Recently I experienced that is a Robot instance is created already and if try to create it again (obviously without calling robot.cleanUp()) it hangs there forever. I investigated this and got to know that it takes a ScreenLock every time we create a Robot instance.
So my question is this kind of behaviour can be achieved by Singleton class. Then why we are allowed to create another Robot instance although it is a deadlock situation. I mean if I am to Create Robot, clean it up and create again then why should I clean and recreate it in the first place? There should be one API which will provide Robot instance upon user request because current approach does not make sense.