diff options
author | Ahmed Ashour <asashour@yahoo.com> | 2017-09-20 12:16:21 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-09-20 13:16:21 +0300 |
commit | 8657a5ff49f22d87005e93771415129dfc657d88 (patch) | |
tree | 67e55d72684c6dbf7b247a00bff4edd4fcde7a01 | |
parent | f3ae6c2c2b1245d20d94cb4eeee4efee8c2b06c6 (diff) | |
download | vaadin-framework-8657a5ff49f22d87005e93771415129dfc657d88.tar.gz vaadin-framework-8657a5ff49f22d87005e93771415129dfc657d88.zip |
Remove unused methods (#10020)
24 files changed, 6 insertions, 214 deletions
diff --git a/client/src/main/java/com/vaadin/client/Profiler.java b/client/src/main/java/com/vaadin/client/Profiler.java index afc0096469..3986bdddbb 100644 --- a/client/src/main/java/com/vaadin/client/Profiler.java +++ b/client/src/main/java/com/vaadin/client/Profiler.java @@ -197,18 +197,6 @@ public class Profiler { return Collections.unmodifiableCollection(children.values()); } - private void buildRecursiveString(StringBuilder builder, - String prefix) { - if (getName() != null) { - String msg = getStringRepresentation(prefix); - builder.append(msg + '\n'); - } - String childPrefix = prefix + "*"; - for (Node node : children.values()) { - node.buildRecursiveString(builder, childPrefix); - } - } - @Override public String toString() { return getStringRepresentation(""); diff --git a/client/src/main/java/com/vaadin/client/ui/layout/LayoutDependencyTree.java b/client/src/main/java/com/vaadin/client/ui/layout/LayoutDependencyTree.java index 26aaf837f5..815509c44b 100644 --- a/client/src/main/java/com/vaadin/client/ui/layout/LayoutDependencyTree.java +++ b/client/src/main/java/com/vaadin/client/ui/layout/LayoutDependencyTree.java @@ -311,28 +311,6 @@ public class LayoutDependencyTree { } - /** - * Go up the hierarchy to find a component whose size might have changed - * in the other direction because changes to this component causes - * scrollbars to appear or disappear. - * - * @return - */ - private LayoutDependency findPotentiallyChangedScrollbar() { - ComponentConnector currentConnector = connector; - while (true) { - ServerConnector parent = currentConnector.getParent(); - if (!(parent instanceof ComponentConnector)) { - return null; - } - if (parent instanceof MayScrollChildren) { - return getDependency(currentConnector.getConnectorId(), - getOppositeDirection()); - } - currentConnector = (ComponentConnector) parent; - } - } - private int getOppositeDirection() { return direction == HORIZONTAL ? VERTICAL : HORIZONTAL; } diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java index a72222d325..4315990d3a 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java @@ -3266,10 +3266,6 @@ public class Grid extends AbstractComponent getRowState().defaultRow = value; } - private boolean isDefaultRow() { - return getRowState().defaultRow; - } - @Override protected HeaderCell createCell() { return new HeaderCell(this); diff --git a/server/src/main/java/com/vaadin/data/TreeData.java b/server/src/main/java/com/vaadin/data/TreeData.java index 60f9d6fb29..ff5bc622c2 100644 --- a/server/src/main/java/com/vaadin/data/TreeData.java +++ b/server/src/main/java/com/vaadin/data/TreeData.java @@ -43,24 +43,14 @@ import com.vaadin.data.provider.TreeDataProvider; public class TreeData<T> implements Serializable { private static class HierarchyWrapper<T> implements Serializable { - private T item; private T parent; private List<T> children; - public HierarchyWrapper(T item, T parent) { - this.item = item; + public HierarchyWrapper(T parent) { this.parent = parent; children = new ArrayList<>(); } - public T getItem() { - return item; - } - - public void setItem(T item) { - this.item = item; - } - public T getParent() { return parent; } @@ -73,10 +63,6 @@ public class TreeData<T> implements Serializable { return children; } - public void setChildren(List<T> children) { - this.children = children; - } - public void addChild(T child) { children.add(child); } @@ -94,7 +80,7 @@ public class TreeData<T> implements Serializable { */ public TreeData() { itemToWrapperMap = new LinkedHashMap<>(); - itemToWrapperMap.put(null, new HierarchyWrapper<>(null, null)); + itemToWrapperMap.put(null, new HierarchyWrapper<>(null)); } /** @@ -491,7 +477,7 @@ public class TreeData<T> implements Serializable { } private void putItem(T item, T parent) { - HierarchyWrapper<T> wrappedItem = new HierarchyWrapper<>(item, parent); + HierarchyWrapper<T> wrappedItem = new HierarchyWrapper<>(parent); if (itemToWrapperMap.containsKey(parent)) { itemToWrapperMap.get(parent).addChild(item); } diff --git a/server/src/main/java/com/vaadin/event/ConnectorActionManager.java b/server/src/main/java/com/vaadin/event/ConnectorActionManager.java index 7363a53b87..8f121015f5 100644 --- a/server/src/main/java/com/vaadin/event/ConnectorActionManager.java +++ b/server/src/main/java/com/vaadin/event/ConnectorActionManager.java @@ -77,8 +77,4 @@ public class ConnectorActionManager extends ActionManager { super.handleAction(action, sender, target); } - private static final Logger getLogger() { - return Logger.getLogger(ConnectorActionManager.class.getName()); - } - } diff --git a/server/src/main/java/com/vaadin/event/EventRouter.java b/server/src/main/java/com/vaadin/event/EventRouter.java index b07efb6c53..04c05d3af8 100644 --- a/server/src/main/java/com/vaadin/event/EventRouter.java +++ b/server/src/main/java/com/vaadin/event/EventRouter.java @@ -254,8 +254,4 @@ public class EventRouter implements MethodEventSource { return listeners; } - private Logger getLogger() { - return Logger.getLogger(EventRouter.class.getName()); - } - } diff --git a/server/src/main/java/com/vaadin/server/AbstractClientConnector.java b/server/src/main/java/com/vaadin/server/AbstractClientConnector.java index fce41b1415..00cbb4f7b4 100644 --- a/server/src/main/java/com/vaadin/server/AbstractClientConnector.java +++ b/server/src/main/java/com/vaadin/server/AbstractClientConnector.java @@ -485,10 +485,6 @@ public abstract class AbstractClientConnector return null; } - private static Logger getLogger() { - return Logger.getLogger(AbstractClientConnector.class.getName()); - } - /** * @deprecated As of 7.0, use {@link #markAsDirtyRecursive()} instead */ diff --git a/server/src/main/java/com/vaadin/server/VaadinPortletService.java b/server/src/main/java/com/vaadin/server/VaadinPortletService.java index 077f91afed..41183ad9dd 100644 --- a/server/src/main/java/com/vaadin/server/VaadinPortletService.java +++ b/server/src/main/java/com/vaadin/server/VaadinPortletService.java @@ -72,11 +72,6 @@ public class VaadinPortletService extends VaadinService { return portlet; } - private String getPortalProperty(VaadinRequest request, - String propertyName) { - return ((VaadinPortletRequest) request).getPortalProperty(propertyName); - } - private String getParameter(VaadinRequest request, String name, String defaultValue) { VaadinPortletRequest portletRequest = (VaadinPortletRequest) request; diff --git a/server/src/main/java/com/vaadin/ui/AbstractComponent.java b/server/src/main/java/com/vaadin/ui/AbstractComponent.java index bea9ef9e56..92aaa0cb36 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractComponent.java +++ b/server/src/main/java/com/vaadin/ui/AbstractComponent.java @@ -1455,7 +1455,4 @@ public abstract class AbstractComponent extends AbstractClientConnector + AbstractFieldState.class.getSimpleName()); } - private static final Logger getLogger() { - return Logger.getLogger(AbstractComponent.class.getName()); - } } diff --git a/server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java b/server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java index 194a354ad0..7b8183d3bb 100644 --- a/server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java +++ b/server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java @@ -461,10 +461,6 @@ public class DragAndDropWrapper extends CustomComponent return file.getFileSize(); } - public StreamVariable getReceiver() { - return ProxyReceiver.this; - } - @Override public Exception getException() { if (wrappedEvent instanceof StreamingErrorEvent) { diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index ceeec79ac1..0105fd9b4e 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -3623,13 +3623,6 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, .forEach(this::removeColumn); } - private String getIdentifier(Column<T, ?> column) { - return columnKeys.entrySet().stream() - .filter(entry -> entry.getValue().equals(column)) - .map(entry -> entry.getKey()).findFirst() - .orElse(getGeneratedIdentifier()); - } - private String getGeneratedIdentifier() { String columnId = "" + counter; counter++; diff --git a/server/src/main/java/com/vaadin/ui/dnd/FileDropTarget.java b/server/src/main/java/com/vaadin/ui/dnd/FileDropTarget.java index bfb66c4fc4..59197cbc26 100644 --- a/server/src/main/java/com/vaadin/ui/dnd/FileDropTarget.java +++ b/server/src/main/java/com/vaadin/ui/dnd/FileDropTarget.java @@ -265,10 +265,6 @@ public class FileDropTarget<T extends AbstractComponent> return file.getFileSize(); } - public StreamVariable getReceiver() { - return FileReceiver.this; - } - @Override public Exception getException() { if (wrappedEvent instanceof StreamingErrorEvent) { diff --git a/server/src/test/java/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java b/server/src/test/java/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java index 274441824b..3017bc3e37 100644 --- a/server/src/test/java/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java +++ b/server/src/test/java/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java @@ -81,31 +81,6 @@ public class TestAbstractApplicationServletStaticFilesLocation { return location; } - private String testIncludedLocation(String base, String portletContextPath, - String servletPath, String pathInfo) throws Exception { - - HttpServletRequest request = createIncludeRequest(base, - portletContextPath, servletPath, pathInfo); - // Set request into replay mode - replay(request); - - String location = servlet.getService() - .getStaticFileLocation(servlet.createVaadinRequest(request)); - return location; - } - - private HttpServletRequest createIncludeRequest(String base, - String realContextPath, String realServletPath, String pathInfo) - throws Exception { - HttpServletRequest request = createRequest(base, "", "", pathInfo); - expect(request.getAttribute("javax.servlet.include.context_path")) - .andReturn(realContextPath).anyTimes(); - expect(request.getAttribute("javax.servlet.include.servlet_path")) - .andReturn(realServletPath).anyTimes(); - - return request; - } - private HttpServletRequest createNonIncludeRequest(String base, String realContextPath, String realServletPath, String pathInfo) throws Exception { diff --git a/server/src/test/java/com/vaadin/tests/util/GraphVizClassHierarchyCreator.java b/server/src/test/java/com/vaadin/tests/util/GraphVizClassHierarchyCreator.java index ebde4b191a..3f07d1c178 100644 --- a/server/src/test/java/com/vaadin/tests/util/GraphVizClassHierarchyCreator.java +++ b/server/src/test/java/com/vaadin/tests/util/GraphVizClassHierarchyCreator.java @@ -32,7 +32,7 @@ public class GraphVizClassHierarchyCreator { } Set<Class> interfaces = new HashSet<>(); - for (Object cls : classesAndParents.toArray()) { + for (Object cls : classesAndParents) { for (Class<?> c : ((Class) cls).getInterfaces()) { addClassAndParentInterfaces(classesAndParents, c, packageToInclude); @@ -134,18 +134,4 @@ public class GraphVizClassHierarchyCreator { } - private static void addInterfaces(Set<Class> interfaces, Class<?> cls) { - if (interfaces.contains(cls)) { - return; - } - - if (cls.isInterface()) { - interfaces.add(cls); - } - - for (Class c : cls.getInterfaces()) { - addInterfaces(interfaces, c); - } - } - } diff --git a/server/src/test/java/com/vaadin/ui/ComponentTest.java b/server/src/test/java/com/vaadin/ui/ComponentTest.java index 1ea4867b93..58a8829d5e 100644 --- a/server/src/test/java/com/vaadin/ui/ComponentTest.java +++ b/server/src/test/java/com/vaadin/ui/ComponentTest.java @@ -22,6 +22,7 @@ import java.util.HashSet; import org.junit.Assert; import com.vaadin.server.ClientConnector; +import com.vaadin.server.LegacyCommunicationManager; import com.vaadin.server.ServerRpcManager; import com.vaadin.shared.communication.ServerRpc; @@ -65,8 +66,7 @@ public class ComponentTest { * the component to update */ public static void updateDiffState(AbstractComponent component) { - component.getUI().getSession().getCommunicationManager() - .encodeState(component, component.getState()); + LegacyCommunicationManager.encodeState(component, component.getState()); } diff --git a/server/src/test/java/com/vaadin/ui/RadioButtonGroupTest.java b/server/src/test/java/com/vaadin/ui/RadioButtonGroupTest.java index fadbf28507..545871f9ce 100644 --- a/server/src/test/java/com/vaadin/ui/RadioButtonGroupTest.java +++ b/server/src/test/java/com/vaadin/ui/RadioButtonGroupTest.java @@ -81,9 +81,4 @@ public class RadioButtonGroupTest { .key(dataObject); } - private static void assertSelectionOrder(Multi<String> selectionModel, - String... selectionOrder) { - Assert.assertEquals(Arrays.asList(selectionOrder), - new ArrayList<>(selectionModel.getSelectedItems())); - } } diff --git a/shared/src/main/java/com/vaadin/shared/util/SharedUtil.java b/shared/src/main/java/com/vaadin/shared/util/SharedUtil.java index d1b7cf0b22..92e03bed5f 100644 --- a/shared/src/main/java/com/vaadin/shared/util/SharedUtil.java +++ b/shared/src/main/java/com/vaadin/shared/util/SharedUtil.java @@ -148,16 +148,6 @@ public class SharedUtil implements Serializable { return join(parts, " "); } - private static boolean isAllUpperCase(String string) { - for (int i = 0; i < string.length(); i++) { - char c = string.charAt(i); - if (!Character.isUpperCase(c) && !Character.isDigit(c)) { - return false; - } - } - return true; - } - /** * Joins the words in the input array together into a single string by * inserting the separator string between each word. diff --git a/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuBarTooltipsNearEdge.java b/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuBarTooltipsNearEdge.java index f0717bbada..4af8820d27 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuBarTooltipsNearEdge.java +++ b/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuBarTooltipsNearEdge.java @@ -63,17 +63,6 @@ public class MenuBarTooltipsNearEdge extends AbstractReindeerTestUI { return menu; } - private Command buildCommand() { - Command command = new Command() { - - @Override - public void menuSelected(MenuItem selectedItem) { - - } - }; - return command; - } - /* * (non-Javadoc) * diff --git a/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuTooltip.java b/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuTooltip.java index 213544c900..59e5cf7734 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuTooltip.java +++ b/uitest/src/main/java/com/vaadin/tests/components/menubar/MenuTooltip.java @@ -55,17 +55,6 @@ public class MenuTooltip extends AbstractReindeerTestUI { return menu; } - private Command buildCommand() { - Command command = new Command() { - - @Override - public void menuSelected(MenuItem selectedItem) { - - } - }; - return command; - } - /* * (non-Javadoc) * diff --git a/uitest/src/main/java/com/vaadin/tests/elements/ComponentElementGetValue.java b/uitest/src/main/java/com/vaadin/tests/elements/ComponentElementGetValue.java index 11c2ac2840..819548cff8 100644 --- a/uitest/src/main/java/com/vaadin/tests/elements/ComponentElementGetValue.java +++ b/uitest/src/main/java/com/vaadin/tests/elements/ComponentElementGetValue.java @@ -63,14 +63,6 @@ public class ComponentElementGetValue extends AbstractTestUI { public static final String DATEFIELD_VALUE_CHANGE = "dateFieldValueChange"; public static final String MULTI_SELECT_VALUE_CHANGE = "multiSelectValueChange"; - private List<String> createTestItems() { - List<String> options = new ArrayList<String>(); - options.add("item 1"); - options.add(TEST_STRING_VALUE); - options.add("item 3"); - return options; - } - private void addSingleSelectComponents() { List<String> options = new ArrayList<String>(); options.add("item 1"); diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/CalendarTest.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/CalendarTest.java index 6155be7f93..ad5a13e744 100644 --- a/uitest/src/main/java/com/vaadin/tests/themes/valo/CalendarTest.java +++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/CalendarTest.java @@ -10,7 +10,6 @@ import com.vaadin.annotations.Theme; import com.vaadin.data.Binder; import com.vaadin.data.ValidationException; import com.vaadin.navigator.View; -import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; @@ -1195,23 +1194,4 @@ public class CalendarTest extends GridLayout implements View { return calendarClone.getTime(); } - private static Date getStartOfDay(java.util.Calendar calendar, Date date) { - java.util.Calendar calendarClone = (java.util.Calendar) calendar - .clone(); - - calendarClone.setTime(date); - calendarClone.set(java.util.Calendar.MILLISECOND, 0); - calendarClone.set(java.util.Calendar.SECOND, 0); - calendarClone.set(java.util.Calendar.MINUTE, 0); - calendarClone.set(java.util.Calendar.HOUR, 0); - calendarClone.set(java.util.Calendar.HOUR_OF_DAY, 0); - - return calendarClone.getTime(); - } - - @Override - public void enter(ViewChangeEvent event) { - // TODO Auto-generated method stub - - } } diff --git a/uitest/src/test/java/com/vaadin/tests/components/textfield/SelectionAndCursorPositionTest.java b/uitest/src/test/java/com/vaadin/tests/components/textfield/SelectionAndCursorPositionTest.java index 8b540b1095..950c64c8b2 100644 --- a/uitest/src/test/java/com/vaadin/tests/components/textfield/SelectionAndCursorPositionTest.java +++ b/uitest/src/test/java/com/vaadin/tests/components/textfield/SelectionAndCursorPositionTest.java @@ -72,11 +72,6 @@ public class SelectionAndCursorPositionTest extends SingleBrowserTest { getSelection(textField)); } - private void clearSelection() { - setSelectionRange(0, 0); - - } - private WebElement getSelectAll() { return findElement(By.id(SelectionAndCursorPosition.SELECT_ALL_ID)); } diff --git a/uitest/src/test/java/com/vaadin/tests/tooltip/TooltipInWindowTest.java b/uitest/src/test/java/com/vaadin/tests/tooltip/TooltipInWindowTest.java index 4b8db08736..b005fd07a1 100644 --- a/uitest/src/test/java/com/vaadin/tests/tooltip/TooltipInWindowTest.java +++ b/uitest/src/test/java/com/vaadin/tests/tooltip/TooltipInWindowTest.java @@ -57,11 +57,4 @@ public class TooltipInWindowTest extends TooltipTest { + tooltipX + " < " + textfieldX + ")", tooltipX, textfieldX); } - private void ensureHiddenTooltipPositionedCorrectly() { - int tooltipX = getTooltipContainerElement().getLocation().getX(); - assertLessThanOrEqual( - "Tooltip should be positioned outside of viewport (was at " - + tooltipX + ")", - tooltipX, -1000); - } } diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/GridClientRenderers.java b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/GridClientRenderers.java index ba8970d167..c120e17262 100644 --- a/uitest/src/test/java/com/vaadin/v7/tests/components/grid/GridClientRenderers.java +++ b/uitest/src/test/java/com/vaadin/v7/tests/components/grid/GridClientRenderers.java @@ -274,9 +274,4 @@ public class GridClientRenderers extends MultiBrowserTest { return $(MyClientGridElement.class).first(); } - private void addColumn(Renderers renderer) { - // Add widget renderer column - $(NativeSelectElement.class).first().selectByText(renderer.toString()); - $(NativeButtonElement.class).caption("Add").first().click(); - } } |