diff --git a/core/codegen/javagen/src/main/java/org/overture/codegen/vdm2java/JavaCodeGen.java b/core/codegen/javagen/src/main/java/org/overture/codegen/vdm2java/JavaCodeGen.java
index <HASH>..<HASH> 100644
--- a/core/codegen/javagen/src/main/java/org/overture/codegen/vdm2java/JavaCodeGen.java
+++ b/core/codegen/javagen/src/main/java/org/overture/codegen/vdm2java/JavaCodeGen.java
@@ -255,7 +255,7 @@ public class JavaCodeGen extends CodeGenBase implements IJavaQouteEventCoordinat
 			{
 				try
 				{
-					if (!isTestCase(status))
+					if (!getInfo().getDeclAssistant().isLibraryName(status.getIrNodeName()))
 					{
 						generator.applyPartialTransformation(status, trans);
 					}
Fix to Java code generator: only transform non-library modules/classes