Skip to content

Commit 978bed6

Browse files
committed
8259522: Apply java.io.Serial annotations in java.desktop
Reviewed-by: aivanov, psadhukhan
1 parent bf28f92 commit 978bed6

File tree

343 files changed

+3138
-1161
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

343 files changed

+3138
-1161
lines changed

src/java.desktop/share/classes/com/sun/beans/editors/ColorEditor.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,24 @@
2525

2626
package com.sun.beans.editors;
2727

28-
import java.awt.*;
29-
import java.beans.*;
28+
import java.awt.Canvas;
29+
import java.awt.Choice;
30+
import java.awt.Color;
31+
import java.awt.Dimension;
32+
import java.awt.Event;
33+
import java.awt.Panel;
34+
import java.awt.TextField;
35+
import java.beans.PropertyChangeListener;
36+
import java.beans.PropertyChangeSupport;
37+
import java.beans.PropertyEditor;
38+
import java.io.Serial;
3039

3140
public class ColorEditor extends Panel implements PropertyEditor {
41+
42+
/**
43+
* Use serialVersionUID from JDK 1.7 for interoperability.
44+
*/
45+
@Serial
3246
private static final long serialVersionUID = 1781257185164716054L;
3347

3448
@SuppressWarnings("deprecation")

src/java.desktop/share/classes/com/sun/beans/editors/FontEditor.java

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,25 @@
2525

2626
package com.sun.beans.editors;
2727

28-
import java.awt.*;
29-
import java.beans.*;
28+
import java.awt.Choice;
29+
import java.awt.Component;
30+
import java.awt.Dimension;
31+
import java.awt.Event;
32+
import java.awt.Font;
33+
import java.awt.FontMetrics;
34+
import java.awt.Label;
35+
import java.awt.Panel;
36+
import java.awt.Toolkit;
37+
import java.beans.PropertyChangeListener;
38+
import java.beans.PropertyChangeSupport;
39+
import java.io.Serial;
3040

3141
public class FontEditor extends Panel implements java.beans.PropertyEditor {
42+
43+
/**
44+
* Use serialVersionUID from JDK 1.7 for interoperability.
45+
*/
46+
@Serial
3247
private static final long serialVersionUID = 6732704486002715933L;
3348

3449
@SuppressWarnings("deprecation")

src/java.desktop/share/classes/com/sun/beans/finder/SignatureException.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -22,9 +22,17 @@
2222
* or visit www.oracle.com if you need additional information or have any
2323
* questions.
2424
*/
25+
2526
package com.sun.beans.finder;
2627

28+
import java.io.Serial;
29+
2730
final class SignatureException extends RuntimeException {
31+
32+
/**
33+
* Use serialVersionUID from JDK 9 for interoperability.
34+
*/
35+
@Serial
2836
private static final long serialVersionUID = 4536098341586118473L;
2937

3038
SignatureException(Throwable cause) {

src/java.desktop/share/classes/com/sun/imageio/plugins/common/SimpleCMYKColorSpace.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -22,15 +22,22 @@
2222
* or visit www.oracle.com if you need additional information or have any
2323
* questions.
2424
*/
25+
2526
package com.sun.imageio.plugins.common;
2627

2728
import java.awt.color.ColorSpace;
29+
import java.io.Serial;
2830

2931
/**
3032
* Singleton class representing a simple, mathematically defined CMYK
3133
* color space.
3234
*/
3335
public final class SimpleCMYKColorSpace extends ColorSpace {
36+
37+
/**
38+
* Use serialVersionUID from JDK 9 for interoperability.
39+
*/
40+
@Serial
3441
private static final long serialVersionUID = 5387117338644522424L;
3542

3643
private static ColorSpace theInstance = null;

src/java.desktop/share/classes/com/sun/media/sound/InvalidDataException.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
2626
package com.sun.media.sound;
2727

2828
import java.io.IOException;
29+
import java.io.Serial;
2930

3031
/**
3132
* This exception is used when a file contains illegal or unexpected data.
@@ -34,6 +35,10 @@
3435
*/
3536
public class InvalidDataException extends IOException {
3637

38+
/**
39+
* Use serialVersionUID from JDK 1.7 for interoperability.
40+
*/
41+
@Serial
3742
private static final long serialVersionUID = 1L;
3843

3944
public InvalidDataException() {

src/java.desktop/share/classes/com/sun/media/sound/InvalidFormatException.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
2525

2626
package com.sun.media.sound;
2727

28+
import java.io.Serial;
29+
2830
/**
2931
* This exception is used when a reader is used to read file of a format
3032
* it doesn't unterstand or support.
@@ -33,6 +35,10 @@
3335
*/
3436
public class InvalidFormatException extends InvalidDataException {
3537

38+
/**
39+
* Use serialVersionUID from JDK 1.7 for interoperability.
40+
*/
41+
@Serial
3642
private static final long serialVersionUID = 1L;
3743

3844
public InvalidFormatException() {

src/java.desktop/share/classes/com/sun/media/sound/RIFFInvalidDataException.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,13 +25,19 @@
2525

2626
package com.sun.media.sound;
2727

28+
import java.io.Serial;
29+
2830
/**
2931
* This exception is used when a RIFF file contains illegal or unexpected data.
3032
*
3133
* @author Karl Helgason
3234
*/
3335
public final class RIFFInvalidDataException extends InvalidDataException {
3436

37+
/**
38+
* Use serialVersionUID from JDK 1.7 for interoperability.
39+
*/
40+
@Serial
3541
private static final long serialVersionUID = 1L;
3642

3743
public RIFFInvalidDataException() {

src/java.desktop/share/classes/com/sun/media/sound/RIFFInvalidFormatException.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
2525

2626
package com.sun.media.sound;
2727

28+
import java.io.Serial;
29+
2830
/**
2931
* This exception is used when a reader is used to read RIFF file of a format it
3032
* doesn't unterstand or support.
@@ -33,6 +35,10 @@
3335
*/
3436
public final class RIFFInvalidFormatException extends InvalidFormatException {
3537

38+
/**
39+
* Use serialVersionUID from JDK 1.7 for interoperability.
40+
*/
41+
@Serial
3642
private static final long serialVersionUID = 1L;
3743

3844
public RIFFInvalidFormatException() {

src/java.desktop/share/classes/java/applet/Applet.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1995, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,7 @@
3434
import java.awt.event.ComponentEvent;
3535
import java.io.IOException;
3636
import java.io.ObjectInputStream;
37+
import java.io.Serial;
3738
import java.net.MalformedURLException;
3839
import java.net.URL;
3940
import java.util.Locale;
@@ -94,6 +95,7 @@ public Applet() throws HeadlessException {
9495
/**
9596
* Use serialVersionUID from JDK 1.0 for interoperability.
9697
*/
98+
@Serial
9799
private static final long serialVersionUID = -5836846270535785031L;
98100

99101
/**
@@ -109,6 +111,7 @@ public Applet() throws HeadlessException {
109111
* @see java.awt.GraphicsEnvironment#isHeadless
110112
* @since 1.4
111113
*/
114+
@Serial
112115
private void readObject(ObjectInputStream s)
113116
throws ClassNotFoundException, IOException, HeadlessException {
114117
if (GraphicsEnvironment.isHeadless()) {
@@ -579,6 +582,7 @@ protected class AccessibleApplet extends AccessibleAWTPanel {
579582
/**
580583
* Use serialVersionUID from JDK 1.3 for interoperability.
581584
*/
585+
@Serial
582586
private static final long serialVersionUID = 8127374778187708896L;
583587

584588
/**

src/java.desktop/share/classes/java/awt/AWTError.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1995, 1997, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1995, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,16 +25,19 @@
2525

2626
package java.awt;
2727

28+
import java.io.Serial;
29+
2830
/**
2931
* Thrown when a serious Abstract Window Toolkit error has occurred.
3032
*
3133
* @author Arthur van Hoff
3234
*/
3335
public class AWTError extends Error {
3436

35-
/*
36-
* JDK 1.1 serialVersionUID
37+
/**
38+
* Use serialVersionUID from JDK 1.1 for interoperability.
3739
*/
40+
@Serial
3841
private static final long serialVersionUID = -1819846354050686206L;
3942

4043
/**

0 commit comments

Comments
 (0)