Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Importing javax.javaeeapi inside imported module causes late value to return null #7440

Open
fill0llif opened this issue Dec 3, 2018 · 0 comments

Comments

@fill0llif
Copy link

As the title says, importing javax.javaeeapi inside imported module causes late value to return null. From the follwing case you can actually see the anonymous method isn't even called and if you remove the javax.javaeeapi import it works again printing the value.

Test project:

  • module.ceylon:
native("jvm")
module test "1.0.0" {
	import javax.javaeeapi "7.0";
	shared import java.desktop "8";
}
  • LateValue.ceylon:
shared final class LateValue<Type>(Type construct()) {
	shared late Type val = (() {
		print("about to retrieve value from generator");
		value result = construct();
		print("returning value = '``result else "null"``' from generator");
		return result;
	})();
}

Test2 project:

  • module.ceylon:
native("jvm")
module test2 "1.0.0" {
	shared import test "1.0.0";
}
  • run.ceylon:
import javax.swing {
	JFrame
}
import test {
	LateValue
}
JFrame f() => JFrame();
shared void run() {
	value lv = LateValue(`function f`.apply<JFrame, []>());
	print("value = '``lv.val else "null"``'");
}

This is what get printed:

value = 'null'

and removing the javax.javaeeapi import:

about to retrieve value from generator
returning value = 'javax.swing.JFrame[frame0,0,0,0x0,invalid,hidden,layout=java.awt.BorderLayout,title=,resizable,normal,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,0,0x0,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]' from generator
value = 'javax.swing.JFrame[frame0,0,0,0x0,invalid,hidden,layout=java.awt.BorderLayout,title=,resizable,normal,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,0,0x0,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]'
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants