@@ -144,10 +144,10 @@ public class ReportUsage { | |||
appendUserAgentProperty(extra, "os.version"); | |||
if (extra.length() != 0) { | |||
userAgent += " (" + extra.toString() + ")"; | |||
userAgent += " (" + extra + ")"; | |||
} | |||
return userAgent.toString(); | |||
return userAgent; | |||
} | |||
private static void appendUserAgentProperty(StringBuilder sb, |
@@ -280,7 +280,7 @@ public class MeasuredSize { | |||
String changedFrom, String changedTo) { | |||
if (debugSizeChanges) { | |||
getLogger().info(sizeChangeType + " has changed from " + changedFrom | |||
+ " to " + changedTo + " for " + element.toString()); | |||
+ " to " + changedTo + " for " + element); | |||
} | |||
} | |||
@@ -251,7 +251,7 @@ public class ServerRpcQueue { | |||
String connectorId = invocation.getConnectorId(); | |||
if (!connectorExists(connectorId)) { | |||
getLogger().info("Ignoring RPC for removed connector: " | |||
+ connectorId + ": " + invocation.toString()); | |||
+ connectorId + ": " + invocation); | |||
continue; | |||
} | |||
@@ -269,8 +269,8 @@ public class ServerRpcQueue { | |||
Method method = type.getMethod(invocation.getMethodName()); | |||
parameterTypes = method.getParameterTypes(); | |||
} catch (NoDataException e) { | |||
throw new RuntimeException( | |||
"No type data for " + invocation.toString(), e); | |||
throw new RuntimeException("No type data for " + invocation, | |||
e); | |||
} | |||
} | |||
@@ -89,7 +89,7 @@ public class Type { | |||
if (i != 0) { | |||
string += ','; | |||
} | |||
string += parameterTypes[i].toString(); | |||
string += parameterTypes[i]; | |||
} | |||
string += '>'; | |||
} |
@@ -152,7 +152,7 @@ public class VAccordion extends VTabsheetBase { | |||
addStyleDependentName("loading"); | |||
connector.getRpcProxy(TabsheetServerRpc.class) | |||
.setSelected(tabKeys.get(index).toString()); | |||
.setSelected(tabKeys.get(index)); | |||
} | |||
} | |||
@@ -828,7 +828,7 @@ public class VTabsheet extends VTabsheetBase | |||
getCurrentlyDisplayedWidget().getElement().getParentElement() | |||
.getStyle().setVisibility(Visibility.HIDDEN); | |||
getRpcProxy().setSelected(tabKeys.get(tabIndex).toString()); | |||
getRpcProxy().setSelected(tabKeys.get(tabIndex)); | |||
waitingForResponse = true; | |||
@@ -131,7 +131,7 @@ public class MenuBarConnector extends AbstractComponentConnector | |||
} | |||
} | |||
currentItem = currentMenu.addItem(itemHTML.toString(), cmd); | |||
currentItem = currentMenu.addItem(itemHTML, cmd); | |||
currentItem.updateFromUIDL(item, client); | |||
if (item.getChildCount() > 0) { |
@@ -3164,8 +3164,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, | |||
if (!columns.contains(column)) { | |||
throw new IllegalArgumentException( | |||
"Given column is not a column in this grid. " | |||
+ column.toString()); | |||
"Given column is not a column in this grid. " + column); | |||
} | |||
if (!column.isSortable()) { | |||
@@ -4724,8 +4723,8 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, | |||
@Override | |||
public void render(RendererCellReference cell, Object data) { | |||
if (!warned && !(data instanceof String)) { | |||
getLogger().warning(Column.this.toString() + ": " | |||
+ DEFAULT_RENDERER_WARNING); | |||
getLogger().warning( | |||
Column.this + ": " + DEFAULT_RENDERER_WARNING); | |||
warned = true; | |||
} | |||
@@ -5599,7 +5598,8 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, | |||
boolean isSelected = hasData && isSelected(rowData); | |||
if (Grid.this.selectionModel.isSelectionAllowed()) { | |||
rowElement.setAttribute("aria-selected", String.valueOf(isSelected)); | |||
rowElement.setAttribute("aria-selected", | |||
String.valueOf(isSelected)); | |||
} else { | |||
rowElement.removeAttribute("aria-selected"); | |||
} | |||
@@ -6318,10 +6318,11 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, | |||
* Adds the given role as 'role="$param"' to the {@code <table />} element | |||
* of the grid. | |||
* | |||
* @param role the role param | |||
* @param role | |||
* the role param | |||
* @since 8.2 | |||
*/ | |||
protected void setAriaRole(String role){ | |||
protected void setAriaRole(String role) { | |||
escalator.getTable().setAttribute("role", role); | |||
} | |||
@@ -471,8 +471,7 @@ public class GridConnector extends AbstractHasComponentsConnector | |||
} else { | |||
getLogger().warning( | |||
"Visibility changed for a unknown column type in Grid: " | |||
+ column.toString() + ", type " | |||
+ column.getClass()); | |||
+ column + ", type " + column.getClass()); | |||
} | |||
} | |||
} |
@@ -3148,8 +3148,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, | |||
if (!columns.contains(column)) { | |||
throw new IllegalArgumentException( | |||
"Given column is not a column in this grid. " | |||
+ column.toString()); | |||
"Given column is not a column in this grid. " + column); | |||
} | |||
if (!column.isSortable()) { | |||
@@ -4714,8 +4713,8 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, | |||
@Override | |||
public void render(RendererCellReference cell, Object data) { | |||
if (!warned && !(data instanceof String)) { | |||
getLogger().warning(Column.this.toString() + ": " | |||
+ DEFAULT_RENDERER_WARNING); | |||
getLogger().warning( | |||
Column.this + ": " + DEFAULT_RENDERER_WARNING); | |||
warned = true; | |||
} | |||
@@ -151,16 +151,14 @@ public class GAEVaadinServlet extends VaadinServlet { | |||
VaadinServletResponse response) throws IOException { | |||
criticalNotification(request, response, "NotSerializableException", | |||
"I'm sorry, but there seems to be a serious problem, please contact the administrator. And please take note of any unsaved data...", | |||
"", | |||
getApplicationUrl(request).toString() + "?restartApplication"); | |||
"", getApplicationUrl(request) + "?restartApplication"); | |||
} | |||
protected void sendCriticalErrorNotification(VaadinServletRequest request, | |||
VaadinServletResponse response) throws IOException { | |||
criticalNotification(request, response, "Critical error", | |||
"I'm sorry, but there seems to be a serious problem, please contact the administrator. And please take note of any unsaved data...", | |||
"", | |||
getApplicationUrl(request).toString() + "?restartApplication"); | |||
"", getApplicationUrl(request) + "?restartApplication"); | |||
} | |||
@Override | |||
@@ -227,8 +225,8 @@ public class GAEVaadinServlet extends VaadinServlet { | |||
try { | |||
Thread.sleep(RETRY_AFTER_MILLISECONDS); | |||
} catch (InterruptedException e) { | |||
getLogger() | |||
.finer("Thread.sleep() interrupted while waiting for lock. Trying again. " | |||
getLogger().finer( | |||
"Thread.sleep() interrupted while waiting for lock. Trying again. " | |||
+ e); | |||
} | |||
} |
@@ -31,7 +31,7 @@ import com.vaadin.v7.data.util.converter.Converter; | |||
* For example <code> | |||
* <pre>textfield.setPropertyDataSource(new PropertyFormatter(property) { | |||
public String format(Object value) { | |||
return ((Double) value).toString() + "000000000"; | |||
return ((Double) value) + "000000000"; | |||
} | |||
public Object parse(String formattedValue) throws Exception { | |||
@@ -223,7 +223,7 @@ public abstract class PropertyFormatter<T> extends AbstractProperty<String> | |||
} | |||
} else { | |||
try { | |||
dataSource.setValue(parse(newValue.toString())); | |||
dataSource.setValue(parse(newValue)); | |||
if (!newValue.equals(getValue())) { | |||
fireValueChange(); | |||
} |
@@ -145,7 +145,7 @@ public class TextFileProperty extends AbstractProperty<String> { | |||
? new OutputStreamWriter(fos) | |||
: new OutputStreamWriter(fos, charset); | |||
BufferedWriter w = new BufferedWriter(osw); | |||
w.append(newValue.toString()); | |||
w.append(newValue); | |||
w.flush(); | |||
w.close(); | |||
osw.close(); |
@@ -127,13 +127,13 @@ public final class RowItem implements Item { | |||
public String toString() { | |||
StringBuilder s = new StringBuilder(); | |||
s.append("ID:"); | |||
s.append(getId().toString()); | |||
s.append(getId()); | |||
for (Object propId : getItemPropertyIds()) { | |||
s.append('|'); | |||
s.append(propId.toString()); | |||
s.append(propId); | |||
s.append(':'); | |||
Object value = getItemProperty(propId).getValue(); | |||
s.append((null != value) ? value.toString() : null); | |||
s.append(value); | |||
} | |||
return s.toString(); | |||
} |
@@ -112,7 +112,7 @@ public class MSSQLGenerator extends DefaultSQLGenerator { | |||
query.append(QueryBuilder.getWhereStringForFilters(filters, sh)); | |||
} | |||
query.append(") AS a WHERE a.rownum BETWEEN ").append(offset) | |||
.append(" AND ").append(Integer.toString(offset + pagelength)); | |||
.append(" AND ").append(offset + pagelength); | |||
sh.setQueryString(query.toString()); | |||
return sh; | |||
} |
@@ -442,9 +442,9 @@ public abstract class AbstractTextField extends AbstractField<String> implements | |||
lastKnownTextContent = getNullRepresentation(); | |||
textChangeEventPending = true; | |||
} else if (newValue != null | |||
&& !newValue.toString().equals(lastKnownTextContent)) { | |||
&& !newValue.equals(lastKnownTextContent)) { | |||
// Value was changed to something else than null representation | |||
lastKnownTextContent = newValue.toString(); | |||
lastKnownTextContent = newValue; | |||
textChangeEventPending = true; | |||
} | |||
firePendingTextChangeEvent(); | |||
@@ -652,7 +652,7 @@ public abstract class AbstractTextField extends AbstractField<String> implements | |||
* @since 6.4 | |||
*/ | |||
public void selectAll() { | |||
String text = getValue() == null ? "" : getValue().toString(); | |||
String text = getValue() == null ? "" : getValue(); | |||
setSelectionRange(0, text.length()); | |||
} | |||
@@ -861,7 +861,7 @@ public class Form extends AbstractField<Object> | |||
final Field<?> oldField = fields.get(propertyId); | |||
if (oldField == null) { | |||
throw new IllegalArgumentException("Field with given propertyid '" | |||
+ propertyId.toString() + "' can not be found."); | |||
+ propertyId + "' can not be found."); | |||
} | |||
final Object value = oldField.getPropertyDataSource() == null | |||
? oldField.getValue() | |||
@@ -890,16 +890,14 @@ public class Form extends AbstractField<Object> | |||
if (!found) { | |||
throw new IllegalArgumentException( | |||
"Currently selected value '" + val | |||
+ "' of property '" | |||
+ propertyId.toString() | |||
+ "' of property '" + propertyId | |||
+ "' was not found"); | |||
} | |||
} | |||
isMultiselect = true; | |||
} else { | |||
throw new IllegalArgumentException( | |||
"Current value '" + value + "' of property '" | |||
+ propertyId.toString() + "' was not found"); | |||
throw new IllegalArgumentException("Current value '" + value | |||
+ "' of property '" + propertyId + "' was not found"); | |||
} | |||
} | |||
@@ -5265,13 +5265,11 @@ public class Grid extends AbstractComponent | |||
addColumnProperty(propertyId, String.class, ""); | |||
} else { | |||
if (columns.containsKey(propertyId)) { | |||
throw new IllegalStateException( | |||
"A column for property id '" + propertyId.toString() | |||
+ "' already exists in this grid"); | |||
throw new IllegalStateException("A column for property id '" | |||
+ propertyId + "' already exists in this grid"); | |||
} else { | |||
throw new IllegalStateException( | |||
"Property id '" + propertyId.toString() | |||
+ "' does not exist in the container"); | |||
throw new IllegalStateException("Property id '" + propertyId | |||
+ "' does not exist in the container"); | |||
} | |||
} | |||
@@ -231,7 +231,7 @@ public class DateRenderer extends AbstractRenderer<Date> { | |||
public String toString() { | |||
final String fieldInfo; | |||
if (dateFormat != null) { | |||
fieldInfo = "dateFormat: " + dateFormat.toString(); | |||
fieldInfo = "dateFormat: " + dateFormat; | |||
} else { | |||
fieldInfo = "locale: " + locale + ", formatString: " + formatString; | |||
} |
@@ -180,9 +180,9 @@ public class NumberRenderer extends AbstractRenderer<Number> { | |||
} else if (numberFormat != null) { | |||
stringValue = numberFormat.format(value); | |||
} else { | |||
throw new IllegalStateException(String.format( | |||
"Internal bug: " + "%s is in an illegal state: " | |||
+ "[locale: %s, numberFormat: %s, formatString: %s]", | |||
throw new IllegalStateException(String.format("Internal bug: " | |||
+ "%s is in an illegal state: " | |||
+ "[locale: %s, numberFormat: %s, formatString: %s]", | |||
getClass().getSimpleName(), locale, numberFormat, | |||
formatString)); | |||
} | |||
@@ -193,7 +193,7 @@ public class NumberRenderer extends AbstractRenderer<Number> { | |||
public String toString() { | |||
final String fieldInfo; | |||
if (numberFormat != null) { | |||
fieldInfo = "numberFormat: " + numberFormat.toString(); | |||
fieldInfo = "numberFormat: " + numberFormat; | |||
} else { | |||
fieldInfo = "locale: " + locale + ", formatString: " + formatString; | |||
} |
@@ -27,7 +27,7 @@ public class FreeformQueryUtil { | |||
QueryBuilder.getWhereStringForFilters(filters, sh)); | |||
} | |||
query.append(") AS a WHERE a.rownum BETWEEN ").append(offset) | |||
.append(" AND ").append(Integer.toString(offset + limit)); | |||
.append(" AND ").append(offset + limit); | |||
sh.setQueryString(query.toString()); | |||
return sh; | |||
} else if (SQLTestsConstants.db == DB.ORACLE) { |
@@ -17,8 +17,6 @@ package com.vaadin.v7.tests.server.component.grid.declarative; | |||
import java.util.List; | |||
import org.junit.Assert; | |||
import com.vaadin.tests.design.DeclarativeTestBase; | |||
import com.vaadin.v7.ui.Grid; | |||
import com.vaadin.v7.ui.Grid.Column; | |||
@@ -54,8 +52,8 @@ public class GridDeclarativeTestBase extends DeclarativeTestBase<Grid> { | |||
} | |||
private void compareHeaders(Grid expected, Grid actual) { | |||
assertEquals("Different header row count", | |||
expected.getHeaderRowCount(), actual.getHeaderRowCount()); | |||
assertEquals("Different header row count", expected.getHeaderRowCount(), | |||
actual.getHeaderRowCount()); | |||
for (int i = 0; i < expected.getHeaderRowCount(); ++i) { | |||
HeaderRow expectedRow = expected.getHeaderRow(i); | |||
HeaderRow actualRow = actual.getHeaderRow(i); | |||
@@ -66,8 +64,8 @@ public class GridDeclarativeTestBase extends DeclarativeTestBase<Grid> { | |||
} | |||
for (Column c : expected.getColumns()) { | |||
String baseError = "Difference when comparing cell for " | |||
+ c.toString() + " on header row " + i + ": "; | |||
String baseError = "Difference when comparing cell for " + c | |||
+ " on header row " + i + ": "; | |||
Object propertyId = c.getPropertyId(); | |||
HeaderCell expectedCell = expectedRow.getCell(propertyId); | |||
HeaderCell actualCell = actualRow.getCell(propertyId); | |||
@@ -92,15 +90,15 @@ public class GridDeclarativeTestBase extends DeclarativeTestBase<Grid> { | |||
} | |||
private void compareFooters(Grid expected, Grid actual) { | |||
assertEquals("Different footer row count", | |||
expected.getFooterRowCount(), actual.getFooterRowCount()); | |||
assertEquals("Different footer row count", expected.getFooterRowCount(), | |||
actual.getFooterRowCount()); | |||
for (int i = 0; i < expected.getFooterRowCount(); ++i) { | |||
FooterRow expectedRow = expected.getFooterRow(i); | |||
FooterRow actualRow = actual.getFooterRow(i); | |||
for (Column c : expected.getColumns()) { | |||
String baseError = "Difference when comparing cell for " | |||
+ c.toString() + " on footer row " + i + ": "; | |||
String baseError = "Difference when comparing cell for " + c | |||
+ " on footer row " + i + ": "; | |||
Object propertyId = c.getPropertyId(); | |||
FooterCell expectedCell = expectedRow.getCell(propertyId); | |||
FooterCell actualCell = actualRow.getCell(propertyId); |
@@ -166,7 +166,7 @@ public class AtmospherePushConnection implements PushConnection { | |||
try { | |||
Writer writer = new StringWriter(); | |||
new UidlWriter().write(getUI(), writer, async); | |||
sendMessage("for(;;);[{" + writer.toString() + "}]"); | |||
sendMessage("for(;;);[{" + writer + "}]"); | |||
} catch (Exception e) { | |||
throw new RuntimeException("Push failed", e); | |||
} | |||
@@ -230,8 +230,8 @@ public class AtmospherePushConnection implements PushConnection { | |||
/** | |||
* Associates this {@link AtmospherePushConnection} with the given | |||
* {@link AtmosphereResource} representing an established push connection. If | |||
* already connected, calls {@link #disconnect()} first. If there is a | |||
* {@link AtmosphereResource} representing an established push connection. | |||
* If already connected, calls {@link #disconnect()} first. If there is a | |||
* deferred push, carries it out via the new connection. | |||
* | |||
* @since 7.2 |
@@ -323,9 +323,8 @@ public abstract class AbstractSingleComponentContainer extends AbstractComponent | |||
protected void readDesignChildren(Elements children, | |||
DesignContext context) { | |||
if (children.size() > 1) { | |||
throw new DesignException( | |||
"The container of type " + getClass().toString() | |||
+ " can have only one child component."); | |||
throw new DesignException("The container of type " + getClass() | |||
+ " can have only one child component."); | |||
} else if (children.size() == 1) { | |||
setContent(context.readDesign(children.first())); | |||
} |
@@ -704,7 +704,7 @@ public class ComboBox<T> extends AbstractSingleSelect<T> | |||
private void updateSelectedItemCaption() { | |||
String selectedCaption = null; | |||
T value = getDataCommunicator().getKeyMapper().get(getSelectedKey()); | |||
T value = keyToItem(getSelectedKey()); | |||
if (value != null) { | |||
selectedCaption = getItemCaptionGenerator().apply(value); | |||
} | |||
@@ -713,7 +713,7 @@ public class ComboBox<T> extends AbstractSingleSelect<T> | |||
private void updateSelectedItemIcon() { | |||
String selectedItemIcon = null; | |||
T value = getDataCommunicator().getKeyMapper().get(getSelectedKey()); | |||
T value = keyToItem(getSelectedKey()); | |||
if (value != null) { | |||
Resource icon = getItemIconGenerator().apply(value); | |||
if (icon != null) { | |||
@@ -772,9 +772,8 @@ public class ComboBox<T> extends AbstractSingleSelect<T> | |||
((DeclarativeStyleGenerator) styleGenerator).setStyle(item, | |||
child.attr("style")); | |||
} else { | |||
throw new IllegalStateException(String.format( | |||
"Don't know how " | |||
+ "to set style using current style generator '%s'", | |||
throw new IllegalStateException(String.format("Don't know how " | |||
+ "to set style using current style generator '%s'", | |||
styleGenerator.getClass().getName())); | |||
} | |||
} |
@@ -2540,9 +2540,9 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, | |||
if (!renderer.getPresentationType() | |||
.isAssignableFrom(definition.getType())) { | |||
throw new IllegalArgumentException(renderer.toString() | |||
+ " cannot be used with a property of type " | |||
+ definition.getType().getName()); | |||
throw new IllegalArgumentException( | |||
renderer + " cannot be used with a property of type " | |||
+ definition.getType().getName()); | |||
} | |||
@SuppressWarnings({ "unchecked", "rawtypes" }) | |||
@@ -4259,7 +4259,7 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, | |||
protected T deserializeDeclarativeRepresentation(String item) { | |||
if (item == null) { | |||
return super.deserializeDeclarativeRepresentation( | |||
new String(UUID.randomUUID().toString())); | |||
UUID.randomUUID().toString()); | |||
} | |||
return super.deserializeDeclarativeRepresentation(new String(item)); | |||
} |
@@ -544,8 +544,7 @@ public abstract class UI extends AbstractSingleComponentContainer | |||
if (session == null) { | |||
return null; | |||
} else { | |||
return session.toString() + " for " | |||
+ session.getService().getServiceName(); | |||
return session + " for " + session.getService().getServiceName(); | |||
} | |||
} | |||
@@ -402,8 +402,8 @@ public class DesignContext implements Serializable { | |||
String contentString = attributes.get("content"); | |||
String[] parts = contentString.split(":"); | |||
if (parts.length != 2) { | |||
throw new DesignException("The meta tag '" | |||
+ child.toString() + "' cannot be parsed."); | |||
throw new DesignException("The meta tag '" + child | |||
+ "' cannot be parsed."); | |||
} | |||
String prefixName = parts[0]; | |||
String packageName = parts[1]; |
@@ -47,8 +47,9 @@ import com.vaadin.ui.declarative.DesignAttributeHandler; | |||
@SuppressWarnings("serial") | |||
public class DesignResourceConverter implements Converter<String, Resource> { | |||
private static final Map<Integer, VaadinIcons> CODE_POINTS = | |||
Arrays.stream(VaadinIcons.values()).collect(Collectors.toMap(VaadinIcons::getCodepoint, icon -> icon)); | |||
private static final Map<Integer, VaadinIcons> CODE_POINTS = Arrays | |||
.stream(VaadinIcons.values()) | |||
.collect(Collectors.toMap(VaadinIcons::getCodepoint, icon -> icon)); | |||
@Override | |||
public Result<Resource> convertToModel(String value, ValueContext context) { | |||
@@ -115,7 +116,9 @@ public class DesignResourceConverter implements Converter<String, Resource> { | |||
return CODE_POINTS.get(codepoint); | |||
} | |||
if (FontAwesome.FONT_FAMILY.equals(familyAndCode[0])) { //Left for compatibility | |||
if (FontAwesome.FONT_FAMILY.equals(familyAndCode[0])) { // Left | |||
// for | |||
// compatibility | |||
return FontAwesome.fromCodepoint(codepoint); | |||
} | |||
// all vaadin icons should have a codepoint | |||
@@ -144,9 +147,8 @@ public class DesignResourceConverter implements Converter<String, Resource> { | |||
@Override | |||
public String format(Resource value) { | |||
throw new UnsupportedOperationException( | |||
"Use " + ResourceConverterByProtocol.FONTICON.toString() | |||
+ " instead"); | |||
throw new UnsupportedOperationException("Use " | |||
+ ResourceConverterByProtocol.FONTICON + " instead"); | |||
} | |||
}, | |||
FILE { | |||
@@ -168,7 +170,8 @@ public class DesignResourceConverter implements Converter<String, Resource> { | |||
}; | |||
public static final String VAADIN_ICONS_NAME = VaadinIcons.ABACUS.getFontFamily(); | |||
public static final String VAADIN_ICONS_NAME = VaadinIcons.ABACUS | |||
.getFontFamily(); | |||
@Override | |||
public Resource parse(String value) { |
@@ -230,7 +230,7 @@ public class DateRenderer extends AbstractRenderer<Object, Date> { | |||
public String toString() { | |||
final String fieldInfo; | |||
if (dateFormat != null) { | |||
fieldInfo = "dateFormat: " + dateFormat.toString(); | |||
fieldInfo = "dateFormat: " + dateFormat; | |||
} else { | |||
fieldInfo = "locale: " + locale + ", formatString: " + formatString; | |||
} |
@@ -179,9 +179,9 @@ public class NumberRenderer extends AbstractRenderer<Object, Number> { | |||
} else if (numberFormat != null) { | |||
stringValue = numberFormat.format(value); | |||
} else { | |||
throw new IllegalStateException(String.format( | |||
"Internal bug: " + "%s is in an illegal state: " | |||
+ "[locale: %s, numberFormat: %s, formatString: %s]", | |||
throw new IllegalStateException(String.format("Internal bug: " | |||
+ "%s is in an illegal state: " | |||
+ "[locale: %s, numberFormat: %s, formatString: %s]", | |||
getClass().getSimpleName(), locale, numberFormat, | |||
formatString)); | |||
} | |||
@@ -192,7 +192,7 @@ public class NumberRenderer extends AbstractRenderer<Object, Number> { | |||
public String toString() { | |||
final String fieldInfo; | |||
if (numberFormat != null) { | |||
fieldInfo = "numberFormat: " + numberFormat.toString(); | |||
fieldInfo = "numberFormat: " + numberFormat; | |||
} else { | |||
fieldInfo = "locale: " + locale + ", formatString: " + formatString; | |||
} |
@@ -47,7 +47,7 @@ public class BackendDataProviderTest extends | |||
} | |||
List<StrBean> list = stream.skip(query.getOffset()) | |||
.limit(query.getLimit()).collect(Collectors.toList()); | |||
list.forEach(s -> System.err.println(s.toString())); | |||
list.forEach(s -> System.err.println(s)); | |||
return list.stream(); | |||
}, query -> (int) data.stream() | |||
.filter(t -> query.getFilter().orElse(s -> true).test(t)) | |||
@@ -66,4 +66,4 @@ public class BackendDataProviderTest extends | |||
getDataProvider().setSortOrders(sortOrder); | |||
} | |||
} | |||
} |
@@ -2,7 +2,7 @@ package com.vaadin.data.provider.hierarchical; | |||
import java.io.Serializable; | |||
public class Node implements Serializable{ | |||
public class Node implements Serializable { | |||
private static int counter = 0; | |||
@@ -27,7 +27,6 @@ public class Node implements Serializable{ | |||
} | |||
public String toString() { | |||
return number + (parent != null ? " [parent: " + parent.toString() + "]" | |||
: ""); | |||
return number + (parent != null ? " [parent: " + parent + "]" : ""); | |||
} | |||
} |
@@ -304,8 +304,7 @@ public class ApplicationRunnerServlet extends LegacyVaadinServlet { | |||
* context, runner, application classname | |||
*/ | |||
private static URIS getApplicationRunnerURIs(HttpServletRequest request) { | |||
final String[] urlParts = request.getRequestURI().toString() | |||
.split("\\/"); | |||
final String[] urlParts = request.getRequestURI().split("\\/"); | |||
// String runner = null; | |||
URIS uris = new URIS(); | |||
String applicationClassname = null; |
@@ -468,7 +468,7 @@ public class DevelopmentServerLauncher { | |||
System.out.println(thread.getName() + " - " + thread.getState()); | |||
for (StackTraceElement stackTraceElement : stackTraceElements) { | |||
System.out.println(" at " + stackTraceElement.toString()); | |||
System.out.println(" at " + stackTraceElement); | |||
} | |||
System.out.println(); | |||
} |
@@ -126,7 +126,7 @@ public class CustomLayoutDemo extends com.vaadin.server.LegacyApplication | |||
public void loginClicked() { | |||
username.setVisible(false); | |||
loginPwd.setVisible(false); | |||
if (username.getValue().toString().length() < 1) { | |||
if (username.getValue().length() < 1) { | |||
username.setValue("Anonymous"); | |||
} | |||
mainLayout.replaceComponent(loginButton, |
@@ -70,8 +70,7 @@ public class Parameters extends com.vaadin.server.LegacyApplication | |||
layout.addComponent( | |||
new Link(u2.toString(), new ExternalResource(u2))); | |||
} catch (final Exception e) { | |||
System.out.println( | |||
"Couldn't get hostname for this machine: " + e.toString()); | |||
System.out.println("Couldn't get hostname for this machine: " + e); | |||
e.printStackTrace(); | |||
} | |||
@@ -52,8 +52,8 @@ public class StressComponentsInTable extends CustomComponent { | |||
@Override | |||
public void buttonClick(ClickEvent event) { | |||
Button b = event.getButton(); | |||
System.out.println(b.getCaption() + " click: " | |||
+ (new Date()).toString()); | |||
System.out | |||
.println(b.getCaption() + " click: " + new Date()); | |||
System.out.println(b.getUI().getSession()); | |||
} | |||
@@ -64,19 +64,19 @@ public class StressComponentsInTable extends CustomComponent { | |||
return t; | |||
} | |||
static String[] testString = { "Jacob", "Michael", "Joshua", | |||
"Matthew", "Ethan", "Andrew", "Daniel", "Anthony", "Christopher", | |||
"Joseph", "William", "Alexander", "Ryan", "David", "Nicholas", | |||
"Tyler", "James", "John", "Jonathan", "Nathan", "Samuel", | |||
"Christian", "Noah", "Dylan", "Benjamin", "Logan", "Brandon", | |||
"Gabriel", "Zachary", "Jose", "Elijah", "Angel", "Kevin", "Jack", | |||
"Caleb", "Justin", "Austin", "Evan", "Robert", "Thomas", "Luke", | |||
"Mason", "Aidan", "Jackson", "Isaiah", "Jordan", "Gavin", "Connor", | |||
"Aiden", "Isaac", "Jason", "Cameron", "Hunter", "Jayden", "Juan", | |||
"Charles", "Aaron", "Lucas", "Luis", "Owen", "Landon", "Diego", | |||
"Brian", "Adam", "Adrian", "Kyle", "Eric", "Ian", "Nathaniel", | |||
"Carlos", "Alex", "Bryan", "Jesus", "Julian", "Sean", "Carter", | |||
"Hayden", "Jeremiah", "Cole", "Brayden", "Wyatt", "Chase", "Steven", | |||
static String[] testString = { "Jacob", "Michael", "Joshua", "Matthew", | |||
"Ethan", "Andrew", "Daniel", "Anthony", "Christopher", "Joseph", | |||
"William", "Alexander", "Ryan", "David", "Nicholas", "Tyler", | |||
"James", "John", "Jonathan", "Nathan", "Samuel", "Christian", | |||
"Noah", "Dylan", "Benjamin", "Logan", "Brandon", "Gabriel", | |||
"Zachary", "Jose", "Elijah", "Angel", "Kevin", "Jack", "Caleb", | |||
"Justin", "Austin", "Evan", "Robert", "Thomas", "Luke", "Mason", | |||
"Aidan", "Jackson", "Isaiah", "Jordan", "Gavin", "Connor", "Aiden", | |||
"Isaac", "Jason", "Cameron", "Hunter", "Jayden", "Juan", "Charles", | |||
"Aaron", "Lucas", "Luis", "Owen", "Landon", "Diego", "Brian", | |||
"Adam", "Adrian", "Kyle", "Eric", "Ian", "Nathaniel", "Carlos", | |||
"Alex", "Bryan", "Jesus", "Julian", "Sean", "Carter", "Hayden", | |||
"Jeremiah", "Cole", "Brayden", "Wyatt", "Chase", "Steven", | |||
"Timothy", "Dominic", "Sebastian", "Xavier", "Jaden", "Jesse", | |||
"Devin", "Seth", "Antonio", "Richard", "Miguel", "Colin", "Cody", | |||
"Alejandro", "Caden", "Blake", "Carson" }; |
@@ -226,8 +226,7 @@ public class TestBench extends com.vaadin.server.LegacyApplication | |||
e1.printStackTrace(); | |||
VerticalLayout lo = new VerticalLayout(); | |||
lo.addComponent(new Label( | |||
"Cannot create application / custom component: " | |||
+ e1.toString())); | |||
"Cannot create application / custom component: " + e1)); | |||
Link l = new Link("Try opening via app runner", | |||
new ExternalResource("../run/" + c.getName())); |
@@ -216,7 +216,7 @@ public class TestCaptionWrapper extends CustomComponent implements Listener { | |||
@Override | |||
public void componentEvent(Event event) { | |||
final String feedback = eventListenerString + " source=" | |||
+ event.getSource() + ", toString()=" + event.toString(); | |||
+ event.getSource() + ", toString()=" + event; | |||
System.out.println("eventListenerFeedback: " + feedback); | |||
eventListenerFeedback.setValue(feedback); | |||
} |
@@ -103,7 +103,7 @@ public class TreeFilesystem extends com.vaadin.server.LegacyApplication | |||
for (int x = 0; x < files.length; x++) { | |||
try { | |||
// add new item (String) to tree | |||
final String path = files[x].getCanonicalPath().toString(); | |||
final String path = files[x].getCanonicalPath(); | |||
tree.addItem(path); | |||
// set parent if this item has one | |||
if (parent != null) { |
@@ -54,13 +54,13 @@ public class UsingCustomNewItemHandlerInSelect extends CustomComponent { | |||
} | |||
public void populateSelect() { | |||
final String[] names = { "John", "Mary", "Joe", "Sarah", | |||
"Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" }; | |||
final String[] names = { "John", "Mary", "Joe", "Sarah", "Jeff", "Jane", | |||
"Peter", "Marc", "Josie", "Linus" }; | |||
for (int j = 0; j < 4; j++) { | |||
Integer id = new Integer(sequence++); | |||
Item item = select.addItem(id); | |||
item.getItemProperty("CAPTION").setValue(id.toString() + ": " | |||
+ names[random.nextInt() % names.length]); | |||
item.getItemProperty("CAPTION").setValue( | |||
id + ": " + names[random.nextInt() % names.length]); | |||
} | |||
} | |||
@@ -71,7 +71,7 @@ public class UsingCustomNewItemHandlerInSelect extends CustomComponent { | |||
Integer id = new Integer(sequence++); | |||
Item item = select.addItem(id); | |||
item.getItemProperty("CAPTION") | |||
.setValue(id.toString() + ": " + newItemCaption); | |||
.setValue(id + ": " + newItemCaption); | |||
select.setValue(id); | |||
} | |||
@@ -82,8 +82,7 @@ public class VaadinClasses { | |||
try { | |||
File f = new File(location.toURI()); | |||
if (!f.exists()) { | |||
throw new IOException( | |||
"Directory " + f.toString() + " does not exist"); | |||
throw new IOException("Directory " + f + " does not exist"); | |||
} | |||
findPackages(f, basePackage, baseClass, classes, | |||
ignoredPackages); |
@@ -145,7 +145,7 @@ public abstract class AbstractFieldTest<T extends AbstractField<V>, V> | |||
Locale.ENGLISH); | |||
value = format.format(date); | |||
} else { | |||
value = "'" + o.toString() + "'"; | |||
value = "'" + o + "'"; | |||
} | |||
} | |||
@@ -174,7 +174,7 @@ public abstract class LegacyAbstractFieldTest<T extends AbstractField> | |||
new Locale("en", "US")); | |||
value = format.format(d); | |||
} else { | |||
value = "'" + o.toString() + "'"; | |||
value = "'" + o + "'"; | |||
} | |||
} | |||
@@ -14,7 +14,7 @@ public class Vaadin6ImplicitDoubleConverter | |||
if (null == value) { | |||
return null; | |||
} | |||
return new Double(value.toString()); | |||
return new Double(value); | |||
} | |||
@Override |
@@ -25,8 +25,7 @@ public abstract class AbstractMultiSelectTestUI<MULTISELECT extends AbstractMult | |||
LinkedHashMap<String, ItemCaptionGenerator<Object>> options = new LinkedHashMap<>(); | |||
options.put("Null Caption Generator", item -> null); | |||
options.put("Default Caption Generator", item -> item.toString()); | |||
options.put("Custom Caption Generator", | |||
item -> item.toString() + " Caption"); | |||
options.put("Custom Caption Generator", item -> item + " Caption"); | |||
createSelectAction("Item Caption Generator", "Item Generator", options, | |||
"None", (abstractMultiSelect, captionGenerator, data) -> { |
@@ -16,7 +16,7 @@ public class ButtonMouseDetails extends TestBase { | |||
@Override | |||
public void buttonClick(ClickEvent event) { | |||
StringBuilder str = new StringBuilder(out.getValue().toString()); | |||
StringBuilder str = new StringBuilder(out.getValue()); | |||
str.append(clickCounter + ":\t"); | |||
// Modifier keys |
@@ -65,7 +65,7 @@ public class CheckBoxGroupTestUI | |||
options.put("Null Description Generator", item -> null); | |||
options.put("Default Description Generator", item -> item.toString()); | |||
options.put("Custom Description Generator", | |||
item -> item.toString() + " Description"); | |||
item -> item + " Description"); | |||
createSelectAction("Item Description Generator", | |||
"Item Description Generator", options, "None", |
@@ -23,12 +23,12 @@ public class ComboBoxBackEndRequests extends AbstractTestUI { | |||
int pageLength = DEFAULT_PAGE_LENGTH; | |||
int items = DEFAULT_NUMBER_OF_ITEMS; | |||
if (request.getParameter(PAGE_LENGTH_REQUEST_PARAMETER) != null) { | |||
pageLength = Integer.parseInt(request | |||
.getParameter(PAGE_LENGTH_REQUEST_PARAMETER).toString()); | |||
pageLength = Integer.parseInt( | |||
request.getParameter(PAGE_LENGTH_REQUEST_PARAMETER)); | |||
} | |||
if (request.getParameter(ITEMS_REQUEST_PARAMETER) != null) { | |||
items = Integer.parseInt( | |||
request.getParameter(ITEMS_REQUEST_PARAMETER).toString()); | |||
items = Integer | |||
.parseInt(request.getParameter(ITEMS_REQUEST_PARAMETER)); | |||
} | |||
ComboBox<String> cb = new ComboBox<>(); |
@@ -24,14 +24,12 @@ public class ComboFocusBlurEvents extends TestBase { | |||
final ObjectProperty<String> log = new ObjectProperty<>(""); | |||
cb.addFocusListener(event -> { | |||
log.setValue(log.getValue().toString() + "<br>" + counter | |||
+ ": Focus event!"); | |||
log.setValue(log.getValue() + "<br>" + counter + ": Focus event!"); | |||
counter++; | |||
}); | |||
cb.addBlurListener(event -> { | |||
log.setValue(log.getValue().toString() + "<br>" + counter | |||
+ ": Blur event!"); | |||
log.setValue(log.getValue() + "<br>" + counter + ": Blur event!"); | |||
counter++; | |||
}); | |||
@@ -42,8 +42,8 @@ public class ComboPushTiming extends TestBase { | |||
cb.addFocusListener(new FieldEvents.FocusListener() { | |||
@Override | |||
public void focus(FocusEvent event) { | |||
log.setValue(log.getValue().toString() + "<br>" + counter | |||
+ ": Focus event!"); | |||
log.setValue( | |||
log.getValue() + "<br>" + counter + ": Focus event!"); | |||
counter++; | |||
changeValue(cb); | |||
} | |||
@@ -52,8 +52,8 @@ public class ComboPushTiming extends TestBase { | |||
cb.addBlurListener(new FieldEvents.BlurListener() { | |||
@Override | |||
public void blur(BlurEvent event) { | |||
log.setValue(log.getValue().toString() + "<br>" + counter | |||
+ ": Blur event!"); | |||
log.setValue( | |||
log.getValue() + "<br>" + counter + ": Blur event!"); | |||
counter++; | |||
} | |||
}); |
@@ -13,8 +13,8 @@ import com.vaadin.ui.DateField; | |||
@SuppressWarnings("serial") | |||
public class DateFields extends ComponentTestCase<DateField> { | |||
private static final Locale[] LOCALES = { Locale.US, | |||
Locale.TAIWAN, new Locale("fi", "FI") }; | |||
private static final Locale[] LOCALES = { Locale.US, Locale.TAIWAN, | |||
new Locale("fi", "FI") }; | |||
@Override | |||
protected Class<DateField> getTestClass() { | |||
@@ -27,14 +27,14 @@ public class DateFields extends ComponentTestCase<DateField> { | |||
for (Locale locale : LOCALES) { | |||
DateField pd = createPopupDateField("Undefined width", "-1", | |||
locale); | |||
pd.setId("Locale-" + locale.toString() + "-undefined-wide"); | |||
pd.setId("Locale-" + locale + "-undefined-wide"); | |||
addTestComponent(pd); | |||
pd = createPopupDateField("500px width", "500px", locale); | |||
pd.setId("Locale-" + locale.toString() + "-500px-wide"); | |||
pd.setId("Locale-" + locale + "-500px-wide"); | |||
addTestComponent(pd); | |||
pd = createPopupDateField("Initially empty", "", locale); | |||
pd.setValue(null); | |||
pd.setId("Locale-" + locale.toString() + "-initially-empty"); | |||
pd.setId("Locale-" + locale + "-initially-empty"); | |||
addTestComponent(pd); | |||
} | |||
@@ -42,7 +42,7 @@ public class DateFields extends ComponentTestCase<DateField> { | |||
private DateField createPopupDateField(String caption, String width, | |||
Locale locale) { | |||
DateField pd = new DateField(caption + "(" + locale.toString() + ")"); | |||
DateField pd = new DateField(caption + "(" + locale + ")"); | |||
pd.setWidth(width); | |||
pd.setValue(LocalDate.of(1970, 05, 23)); | |||
pd.setLocale(locale); |
@@ -13,8 +13,8 @@ import com.vaadin.ui.InlineDateField; | |||
@SuppressWarnings("serial") | |||
public class InlineDateFields extends ComponentTestCase<InlineDateField> { | |||
private static final Locale[] LOCALES = { Locale.US, | |||
Locale.TAIWAN, new Locale("fi", "FI") }; | |||
private static final Locale[] LOCALES = { Locale.US, Locale.TAIWAN, | |||
new Locale("fi", "FI") }; | |||
@Override | |||
protected Class<InlineDateField> getTestClass() { | |||
@@ -32,22 +32,21 @@ public class InlineDateFields extends ComponentTestCase<InlineDateField> { | |||
InlineDateField pd = createInlineDateField("Undefined width", "-1", | |||
locale); | |||
pd.setId("Locale-" + locale.toString() + "-undefined-wide"); | |||
pd.setId("Locale-" + locale + "-undefined-wide"); | |||
addTestComponent(pd); | |||
pd = createInlineDateField("300px width", "300px", locale); | |||
pd.setId("Locale-" + locale.toString() + "-300px-wide"); | |||
pd.setId("Locale-" + locale + "-300px-wide"); | |||
addTestComponent(pd); | |||
pd = createInlineDateField("Initially empty", "", locale); | |||
pd.setValue(null); | |||
pd.setId("Locale-" + locale.toString() + "-initially-empty"); | |||
pd.setId("Locale-" + locale + "-initially-empty"); | |||
addTestComponent(pd); | |||
} | |||
private InlineDateField createInlineDateField(String caption, String width, | |||
Locale locale) { | |||
InlineDateField pd = new InlineDateField( | |||
caption + "(" + locale.toString() + ")"); | |||
InlineDateField pd = new InlineDateField(caption + "(" + locale + ")"); | |||
pd.setWidth(width); | |||
pd.setValue(LocalDate.of(1970, 05, 23)); | |||
pd.setLocale(locale); |
@@ -91,7 +91,7 @@ public class GridBasics extends AbstractTestUIWithLog { | |||
} | |||
log("Columns reordered, userOriginated: " | |||
+ event.isUserOriginated()); | |||
log("Column order: " + columnCaptions.toString()); | |||
log("Column order: " + columnCaptions); | |||
}); | |||
log("Registered a column reorder listener."); | |||
} |
@@ -53,7 +53,7 @@ public class OptionGroups extends AbstractSelectTestCase<OptionGroup> { | |||
private void createDisabledItemsMultiToggle(String category) { | |||
for (Object id : getComponent().getItemIds()) { | |||
createBooleanAction(id.toString() + " - enabled", category, true, | |||
createBooleanAction(id + " - enabled", category, true, | |||
enabledItemCommand, id); | |||
} | |||
} |
@@ -84,8 +84,7 @@ public class RadioButtonGroupTestUI | |||
LinkedHashMap<String, ItemCaptionGenerator<Object>> options = new LinkedHashMap<>(); | |||
options.put("Null Caption Generator", item -> null); | |||
options.put("Default Caption Generator", item -> item.toString()); | |||
options.put("Custom Caption Generator", | |||
item -> item.toString() + " Caption"); | |||
options.put("Custom Caption Generator", item -> item + " Caption"); | |||
createSelectAction("Item Caption Generator", "Item Caption Generator", | |||
options, "None", (radioButtonGroup, captionGenerator, data) -> { | |||
@@ -99,7 +98,7 @@ public class RadioButtonGroupTestUI | |||
options.put("Null Description Generator", item -> null); | |||
options.put("Default Description Generator", item -> item.toString()); | |||
options.put("Custom Description Generator", | |||
item -> item.toString() + " Description"); | |||
item -> item + " Description"); | |||
createSelectAction("Item Description Generator", | |||
"Item Description Generator", options, "None", |
@@ -31,7 +31,7 @@ public class RichTextAreaWithKeyboardShortcuts extends TestBase { | |||
msg += " Target:" + target.getClass().getSimpleName() + " '" | |||
+ f.getCaption() + "'"; | |||
String string = f.getValue().toString(); | |||
String string = f.getValue(); | |||
msg += " Value: " + string; | |||
Notification notification = new Notification(msg); |
@@ -34,7 +34,7 @@ public class ColumnReorderEvent extends TestBase { | |||
private String aToString(Object[] visibleColumns) { | |||
StringBuilder sb = new StringBuilder(); | |||
for (Object object : visibleColumns) { | |||
sb.append(object.toString()); | |||
sb.append(object); | |||
sb.append(" | "); | |||
} | |||
return sb.toString(); |
@@ -45,8 +45,7 @@ public class KeyControl extends TestBase { | |||
public void valueChange(ValueChangeEvent event) { | |||
@SuppressWarnings("unchecked") | |||
Set<String> value = (Set<String>) table1.getValue(); | |||
selected1 | |||
.setValue(value.toString() + " TOTAL: " + value.size()); | |||
selected1.setValue(value + " TOTAL: " + value.size()); | |||
} | |||
}); | |||
@@ -64,7 +64,7 @@ public class ScrollCursor extends TestBase { | |||
@Override | |||
public void buttonClick(ClickEvent event) { | |||
position = textArea.getValue().toString().length(); | |||
position = textArea.getValue().length(); | |||
} | |||
}); | |||
@@ -66,13 +66,11 @@ public class TextFieldFocusAndBlurListeners extends TestBase | |||
@Override | |||
public void blur(BlurEvent event) { | |||
TextField tf = (TextField) event.getComponent(); | |||
log.log(tf.getCaption() + ": Blur. Value is: " | |||
+ tf.getValue().toString()); | |||
log.log(tf.getCaption() + ": Blur. Value is: " + tf.getValue()); | |||
} | |||
public void valueChange(TextField source) { | |||
log.log(source.getCaption() + ": ValueChange: " | |||
+ source.getValue().toString()); | |||
log.log(source.getCaption() + ": ValueChange: " + source.getValue()); | |||
} | |||
} |
@@ -40,7 +40,7 @@ public class PushStateAndReplaceState extends AbstractReindeerTestUI { | |||
addComponent(replace); | |||
addComponent(createButton("test", "Move to ./test", | |||
Page.getCurrent().getLocation().toString() + "/test")); | |||
Page.getCurrent().getLocation() + "/test")); | |||
addComponent(createButton("X", "Move to X", "X")); | |||
addComponent(createButton("root_X", "Move to /X", "/X")); | |||
} | |||
@@ -67,7 +67,7 @@ public class PushStateAndReplaceState extends AbstractReindeerTestUI { | |||
private void updateLabel() { | |||
URI location = getPage().getLocation(); | |||
locationLabel.setValue("Current Location: " + location.toString()); | |||
locationLabel.setValue("Current Location: " + location); | |||
} | |||
@Override |
@@ -32,7 +32,7 @@ public class RpcInvocationHandlerToString extends AbstractTestUIWithLog { | |||
@Override | |||
public void buttonClick(ClickEvent event) { | |||
log("An invoation proxy: " + dummyProxy.toString()); | |||
log("An invoation proxy: " + dummyProxy); | |||
} | |||
}); | |||
addButton("Exec hashCode() for an invocation proxy", |
@@ -45,7 +45,7 @@ public class ShortcutInWindow extends AbstractTestUIWithLog { | |||
ValueChangeMode m = ValueChangeMode.values()[i]; | |||
toggle.setCaption(m.toString()); | |||
name.setValueChangeMode(m); | |||
log("New ValueChangeMode: " + m.toString()); | |||
log("New ValueChangeMode: " + m); | |||
}); | |||
final Button submit = new Button("Submit", | |||
(e) -> log("Submitted value: " + name.getValue())); |
@@ -89,7 +89,7 @@ public class BeanItemContainerFilteringTest extends TestBase { | |||
container.removeAllContainerFilters(); | |||
if (event.getValue()) { | |||
container.addContainerFilter("value", | |||
filterString.getValue().toString(), false, false); | |||
filterString.getValue(), false, false); | |||
} | |||
}); | |||
vl.addComponent(cb); | |||
@@ -143,8 +143,7 @@ public class BeanItemContainerFilteringTest extends TestBase { | |||
new Button.ClickListener() { | |||
@Override | |||
public void buttonClick(ClickEvent event) { | |||
int index = Integer | |||
.parseInt(position.getValue().toString()); | |||
int index = Integer.parseInt(position.getValue()); | |||
TestBean bean = new TestBean( | |||
"addItemAt() " + nextToAdd, | |||
"value " + nextToAdd); |
@@ -55,8 +55,8 @@ public class IndexedContainerFilteringTest extends TestBase { | |||
cb.addValueChangeListener(event -> { | |||
container.removeAllContainerFilters(); | |||
if (event.getValue()) { | |||
container.addContainerFilter("column1", | |||
filterString.getValue().toString(), false, false); | |||
container.addContainerFilter("column1", filterString.getValue(), | |||
false, false); | |||
} | |||
}); | |||
vl.addComponent(cb); | |||
@@ -113,8 +113,7 @@ public class IndexedContainerFilteringTest extends TestBase { | |||
new Button.ClickListener() { | |||
@Override | |||
public void buttonClick(ClickEvent event) { | |||
int index = Integer | |||
.parseInt(position.getValue().toString()); | |||
int index = Integer.parseInt(position.getValue()); | |||
String id = "addItemAt() " + nextToAdd; | |||
Item item = container.addItemAt(index, id); | |||
if (item != null) { |
@@ -38,9 +38,7 @@ public class DragImage extends AbstractTestUIWithLog { | |||
layout1.addComponents(label, new Label("spacer")); | |||
styles.add(new StringBuilder(".").append(position) | |||
.append(" { position: ").append(position).append(";}") | |||
.toString()); | |||
styles.add("." + position + " { position: " + position + ";}"); | |||
}); | |||
HorizontalLayout layout2 = new HorizontalLayout(); | |||
@@ -52,9 +50,7 @@ public class DragImage extends AbstractTestUIWithLog { | |||
.setDragImage(new ThemeResource(TestSampler.ICON_URL)); | |||
layout2.addComponents(label, new Label("spacer")); | |||
styles.add(new StringBuilder(".").append(position) | |||
.append(" { position: ").append(position).append(";}") | |||
.toString()); | |||
styles.add("." + position + " { position: " + position + ";}"); | |||
}); | |||
// #9261 grid row like element that safari can't show the drag image for |
@@ -547,7 +547,7 @@ public class OrderedLayoutBasics extends TestBase { | |||
// AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER, valign[i % 3]); | |||
// } | |||
// | |||
// tf.setValue(tf.getValue().toString() + " (100% wide)"); | |||
// tf.setValue(tf.getValue() + " (100% wide)"); | |||
// tf.setWidth("100%"); | |||
// tf = new TextField("100%x70px Field"); | |||
@@ -640,7 +640,7 @@ public class OrderedLayoutBasics extends TestBase { | |||
// AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER, valign[i % 3]); | |||
// } | |||
// | |||
// tf.setValue(tf.getValue().toString() + " (100% wide)"); | |||
// tf.setValue(tf.getValue() + " (100% wide)"); | |||
// tf.setWidth("100%"); | |||
// tf = new TextField("100%x70px Field"); |
@@ -170,7 +170,7 @@ public class CSSInjectWithColorpicker extends UI { | |||
select.setEmptySelectionAllowed(false); | |||
select.addValueChangeListener(event -> { | |||
// Get the new font family | |||
String fontFamily = select.getValue().toString(); | |||
String fontFamily = select.getValue(); | |||
// Get the stylesheet of the page | |||
Styles styles = Page.getCurrent().getStyles(); |
@@ -452,7 +452,7 @@ public class SerializerTest extends AbstractReindeerTestUI { | |||
@Override | |||
public void sendWrappedGenerics( | |||
Map<Set<SimpleTestBean>, Map<Integer, List<SimpleTestBean>>> generics) { | |||
log.log("sendWrappedGenerics: " + generics.toString()); | |||
log.log("sendWrappedGenerics: " + generics); | |||
} | |||
@Override |
@@ -6,8 +6,8 @@ import java.util.UUID; | |||
import com.vaadin.server.Page; | |||
import com.vaadin.server.Page.Styles; | |||
import com.vaadin.shared.ui.ContentMode; | |||
import com.vaadin.server.StreamResource; | |||
import com.vaadin.shared.ui.ContentMode; | |||
import com.vaadin.tests.components.TestBase; | |||
import com.vaadin.ui.Button; | |||
import com.vaadin.ui.Button.ClickEvent; | |||
@@ -68,7 +68,7 @@ public class CSSInjectTest extends TestBase { | |||
return new ByteArrayInputStream( | |||
css.getBytes()); | |||
} | |||
}, UUID.randomUUID().toString() + ".css")); | |||
}, UUID.randomUUID() + ".css")); | |||
cssToInject.setValue(""); | |||
} |
@@ -53,8 +53,7 @@ public class DateFieldElementTest extends SingleBrowserTest { | |||
} | |||
private void assertServerValue(String id, LocalDate testDateTime) { | |||
assertEquals(id + " value set to " + testDateTime.toString(), | |||
getLogRow(0)); | |||
assertEquals(id + " value set to " + testDateTime, getLogRow(0)); | |||
} | |||
@@ -56,8 +56,7 @@ public class DateTimeFieldElementTest extends SingleBrowserTest { | |||
} | |||
private void assertServerValue(String id, LocalDateTime testDateTime) { | |||
assertEquals(id + " value set to " + testDateTime.toString(), | |||
getLogRow(0)); | |||
assertEquals(id + " value set to " + testDateTime, getLogRow(0)); | |||
} | |||
@@ -73,8 +73,7 @@ public class TB3TestLocator { | |||
try { | |||
File f = new File(location.toURI()); | |||
if (!f.exists()) { | |||
throw new IOException( | |||
"Directory " + f.toString() + " does not exist"); | |||
throw new IOException("Directory " + f + " does not exist"); | |||
} | |||
findPackages(f, basePackage, baseClass, classes, | |||
ignoredPackages); |