Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit ff54b77

Browse files
committedJan 11, 2021
8259439: Apply java.io.Serial annotations in java.datatransfer
Reviewed-by: aivanov, pbansal, trebari, darcy
1 parent 712ea25 commit ff54b77

File tree

5 files changed

+31
-12
lines changed

5 files changed

+31
-12
lines changed
 

‎src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2017, 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
@@ -35,6 +35,7 @@
3535
import java.io.ObjectOutput;
3636
import java.io.OptionalDataException;
3737
import java.io.Reader;
38+
import java.io.Serial;
3839
import java.io.StringReader;
3940
import java.io.UnsupportedEncodingException;
4041
import java.nio.ByteBuffer;
@@ -111,6 +112,10 @@
111112
*/
112113
public class DataFlavor implements Externalizable, Cloneable {
113114

115+
/**
116+
* Use serialVersionUID from JDK 1.2 for interoperability.
117+
*/
118+
@Serial
114119
private static final long serialVersionUID = 8367026044764648243L;
115120
private static final Class<InputStream> ioInputStreamClass = InputStream.class;
116121

‎src/java.datatransfer/share/classes/java/awt/datatransfer/FlavorEvent.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 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,7 @@
2525

2626
package java.awt.datatransfer;
2727

28+
import java.io.Serial;
2829
import java.util.EventObject;
2930

3031
/**
@@ -37,6 +38,10 @@
3738
*/
3839
public class FlavorEvent extends EventObject {
3940

41+
/**
42+
* Use serialVersionUID from JDK 1.5 for interoperability.
43+
*/
44+
@Serial
4045
private static final long serialVersionUID = -5842664112252414548L;
4146

4247
/**

‎src/java.datatransfer/share/classes/java/awt/datatransfer/MimeType.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 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
@@ -29,6 +29,7 @@
2929
import java.io.IOException;
3030
import java.io.ObjectInput;
3131
import java.io.ObjectOutput;
32+
import java.io.Serial;
3233
import java.util.Locale;
3334

3435
/**
@@ -41,11 +42,11 @@
4142
*/
4243
class MimeType implements Externalizable, Cloneable {
4344

44-
/*
45-
* serialization support
45+
/**
46+
* Use serialVersionUID from JDK 1.2 for interoperability.
4647
*/
47-
48-
static final long serialVersionUID = -6568722458793895906L;
48+
@Serial
49+
private static final long serialVersionUID = -6568722458793895906L;
4950

5051
/**
5152
* Constructor for externalization; this constructor should not be called

‎src/java.datatransfer/share/classes/java/awt/datatransfer/MimeTypeParseException.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 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 java.awt.datatransfer;
2727

28+
import java.io.Serial;
29+
2830
/**
2931
* A class to encapsulate MimeType parsing related exceptions.
3032
*
@@ -33,7 +35,10 @@
3335
*/
3436
public class MimeTypeParseException extends Exception {
3537

36-
// use serialVersionUID from JDK 1.2.2 for interoperability
38+
/**
39+
* Use serialVersionUID from JDK 1.2.2 for interoperability.
40+
*/
41+
@Serial
3742
private static final long serialVersionUID = -5604407764691570741L;
3843

3944
/**

‎src/java.datatransfer/share/classes/java/awt/datatransfer/UnsupportedFlavorException.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2017, 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,6 +25,8 @@
2525

2626
package java.awt.datatransfer;
2727

28+
import java.io.Serial;
29+
2830
/**
2931
* Signals that the requested data is not supported in this flavor.
3032
*
@@ -34,9 +36,10 @@
3436
*/
3537
public class UnsupportedFlavorException extends Exception {
3638

37-
/*
38-
* JDK 1.1 serialVersionUID
39+
/**
40+
* Use serialVersionUID from JDK 1.1 for interoperability.
3941
*/
42+
@Serial
4043
private static final long serialVersionUID = 5383814944251665601L;
4144

4245
/**

0 commit comments

Comments
 (0)
This repository has been archived.