tracker issue : CF-4201768

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

Cannot execute certain methods

| View in Tracker

Status/Resolution/Reason: To Fix/Withdrawn/EnhancementRequired

Reporter/Name(from Bugbase): Luis Majano / ()

Created: 03/28/2018

Components: Java Integration

Versions: 2016

Failure Type: Others

Found In Build/Fixed In Build: all /

Priority/Frequency: Normal /

Locale/System: / Linux All

Vote Count: 8

Problem Description:

There is tremendous inconsistency the way that java objects are used in CF and makes java interop basically null.

When creating certain direct java classes and calling methods on it, those methods seem to be lost and not executable.  Which goes against the JDK spec.  Below are several examples:

variables.longStream    = createObject( "java", "java.util.stream.LongStream" );
variables.jStream = variables.longStream.range( 
            javaCast( "long", arguments.start ), 
            javaCast( "long", arguments.end ) 
        );


var stream = createObject( "java", "java.util.stream.Stream" ).empty();```


createObject("java", "java.lang.String").init( "luis" ).chars()


I am not sure why, but they work as they should in lucee.

Attachments:

Comments:

Cannnot execute native methods on Java instances
Comment by Luis M.
26212 | March 28, 2018 07:33:07 PM GMT
Yep, please allow full access to underlying Java class instances.
Vote by Bradley W.
26213 | March 28, 2018 07:34:29 PM GMT
Important.
Vote by Evagoras C.
26409 | March 29, 2018 08:21:52 AM GMT
Related tickets: https://tracker.adobe.com/#/view/CF-4199987 https://tracker.adobe.com/#/view/CF-4187705
Comment by John W.
26408 | March 29, 2018 10:44:59 AM GMT
This has been raised in the past so please fix it! Related tickets: https://tracker.adobe.com/#/view/CF-4199987 https://tracker.adobe.com/#/view/CF-4187705
Vote by John W.
26410 | March 29, 2018 10:46:05 AM GMT
Not a Bug. The java artifacts ( java.util.stream.LongStream and java.util.stream.Stream) in the example mentioned in the bug are interfaces. You can't create an object of an interface or abstract class.
Comment by Vijay M.
27654 | April 20, 2018 09:33:28 AM GMT
How is this "not a bug"? Adobe, when you close a ticket, please *always* give feedback as to what was done / not done / rationale for yer action.
Comment by Adam C.
27643 | May 02, 2018 08:24:17 AM GMT
Java8 introduced the support for having static methods in interface. CF today doesn't support invoking java interface methods. This will be an ER.
Comment by Vijay M.
27655 | May 02, 2018 10:04:53 AM GMT
+1 - Methods must be callable. Basic stuff?
Vote by Aaron N.
27645 | May 02, 2018 10:45:26 AM GMT
Adobe, when you close a ticket, please *always* give feedback as to what was done / not done / rationale for yer action. This ^^ ..sounds like an echo Thanks!, -Aaron
Comment by Aaron N.
27644 | May 02, 2018 10:50:08 AM GMT