compiler, java. Removed static fields/methods from generated code, fixed #306.