RFR: 8281535: Create a regression test for JDK-4670051 [v2]

Alexey Ivanov aivanov at openjdk.java.net
Fri Feb 11 15:50:12 UTC 2022


On Fri, 11 Feb 2022 15:14:51 GMT, Manukumar V S <mvs at openjdk.org> wrote:

>> Create a regression test for [JDK-4670051](https://bugs.openjdk.java.net/browse/JDK-4670051) which checks whether JSpinner with a SpinnerDateModel exactly spins the field where cursor is there.
>> I have updated the testing details in the comment section of JDK-8281535.
>
> Manukumar V S has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Review comments fixed: Updated copyright, formatting changes, changed compareDates(), renamed some variables and methods.

test/jdk/javax/swing/JSpinner/4670051/JSpinnerFieldUnderCursorTest.java line 40:

> 38: import javax.swing.SwingUtilities;
> 39: import javax.swing.UIManager;
> 40: import static javax.swing.UIManager.getInstalledLookAndFeels;

Suggestion:

import javax.swing.UIManager;

import static javax.swing.UIManager.getInstalledLookAndFeels;

There should always be a blank between regular imports and static imports.

test/jdk/javax/swing/JSpinner/4670051/JSpinnerFieldUnderCursorTest.java line 50:

> 48:  * @run main JSpinnerFieldUnderCursorTest
> 49:  */
> 50: public class JSpinnerFieldUnderCursorTest {

Is `DateFieldUnderCursorTest` a more descriptive name name?

test/jdk/javax/swing/JSpinner/4670051/JSpinnerFieldUnderCursorTest.java line 170:

> 168:         return (expected.get(Calendar.DATE) == actual.get(Calendar.DATE)) &&
> 169:                 (expected.get(Calendar.MONTH) == actual.get(Calendar.MONTH)) &&
> 170:                 (expected.get(Calendar.YEAR) == actual.get(Calendar.YEAR));

Suggestion:

        return (expected.get(Calendar.DATE) == actual.get(Calendar.DATE))
               && (expected.get(Calendar.MONTH) == actual.get(Calendar.MONTH))
               && (expected.get(Calendar.YEAR) == actual.get(Calendar.YEAR));

Otherwise, this looks inconsistently to other places where you put the operator on the wrapped line.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7404



More information about the client-libs-dev mailing list