changeset 4988:b81242a973ce

RT-19329 FXMLLoader could expose error line number and error location
author Martin Sladecek <martin.sladecek@oracle.com>
date Fri, 06 Sep 2013 09:57:44 +0200
parents fc17d9decdce
children 73c7426d2a0b f16a4c87f37c
files modules/fxml/src/main/java/javafx/fxml/FXMLLoader.java
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/modules/fxml/src/main/java/javafx/fxml/FXMLLoader.java	Thu Sep 05 14:22:11 2013 -0700
+++ b/modules/fxml/src/main/java/javafx/fxml/FXMLLoader.java	Fri Sep 06 09:57:44 2013 +0200
@@ -97,7 +97,6 @@
     // Abstract base class for elements
     private abstract class Element {
         public final Element parent;
-        public final int lineNumber;
 
         public Object value = null;
         private BeanAdapter valueAdapter = null;
@@ -109,7 +108,6 @@
 
         public Element() {
             parent = current;
-            lineNumber = getLineNumber();
         }
 
         public boolean isCollection() {
@@ -2449,7 +2447,7 @@
 
             if (loader.current != null) {
                 messageBuilder.append(":");
-                messageBuilder.append(loader.current.lineNumber);
+                messageBuilder.append(loader.getLineNumber());
             }
 
             messageBuilder.append("\n");
@@ -2491,7 +2489,7 @@
         int i = 0;
         for (FXMLLoader loader : loaders) {
             parseTrace[i++] = new ParseTraceElement(loader.location, (loader.current != null) ?
-                loader.current.lineNumber : -1);
+                loader.getLineNumber() : -1);
         }
 
         return parseTrace;