Skip to content

Commit 5955d8c

Browse files
authored
Merge pull request #13 from coldbox-modules/patch/Boxlang-Compat
Boxlang compat
2 parents 389d615 + b678d74 commit 5955d8c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

models/javaloader/JavaLoader.cfc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,15 @@
114114
<cfargument name="className" hint="The name of the class to create" type="string" required="Yes">
115115
<cfscript>
116116
try {
117-
// do this in one line just for speed.
118-
return createJavaProxy( getURLClassLoader().loadClass( arguments.className ) );
117+
if ( server.keyExists( "boxlang" ) ) {
118+
// Boxlang's Dynamic object class handles all of our needs - we just need to retrieve the class through the module classloader
119+
return createObject( "java", "ortus.boxlang.runtime.interop.DynamicObject" ).of(
120+
getURLClassLoader().loadClass( arguments.className )
121+
);
122+
} else {
123+
// do this in one line just for speed.
124+
return createJavaProxy( getURLClassLoader().loadClass( arguments.className ) );
125+
}
119126
} catch ( java.lang.ClassNotFoundException exc ) {
120127
throwException(
121128
"javaloader.ClassNotFoundException",

0 commit comments

Comments
 (0)