diff --git a/modules/javafx.fxml/src/main/java/com/sun/javafx/fxml/FXMLLoaderHelper.java b/modules/javafx.fxml/src/main/java/com/sun/javafx/fxml/FXMLLoaderHelper.java deleted file mode 100644 index 7d54103fce..0000000000 --- a/modules/javafx.fxml/src/main/java/com/sun/javafx/fxml/FXMLLoaderHelper.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.javafx.fxml; - -import com.sun.javafx.util.Utils; -import javafx.fxml.FXMLLoader; - -/** - * Used to access internal FXMLLoader methods. - */ -public class FXMLLoaderHelper { - private static FXMLLoaderAccessor fxmlLoaderAccessor; - - static { - Utils.forceInit(FXMLLoader.class); - } - - private FXMLLoaderHelper() { - } - - public static void setStaticLoad(FXMLLoader fxmlLoader, boolean staticLoad) { - fxmlLoaderAccessor.setStaticLoad(fxmlLoader, staticLoad); - } - - public static void setFXMLLoaderAccessor(final FXMLLoaderAccessor newAccessor) { - if (fxmlLoaderAccessor != null) { - throw new IllegalStateException(); - } - - fxmlLoaderAccessor = newAccessor; - } - - public interface FXMLLoaderAccessor { - void setStaticLoad(FXMLLoader fxmlLoader, boolean staticLoad); - } -} diff --git a/modules/javafx.fxml/src/main/java/javafx/fxml/FXMLLoader.java b/modules/javafx.fxml/src/main/java/javafx/fxml/FXMLLoader.java index 3569849324..f3ba0759d9 100644 --- a/modules/javafx.fxml/src/main/java/javafx/fxml/FXMLLoader.java +++ b/modules/javafx.fxml/src/main/java/javafx/fxml/FXMLLoader.java @@ -82,7 +82,6 @@ import com.sun.javafx.fxml.expression.ExpressionValue; import com.sun.javafx.fxml.expression.KeyPath; import static com.sun.javafx.FXPermissions.MODIFY_FXML_CLASS_LOADER_PERMISSION; -import com.sun.javafx.fxml.FXMLLoaderHelper; import com.sun.javafx.fxml.MethodHelper; import java.net.MalformedURLException; import java.security.AccessController; @@ -312,7 +311,7 @@ public void processPropertyAttribute(Attribute attribute) throws IOException { throw constructLoadException("Cannot bind to builder property."); } - if (!isStaticLoad()) { + if (!staticLoad) { value = value.substring(BINDING_EXPRESSION_PREFIX.length(), value.length() - 1); expression = Expression.valueOf(value); @@ -2052,13 +2051,6 @@ public String run() { return System.getProperty("javafx.version"); } }); - - FXMLLoaderHelper.setFXMLLoaderAccessor(new FXMLLoaderHelper.FXMLLoaderAccessor() { - @Override - public void setStaticLoad(FXMLLoader fxmlLoader, boolean staticLoad) { - fxmlLoader.setStaticLoad(staticLoad); - } - }); } /** @@ -2378,21 +2370,22 @@ public void setClassLoader(ClassLoader classLoader) { clearImports(); } - /* + /** * Returns the static load flag. + * + * @since 11 */ - boolean isStaticLoad() { - // SB-dependency: RT-21226 has been filed to track this + public final boolean isStaticLoad() { return staticLoad; } - /* + /** * Sets the static load flag. * - * @param staticLoad + * @param staticLoad The value for the static load flag + * @since 11 */ - void setStaticLoad(boolean staticLoad) { - // SB-dependency: RT-21226 has been filed to track this + public final void setStaticLoad(boolean staticLoad) { this.staticLoad = staticLoad; } diff --git a/modules/javafx.fxml/src/test/java/test/javafx/fxml/FXMLLoader_ScriptTest.java b/modules/javafx.fxml/src/test/java/test/javafx/fxml/FXMLLoader_ScriptTest.java index 7f98351b7a..7664798fc7 100644 --- a/modules/javafx.fxml/src/test/java/test/javafx/fxml/FXMLLoader_ScriptTest.java +++ b/modules/javafx.fxml/src/test/java/test/javafx/fxml/FXMLLoader_ScriptTest.java @@ -24,7 +24,6 @@ * questions. */ -import com.sun.javafx.fxml.FXMLLoaderHelper; import org.junit.Test; import java.io.IOException; @@ -39,7 +38,7 @@ public class FXMLLoader_ScriptTest { @SuppressWarnings("deprecation") public void testStaticScriptLoad() throws IOException { FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("static_script_load.fxml")); - FXMLLoaderHelper.setStaticLoad(fxmlLoader, true); + fxmlLoader.setStaticLoad(true); AtomicBoolean scriptCalled = new AtomicBoolean(); AtomicBoolean scriptEndCalled = new AtomicBoolean(); fxmlLoader.setLoadListener(new LoadListener() { diff --git a/modules/javafx.fxml/src/test/java/test/javafx/fxml/RT_18218Test.java b/modules/javafx.fxml/src/test/java/test/javafx/fxml/RT_18218Test.java index 551b302367..51cb6c1f7c 100644 --- a/modules/javafx.fxml/src/test/java/test/javafx/fxml/RT_18218Test.java +++ b/modules/javafx.fxml/src/test/java/test/javafx/fxml/RT_18218Test.java @@ -25,7 +25,6 @@ package test.javafx.fxml; -import com.sun.javafx.fxml.FXMLLoaderHelper; import java.io.IOException; import java.util.Map; import javafx.fxml.FXMLLoader; @@ -39,7 +38,7 @@ public class RT_18218Test { @SuppressWarnings({"unchecked", "deprecation"}) public void testStaticScriptLoad() throws IOException { FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("rt_18218.fxml")); - FXMLLoaderHelper.setStaticLoad(fxmlLoader, true); + fxmlLoader.setStaticLoad(true); fxmlLoader.setLoadListener(new LoadListener() { private String unknownStaticPropertyElementName = null;