Skip to content

Commit

Permalink
Do not use API from com.sun.* packages in compiler implementation
Browse files Browse the repository at this point in the history
Using those packages may cause illegal access errors with modularized
javac.

Task-number: #31
  • Loading branch information
Paullo612 committed May 25, 2023
1 parent 020721b commit 78a990a
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package io.github.paullo612.mlfx.compiler.elements;

import com.sun.javafx.beans.IDProperty;
import io.github.paullo612.mlfx.compiler.CompilerContext;
import io.github.paullo612.mlfx.compiler.ProcessingInstructions;
import io.github.paullo612.mlfx.expression.ExpressionContext;
Expand All @@ -30,6 +29,8 @@
// FXML element that can be identified. Can have id assigned, so, can be referenced anywhere in FXML file.
abstract class IdentifiableFXMLElement extends LoadableFXMLElement<FXMLElement<?>> {

private static final String ID_PROPERTY_ANNOTATION = "com.sun.javafx.beans.IDProperty";

private int slot = -1;
private boolean hasId;

Expand Down Expand Up @@ -77,10 +78,10 @@ private void doSetIdProperty(CompilerContext context, String id, MethodElement s
private void setIdProperty(CompilerContext context, String id) {
ClassElement classElement = getClassElement();

AnnotationValue<IDProperty> annotation = classElement.getAnnotation(IDProperty.class);
AnnotationValue<?> annotation = classElement.getAnnotation(ID_PROPERTY_ANNOTATION);

if (annotation == null) {
// No ID property present, noting to do here.
// No ID property present, nothing to do here.
return;
}

Expand Down

0 comments on commit 78a990a

Please sign in to comment.