29 Replies Latest reply: Dec 31, 2012 9:21 AM by BKBK RSS

    Checking Type of java classes created with Scala

    Kirill_Grishin Community Member

      Hi.

       

      I've created a simple class in Scala and packed it into a .jar file. I have no problems loading it into ColdFusion and running its methods.

       

      Here is a copy of cfdump of the created object:

       

      object of example.HelloWorld
      Class Nameexample.HelloWorld
      MethodsMethodReturn Type
      Country()example.HelloWorld$Country$
      cn()example.HelloWorld$Country
      countriesList()scala.collection.immutable.List
      countriesMap()scala.collection.immutable.Map
      getCountryByCode(java.lang.String)scala.Option
      ja()example.HelloWorld$Country
      ru()example.HelloWorld$Country
      us()example.HelloWorld$Country

       

      But I have problems with isInstanceOf function with this object. If I run:

       

      HelloWorldApp = CreateObject("java","example.HelloWorld");

      writeOutput(isInstanceOf(HelloWorldApp,"example.HelloWorld"));

       

      I get false as a result, but it should be true, right? The class does get loaded properly by CreateObject function.

       

      Is there a workaround? The cfdump tag somehow manages to get the proper type of the object which it displays in the Class Name field of the dump table.

       

      Thank you.