changeset 5511:e3c32ab8f05f

RT-33491 FXML contains treatAsPrivate stuff that is not prefixed by impl_ Reviewed-by: ekrejcir
author Martin Sladecek <martin.sladecek@oracle.com>
date Thu, 24 Oct 2013 09:26:59 +0200
parents 87e9754eb7fb
children 70401ef2c3cd
files modules/fxml/src/main/java/com/sun/javafx/fxml/ParseTraceElement.java modules/fxml/src/main/java/javafx/fxml/FXMLLoader.java modules/fxml/src/main/java/javafx/fxml/ParseTraceElement.java modules/fxml/src/test/java/javafx/fxml/FXMLLoader_ScriptTest.java modules/fxml/src/test/java/javafx/fxml/RT_18218Test.java
diffstat 5 files changed, 72 insertions(+), 74 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/fxml/src/main/java/com/sun/javafx/fxml/ParseTraceElement.java	Thu Oct 24 09:26:59 2013 +0200
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2010, 2013, 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 java.net.URL;
+
+/**
+ * An element in a parse trace, as returned by
+ * {@link javafx.fxml.FXMLLoader#impl_getParseTrace()}.
+ *
+ * @treatAsPrivate
+ * @since JavaFX 2.1
+ */
+public class ParseTraceElement {
+    private URL location;
+    private int lineNumber;
+
+    public ParseTraceElement(URL location, int lineNumber) {
+        this.location = location;
+        this.lineNumber = lineNumber;
+    }
+
+    public URL getLocation() {
+        return location;
+    }
+
+    public int getLineNumber() {
+        return lineNumber;
+    }
+
+    @Override
+    public String toString() {
+        return ((location == null) ? "?" : location.getPath()) + ": " + lineNumber;
+    }
+}
--- a/modules/fxml/src/main/java/javafx/fxml/FXMLLoader.java	Wed Oct 23 16:24:51 2013 -0700
+++ b/modules/fxml/src/main/java/javafx/fxml/FXMLLoader.java	Thu Oct 24 09:26:59 2013 +0200
@@ -81,7 +81,6 @@
 import java.net.MalformedURLException;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.util.Deque;
 import java.util.EnumMap;
 import java.util.Locale;
 import java.util.StringTokenizer;
@@ -1125,7 +1124,7 @@
                         FXMLLoader.this.location.toExternalForm()));
             }
             fxmlLoader.setClassLoader(classLoader);
-            fxmlLoader.setStaticLoad(staticLoad);
+            fxmlLoader.impl_setStaticLoad(staticLoad);
 
             Object value = fxmlLoader.load();
 
@@ -2312,7 +2311,7 @@
      * @treatAsPrivate
      * @deprecated
      */
