tracker issue : CF-4203263

select a category, or use search below
(searches all categories and all time range)
Title:

Improve cfdump of a java class to include more information

| View in Tracker

Status/Resolution/Reason: To Fix//BugVerified

Reporter/Name(from Bugbase): Bradley Wood / ()

Created: 08/10/2018

Components: Language

Versions: 2018

Failure Type: Usability Issue

Found In Build/Fixed In Build: /

Priority/Frequency: Normal /

Locale/System: / Platforms All

Vote Count: 1

When you cfdump a class in Lucee Server

writedump( createOBject('java', 'java.io.File' ) );

https://trycf.com/gist/205d8a450a2a0448315dab54a28ae08d/acf2018?theme=monokai

You get the following additional items that Adobe does not provide:

- Fields includes the pattern along with the name and value.  Ex:
name: separatorChar
Pattern: public static final char java.io.File.separatorChar
Value: /

- Constructors, which lists all the constructors for the class showing the method and the declared exceptions that can be thrown.  Ex:
Method: <init>(java.lang.String, java.lang.String)
Exceptions: (none) 

- "Methods inherited from <parent object>".  Ex:
wait, wait, wait, getClass, notify, notifyAll

- The list of methods includes the exceptions that can be thrown.  Ex:
Method:  toURL()
Return Type: java.net.URL
Exceptions: java.net.MalformedURLException

And additionally, I'm including this in the ticket because it's all part of how CFDump handles classes, when I run this code:

  myStr = 'myString';
  writedump( myStr.getClass() );

https://trycf.com/gist/205d8a450a2a0448315dab54a28ae08d/acf2018?theme=monokai

The resulting dump in Lucee shows the details of the "java.lang.String" class.  However, when I run that same code in Adobe CF, the dump shows me the details of the "java.lang.Class" class.  This isn't very helpful and I don't know how to dump the actual class instance since dumping myStr directly wouldn't obviously just output the string!  I think what Lucee does here is much more useful when dealing with Java objects.

Attachments:

Comments:

Crap, I copy pasted the wrong trycf.com URLs and now I can't edit the description. Can an Adobe team member please update those? The first try CF URL should have been: https://trycf.com/gist/e54f2c812cc52decbb28f2759ddfa6d9/lucee5?theme=monokai And the second trycf URL should have been: https://trycf.com/gist/c697dbf721a58a73895183574214842b/lucee5?theme=monokai
Comment by Bradley W.
29473 | August 10, 2018 06:52:41 PM GMT
+1 - CF always dumping "java.lang.Class" is especially irritating. Useful info please and thanks!
Vote by Aaron N.
29493 | August 15, 2018 04:41:58 AM GMT