From: Henri Sara Date: Mon, 25 May 2009 11:17:52 +0000 (+0000) Subject: #2643 more fixing of demo warnings X-Git-Tag: 6.7.0.beta1~2785 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0f3e18635c4525538cfebc7dd8ef448be8a2f4c6;p=vaadin-framework.git #2643 more fixing of demo warnings svn changeset:7987/svn branch:6.0 --- diff --git a/src/com/vaadin/automatedtests/featurebrowser/FeatureBrowser.java b/src/com/vaadin/automatedtests/featurebrowser/FeatureBrowser.java index 275d42efb6..b6f2e0e163 100644 --- a/src/com/vaadin/automatedtests/featurebrowser/FeatureBrowser.java +++ b/src/com/vaadin/automatedtests/featurebrowser/FeatureBrowser.java @@ -54,7 +54,7 @@ public class FeatureBrowser extends com.vaadin.Application implements private TabSheet ts; // Example "cache" - private final HashMap exampleInstances = new HashMap(); + private final HashMap, Component> exampleInstances = new HashMap, Component>(); private String section; // List of examples @@ -129,9 +129,9 @@ public class FeatureBrowser extends com.vaadin.Application implements final SplitPanel split = new SplitPanel( SplitPanel.ORIENTATION_HORIZONTAL); split.setSplitPosition(200, SplitPanel.UNITS_PIXELS); - main.setLayout(split); + main.setContent(split); - final HashMap sectionIds = new HashMap(); + final HashMap sectionIds = new HashMap(); final HierarchicalContainer container = createContainer(); final Object rootId = container.addItem(); Item item = container.getItem(rootId); @@ -212,7 +212,7 @@ public class FeatureBrowser extends com.vaadin.Application implements public void buttonClick(ClickEvent event) { Component component = (Component) ts.getComponentIterator() .next(); - String caption = ts.getTabCaption(component); + String caption = ts.getTab(component).getCaption(); try { component = component.getClass().newInstance(); } catch (Exception e) { @@ -222,7 +222,7 @@ public class FeatureBrowser extends com.vaadin.Application implements Window w = new Window(caption); w.setWidth("640px"); if (Layout.class.isAssignableFrom(component.getClass())) { - w.setLayout((Layout) component); + w.setContent((Layout) component); } else { // w.getLayout().getSize().setSizeFull(); w.addComponent(component); @@ -237,7 +237,7 @@ public class FeatureBrowser extends com.vaadin.Application implements public void buttonClick(ClickEvent event) { Component component = (Component) ts.getComponentIterator() .next(); - final String caption = ts.getTabCaption(component); + final String caption = ts.getTab(component).getCaption(); Window w = getWindow(caption); if (w == null) { try { @@ -249,7 +249,7 @@ public class FeatureBrowser extends com.vaadin.Application implements w = new Window(caption); w.setName(caption); if (Layout.class.isAssignableFrom(component.getClass())) { - w.setLayout((Layout) component); + w.setContent((Layout) component); } else { // w.getLayout().getSize().setSizeFull(); w.addComponent(component); @@ -381,7 +381,7 @@ public class FeatureBrowser extends com.vaadin.Application implements return null; } } - return (Component) exampleInstances.get(componentClass); + return exampleInstances.get(componentClass); } } diff --git a/src/com/vaadin/demo/VaadinTunesLayout.java b/src/com/vaadin/demo/VaadinTunesLayout.java index 695c4dc2cf..6b82e53e0a 100644 --- a/src/com/vaadin/demo/VaadinTunesLayout.java +++ b/src/com/vaadin/demo/VaadinTunesLayout.java @@ -51,7 +51,7 @@ public class VaadinTunesLayout extends Application { // Our root window contains one VerticalLayout by default, let's make // sure it's 100% sized, and remove unwanted margins - root.getLayout().setSizeFull(); + root.getContent().setSizeFull(); root.getLayout().setMargin(false); // Top area, containing playback and volume controls, play status, view @@ -172,7 +172,7 @@ public class VaadinTunesLayout extends Application { // The splitpanel is by default 100% x 100%, but we'll need to adjust // our main window layout to accomodate the height - ((VerticalLayout) root.getLayout()).setExpandRatio(bottom, 1.0F); + ((VerticalLayout) root.getContent()).setExpandRatio(bottom, 1.0F); // Give the sidebar less space than the listing bottom.setSplitPosition(200, SplitPanel.UNITS_PIXELS); diff --git a/src/com/vaadin/demo/colorpicker/ColorPicker.java b/src/com/vaadin/demo/colorpicker/ColorPicker.java index 520a99d04a..99a3abd37a 100644 --- a/src/com/vaadin/demo/colorpicker/ColorPicker.java +++ b/src/com/vaadin/demo/colorpicker/ColorPicker.java @@ -18,7 +18,7 @@ public class ColorPicker extends AbstractField { setValue(new String("white")); } - /** The property value of the field is an Integer. */ + /** The property value of the field is a String. */ @Override public Class getType() { return String.class; diff --git a/src/com/vaadin/demo/featurebrowser/FeatureBrowser.java b/src/com/vaadin/demo/featurebrowser/FeatureBrowser.java index 45da691988..5b9e769015 100644 --- a/src/com/vaadin/demo/featurebrowser/FeatureBrowser.java +++ b/src/com/vaadin/demo/featurebrowser/FeatureBrowser.java @@ -53,7 +53,7 @@ public class FeatureBrowser extends com.vaadin.Application implements private TabSheet ts; // Example "cache" - private final HashMap exampleInstances = new HashMap(); + private final HashMap, Component> exampleInstances = new HashMap, Component>(); private String section; // List of examples @@ -129,7 +129,7 @@ public class FeatureBrowser extends com.vaadin.Application implements split.setSplitPosition(200, SplitPanel.UNITS_PIXELS); main.setContent(split); - final HashMap sectionIds = new HashMap(); + final HashMap sectionIds = new HashMap(); final HierarchicalContainer container = createContainer(); final Object rootId = container.addItem(); Item item = container.getItem(rootId); @@ -166,7 +166,7 @@ public class FeatureBrowser extends com.vaadin.Application implements tree.addListener(this); tree.setImmediate(true); tree.expandItemsRecursively(rootId); - for (Iterator i = container.getItemIds().iterator(); i.hasNext();) { + for (Iterator i = container.getItemIds().iterator(); i.hasNext();) { Object id = i.next(); if (container.getChildren(id) == null) { tree.setChildrenAllowed(id, false); @@ -209,7 +209,7 @@ public class FeatureBrowser extends com.vaadin.Application implements public void buttonClick(ClickEvent event) { Component component = (Component) ts.getComponentIterator() .next(); - String caption = ts.getTabCaption(component); + String caption = ts.getTab(component).getCaption(); try { component = component.getClass().newInstance(); } catch (Exception e) { @@ -233,7 +233,7 @@ public class FeatureBrowser extends com.vaadin.Application implements public void buttonClick(ClickEvent event) { Component component = (Component) ts.getComponentIterator() .next(); - final String caption = ts.getTabCaption(component); + final String caption = ts.getTab(component).getCaption(); Window w = getWindow(caption); if (w == null) { try { @@ -347,8 +347,8 @@ public class FeatureBrowser extends com.vaadin.Application implements tree.setValue(table.getValue()); table.addListener(this); final Item item = table.getItem(table.getValue()); - final Class c = (Class) item.getItemProperty(PROPERTY_ID_CLASS) - .getValue(); + final Class c = (Class) item.getItemProperty( + PROPERTY_ID_CLASS).getValue(); final Component component = getComponent(c); if (component != null) { final String caption = (String) item.getItemProperty( @@ -368,7 +368,7 @@ public class FeatureBrowser extends com.vaadin.Application implements } - private Component getComponent(Class componentClass) { + private Component getComponent(Class componentClass) { if (!exampleInstances.containsKey(componentClass)) { try { final Component c = (Component) componentClass.newInstance(); @@ -377,7 +377,7 @@ public class FeatureBrowser extends com.vaadin.Application implements return null; } } - return (Component) exampleInstances.get(componentClass); + return exampleInstances.get(componentClass); } } diff --git a/src/com/vaadin/demo/featurebrowser/GeneratedColumnExample.java b/src/com/vaadin/demo/featurebrowser/GeneratedColumnExample.java index cbb543722c..0ce1afb511 100644 --- a/src/com/vaadin/demo/featurebrowser/GeneratedColumnExample.java +++ b/src/com/vaadin/demo/featurebrowser/GeneratedColumnExample.java @@ -4,10 +4,10 @@ package com.vaadin.demo.featurebrowser; +import java.util.ArrayList; import java.util.Collection; import java.util.Date; import java.util.GregorianCalendar; -import java.util.Vector; import com.vaadin.data.Container; import com.vaadin.data.Item; @@ -15,10 +15,10 @@ import com.vaadin.data.Property; import com.vaadin.data.Container.Indexed; import com.vaadin.data.util.BeanItem; import com.vaadin.ui.AbstractField; -import com.vaadin.ui.BaseFieldFactory; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Component; import com.vaadin.ui.CustomComponent; +import com.vaadin.ui.DefaultFieldFactory; import com.vaadin.ui.Field; import com.vaadin.ui.Label; import com.vaadin.ui.Table; @@ -117,15 +117,15 @@ public class GeneratedColumnExample extends CustomComponent { * implementations, as they are not needed in this example. */ public class MySimpleIndexedContainer implements Container, Indexed { - Vector items; + ArrayList items; Object itemtemplate; public MySimpleIndexedContainer(Object itemtemplate) { this.itemtemplate = itemtemplate; - items = new Vector(); // Yeah this is just a test + items = new ArrayList(); // Yeah this is just a test } - public boolean addContainerProperty(Object propertyId, Class type, + public boolean addContainerProperty(Object propertyId, Class type, Object defaultValue) throws UnsupportedOperationException { throw new UnsupportedOperationException(); } @@ -165,7 +165,7 @@ public class GeneratedColumnExample extends CustomComponent { if (itemId instanceof Integer) { int pos = ((Integer) itemId).intValue(); if (pos >= 0 && pos < items.size()) { - Item item = (Item) items.get(pos); + Item item = items.get(pos); // The BeanItem provides the property objects for the items. return item.getItemProperty(propertyId); @@ -175,7 +175,7 @@ public class GeneratedColumnExample extends CustomComponent { } /** Table calls this to get the column names. */ - public Collection getContainerPropertyIds() { + public Collection getContainerPropertyIds() { Item item = new BeanItem(itemtemplate); // The BeanItem knows how to get the property names from the bean. @@ -186,21 +186,21 @@ public class GeneratedColumnExample extends CustomComponent { if (itemId instanceof Integer) { int pos = ((Integer) itemId).intValue(); if (pos >= 0 && pos < items.size()) { - return (Item) items.get(pos); + return items.get(pos); } } return null; } - public Collection getItemIds() { - Vector ids = new Vector(items.size()); + public Collection getItemIds() { + ArrayList ids = new ArrayList(items.size()); for (int i = 0; i < items.size(); i++) { ids.add(Integer.valueOf(i)); } return ids; } - public Class getType(Object propertyId) { + public Class getType(Object propertyId) { return BeanItem.class; } @@ -427,11 +427,13 @@ public class GeneratedColumnExample extends CustomComponent { /** * Custom field factory that sets the fields as immediate. */ - public class ImmediateFieldFactory extends BaseFieldFactory { + public class ImmediateFieldFactory extends DefaultFieldFactory { @Override - public Field createField(Class type, Component uiContext) { - // Let the BaseFieldFactory create the fields - Field field = super.createField(type, uiContext); + public Field createField(Container container, Object itemId, + Object propertyId, Component uiContext) { + // Let the DefaultFieldFactory create the fields + Field field = super.createField(container, itemId, propertyId, + uiContext); // ...and just set them as immediate ((AbstractField) field).setImmediate(true); @@ -529,7 +531,7 @@ public class GeneratedColumnExample extends CustomComponent { // Use a custom field factory to set the edit fields as immediate. // This is used when the table is in editable mode. - table.setFieldFactory(new ImmediateFieldFactory()); + table.setTableFieldFactory(new ImmediateFieldFactory()); // Setting the table itself as immediate has no relevance in this // example, diff --git a/src/com/vaadin/demo/featurebrowser/TableExample.java b/src/com/vaadin/demo/featurebrowser/TableExample.java index 057bf380b5..808762724b 100644 --- a/src/com/vaadin/demo/featurebrowser/TableExample.java +++ b/src/com/vaadin/demo/featurebrowser/TableExample.java @@ -232,6 +232,7 @@ public class TableExample extends CustomComponent implements Action.Handler, } } + @SuppressWarnings("unchecked") public void buttonClick(ClickEvent event) { final Button b = event.getButton(); if (b == deselect) { diff --git a/src/com/vaadin/demo/reservation/CalendarField.java b/src/com/vaadin/demo/reservation/CalendarField.java index f555c83228..2af0f1ed71 100644 --- a/src/com/vaadin/demo/reservation/CalendarField.java +++ b/src/com/vaadin/demo/reservation/CalendarField.java @@ -126,19 +126,19 @@ public class CalendarField extends DateField implements Container.Viewer { // Check old propertyIds if (itemEndPropertyId != null) { - final Class c = dataSource.getType(itemEndPropertyId); + final Class c = dataSource.getType(itemEndPropertyId); if (!Date.class.isAssignableFrom(c)) { itemEndPropertyId = null; } } if (itemNotimePropertyId != null) { - final Class c = dataSource.getType(itemNotimePropertyId); + final Class c = dataSource.getType(itemNotimePropertyId); if (!Boolean.class.isAssignableFrom(c)) { itemNotimePropertyId = null; } } if (itemStartPropertyId != null) { - final Class c = dataSource.getType(itemStartPropertyId); + final Class c = dataSource.getType(itemStartPropertyId); if (Date.class.isAssignableFrom(c)) { // All we _really_ need is one date return true; @@ -147,10 +147,10 @@ public class CalendarField extends DateField implements Container.Viewer { } } // We need at least one Date - final Collection ids = dataSource.getContainerPropertyIds(); - for (final Iterator it = ids.iterator(); it.hasNext();) { + final Collection ids = dataSource.getContainerPropertyIds(); + for (final Iterator it = ids.iterator(); it.hasNext();) { final Object id = it.next(); - final Class c = dataSource.getType(id); + final Class c = dataSource.getType(id); if (Date.class.isAssignableFrom(c)) { itemStartPropertyId = id; return true; @@ -257,7 +257,7 @@ public class CalendarField extends DateField implements Container.Viewer { month = ((Date) value).getMonth(); } - for (final Iterator it = dataSource.getItemIds().iterator(); it + for (final Iterator it = dataSource.getItemIds().iterator(); it .hasNext();) { final Object itemId = it.next(); final Item item = dataSource.getItem(itemId); diff --git a/src/com/vaadin/demo/reservation/GoogleMap.java b/src/com/vaadin/demo/reservation/GoogleMap.java index 54d7d4bcf7..e82f7c0f6a 100644 --- a/src/com/vaadin/demo/reservation/GoogleMap.java +++ b/src/com/vaadin/demo/reservation/GoogleMap.java @@ -55,8 +55,8 @@ public class GoogleMap extends AbstractComponent implements Sizeable, if (dataSource != null) { target.startTag(TAG_MARKERS); - final Collection itemIds = dataSource.getItemIds(); - for (final Iterator it = itemIds.iterator(); it.hasNext();) { + final Collection itemIds = dataSource.getItemIds(); + for (final Iterator it = itemIds.iterator(); it.hasNext();) { final Object itemId = it.next(); final Item item = dataSource.getItem(itemId); Property p = item.getItemProperty(getItemMarkerXPropertyId()); diff --git a/src/com/vaadin/demo/reservation/ResourceSelectorPanel.java b/src/com/vaadin/demo/reservation/ResourceSelectorPanel.java index c73e287ef1..a99cb23940 100644 --- a/src/com/vaadin/demo/reservation/ResourceSelectorPanel.java +++ b/src/com/vaadin/demo/reservation/ResourceSelectorPanel.java @@ -17,7 +17,7 @@ import com.vaadin.ui.Panel; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Button.ClickEvent; -@SuppressWarnings("serial") +@SuppressWarnings( { "serial", "unchecked" }) public class ResourceSelectorPanel extends Panel implements Button.ClickListener { private final HashMap categoryLayouts = new HashMap(); diff --git a/src/com/vaadin/demo/reservation/SampleDB.java b/src/com/vaadin/demo/reservation/SampleDB.java index a9ab81fc1b..9be151c9e0 100644 --- a/src/com/vaadin/demo/reservation/SampleDB.java +++ b/src/com/vaadin/demo/reservation/SampleDB.java @@ -267,7 +267,7 @@ public class SampleDB { } - public Container getReservations(List resources) { + public Container getReservations(List resources) { // TODO where reserved_by=? // TODO where from=? // TODO where to=? @@ -277,7 +277,7 @@ public class SampleDB { + Resource.PROPERTY_ID_ID; if (resources != null && resources.size() > 0) { final StringBuffer s = new StringBuffer(); - for (final Iterator it = resources.iterator(); it.hasNext();) { + for (final Iterator it = resources.iterator(); it.hasNext();) { if (s.length() > 0) { s.append(","); } @@ -397,14 +397,14 @@ public class SampleDB { "Customer meeting", "Guests arriving at harbour", "Moving furniture", "Taking guests to see town" }; final Container cat = getCategories(); - final Collection cIds = cat.getItemIds(); - for (final Iterator it = cIds.iterator(); it.hasNext();) { + final Collection cIds = cat.getItemIds(); + for (final Iterator it = cIds.iterator(); it.hasNext();) { final Object id = it.next(); final Item ci = cat.getItem(id); final String c = (String) ci.getItemProperty( Resource.PROPERTY_ID_CATEGORY).getValue(); final Container resources = getResources(c); - final Collection rIds = resources.getItemIds(); + final Collection rIds = resources.getItemIds(); final Calendar cal = Calendar.getInstance(); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); @@ -413,7 +413,7 @@ public class SampleDB { // cal.add(Calendar.DAY_OF_MONTH, -days); for (int i = 0; i < days; i++) { int r = 3; - for (final Iterator rit = rIds.iterator(); rit.hasNext() + for (final Iterator rit = rIds.iterator(); rit.hasNext() && r > 0; r--) { final Object rid = rit.next(); final Item resource = resources.getItem(rid); diff --git a/src/com/vaadin/demo/reservation/gwt/client/ui/VCalendarField.java b/src/com/vaadin/demo/reservation/gwt/client/ui/VCalendarField.java index ad9b2f8ae3..0ccb5b73ef 100644 --- a/src/com/vaadin/demo/reservation/gwt/client/ui/VCalendarField.java +++ b/src/com/vaadin/demo/reservation/gwt/client/ui/VCalendarField.java @@ -24,6 +24,7 @@ import com.vaadin.terminal.gwt.client.ui.CalendarEntry; import com.vaadin.terminal.gwt.client.ui.VCalendarPanel; import com.vaadin.terminal.gwt.client.ui.VDateField; +@SuppressWarnings( { "deprecation", "unchecked" }) public class VCalendarField extends VDateField { private final VCalendarPanel calPanel; @@ -87,7 +88,6 @@ public class VCalendarField extends VDateField { buildDayView(date); } - @SuppressWarnings("deprecation") protected void buildDayView(Date date) { if (hourPanel == null) { hourPanel = new SimplePanel(); @@ -219,7 +219,6 @@ public class VCalendarField extends VDateField { private final HashMap dates = new HashMap(); - @SuppressWarnings("deprecation") public void addItem(UIDL item) { final String styleName = item.getStringAttribute("styleName"); // final Integer id = new Integer(item.getIntAttribute("id")); @@ -265,7 +264,6 @@ public class VCalendarField extends VDateField { } } - @SuppressWarnings("deprecation") public List getEntries(Date date, int resolution) { final ArrayList res = new ArrayList(); if (date == null) { diff --git a/src/com/vaadin/demo/reservation/gwt/client/ui/VGoogleMap.java b/src/com/vaadin/demo/reservation/gwt/client/ui/VGoogleMap.java index 026f89f1be..e6150c39b7 100644 --- a/src/com/vaadin/demo/reservation/gwt/client/ui/VGoogleMap.java +++ b/src/com/vaadin/demo/reservation/gwt/client/ui/VGoogleMap.java @@ -78,6 +78,7 @@ public class VGoogleMap extends Composite implements Paintable { private void addMarkerPopup(Marker marker, final String html) { marker.addMarkerClickHandler(new MarkerClickHandler() { + @SuppressWarnings("deprecation") public void onClick(MarkerClickEvent event) { widget.getInfoWindow().open(event.getSender().getPoint(), new InfoWindowContent(html)); diff --git a/src/com/vaadin/demo/reservation/simple/AdminView.java b/src/com/vaadin/demo/reservation/simple/AdminView.java index 59d772b80a..49798f5181 100644 --- a/src/com/vaadin/demo/reservation/simple/AdminView.java +++ b/src/com/vaadin/demo/reservation/simple/AdminView.java @@ -76,8 +76,7 @@ public class AdminView extends VerticalLayout { public void buttonClick(ClickEvent event) { if (editedItem == null) { // save - int addResource = application.getDb().addResource( - name.getValue().toString(), + application.getDb().addResource(name.getValue().toString(), desc.getValue().toString()); } else { // update diff --git a/src/com/vaadin/demo/reservation/simple/SampleDB.java b/src/com/vaadin/demo/reservation/simple/SampleDB.java index 286f1dd564..bd1808e385 100644 --- a/src/com/vaadin/demo/reservation/simple/SampleDB.java +++ b/src/com/vaadin/demo/reservation/simple/SampleDB.java @@ -236,7 +236,7 @@ public class SampleDB { } - public Container getReservations(List resources) { + public Container getReservations(List resources) { // TODO where reserved_by=? // TODO where from=? // TODO where to=? @@ -246,7 +246,7 @@ public class SampleDB { + Resource.PROPERTY_ID_ID; if (resources != null && resources.size() > 0) { final StringBuffer s = new StringBuffer(); - for (final Iterator it = resources.iterator(); it.hasNext();) { + for (final Iterator it = resources.iterator(); it.hasNext();) { if (s.length() > 0) { s.append(","); } @@ -355,14 +355,14 @@ public class SampleDB { "Customer meeting", "Guests arriving at harbour", "Moving furniture", "Taking guests to see town" }; final Container cat = getCategories(); - final Collection cIds = cat.getItemIds(); - for (final Iterator it = cIds.iterator(); it.hasNext();) { + final Collection cIds = cat.getItemIds(); + for (final Iterator it = cIds.iterator(); it.hasNext();) { final Object id = it.next(); final Item ci = cat.getItem(id); final String c = (String) ci.getItemProperty( Resource.PROPERTY_ID_CATEGORY).getValue(); final Container resources = getResources(c); - final Collection rIds = resources.getItemIds(); + final Collection rIds = resources.getItemIds(); final Calendar cal = Calendar.getInstance(); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); @@ -371,7 +371,7 @@ public class SampleDB { // cal.add(Calendar.DAY_OF_MONTH, -days); for (int i = 0; i < days; i++) { int r = 3; - for (final Iterator rit = rIds.iterator(); rit.hasNext() + for (final Iterator rit = rIds.iterator(); rit.hasNext() && r > 0; r--) { final Object rid = rit.next(); final Item resource = resources.getItem(rid); diff --git a/src/com/vaadin/demo/sampler/APIResource.java b/src/com/vaadin/demo/sampler/APIResource.java index 111b0be60f..76719f48ab 100644 --- a/src/com/vaadin/demo/sampler/APIResource.java +++ b/src/com/vaadin/demo/sampler/APIResource.java @@ -14,15 +14,15 @@ public class APIResource extends NamedExternalResource { private static final String SERVLET_BASE = "http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2"; private static final String PORTLET_BASE = "http://developers.sun.com/docs/jscreator/apis/portlet"; - public APIResource(Class clazz) { + public APIResource(Class clazz) { this(resolveBaseUrl(clazz), clazz); } - public APIResource(String baseUrl, Class clazz) { + public APIResource(String baseUrl, Class clazz) { super(resolveName(clazz), getJavadocUrl(baseUrl, clazz)); } - private static String getJavadocUrl(String baseUrl, Class clazz) { + private static String getJavadocUrl(String baseUrl, Class clazz) { if (!baseUrl.endsWith("/")) { baseUrl += "/"; } @@ -38,7 +38,7 @@ public class APIResource extends NamedExternalResource { * @param clazz * @return */ - private static String resolveBaseUrl(Class clazz) { + private static String resolveBaseUrl(Class clazz) { String name = clazz.getName(); if (name.startsWith("javax.servlet.")) { return SERVLET_BASE; @@ -50,8 +50,8 @@ public class APIResource extends NamedExternalResource { return VAADIN_BASE; } - private static String resolveName(Class clazz) { - Class ec = clazz.getEnclosingClass(); + private static String resolveName(Class clazz) { + Class ec = clazz.getEnclosingClass(); return (ec != null ? ec.getSimpleName() + "." : "") + clazz.getSimpleName(); } diff --git a/src/com/vaadin/demo/sampler/ModeSwitch.java b/src/com/vaadin/demo/sampler/ModeSwitch.java index c6565c0c61..738f9f07cb 100644 --- a/src/com/vaadin/demo/sampler/ModeSwitch.java +++ b/src/com/vaadin/demo/sampler/ModeSwitch.java @@ -72,10 +72,11 @@ public class ModeSwitch extends CustomComponent { updateStyles(); } + @SuppressWarnings("unchecked") private void updateStyles() { boolean first = true; - for (Iterator it = layout.getComponentIterator(); it.hasNext();) { - Button b = (Button) it.next(); + for (Iterator