Browse Source

Fix formatting (#11023)

tags/8.6.0.alpha1
Ilia Motornyi 6 years ago
parent
commit
57f67c3a46

+ 22
- 18
server/src/main/java/com/vaadin/data/util/BeanUtil.java View File

} }


/** /**
* Checks if the object is serializable or not. To be used in assertion checks only,
* since the check might be a bit heavyweight.
* Checks if the object is serializable or not. To be used in assertion
* checks only, since the check might be a bit heavyweight.
* *
* @param obj to be checked
* @param obj
* to be checked
* @return {@code true} * @return {@code true}
* @throws AssertionError if the object is not serializable
* @throws AssertionError
* if the object is not serializable
*/ */
public static boolean checkSerialization(Object obj) { public static boolean checkSerialization(Object obj) {
try { try {
ObjectOutputStream dummyObjectOutputStream = new ObjectOutputStream(new OutputStream() {
@Override
public void write(int b) {
}
ObjectOutputStream dummyObjectOutputStream = new ObjectOutputStream(
new OutputStream() {
@Override
public void write(int b) {
}


@SuppressWarnings("NullableProblems")
@Override
public void write(byte[] ignored) {
}
@SuppressWarnings("NullableProblems")
@Override
public void write(byte[] ignored) {
}


@SuppressWarnings("NullableProblems")
@Override
public void write(byte[] b, int off, int len) {
}
});
@SuppressWarnings("NullableProblems")
@Override
public void write(byte[] b, int off, int len) {
}
});
dummyObjectOutputStream.writeObject(obj); dummyObjectOutputStream.writeObject(obj);
} catch (Throwable e) { } catch (Throwable e) {
throw new AssertionError("Formatter supplier should be serializable", e);
throw new AssertionError(
"Formatter supplier should be serializable", e);
} }
return true; return true;
} }

+ 1
- 0
server/src/main/java/com/vaadin/server/VaadinServlet.java View File



/* /*
* (non-Javadoc) * (non-Javadoc)
*
* @see javax.servlet.GenericServlet#destroy() * @see javax.servlet.GenericServlet#destroy()
*/ */
@Override @Override

+ 2
- 2
server/src/main/java/com/vaadin/ui/Upload.java View File

fireUploadSuccess(event.getFileName(), event.getMimeType(), fireUploadSuccess(event.getFileName(), event.getMimeType(),
event.getContentLength()); event.getContentLength());
endUpload(); endUpload();
if(lastStartedEvent != null)
if (lastStartedEvent != null)
lastStartedEvent.disposeStreamVariable(); lastStartedEvent.disposeStreamVariable();
} }


} }
} finally { } finally {
endUpload(); endUpload();
if(lastStartedEvent != null)
if (lastStartedEvent != null)
lastStartedEvent.disposeStreamVariable(); lastStartedEvent.disposeStreamVariable();
} }
} }

+ 2
- 3
server/src/test/java/com/vaadin/tests/server/ClassesSerializableTest.java View File

"com\\.vaadin\\.screenshotbrowser\\.ScreenshotBrowser.*", // "com\\.vaadin\\.screenshotbrowser\\.ScreenshotBrowser.*", //
"com\\.vaadin\\.osgi.*", // "com\\.vaadin\\.osgi.*", //
"com\\.vaadin\\.server\\.osgi.*", "com\\.vaadin\\.server\\.osgi.*",
//V7
// V7
"com\\.vaadin\\.v7\\.ui\\.themes\\.BaseTheme", "com\\.vaadin\\.v7\\.ui\\.themes\\.BaseTheme",
"com\\.vaadin\\.v7\\.ui\\.themes\\.ChameleonTheme", "com\\.vaadin\\.v7\\.ui\\.themes\\.ChameleonTheme",
"com\\.vaadin\\.v7\\.ui\\.themes\\.Reindeer", "com\\.vaadin\\.v7\\.ui\\.themes\\.Reindeer",
"com\\.vaadin\\.v7\\.data\\.util.BeanItemContainerGenerator.*", "com\\.vaadin\\.v7\\.data\\.util.BeanItemContainerGenerator.*",
"com\\.vaadin\\.v7\\.data\\.util\\.sqlcontainer\\.connection\\.MockInitialContextFactory", "com\\.vaadin\\.v7\\.data\\.util\\.sqlcontainer\\.connection\\.MockInitialContextFactory",
"com\\.vaadin\\.v7\\.data\\.util\\.sqlcontainer\\.DataGenerator", "com\\.vaadin\\.v7\\.data\\.util\\.sqlcontainer\\.DataGenerator",
"com\\.vaadin\\.v7\\.data\\.util\\.sqlcontainer\\.FreeformQueryUtil",
};
"com\\.vaadin\\.v7\\.data\\.util\\.sqlcontainer\\.FreeformQueryUtil", };


/** /**
* Tests that all the relevant classes and interfaces under * Tests that all the relevant classes and interfaces under

+ 1
- 1
server/src/test/java/com/vaadin/ui/AbstractListingTest.java View File



/** /**
* Used to execute data generation * Used to execute data generation
*
*
* @param initial * @param initial
* {@code true} to mock initial data request; {@code false} * {@code true} to mock initial data request; {@code false}
* for follow-up request. * for follow-up request.

+ 2
- 1
uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldUnparsableDateString.java View File

protected Result<LocalDate> handleUnparsableDateString( protected Result<LocalDate> handleUnparsableDateString(
String dateString) { String dateString) {
try { try {
String parseableString = dateString == null ? "" : dateString.replaceAll(" ", "");
String parseableString = dateString == null ? ""
: dateString.replaceAll(" ", "");
if (parseableString.length() % 2 == 1) { if (parseableString.length() % 2 == 1) {
parseableString = "0" + parseableString; parseableString = "0" + parseableString;
} }

+ 2
- 2
uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java View File

* {@link Actions#moveToElement(WebElement, int, int)}. This method takes * {@link Actions#moveToElement(WebElement, int, int)}. This method takes
* into account the W3C specification in browsers that properly implement * into account the W3C specification in browsers that properly implement
* it. * it.
*
*
* @param element * @param element
* the element * the element
* @param targetX * @param targetX
* {@link Actions#moveToElement(WebElement, int, int)}. This method takes * {@link Actions#moveToElement(WebElement, int, int)}. This method takes
* into account the W3C specification in browsers that properly implement * into account the W3C specification in browsers that properly implement
* it. * it.
*
*
* @param element * @param element
* the element * the element
* @param targetY * @param targetY

Loading…
Cancel
Save