-    public boolean isStaticLoad() {
+    public boolean impl_isStaticLoad() {
         // SB-dependency: RT-21226 has been filed to track this
         return staticLoad;
     }
@@ -2325,7 +2324,7 @@
      * @treatAsPrivate
      * @deprecated
      */
-    public void setStaticLoad(boolean staticLoad) {
+    public void impl_setStaticLoad(boolean staticLoad) {
         // SB-dependency: RT-21226 has been filed to track this
         this.staticLoad = staticLoad;
     }
@@ -2336,7 +2335,7 @@
      * @treatAsPrivate
      * @deprecated
      */
-    public LoadListener getLoadListener() {
+    public LoadListener impl_getLoadListener() {
         // SB-dependency: RT-21228 has been filed to track this
         return loadListener;
     }
@@ -2349,7 +2348,7 @@
      * @treatAsPrivate
      * @deprecated
      */
-    public void setLoadListener(LoadListener loadListener) {
+    public void impl_setLoadListener(LoadListener loadListener) {
         // SB-dependency: RT-21228 has been filed to track this
         this.loadListener = loadListener;
     }
@@ -2569,7 +2568,7 @@
 
             if (loader.current != null) {
                 messageBuilder.append(":");
-                messageBuilder.append(loader.getLineNumber());
+                messageBuilder.append(loader.impl_getLineNumber());
             }
 
             messageBuilder.append("\n");
@@ -2584,7 +2583,7 @@
      * @deprecated
      * @since JavaFX 2.2
      */
-    public int getLineNumber() {
+    public int impl_getLineNumber() {
         return xmlStreamReader.getLocation().getLineNumber();
     }
 
@@ -2596,13 +2595,13 @@
      * @since JavaFX 2.1
      */
     // SB-dependency: RT-21475 has been filed to track this
-    public ParseTraceElement[] getParseTrace() {
+    public ParseTraceElement[] impl_getParseTrace() {
         ParseTraceElement[] parseTrace = new ParseTraceElement[loaders.size()];
 
         int i = 0;
         for (FXMLLoader loader : loaders) {
             parseTrace[i++] = new ParseTraceElement(loader.location, (loader.current != null) ?
-                loader.getLineNumber() : -1);
+                loader.impl_getLineNumber() : -1);
         }
 
         return parseTrace;
--- a/modules/fxml/src/main/java/javafx/fxml/ParseTraceElement.java	Wed Oct 23 16:24:51 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2010, 2013, 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 javafx.fxml;
-
-import java.net.URL;
-
-/**
- * An element in a parse trace, as returned by
- * {@link FXMLLoader#getParseTrace()}.
- *
- * @treatAsPrivate
- * @since JavaFX 2.1
- */
-public class ParseTraceElement {
-    private URL location;
-    private int lineNumber;
-
-    public ParseTraceElement(URL location, int lineNumber) {
-        this.location = location;
-        this.lineNumber = lineNumber;
-    }
-
-    public URL getLocation() {
-        return location;
-    }
-
-    public int getLineNumber() {
-        return lineNumber;
-    }
-
-    @Override
-    public String toString() {
-        return ((location == null) ? "?" : location.getPath()) + ": " + lineNumber;
-    }
-}
--- a/modules/fxml/src/test/java/javafx/fxml/FXMLLoader_ScriptTest.java	Wed Oct 23 16:24:51 2013 -0700
+++ b/modules/fxml/src/test/java/javafx/fxml/FXMLLoader_ScriptTest.java	Thu Oct 24 09:26:59 2013 +0200
@@ -25,7 +25,6 @@
  */
 
 import com.sun.javafx.fxml.LoadListener;
-import org.junit.Ignore;
 import org.junit.Test;
 
 import java.io.IOException;
@@ -38,10 +37,10 @@
     @SuppressWarnings("deprecation")
     public void testStaticScriptLoad() throws IOException {
         FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("static_script_load.fxml"));
-        fxmlLoader.setStaticLoad(true);
+        fxmlLoader.impl_setStaticLoad(true);
         AtomicBoolean scriptCalled = new AtomicBoolean();
         AtomicBoolean scriptEndCalled = new AtomicBoolean();
-        fxmlLoader.setLoadListener(new LoadListener() {
+        fxmlLoader.impl_setLoadListener(new LoadListener() {
 
             @Override
             public void readImportProcessingInstruction(String target) {
@@ -114,7 +113,7 @@
 
             @Override
             public void endElement(Object value) {
-                if (value instanceof String && ((String)value).contains("doSomething")) {
+                if (value instanceof String && ((String) value).contains("doSomething")) {
                     assertTrue(scriptCalled.get());
                     assertFalse(scriptEndCalled.getAndSet(true));
                 }
--- a/modules/fxml/src/test/java/javafx/fxml/RT_18218Test.java	Wed Oct 23 16:24:51 2013 -0700
+++ b/modules/fxml/src/test/java/javafx/fxml/RT_18218Test.java	Thu Oct 24 09:26:59 2013 +0200
@@ -37,8 +37,8 @@
     @SuppressWarnings({"unchecked", "deprecation"})
     public void testStaticScriptLoad() throws IOException {
         FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("rt_18218.fxml"));
-        fxmlLoader.setStaticLoad(true);
-        fxmlLoader.setLoadListener(new LoadListener() {
+        fxmlLoader.impl_setStaticLoad(true);
+        fxmlLoader.impl_setLoadListener(new LoadListener() {
             private String unknownStaticPropertyElementName = null;
 
             @Override