Fence Java code properly.