Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntelliJ build fails #31

Closed
ennerf opened this issue May 25, 2023 · 2 comments
Closed

IntelliJ build fails #31

ennerf opened this issue May 25, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ennerf
Copy link

ennerf commented May 25, 2023

I can generate the fxml code via maven, but when I execute it from IntelliJ the recompile fails due to IDProperty being an internal class:

image

Do you know of a way to fix that? I tried the usual opens/exports args, but apparently those don't have an effect when used as a compilerArgs. IDProperty seems like a rarely used feature - can you maybe wrap it in a try catch block to not break in the 99% case?

@Paullo612
Copy link
Owner

I cannot say that it's rarely used, because javafx.scene.Node is annotated with it. Cannot reproduce this, but, the fix is likely to change class reference to string constant here.

Can you please try following patch and say whether the issue is gone?

Subject: [PATCH] Fix IDProperty
---
Index: compiler/compiler-core/src/main/java/io/github/paullo612/mlfx/compiler/elements/IdentifiableFXMLElement.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/compiler/compiler-core/src/main/java/io/github/paullo612/mlfx/compiler/elements/IdentifiableFXMLElement.java b/compiler/compiler-core/src/main/java/io/github/paullo612/mlfx/compiler/elements/IdentifiableFXMLElement.java
--- a/compiler/compiler-core/src/main/java/io/github/paullo612/mlfx/compiler/elements/IdentifiableFXMLElement.java	(revision 5beb9dfa07fe1f831af24a801bbd669cd58f8e89)
+++ b/compiler/compiler-core/src/main/java/io/github/paullo612/mlfx/compiler/elements/IdentifiableFXMLElement.java	(date 1685017964561)
@@ -77,7 +77,7 @@
     private void setIdProperty(CompilerContext context, String id) {
         ClassElement classElement = getClassElement();
 
-        AnnotationValue<IDProperty> annotation = classElement.getAnnotation(IDProperty.class);
+        AnnotationValue<IDProperty> annotation = classElement.getAnnotation("com.sun.javafx.beans.IDProperty");
 
         if (annotation == null) {
             // No ID property present, noting to do here.

@ennerf
Copy link
Author

ennerf commented May 25, 2023

Yes, that fixed the build. IntelliJ also complains about the import, so maybe also get rid of the unnecessary generics reference

AnnotationValue<? extends Annotation> annotation = classElement.getAnnotation("com.sun.javafx.beans.IDProperty");

@Paullo612 Paullo612 self-assigned this May 25, 2023
@Paullo612 Paullo612 added the bug Something isn't working label May 25, 2023
Paullo612 added a commit that referenced this issue May 25, 2023
Using those packages may cause illegal access errors with modularized
javac.

Task-number: #31
Paullo612 added a commit that referenced this issue May 25, 2023
Using those packages may cause illegal access errors with modularized
javac.

Task-number: #31
Paullo612 added a commit that referenced this issue May 25, 2023
Using those packages may cause illegal access errors with modularized
javac.

Task-number: #31
Paullo612 added a commit that referenced this issue May 25, 2023
Using those packages may cause illegal access errors with modularized
javac.

Task-number: #31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants