Smart modules for Java-like languages