diff --git a/engine/src/main/java/org/pentaho/di/trans/TransMeta.java b/engine/src/main/java/org/pentaho/di/trans/TransMeta.java index 46eb75c01e7f..fef38f5698ca 100644 --- a/engine/src/main/java/org/pentaho/di/trans/TransMeta.java +++ b/engine/src/main/java/org/pentaho/di/trans/TransMeta.java @@ -2786,7 +2786,7 @@ public TransMeta( String fname, IMetaStore metaStore, Repository rep, boolean se Document doc = null; try { if (parentVariableSpace == null ) { - parentVariableSpace = new Variables(); + parentVariableSpace = Variables.getADefaultVariableSpace(); } final FileObject transFile = KettleVFS.getFileObject( fname, parentVariableSpace ); diff --git a/engine/src/test/java/org/pentaho/di/trans/TransMetaTest.java b/engine/src/test/java/org/pentaho/di/trans/TransMetaTest.java index 3a72a7dba4a5..ec489faa2118 100644 --- a/engine/src/test/java/org/pentaho/di/trans/TransMetaTest.java +++ b/engine/src/test/java/org/pentaho/di/trans/TransMetaTest.java @@ -867,4 +867,13 @@ public void testSetInternalEntryCurrentDirectoryWithoutFilenameOrRepository( ) { assertEquals( "Original value defined at run execution", transMetaTest.getVariable( Const.INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY ) ); } + + @Test + public void testTransMetaUsingDefaultVariableSpaceWithSystemProperties() { + System.setProperty( "TransMetaTest.A_TEST_PROPERTY", "1000" ); + TransMeta transMeta = new TransMeta(); + assertEquals( "1000", transMeta.getVariable( "TransMetaTest.A_TEST_PROPERTY" ) ); + System.clearProperty( "TransMetaTest.A_TEST_PROPERTY" ); + } + }