From f784ca8d3253efc36098fd3de736acc551e73714 Mon Sep 17 00:00:00 2001 From: Henri Sara Date: Tue, 6 Jul 2010 06:14:52 +0000 Subject: [PATCH] Make private nested class constructor visibility public or package to prevent the generation of non-serializable access constructors by the compiler. svn changeset:14080/svn branch:6.4 --- src/com/vaadin/Application.java | 2 +- .../vaadin/data/util/ContainerHierarchicalWrapper.java | 2 +- src/com/vaadin/data/util/FilesystemContainer.java | 2 +- src/com/vaadin/data/util/IndexedContainer.java | 8 ++++---- src/com/vaadin/data/util/PropertysetItem.java | 2 +- src/com/vaadin/data/util/QueryContainer.java | 2 +- src/com/vaadin/event/ListenerMethod.java | 2 +- src/com/vaadin/ui/AbstractSelect.java | 2 +- src/com/vaadin/ui/CustomComponent.java | 5 +++++ src/com/vaadin/ui/SplitPanel.java | 5 +++++ src/com/vaadin/ui/Window.java | 2 +- 11 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/com/vaadin/Application.java b/src/com/vaadin/Application.java index 61df7c9f9a..872bdc99ba 100644 --- a/src/com/vaadin/Application.java +++ b/src/com/vaadin/Application.java @@ -1347,7 +1347,7 @@ public abstract class Application implements URIHandler, /** * Use {@link CustomizedSystemMessages} to customize */ - private SystemMessages() { + SystemMessages() { } diff --git a/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java b/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java index 4dca5cf52b..f429cdc256 100644 --- a/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java +++ b/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java @@ -67,7 +67,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, Comparator, Serializable { private final Collection itemIds; - private ListedItemsFirstComparator(Collection itemIds) { + public ListedItemsFirstComparator(Collection itemIds) { this.itemIds = itemIds; } diff --git a/src/com/vaadin/data/util/FilesystemContainer.java b/src/com/vaadin/data/util/FilesystemContainer.java index 1c9671d52d..7460a84b7f 100644 --- a/src/com/vaadin/data/util/FilesystemContainer.java +++ b/src/com/vaadin/data/util/FilesystemContainer.java @@ -596,7 +596,7 @@ public class FilesystemContainer implements Container.Hierarchical { /** * Constructs a FileItem from a existing file. */ - private FileItem(File file) { + FileItem(File file) { this.file = file; } diff --git a/src/com/vaadin/data/util/IndexedContainer.java b/src/com/vaadin/data/util/IndexedContainer.java index 2f6bae9851..e4dd54e276 100644 --- a/src/com/vaadin/data/util/IndexedContainer.java +++ b/src/com/vaadin/data/util/IndexedContainer.java @@ -747,7 +747,7 @@ public class IndexedContainer implements Container.Indexed, private class PropertySetChangeEvent extends EventObject implements Container.PropertySetChangeEvent, Serializable { - private PropertySetChangeEvent(IndexedContainer source) { + public PropertySetChangeEvent(IndexedContainer source) { super(source); } @@ -813,7 +813,7 @@ public class IndexedContainer implements Container.Indexed, private class PropertyValueChangeEvent extends EventObject implements Property.ValueChangeEvent, Serializable { - private PropertyValueChangeEvent(Property source) { + public PropertyValueChangeEvent(Property source) { super(source); } @@ -1068,7 +1068,7 @@ public class IndexedContainer implements Container.Indexed, * @param itemId * the Item ID of the new Item. */ - private IndexedContainerItem(Object itemId) { + IndexedContainerItem(Object itemId) { // Gets the item contents from the host if (itemId == null) { @@ -1212,7 +1212,7 @@ public class IndexedContainer implements Container.Indexed, * the list that contains the Item to contain the new * Property. */ - private IndexedContainerProperty(Object itemId, Object propertyId) { + public IndexedContainerProperty(Object itemId, Object propertyId) { if (itemId == null || propertyId == null) { // Null ids are not accepted throw new NullPointerException( diff --git a/src/com/vaadin/data/util/PropertysetItem.java b/src/com/vaadin/data/util/PropertysetItem.java index 83eb15b6ad..825934c831 100644 --- a/src/com/vaadin/data/util/PropertysetItem.java +++ b/src/com/vaadin/data/util/PropertysetItem.java @@ -166,7 +166,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, private class PropertySetChangeEvent extends EventObject implements Item.PropertySetChangeEvent { - private PropertySetChangeEvent(Item source) { + public PropertySetChangeEvent(Item source) { super(source); } diff --git a/src/com/vaadin/data/util/QueryContainer.java b/src/com/vaadin/data/util/QueryContainer.java index 96788947a9..351d4af697 100644 --- a/src/com/vaadin/data/util/QueryContainer.java +++ b/src/com/vaadin/data/util/QueryContainer.java @@ -498,7 +498,7 @@ public class QueryContainer implements Container, Container.Ordered, Object id; - private Row(Object rowId) { + Row(Object rowId) { id = rowId; } diff --git a/src/com/vaadin/event/ListenerMethod.java b/src/com/vaadin/event/ListenerMethod.java index b294dbf86d..ec7ee6a2cf 100644 --- a/src/com/vaadin/event/ListenerMethod.java +++ b/src/com/vaadin/event/ListenerMethod.java @@ -596,7 +596,7 @@ public class ListenerMethod implements EventListener, Serializable { private String message; - private MethodException(String message, Throwable cause) { + MethodException(String message, Throwable cause) { super(message); this.cause = cause; } diff --git a/src/com/vaadin/ui/AbstractSelect.java b/src/com/vaadin/ui/AbstractSelect.java index 510536a12b..80a3a2f91c 100644 --- a/src/com/vaadin/ui/AbstractSelect.java +++ b/src/com/vaadin/ui/AbstractSelect.java @@ -1891,7 +1891,7 @@ public abstract class AbstractSelect extends AbstractField implements public static VerticalLocationIs MIDDLE = new VerticalLocationIs( VerticalDropLocation.MIDDLE); - private VerticalLocationIs(VerticalDropLocation l) { + VerticalLocationIs(VerticalDropLocation l) { super("detail", l.name()); } } diff --git a/src/com/vaadin/ui/CustomComponent.java b/src/com/vaadin/ui/CustomComponent.java index e06fb321e3..25f829145c 100644 --- a/src/com/vaadin/ui/CustomComponent.java +++ b/src/com/vaadin/ui/CustomComponent.java @@ -156,6 +156,11 @@ public class CustomComponent extends AbstractComponentContainer { Serializable { boolean first = getCompositionRoot() != null; + public ComponentIterator() { + // needed to prevent generation of non-serializable access + // constructor classes as this nested class is private + } + public boolean hasNext() { return first; } diff --git a/src/com/vaadin/ui/SplitPanel.java b/src/com/vaadin/ui/SplitPanel.java index d38dc06f9e..3385376e79 100644 --- a/src/com/vaadin/ui/SplitPanel.java +++ b/src/com/vaadin/ui/SplitPanel.java @@ -73,6 +73,11 @@ public class SplitPanel extends AbstractLayout { int i = 0; + public ComponentIterator() { + // needed to prevent generation of non-serializable access + // constructor classes as this nested class is private + } + public boolean hasNext() { if (i < (firstComponent == null ? 0 : 1) + (secondComponent == null ? 0 : 1)) { diff --git a/src/com/vaadin/ui/Window.java b/src/com/vaadin/ui/Window.java index 866c2d0c34..bb5dc89238 100644 --- a/src/com/vaadin/ui/Window.java +++ b/src/com/vaadin/ui/Window.java @@ -994,7 +994,7 @@ public class Window extends Panel implements URIHandler, ParameterHandler { * @param border * The border style of the target window */ - private OpenResource(Resource resource, String name, int width, + public OpenResource(Resource resource, String name, int width, int height, int border) { this.resource = resource; this.name = name; -- 2.39.5